Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath22
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.project56
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/net.sf.jautodoc.prefs14
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs24
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF138
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/about.html56
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/build.properties22
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen269
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen172
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.properties24
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml46
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/CreateViewCommand.java124
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/ISemanticHintAdapter.java54
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/IdentityCommandWithNotification.java178
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/SemanticElementAdapter.java174
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/DiagramVersioningUtils.java124
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/IDiagramVersionUpdater.java62
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/part/ITextAwareEditPart.java74
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java742
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultContainerNodeEditPolicy.java144
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultCreationEditPolicy.java222
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java218
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSemanticEditPolicy.java48
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSnapBackEditPolicy.java216
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultXYLayoutEditPolicy.java174
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ExternalLabelPrimaryDragRoleEditPolicy.java150
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ILinkMappingHelper.java86
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDefaultSemanticEditPolicy.java168
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDirectEditPolicy.java218
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LinkLabelDragEditPolicy.java78
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextNonResizableEditPolicy.java418
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextSelectionEditPolicy.java384
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AbstractLabelViewFactory.java64
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AffixedLabelViewFactory.java104
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentListViewFactory.java66
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentShapeViewFactory.java74
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorLabelViewFactory.java104
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorViewFactory.java124
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/InnerLabelViewFactory.java42
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeChildLabelViewFactory.java118
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeViewFactory.java118
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/figure/SelectableBorderedNodeFigure.java148
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/CellEditorLocatorUtil.java72
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/LabelCellEditorLocator.java104
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/MultilineCellEditorLocator.java104
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/TextCellEditorLocator.java112
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/parser/IMaskManagedSemanticParser.java68
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/AbstractViewProvider.java626
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractEditPartProvider.java98
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractViewProvider.java308
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/DiagramEditorUtil.java84
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/ElementTypeLabelProvider.java100
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/MarkerNavigationProvider.java182
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/ConstraintExtendedDirectEditionDialog.java16
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateActorPartWithTypeConfigureCommandFactory.java178
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateConstraintPropertyWithTypeConfigureCommandFactory.java154
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateFlowPortWithFlowSpecificationConfigureCommandFactory.java176
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreatePartWithTypeConfigureCommandFactory.java176
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateReferenceWithTypeConfigureCommandFactory.java176
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateValueWithTypeConfigureCommandFactory.java176
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectActorPartTypeDialog.java238
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectBlockPropertyTypeDialog.java242
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectConstraintPropertyTypeDialog.java122
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectNonAtomicFlowPortTypeDialog.java242
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectTypeDialog.java1210
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectValuePropertyTypeDialog.java568
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/ServiceEditContentProvider.java84
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintBlockPropertyCompositeEditPart.java222
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintPropertyChildLabelEditPart.java112
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java258
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortChildLabelEditPart.java112
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPropertyChildLabelEditPart.java112
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/BlockPropertyStructureCompartmentSemanticEditPolicy.java6
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/CustomDuplicatePasteEditPolicy.java112
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PartCompartmentSemanticEditPolicy.java5
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PropertyCompartmentSemanticEditPolicy.java6
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/StructureCompartmentSemanticEditPolicy.java5
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/AssociationFigure.java242
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/FlowPortFigure.java68
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/Messages.java298
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/messages.properties16
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java502
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPropertyLabelParser.java264
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java178
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java252
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/ILabelPreferenceConstants.java178
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/LabelPreferenceHelper.java100
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/dnd/helper/LinkMappingHelper.java312
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementBorderEditPart.java456
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java1726
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementEditPart.java366
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java1342
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLinkEditPart.java490
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java1454
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractShapeCompartmentEditPart.java232
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java254
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeLinkLabelEditPart.java160
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceMultiplicityEditPart.java182
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceRoleEditPart.java166
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetMultiplicityEditPart.java182
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetRoleEditPart.java166
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelEditPart.java106
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelSourceMultiplicityEditPart.java180
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelTargetMultiplicityEditPart.java180
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConstraintNodeLabelEditPart.java70
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/DefaultChildLabelEditPart.java70
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java242
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementLinkLabelNameEditPart.java106
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementNodeLabelNameEditPart.java98
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java240
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PropertyNodeLabelEditPart.java98
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/SlotChildLabelEditPart.java70
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/EncapsulatedClassifierResizableShapeEditPolicy.java252
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java252
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/StructuredClassifierCreationEditPolicy.java280
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/ConnectorEdgeFigure.java166
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/EdgeDecorationType.java78
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/GeneralizationFigure.java52
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/InterfaceRealizationFigure.java48
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/NamedElementEdgeFigure.java128
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java338
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java242
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java414
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/DefaultParserHintAdapter.java86
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/MultiplicityElementLabelParser.java320
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java294
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java396
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ParameterLabelParser.java420
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java484
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java248
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/SlotLabelParser.java284
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/AssociationViewUtils.java162
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/factory/ConstraintBlockPropertyCompositeClassifierViewFactory.java83
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/figure/ConstraintBlockPropertyCompositeFigure.java49
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/figure/SysMLDiagramFrameFigure.java151
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLGraphicalTypes.java2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java40
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConstraintParameterAffixedNodeEditPart.java201
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/factory/ConstraintPropertyAffixedNodeViewFactory.java (renamed from plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/DeleteElementAction.java)35
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/utils/UMLGraphicalTypes.java2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java612
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/commands/CreateSysMLModelCommand.java138
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java286
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.classpath16
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.options7
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.project56
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/Parametric.gmfgen.prefs8
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.core.prefs15
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.svnignore1
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF123
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/about.html56
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/build.properties26
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramCommand.java136
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java27
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/actions/RestoreRelatedLinksAction.java83
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateConstraintPropertyCommand.java16
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java123
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/RestoreRelatedLinksCommand.java335
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java56
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CustomDiagramDragDropEditPolicy.java258
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/NoDeleteFromDiagramEditPolicy.java52
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/NoDeleteFromModelEditPolicy.java61
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CenteredWrappedLabel.java34
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/ConnectorLinkMappingHelper.java90
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/ModelValidationHelper.java150
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/SelfCompartmentNotificationHelper.java223
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/locator/ParameterPositionLocator.java82
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConnectorLabelParser.java136
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintLabelParser.java182
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyLabelParser.java230
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/PropertyLabelParser.java223
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/CustomEditPolicyProvider.java81
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ParametricDiagramContributionItemProvider.java39
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ParametricDiagramContributionPolicyClass.java46
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/texteditor/ConstraintPropertyConfiguration.java133
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/PropertyLinkedToClassifier.java152
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/PropertyLinkedToClassifierNode.java234
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/Route.java102
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/incomingLinksNavigatorGroup.gifbin709 -> 709 bytes
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkSourceNavigatorGroup.gifbin709 -> 709 bytes
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkTargetNavigatorGroup.gifbin709 -> 709 bytes
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linksNavigatorGroup.gifbin709 -> 709 bytes
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.gifbin118 -> 118 bytes
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/ResourceDiagramFile.gifbin339 -> 339 bytes
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/outgoingLinksNavigatorGroup.gifbin709 -> 709 bytes
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/messages.properties133
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen559
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph147
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfmap182
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmftool56
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.trace36
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/SysML.Parametric.idgen124
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/parametric.palette.xml41
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.properties69
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.xml1352
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCreateCommand.java168
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java12
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java (renamed from plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java)217
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/ParametricDiagramEditPart.java31
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/DiagramSemanticEditPolicy.java43
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/ParametricDiagramDragDropEditPolicy.java38
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java62
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java.lost18
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/ParametricDiagramViewFactory.java18
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/part/ParametricDiagramEditor.java51
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockCompositePreferencePage.java83
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentAnnotatedElementPreferencePage.java30
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentPreferencePage.java31
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java61
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintConstrainedElementPreferencePage.java30
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPreferencePage.java31
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DependencyPreferencePage.java59
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/FlowPortPreferencePage.java60
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramGeneralPreferencePage.java11
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramLinkPreferencePage.java60
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramNodePreferencePage.java106
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramPreferenceInitializer.java28
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PortPreferencePage.java60
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPartProvider.java120
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypeRegistry.java224
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypes.java13
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomViewProvider.java87
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ElementTypes.java52
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/GraphicalTypeRegistry.java195
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/IGraphicalTypeRegistry.java97
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramEditPartProvider.java54
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramViewProvider.java218
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPartProvider.java37
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPolicyProvider.java50
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramViewProvider.java31
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/utils/ParametricDiagramGraphicalTypes.java15
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/Activator.java105
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramWithNavigationHandler.java (renamed from plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramWithNavigationHandler.java)50
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java (renamed from plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java)84
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorCreateCommand.java113
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConnectorCreateCommand.java174
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConnectorReorientCommand.java190
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConstraintPropertyCreateCommand.java138
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java141
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/PropertyCreateCommand.java126
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/SysmlReorientConnectionViewCommand.java80
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ConnectorEditHelper.java20
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ConstraintPropertyEditHelper.java20
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ResourceEditHelper.java20
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/SysmlBaseEditHelper.java99
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockCompositeEditPartTN.java69
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java17
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockPropertyCompositeEditPart.java20
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintBlockPropertyCompositeEditPart.java21
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintParameterAffixedNodeEditPart.java19
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomPortAffixedNodeEditPart.java20
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConnectorEditPart.java154
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConnectorNameEditPart.java756
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintLabelEditPart.java767
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java496
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyNameEditPart.java792
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ParametricEditPart.java147
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/Property2EditPart.java383
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java427
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyName2EditPart.java754
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java800
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java228
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConnectorItemSemanticEditPolicy.java52
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConstraintPropertyCanonicalEditPolicy.java172
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConstraintPropertyItemSemanticEditPolicy.java115
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/OpenDiagramEditPolicy.java183
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ParametricCanonicalEditPolicy.java352
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ParametricItemSemanticEditPolicy.java80
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/Property2ItemSemanticEditPolicy.java111
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/PropertyItemSemanticEditPolicy.java111
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java379
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlTextNonResizableEditPolicy.java236
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlTextSelectionEditPolicy.java220
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CustomBlockPropertyCompositeFigure.java24
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/ParametricDiagramFrameFigure.java (renamed from plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/PropertyEditHelper.java)37
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlAbstractNavigatorItem.java71
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorContentProvider.java230
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorItem.java119
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorLabelProvider.java107
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorActionProvider.java181
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java503
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorGroup.java110
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorItem.java97
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java274
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLinkHelper.java128
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorSorter.java40
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parser/ParametricFrameParser.java22
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/AbstractParser.java431
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/MessageFormatParser.java202
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/DiagramEditorContextMenuProvider.java62
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/LoadResourceAction.java43
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/Messages.java367
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/ModelElementSelectionPage.java156
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlCreationWizard.java167
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlCreationWizardPage.java96
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramActionBarContributor.java60
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditor.java569
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorPlugin.java333
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java377
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdateCommand.java91
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java359
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDocumentProvider.java988
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlInitDiagramFileAction.java99
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlLinkDescriptor.java105
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlMatchingStrategy.java47
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlNewDiagramFileWizard.java174
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlNodeDescriptor.java55
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlPaletteFactory.java111
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlUriEditorInputTester.java35
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java283
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/ValidateAction.java264
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDefaultSemanticEditPolicy.java94
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDragDropEditPolicy.java277
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomParametricSemanticPolicy.java38
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/StructureClassifierDropEditPolicy.java139
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockPropertyCompositePreferencePage.java42
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java88
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintParameterAsBorderItemPreferencePage.java302
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPropertyPreferencePage.java64
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomBlockPropertyCompositePreferencePage.java327
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConnectorPreferencePage.java464
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConstraintPropertyCompositePreferencePage.java327
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomPreferenceInitializer.java80
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramAppearancePreferencePage.java31
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramConnectionsPreferencePage.java31
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramGeneralPreferencePage.java33
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramPreferenceInitializer.java45
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramPrintingPreferencePage.java31
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramRulersAndGridPreferencePage.java31
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/FlowPortAsBorderItemPreferencePage.java310
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PortAsBorderItemPreferencePage.java301
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PropertyPreferencePage.java64
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPolicyProvider.java188
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParserProvider.java107
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ElementInitializers.java38
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlEditPartProvider.java154
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlElementTypes.java252
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlIconProvider.java44
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlMarkerNavigationProvider.java94
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlModelingAssistantProvider.java202
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java205
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlValidationProvider.java166
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java489
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/sheet/SysmlPropertySection.java123
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/sheet/SysmlSheetLabelProvider.java91
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/BlockDropHelper.java239
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.classpath16
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.project58
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF78
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/about.html56
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/build.properties14
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml1384
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerCustomization.uiCustom18244
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerQueries.querySet34
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src-gen/org/eclipse/papyrus/sysml/modelexplorer/handler/ConstraintPropertyHandler.java44
-rw-r--r--plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/handler/AbstractSysmlModelExplorerCreateCommandHandler.java68
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/.classpath16
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/.project56
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/.settings/org.eclipse.jdt.core.prefs42
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF62
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/about.html56
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/build.properties20
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/model/ElementTypeModelForSySML.domaincontextcodegen300
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/plugin.xml8
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/command/SetNestedPathCommand.java322
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/handlers/AbstractSysmlCreateCommandHandler.java64
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AbstractPropertyEditHelperAdvice.java406
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ActorPartPropertyEditHelperAdvice.java176
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AllocateEditHelperAdvice.java110
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/BlockEditHelperAdvice.java292
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConformEditHelperAdvice.java110
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockEditHelperAdvice.java174
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockPropertyEditHelperAdvice.java108
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintParameterEditHelperAdvice.java50
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintPropertyEditHelperAdvice.java170
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/CopyEditHelperAdvice.java110
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DeriveReqtEditHelperAdvice.java114
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DimensionEditHelperAdvice.java112
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortEditHelperAdvice.java280
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInEditHelperAdvice.java114
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInOutEditHelperAdvice.java112
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortNAEditHelperAdvice.java118
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortOutEditHelperAdvice.java112
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPropertyEditHelperAdvice.java272
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowSpecificationEditHelperAdvice.java276
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ItemFlowEditHelperAdvice.java110
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/PartPropertyEditHelperAdvice.java322
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ProblemEditHelperAdvice.java98
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/RationaleEditHelperAdvice.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.classpath14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.project60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.core.resources.prefs4
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.jdt.core.prefs14
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF192
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/about.html56
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/build.properties12
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/icons/flower.svg19
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Action.gmfgraph68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Association.gmfgraph350
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Classifier.gmfgraph346
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Comment.gmfgraph90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Constraint.gmfgraph118
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Dependency.gmfgraph154
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/DiamondNode.gmfgraph38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Enumeration.gmfgraph216
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FinalNode.gmfgraph38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FlowFinalNode.gmfgraph38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ForkNode.gmfgraph38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Generalization.gmfgraph82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/GenericUML.gmfgen5050
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InitialNode.gmfgraph38
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InstanceSpecification.gmfgraph220
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InterfaceRealization.gmfgraph112
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/NodeNamedElement.gmfgraph68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PackageElement.gmfgraph178
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PrimitiveType.gmfgraph160
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ReceiveNodeFigure.gmfgraph68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SendNodeFigure.gmfgraph68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SideNodeNamedElement.gmfgraph70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Template.gmfgraph94
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml1212
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/aspectToolProvider.exsd376
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteCustomization.exsd204
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteDefinition.exsd450
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Activator.java1188
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/AbstractShowHideAction.java1314
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/LoadResourceAction.java102
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/ShowHideContentsAction.java2080
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/AbstractShowHideHandler.java226
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandler.java1374
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandlerProvider.java228
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/CommandProxyWithResult.java62
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/EMFtoGMFCommandWrapper.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GEFtoEMFCommandWrapper.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GMFtoEMFCommandWrapper.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ApplyStereotypeCommand.java154
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java378
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateBehavioredClassifierDiagramCommand.java336
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateUMLModelCommand.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeferredCreateCommand.java254
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DefferedAppliedStereotypeToDisplayCommand.java192
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeleteLinkDuringCreationCommand.java232
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateAnythingCommand.java104
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateNamedElementCommand.java184
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/EObjectInheritanceCopyCommand.java788
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/FixPortLocationCommand.java186
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ModelCreationCommandBase.java234
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/PapyrusDuplicateViewsCommand.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SemanticAdapter.java192
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetNodeVisibilityCommand.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetValueSpecificationValueCommand.java100
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideCompartmentRequest.java142
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideConnectionLabelsRequest.java124
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideElementsRequest.java244
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideLabelsRequest.java124
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideTitleOfCompartmentCommand.java120
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SupplementCommand.java224
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdateLifelineRepresentsCommand.java462
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java238
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/AbstractCheckedTreeColumnViewerSelectionDialog.java364
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/CustomCheckedTreeSelectionDialog.java872
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/FigureControler.java130
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/ILabelControler.java76
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/IPropertyAccessor.java88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/LabelDirectEditManager.java366
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultiLineCellEditor.java42
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultilineLabelDirectEditManager.java168
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/PropertyAccessor.java126
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/TextFlowCellEditorLocator.java142
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollDragEditPartsTrackerEx.java202
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollResizeTracker.java150
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/InteractionFigure.java206
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LeftToolbarLayout.java994
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LifelineDotLineFigure.java356
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LinesBorder.java384
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/PileLayout.java438
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/RoundedRectangleDashedBorder.java144
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/CenterAnchor.java120
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/FixedAnchor.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/LifelineAnchor.java146
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractBorderEditPart.java92
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractCommentEditPart.java224
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractConstraintEditPart.java212
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractLabelEditPart.java80
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShapeEditPart.java274
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortCutDiagramEditPart.java340
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortcutDiagramNameEditPart.java226
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderNodeEditPart.java374
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderUMLNodeEditPart.java468
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ClassifierEditPart.java206
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/CompositeEditPart.java208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/DeploymentNodeEditPart.java170
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IEditpartListenerAccess.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ILabelRoleProvider.java74
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLEditPart.java86
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLNamedElementEditPart.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NoScrollBarShapeCompartmentEditPart.java78
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLCompartmentEditPart.java140
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java624
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLNodeEditPart.java504
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractAppliedStereotypeDisplayEditPolicy.java594
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractMaskManagedEditPolicy.java502
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractNameReferencesListenerEditPolicy.java176
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AffixedNodeAlignmentEditPolicy.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeAbstractionLabelDisplayEditPolicy.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeDeploymentLabelDisplayEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java296
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeIconlDisplayEditPolicy.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeInformationFlowLabelDisplayEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLabelDisplayEditPolicy.java646
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLinkLabelDisplayEditPolicy.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeManifestationLabelDisplayEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeNodeLabelDisplayEditPolicy.java308
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageImportLabelDisplayEditPolicy.java118
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageMergeLabelDisplayEditPolicy.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePropertyDirectEditPolicy.java130
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeSubstitutionLabelDisplayEditPolicy.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeUsageLabelDisplayEditPolicy.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ApplyStereotypeEditPolicy.java208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/BorderItemResizableEditPolicy.java222
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CResizableCompartmentEditPolicy.java266
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ChangeStereotypedShapeEditPolicy.java500
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentReferencesListenerEditPolicy.java62
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentShapeForAppliedStereotypeEditPolicy.java376
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommonDiagramDragDropEditPolicy.java1364
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ConstrainedItemBorderLayoutEditPolicy.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomConnectionLabelsEditPolicy.java170
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomContainerEditPolicy.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/DuplicatePasteEditPolicy.java426
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ExtendedDirectEditPolicy.java724
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IDirectEdition.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IStructuralFeatureListener.java80
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ListenerEventEditPolicy.java474
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OldCommonDiagramDragDropEditPolicy.java1358
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OrphanViewPolicy.java1204
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/PapyrusCreationEditPolicy.java210
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java446
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayExternalNodeEditPolicy.java306
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutDiagramEditPolicy.java184
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideClassifierContentsEditPolicy.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideCompartmentEditPolicy.java228
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideLabelEditPolicy.java178
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideRelatedContentsEditPolicy.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowViewEditPolicy.java130
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLBaseItemSemanticEditPolicy.java68
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextNonResizableEditPolicy.java474
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextSelectionEditPolicy.java442
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/DashedEdgeFigure.java328
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java80
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java74
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/UMLEdgeFigure.java190
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/AutomaticCompartmentToolBox.java100
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ILayoutToolBox.java92
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ManualCompartmentToolBox.java102
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/PropertiesCompartmentLayoutManager.java180
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AffixedNamedElementFigure.java186
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeCompartmentFigure.java60
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AssociationNodeFigure.java96
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java608
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CenteredWrappedLabel.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ClassifierFigure.java288
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CompartmentFigure.java174
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ComponentFigure.java56
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ConstraintFigure.java642
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerBorder.java464
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerFigure.java124
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CornerBentFigure.java672
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CustomAbstractFigure.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DataTypeFigure.java134
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiagramNodeFigure.java246
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiamondNode.java204
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EditingFlowPage.java216
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EnumerationFigure.java110
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FinalNode.java180
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FlowFinalNode.java176
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ForkNode.java166
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCommentParser.java192
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentBodyFigure.java168
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentFigure.java1372
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IAbstractElementFigure.java402
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IEllipseFigure.java44
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ILabelFigure.java104
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IMultilineEditableFigure.java82
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeNamedElementFigure.java132
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeUMLElementFigure.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusUMLElementFigure.java76
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InitialNode.java146
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InstanceSpecificationFigure.java110
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InteractionRectangleFigure.java208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InterfaceFigure.java56
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ManualCompartmentLayoutManager.java458
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java2082
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NoteShadowBorder.java178
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/OLDCompartmentFigure.java538
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageFigure.java486
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageNodePlateFigure.java158
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusNodeFigure.java536
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusReceiveNodeFigure.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusRoundedNodeFigure.java230
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeFigure.java194
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeShadowBorder.java142
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PrimitiveTypeFigure.java136
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ProfileFigure.java58
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/QualifiedNameWrappingLabelFigure.java212
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/RoundedRectangleDashedShadowBorder.java200
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ShapeNamedElementFigure.java598
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SignalFigure.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/StereotypePropertiesCompartment.java148
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SubCompartmentLayoutManager.java226
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java288
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/LoadHandler.java252
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/ParametricAndListeningHandler.java310
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/RenamedElementHandler.java198
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/UnloadHandler.java248
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AlignmentLinkHelper.java356
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AssociationHelper.java360
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/BasicClassifierCompartmentLayoutHelper.java234
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ClassifierCompartmentLayoutHelper.java168
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/CleanDiagramHelper.java376
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationConstraintHelper.java218
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationObservationHelper.java196
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ElementHelper.java70
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ICompartmentLayoutHelper.java90
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ILinkMappingHelper.java88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/InteractionFragmentHelper.java312
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/LinkMappingHelper.java390
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NamedElementHelper.java212
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NotificationHelper.java164
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/OperationLabelHelper.java270
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PortLabelHelper.java158
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PreferenceInitializerForElementHelper.java712
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PropertyLabelHelper.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypeFigureHelper.java768
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypedElementLabelHelper.java830
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeConstraintHelper.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeObservationHelper.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/UMLBaseEditHelper.java218
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ids/ReorientLinkIDs.java54
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/AlignmentTree.java364
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionConstants.java260
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionTree.java192
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartRepresentation.java222
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartTree.java934
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java1276
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentation.java740
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentationForLayoutAction.java568
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/OverlayLocator.java208
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/RoutingConstants.java222
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/SameAlignment.java646
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/AbstractPapyrusModifcationTriggerListener.java256
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/AdvancedBorderItemLocator.java128
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ConstraintParameterPositionLocator.java108
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ExternalLabelPositionLocator.java194
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocator.java464
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocatorUtils.java298
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateBorderItemLocator.java228
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateClassifierBorderItemLocator.java106
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/CommentParser.java322
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintParser.java586
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ShortcutDiagramParser.java248
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/StereotypePropertyParser.java380
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AbstractAssociationEndParser.java216
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationEndParser.java180
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationMultiplicityParser.java168
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/CachedResourcesDocumentProvider.java2142
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/ICustomDiagramUpdater.java46
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/IPaletteDescription.java132
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteMenuAction.java452
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteUtil.java996
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteContextMenuProvider.java98
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteCustomizer.java798
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteDescription.java366
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteEntryState.java184
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPalettePreferences.java1160
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteViewer.java146
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UMLDiagramActionBarContributor.java120
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java450
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/ProfileApplicationPreferencePage.java114
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/AbstractActionStateSourceProvider.java556
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java224
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java120
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java860
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusDiagramGlobalActionHandler.java614
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusGlobalActionHandlerProvider.java240
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UIAdapterImpl.java126
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UMLComposedAdapterFactory.java50
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AbstractXMLDefinitionPaletteFactory.java142
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ApplyStereotypeRequest.java184
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectCreationEntry.java330
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java1510
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeCreationTool.java572
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ExtendedPaletteProviderConfiguration.java172
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IPapyrusPaletteConstant.java262
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IProfileDependantPaletteProvider.java62
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecorator.java942
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecoratorProvider.java130
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java344
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PaletteProfileApplicationListener.java104
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java248
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteFactory.java604
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteParser.java298
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLPaletteProviderConfiguration.java440
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLRequiredProfileFactory.java228
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractAspectActionProvider.java182
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractPreConditionAction.java338
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectActionFactoryRegistry.java170
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolProviderConfiguration.java130
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolService.java334
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndAspectActionProvider.java162
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndPostAction.java1352
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayAspectActionProvider.java94
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayPostAction.java664
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Configuration.java922
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DefinedPropertiesAtRuntimeDialog.java700
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypeAspectActionProvider.java92
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePostAction.java678
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider.java92
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentPostAction.java872
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DynamicConfigureRequest.java158
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAllAspectToolProvidersOperation.java80
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAspectToolProviderOperation.java106
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalAspectActionProvider.java92
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalPostAction.java272
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectAction.java178
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectActionProvider.java138
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectToolProviderService.java72
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IFeatureSetterAspectAction.java240
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteAspectToolEntryProxy.java72
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteEntryProxy.java56
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPostAction.java102
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPreAction.java86
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Messages.java64
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ModelPostAction.java496
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/PropertyRepresentation.java618
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticAspectActionProvider.java94
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticPostAction.java1476
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SetDynamicValueCommand.java164
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeAspectActionProvider.java182
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypePostAction.java4344
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeRepresentation.java370
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Value.java204
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySection.java282
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java326
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/AbstractChooseElement.java202
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboDialogWithMessage.java222
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboInputDialog.java206
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ElementChooseDialog.java412
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialog.java228
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialogMessage.java380
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/PropertyEditors.java1008
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/CustomPopupDialog.java364
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpComponentFactory.java240
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpDialog.java256
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ColorManager.java108
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentTitleRepresentation.java154
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentUtils.java418
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CrossReferencerUtil.java176
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramCoreServiceUtils.java242
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramTester.java142
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/FontManager.java104
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/MessageDirection.java74
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ServiceUtilsForGMF.java160
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/StringComparator.java144
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/UMLSelectionTester.java200
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Util.java1010
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewServiceUtil.java122
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Visitor.java226
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/EObjectToViewFunction.java88
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/SettingToEObjectFunction.java66
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ReferencingViewPredicate.java104
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ViewTypePredicate.java92
774 files changed, 95902 insertions, 111578 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath
index 0fec5fb4af5..a93010f69d7 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath
@@ -1,11 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-gen"/>
- <classpathentry kind="src" path="src-common-sysml"/>
- <classpathentry kind="src" path="src-common-uml"/>
- <classpathentry kind="src" path="src-common-gmf"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="src" path="src-common-sysml"/>
+ <classpathentry kind="src" path="src-common-uml"/>
+ <classpathentry kind="src" path="src-common-gmf"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.project b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.project
index cc9bf0a16f6..eac33086b37 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.project
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.sysml.diagram.common</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.diagram.common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/net.sf.jautodoc.prefs b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/net.sf.jautodoc.prefs
index cf276e6a88f..f03f98026a8 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/net.sf.jautodoc.prefs
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/net.sf.jautodoc.prefs
@@ -1,7 +1,7 @@
-#Fri Aug 19 13:56:17 CEST 2011
-add_header=true
-eclipse.preferences.version=1
-header_text=/*****************************************************************************\r\n * Copyright (c) 2011 CEA LIST.\r\n *\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n *\t\t\r\n *\t\tCEA LIST - Initial API and implementation\r\n *\r\n *****************************************************************************/
-project_specific_settings=true
-replace_header=true
-replacements=<?xml version\="1.0" standalone\="yes"?>\n\n<replacements>\n<replacement key\="get" scope\="1" mode\="0">Gets the</replacement>\n<replacement key\="set" scope\="1" mode\="0">Sets the</replacement>\n<replacement key\="add" scope\="1" mode\="0">Adds the</replacement>\n<replacement key\="edit" scope\="1" mode\="0">Edits the</replacement>\n<replacement key\="remove" scope\="1" mode\="0">Removes the</replacement>\n<replacement key\="init" scope\="1" mode\="0">Inits the</replacement>\n<replacement key\="parse" scope\="1" mode\="0">Parses the</replacement>\n<replacement key\="create" scope\="1" mode\="0">Creates the</replacement>\n<replacement key\="build" scope\="1" mode\="0">Builds the</replacement>\n<replacement key\="is" scope\="1" mode\="0">Checks if is</replacement>\n<replacement key\="print" scope\="1" mode\="0">Prints the</replacement>\n<replacement key\="has" scope\="1" mode\="0">Checks for</replacement>\n</replacements>\n\n
+#Fri Aug 19 13:56:17 CEST 2011
+add_header=true
+eclipse.preferences.version=1
+header_text=/*****************************************************************************\r\n * Copyright (c) 2011 CEA LIST.\r\n *\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n *\t\t\r\n *\t\tCEA LIST - Initial API and implementation\r\n *\r\n *****************************************************************************/
+project_specific_settings=true
+replace_header=true
+replacements=<?xml version\="1.0" standalone\="yes"?>\n\n<replacements>\n<replacement key\="get" scope\="1" mode\="0">Gets the</replacement>\n<replacement key\="set" scope\="1" mode\="0">Sets the</replacement>\n<replacement key\="add" scope\="1" mode\="0">Adds the</replacement>\n<replacement key\="edit" scope\="1" mode\="0">Edits the</replacement>\n<replacement key\="remove" scope\="1" mode\="0">Removes the</replacement>\n<replacement key\="init" scope\="1" mode\="0">Inits the</replacement>\n<replacement key\="parse" scope\="1" mode\="0">Parses the</replacement>\n<replacement key\="create" scope\="1" mode\="0">Creates the</replacement>\n<replacement key\="build" scope\="1" mode\="0">Builds the</replacement>\n<replacement key\="is" scope\="1" mode\="0">Checks if is</replacement>\n<replacement key\="print" scope\="1" mode\="0">Prints the</replacement>\n<replacement key\="has" scope\="1" mode\="0">Checks for</replacement>\n</replacements>\n\n
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs
index 35069b007a0..980d46758d6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,12 @@
-#Thu Apr 21 15:05:56 CEST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+#Thu Apr 21 15:05:56 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
index 600341fe7a2..0e8dac95afe 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
@@ -1,69 +1,69 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
- org.eclipse.emf;bundle-version="2.6.0",
- org.eclipse.uml2.uml;bundle-version="3.1.0",
- org.eclipse.papyrus.sysml;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
- org.eclipse.core.expressions,
- org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.1",
- org.eclipse.papyrus.editor;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="0.10.1",
- org.eclipse.papyrus.extensionpoints.editors;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.service.types;bundle-version="0.10.1",
- org.eclipse.papyrus.sysml.service.types;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.widgets;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.modelexplorer.widgets;bundle-version="0.10.1",
- org.eclipse.draw2d;bundle-version="3.7.1",
- org.eclipse.gmf.runtime.diagram.core;bundle-version="1.4.1",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
- org.eclipse.papyrus.uml.tools;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.emf.appearance;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.pastemanager;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
- org.eclipse.uml2.common.edit;bundle-version="1.6.0",
- org.eclipse.uml2.uml.edit;bundle-version="4.0.0",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1",
- org.eclipse.emf.edit.ui;bundle-version="2.8.0",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.1"
-Export-Package: org.eclipse.papyrus.gmf.diagram.common.commands,
- org.eclipse.papyrus.gmf.diagram.common.compatibility,
- org.eclipse.papyrus.gmf.diagram.common.edit.part,
- org.eclipse.papyrus.gmf.diagram.common.edit.policy,
- org.eclipse.papyrus.gmf.diagram.common.factory,
- org.eclipse.papyrus.gmf.diagram.common.locator,
- org.eclipse.papyrus.gmf.diagram.common.provider,
- org.eclipse.papyrus.sysml.diagram.common,
- org.eclipse.papyrus.sysml.diagram.common.commands,
- org.eclipse.papyrus.sysml.diagram.common.dialogs,
- org.eclipse.papyrus.sysml.diagram.common.edit.part,
- org.eclipse.papyrus.sysml.diagram.common.edit.policy,
- org.eclipse.papyrus.sysml.diagram.common.factory,
- org.eclipse.papyrus.sysml.diagram.common.figure,
- org.eclipse.papyrus.sysml.diagram.common.messages,
- org.eclipse.papyrus.sysml.diagram.common.parser,
- org.eclipse.papyrus.sysml.diagram.common.preferences,
- org.eclipse.papyrus.sysml.diagram.common.utils,
- org.eclipse.papyrus.uml.diagram.common.dnd.helper,
- org.eclipse.papyrus.uml.diagram.common.edit.part,
- org.eclipse.papyrus.uml.diagram.common.factory,
- org.eclipse.papyrus.uml.diagram.common.figure,
- org.eclipse.papyrus.uml.diagram.common.parser,
- org.eclipse.papyrus.uml.diagram.common.utils
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 0.10.1.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.sysml.diagram.common.Activator
-Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.common;singleto
- n:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
+ org.eclipse.emf;bundle-version="2.6.0",
+ org.eclipse.uml2.uml;bundle-version="3.1.0",
+ org.eclipse.papyrus.sysml;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
+ org.eclipse.core.expressions,
+ org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.1",
+ org.eclipse.papyrus.editor;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="0.10.1",
+ org.eclipse.papyrus.extensionpoints.editors;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.service.types;bundle-version="0.10.1",
+ org.eclipse.papyrus.sysml.service.types;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.modelexplorer.widgets;bundle-version="0.10.1",
+ org.eclipse.draw2d;bundle-version="3.7.1",
+ org.eclipse.gmf.runtime.diagram.core;bundle-version="1.4.1",
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.emf.appearance;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.pastemanager;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
+ org.eclipse.uml2.common.edit;bundle-version="1.6.0",
+ org.eclipse.uml2.uml.edit;bundle-version="4.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1",
+ org.eclipse.emf.edit.ui;bundle-version="2.8.0",
+ org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.1"
+Export-Package: org.eclipse.papyrus.gmf.diagram.common.commands,
+ org.eclipse.papyrus.gmf.diagram.common.compatibility,
+ org.eclipse.papyrus.gmf.diagram.common.edit.part,
+ org.eclipse.papyrus.gmf.diagram.common.edit.policy,
+ org.eclipse.papyrus.gmf.diagram.common.factory,
+ org.eclipse.papyrus.gmf.diagram.common.locator,
+ org.eclipse.papyrus.gmf.diagram.common.provider,
+ org.eclipse.papyrus.sysml.diagram.common,
+ org.eclipse.papyrus.sysml.diagram.common.commands,
+ org.eclipse.papyrus.sysml.diagram.common.dialogs,
+ org.eclipse.papyrus.sysml.diagram.common.edit.part,
+ org.eclipse.papyrus.sysml.diagram.common.edit.policy,
+ org.eclipse.papyrus.sysml.diagram.common.factory,
+ org.eclipse.papyrus.sysml.diagram.common.figure,
+ org.eclipse.papyrus.sysml.diagram.common.messages,
+ org.eclipse.papyrus.sysml.diagram.common.parser,
+ org.eclipse.papyrus.sysml.diagram.common.preferences,
+ org.eclipse.papyrus.sysml.diagram.common.utils,
+ org.eclipse.papyrus.uml.diagram.common.dnd.helper,
+ org.eclipse.papyrus.uml.diagram.common.edit.part,
+ org.eclipse.papyrus.uml.diagram.common.factory,
+ org.eclipse.papyrus.uml.diagram.common.figure,
+ org.eclipse.papyrus.uml.diagram.common.parser,
+ org.eclipse.papyrus.uml.diagram.common.utils
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 0.10.1.qualifier
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.sysml.diagram.common.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.common;singleto
+ n:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/about.html b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/about.html
index 82d49bf5f81..d35d5aed64c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/about.html
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/build.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/build.properties
index 86df25841da..58321663d25 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/build.properties
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/build.properties
@@ -1,11 +1,11 @@
-bin.includes = META-INF/,\
- .,\
- icons/,\
- about.html,\
- plugin.properties,\
- plugin.xml
-output..=bin/
-src.includes = icons/,\
- about.html
-source..=src/,src-gen/,src-common-uml/,src-common-sysml/,src-common-gmf/
-bin..=bin/
+bin.includes = META-INF/,\
+ .,\
+ icons/,\
+ about.html,\
+ plugin.properties,\
+ plugin.xml
+output..=bin/
+src.includes = icons/,\
+ about.html
+source..=src/,src-gen/,src-common-uml/,src-common-sysml/,src-common-gmf/
+bin..=bin/
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen
index 7c5953d2b6b..bf9c0deaeee 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen
@@ -1,131 +1,138 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<idgen:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:idgen="http://www.eclipse.org/papyrus/0.7.0/idgen" name="SysML Reusable Parts" type="" icon="" label="" language="" javaPackagePrefix="org.eclipse.papyrus.sysml.diagram.common" javaClassPrefix="SysML" createCommandLabel="">
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_constraintproperty_as_label" label="ConstraintProperty" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintPropertyChildLabelEditPart" semanticType="org.eclipse.papyrus.sysml.ConstraintProperty" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_flowport_as_label" label="FlowPort" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortChildLabelEditPart" semanticType="org.eclipse.papyrus.sysml.FlowPort" labelMask="Direction, Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_flowproperty_as_label" label="FlowProperty" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPropertyChildLabelEditPart" semanticType="org.eclipse.papyrus.sysml.FlowProperty" labelMask="Direction, Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_part_as_label" label="Part" semanticType="org.eclipse.papyrus.sysml.PartProperty" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers">
- <editPart href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart"/>
- </customNodes>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_reference_as_label" label="Reference" semanticType="org.eclipse.papyrus.sysml.ReferenceProperty" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers">
- <editPart href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart"/>
- </customNodes>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_value_as_label" label="Value" semanticType="org.eclipse.papyrus.sysml.ValueProperty" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers">
- <editPart href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart"/>
- </customNodes>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_block_as_classifier" label="Block" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockCompositeSemanticEditPolicy" creationPolicy="org.eclipse.papyrus.uml.diagram.common.edit.policy.StructuredClassifierCreationEditPolicy" semanticType="org.eclipse.papyrus.sysml.Block" tag="block" labels="label_sysml_block_name">
- <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
- <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
- <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
- <compartments href="#compartment_sysml_property_as_list"/>
- <compartments href="#compartment_sysml_part_as_list"/>
- <compartments href="#compartment_sysml_reference_as_list"/>
- <compartments href="UML.ReusableParts.idgen#compartment_uml_port_as_list"/>
- <compartments href="#compartment_sysml_flowport_as_list"/>
- <compartments href="UML.ReusableParts.idgen#compartment_uml_operation_as_list"/>
- <compartments href="#compartment_sysml_constraint_as_list"/>
- <compartments href="#compartment_sysml_value_as_list"/>
- <visibleCompartments href="#compartment_sysml_property_as_list"/>
- <visibleCompartments href="UML.ReusableParts.idgen#compartment_uml_operation_as_list"/>
- <visibleCompartments href="#compartment_sysml_constraint_as_list"/>
- </customNodes>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_block_as_composite" label="BlockComposite" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockCompositeSemanticEditPolicy" creationPolicy="org.eclipse.papyrus.uml.diagram.common.edit.policy.StructuredClassifierCreationEditPolicy" semanticType="org.eclipse.papyrus.sysml.Block" tag="block" labels="label_sysml_block_name" compartments="compartment_sysml_structure" visibleCompartments="compartment_sysml_structure">
- <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
- <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
- <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
- </customNodes>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_blockproperty_as_composite" label="BlockPropertyComposite" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart" semanticType="org.eclipse.papyrus.sysml.PartProperty" altSemanticTypes="org.eclipse.papyrus.sysml.ReferenceProperty" tag="[#runtime-defined]" compartments="compartment_sysml_blockproperty_structure" visibleCompartments="compartment_sysml_blockproperty_structure">
- <labels href="UML.ReusableParts.idgen#label_uml_property_label"/>
- <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
- <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
- <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
- </customNodes>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_dimension_as_classifier" label="Dimension" semanticType="org.eclipse.papyrus.sysml.Dimension" tag="dimension" labels="label_sysml_dimension_name"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_constraintblock_as_classifier" label="ConstraintBlock" semanticType="org.eclipse.papyrus.sysml.ConstraintBlock" tag="constraint" labels="label_sysml_constraintblock_name" compartments="compartment_sysml_parameter_as_list compartment_sysml_constraint_as_list" visibleCompartments="compartment_sysml_parameter_as_list compartment_sysml_constraint_as_list"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_flowspecification_as_classifier" label="FlowSpecification" semanticType="org.eclipse.papyrus.sysml.FlowSpecification" tag="flowSpecification" labels="label_sysml_flowspecification_name" compartments="compartment_sysml_flowproperty_as_list" visibleCompartments="compartment_sysml_flowproperty_as_list"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_unit_as_classifier" label="Unit" semanticType="org.eclipse.papyrus.sysml.Unit" labelMask="Name, Dimension" tag="unit" labels="label_sysml_unit_name"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_valuetype_as_classifier" label="ValueType" semanticType="org.eclipse.papyrus.sysml.ValueType" tag="valuetype" labels="label_sysml_valuetype_name">
- <compartments href="UML.ReusableParts.idgen#compartment_uml_property_as_list"/>
- <compartments href="UML.ReusableParts.idgen#compartment_uml_operation_as_list"/>
- <visibleCompartments href="UML.ReusableParts.idgen#compartment_uml_property_as_list"/>
- <visibleCompartments href="UML.ReusableParts.idgen#compartment_uml_operation_as_list"/>
- </customNodes>
- <customNodes xsi:type="idgen:CustomAffixedNode" id="shape_sysml_flowport_as_affixed" label="FlowPort" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedNodeEditPart" semanticType="org.eclipse.papyrus.sysml.FlowPort" altSemanticTypes="org.eclipse.papyrus.sysml.FlowPort_In org.eclipse.papyrus.sysml.FlowPort_Out org.eclipse.papyrus.sysml.FlowPort_InOut">
- <affixedLabels href="#affixedlabel_sysml_flowport_label"/>
- <affixedLabels href="UML.ReusableParts.idgen#affixedlabel_uml_appliedstereotype"/>
- <locator href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator"/>
- </customNodes>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_nestedblockproperty_as_composite" label="NestedBlockPropertyComposite" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.NestedBlockPropertyCompositeEditPart" semanticType="org.eclipse.papyrus.sysml.PartProperty" altSemanticTypes="org.eclipse.papyrus.sysml.ReferenceProperty" tag="[#runtime-defined]">
- <labels href="UML.ReusableParts.idgen#label_uml_property_label"/>
- <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
- <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
- <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
- </customNodes>
- <customEdges xsi:type="idgen:CustomLink" id="link_sysml_association" label="Association" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.AssociationEditPart" semanticType="org.eclipse.papyrus.sysml.Association" altSemanticTypes="org.eclipse.papyrus.sysml.AssociationComposite org.eclipse.papyrus.sysml.AssociationCompositeDirected org.eclipse.papyrus.sysml.AssociationNone org.eclipse.papyrus.sysml.AssociationNoneDirected org.eclipse.papyrus.sysml.AssociationShared org.eclipse.papyrus.sysml.AssociationSharedDirected" figure="org.eclipse.papyrus.sysml.diagram.common.figure.AssociationFigure">
- <viewFactory href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.factory.AssociationLinkViewFactory"/>
- <labels href="UML.ReusableParts.idgen#linklabel_uml_namedelement_name"/>
- <labels href="UML.ReusableParts.idgen#linklabel_uml_association_source_role"/>
- <labels href="UML.ReusableParts.idgen#linklabel_uml_association_source_multiplicity"/>
- <labels href="UML.ReusableParts.idgen#linklabel_uml_association_target_role"/>
- <labels href="UML.ReusableParts.idgen#linklabel_uml_association_target_multiplicity"/>
- </customEdges>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_constraint_as_list" label="BlockConstraint" title="constraints"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_flowport_as_list" label="FlowPort" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.FlowPortCompartmentSemanticEditPolicy" title="flow ports"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_flowproperty_as_list" label="FlowProperty" title="flow properties"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_parameter_as_list" label="Parameter" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ConstraintParameterCompartmentSemanticEditPolicy" title="parameters"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_part_as_list" label="PartProperty" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.PartCompartmentSemanticEditPolicy" title="parts"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_property_as_list" label="BlockProperty" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.PropertyCompartmentSemanticEditPolicy" title="properties"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_reference_as_list" label="ReferenceProperty" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ReferenceCompartmentSemanticEditPolicy" title="references"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_structure" label="Structure" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.StructureCompartmentSemanticEditPolicy" title="structure" list="false"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_blockproperty_structure" label="BlockPropertyStructure" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockPropertyStructureCompartmentSemanticEditPolicy" title="structure" list="false"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_value_as_list" label="ValueProperty" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ValueCompartmentSemanticEditPolicy" title="values"/>
- <customDecorations xsi:type="idgen:CustomAffixedLabel" id="affixedlabel_sysml_flowport_label" label="FlowPortAffixedLabel" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedLabelNameEditPart" role="Label">
- <locator href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator"/>
- </customDecorations>
- <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_block_name" label="BlockLabelName" specificIconKey=""/>
- <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_constraintblock_name" label="ConstraintBlockLabelName" specificIconKey=""/>
- <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_dimension_name" label="DimensionLabelName" specificIconKey=""/>
- <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_flowspecification_name" label="FlowSpecificationLabelName" specificIconKey=""/>
- <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_unit_name" label="UnitLabelName" specificIconKey=""/>
- <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_valuetype_name" label="ValueTypeLabelName" specificIconKey=""/>
- <semanticTypes id="org.eclipse.papyrus.sysml.Block" name="Block" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.ConstraintBlock" name="ConstraintBlock" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintBlock.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.ConstraintProperty" name="ConstraintProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintProperty.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.Dimension" name="Dimension" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Dimension.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.FlowPort" name="FlowPort" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.FlowPort_In" name="FlowPort_In" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.FlowPort_Out" name="FlowPort_Out" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.FlowPort_InOut" name="FlowPort_InOut" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.FlowProperty" name="FlowProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowProperty.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.FlowSpecification" name="FlowSpecification" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowSpecification.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.PartProperty" name="PartProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.ReferenceProperty" name="ReferenceProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.Unit" name="Unit" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Unit.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.ValueProperty" name="ValueProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.ValueType" name="ValueType" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.Association" name="Association" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.AssociationNone" name="AssociationNone" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.AssociationNoneDirected" name="AssociationNoneDirected" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.uml.service.types/icons/Association_none_directed.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.AssociationComposite" name="AssociationComposite" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association_composite.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.AssociationCompositeDirected" name="AssociationCompositeDirected" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.uml.service.types/icons/Association_composite_directed.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.AssociationShared" name="AssociationShared" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association_shared.gif"/>
- <semanticTypes id="org.eclipse.papyrus.sysml.AssociationSharedDirected" name="AssociationSharedDirected" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association_shared_directed.gif"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.NestedBlockPropertyCompositeEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.policy.StructuredClassifierCreationEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintPropertyChildLabelEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedLabelNameEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedNodeEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPropertyChildLabelEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortChildLabelEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.AssociationEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.figure.AssociationFigure"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ConstraintParameterCompartmentSemanticEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.PartCompartmentSemanticEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.PropertyCompartmentSemanticEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ReferenceCompartmentSemanticEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.StructureCompartmentSemanticEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ValueCompartmentSemanticEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockPropertyStructureCompartmentSemanticEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockCompositeSemanticEditPolicy"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.FlowPortCompartmentSemanticEditPolicy"/>
-</idgen:Diagram>
+<?xml version="1.0" encoding="UTF-8"?>
+<idgen:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:idgen="http://www.eclipse.org/papyrus/0.7.0/idgen" name="SysML Reusable Parts" type="" icon="" label="" language="" javaPackagePrefix="org.eclipse.papyrus.sysml.diagram.common" javaClassPrefix="SysML" createCommandLabel="">
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_constraintproperty_as_label" label="ConstraintProperty" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintPropertyChildLabelEditPart" semanticType="org.eclipse.papyrus.sysml.ConstraintProperty" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_flowport_as_label" label="FlowPort" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortChildLabelEditPart" semanticType="org.eclipse.papyrus.sysml.FlowPort" labelMask="Direction, Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_flowproperty_as_label" label="FlowProperty" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPropertyChildLabelEditPart" semanticType="org.eclipse.papyrus.sysml.FlowProperty" labelMask="Direction, Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_part_as_label" label="Part" semanticType="org.eclipse.papyrus.sysml.PartProperty" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers">
+ <editPart href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_reference_as_label" label="Reference" semanticType="org.eclipse.papyrus.sysml.ReferenceProperty" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers">
+ <editPart href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_sysml_value_as_label" label="Value" semanticType="org.eclipse.papyrus.sysml.ValueProperty" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers">
+ <editPart href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_block_as_classifier" label="Block" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockCompositeSemanticEditPolicy" creationPolicy="org.eclipse.papyrus.uml.diagram.common.edit.policy.StructuredClassifierCreationEditPolicy" semanticType="org.eclipse.papyrus.sysml.Block" tag="block" labels="label_sysml_block_name">
+ <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
+ <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
+ <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
+ <compartments href="#compartment_sysml_property_as_list"/>
+ <compartments href="#compartment_sysml_part_as_list"/>
+ <compartments href="#compartment_sysml_reference_as_list"/>
+ <compartments href="UML.ReusableParts.idgen#compartment_uml_port_as_list"/>
+ <compartments href="#compartment_sysml_flowport_as_list"/>
+ <compartments href="UML.ReusableParts.idgen#compartment_uml_operation_as_list"/>
+ <compartments href="#compartment_sysml_constraint_as_list"/>
+ <compartments href="#compartment_sysml_value_as_list"/>
+ <visibleCompartments href="#compartment_sysml_property_as_list"/>
+ <visibleCompartments href="UML.ReusableParts.idgen#compartment_uml_operation_as_list"/>
+ <visibleCompartments href="#compartment_sysml_constraint_as_list"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_block_as_composite" label="BlockComposite" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockCompositeSemanticEditPolicy" creationPolicy="org.eclipse.papyrus.uml.diagram.common.edit.policy.StructuredClassifierCreationEditPolicy" semanticType="org.eclipse.papyrus.sysml.Block" tag="block" labels="label_sysml_block_name" compartments="compartment_sysml_structure" visibleCompartments="compartment_sysml_structure">
+ <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
+ <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
+ <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_blockproperty_as_composite" label="BlockPropertyComposite" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart" semanticType="org.eclipse.papyrus.sysml.PartProperty" altSemanticTypes="org.eclipse.papyrus.sysml.ReferenceProperty" tag="[#runtime-defined]" compartments="compartment_sysml_blockproperty_structure" visibleCompartments="compartment_sysml_blockproperty_structure">
+ <labels href="UML.ReusableParts.idgen#label_uml_property_label"/>
+ <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
+ <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
+ <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_constraintblockproperty_as_composite" label="ConstraintBlockPropertyComposite" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintBlockPropertyCompositeEditPart" semanticType="org.eclipse.papyrus.sysml.PartProperty" altSemanticTypes="org.eclipse.papyrus.sysml.ReferenceProperty" tag="[#runtime-defined]" compartments="compartment_sysml_blockproperty_structure" visibleCompartments="compartment_sysml_blockproperty_structure">
+ <labels href="UML.ReusableParts.idgen#label_uml_property_label"/>
+ <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
+ <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
+ <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_dimension_as_classifier" label="Dimension" semanticType="org.eclipse.papyrus.sysml.Dimension" tag="dimension" labels="label_sysml_dimension_name"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_constraintblock_as_classifier" label="ConstraintBlock" semanticType="org.eclipse.papyrus.sysml.ConstraintBlock" tag="constraint" labels="label_sysml_constraintblock_name" compartments="compartment_sysml_parameter_as_list compartment_sysml_constraint_as_list" visibleCompartments="compartment_sysml_parameter_as_list compartment_sysml_constraint_as_list"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_flowspecification_as_classifier" label="FlowSpecification" semanticType="org.eclipse.papyrus.sysml.FlowSpecification" tag="flowSpecification" labels="label_sysml_flowspecification_name" compartments="compartment_sysml_flowproperty_as_list" visibleCompartments="compartment_sysml_flowproperty_as_list"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_unit_as_classifier" label="Unit" semanticType="org.eclipse.papyrus.sysml.Unit" labelMask="Name, Dimension" tag="unit" labels="label_sysml_unit_name"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_valuetype_as_classifier" label="ValueType" semanticType="org.eclipse.papyrus.sysml.ValueType" tag="valuetype" labels="label_sysml_valuetype_name">
+ <compartments href="UML.ReusableParts.idgen#compartment_uml_property_as_list"/>
+ <compartments href="UML.ReusableParts.idgen#compartment_uml_operation_as_list"/>
+ <visibleCompartments href="UML.ReusableParts.idgen#compartment_uml_property_as_list"/>
+ <visibleCompartments href="UML.ReusableParts.idgen#compartment_uml_operation_as_list"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomAffixedNode" id="shape_sysml_flowport_as_affixed" label="FlowPort" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedNodeEditPart" semanticType="org.eclipse.papyrus.sysml.FlowPort" altSemanticTypes="org.eclipse.papyrus.sysml.FlowPort_In org.eclipse.papyrus.sysml.FlowPort_Out org.eclipse.papyrus.sysml.FlowPort_InOut">
+ <affixedLabels href="#affixedlabel_sysml_flowport_label"/>
+ <affixedLabels href="UML.ReusableParts.idgen#affixedlabel_uml_appliedstereotype"/>
+ <locator href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator"/>
+ </customNodes>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_sysml_nestedblockproperty_as_composite" label="NestedBlockPropertyComposite" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.NestedBlockPropertyCompositeEditPart" semanticType="org.eclipse.papyrus.sysml.PartProperty" altSemanticTypes="org.eclipse.papyrus.sysml.ReferenceProperty" tag="[#runtime-defined]">
+ <labels href="UML.ReusableParts.idgen#label_uml_property_label"/>
+ <affixedNodes href="#shape_sysml_flowport_as_affixed"/>
+ <affixedNodes href="UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
+ <borderedNodeFigure href="UML.ReusableParts.idgen#org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
+ </customNodes>
+ <customEdges xsi:type="idgen:CustomLink" id="link_sysml_association" label="Association" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.AssociationEditPart" semanticType="org.eclipse.papyrus.sysml.Association" altSemanticTypes="org.eclipse.papyrus.sysml.AssociationComposite org.eclipse.papyrus.sysml.AssociationCompositeDirected org.eclipse.papyrus.sysml.AssociationNone org.eclipse.papyrus.sysml.AssociationNoneDirected org.eclipse.papyrus.sysml.AssociationShared org.eclipse.papyrus.sysml.AssociationSharedDirected" figure="org.eclipse.papyrus.sysml.diagram.common.figure.AssociationFigure">
+ <viewFactory href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.factory.AssociationLinkViewFactory"/>
+ <labels href="UML.ReusableParts.idgen#linklabel_uml_namedelement_name"/>
+ <labels href="UML.ReusableParts.idgen#linklabel_uml_association_source_role"/>
+ <labels href="UML.ReusableParts.idgen#linklabel_uml_association_source_multiplicity"/>
+ <labels href="UML.ReusableParts.idgen#linklabel_uml_association_target_role"/>
+ <labels href="UML.ReusableParts.idgen#linklabel_uml_association_target_multiplicity"/>
+ </customEdges>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_constraint_as_list" label="BlockConstraint" title="constraints"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_flowport_as_list" label="FlowPort" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.FlowPortCompartmentSemanticEditPolicy" title="flow ports"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_flowproperty_as_list" label="FlowProperty" title="flow properties"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_parameter_as_list" label="Parameter" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ConstraintParameterCompartmentSemanticEditPolicy" title="parameters"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_part_as_list" label="PartProperty" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.PartCompartmentSemanticEditPolicy" title="parts"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_property_as_list" label="BlockProperty" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.PropertyCompartmentSemanticEditPolicy" title="properties"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_reference_as_list" label="ReferenceProperty" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ReferenceCompartmentSemanticEditPolicy" title="references"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_structure" label="Structure" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.StructureCompartmentSemanticEditPolicy" title="structure" list="false"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_blockproperty_structure" label="BlockPropertyStructure" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockPropertyStructureCompartmentSemanticEditPolicy" title="structure" list="false"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_sysml_value_as_list" label="ValueProperty" semanticPolicy="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ValueCompartmentSemanticEditPolicy" title="values"/>
+ <customDecorations xsi:type="idgen:CustomAffixedLabel" id="affixedlabel_sysml_flowport_label" label="FlowPortAffixedLabel" editPart="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedLabelNameEditPart" role="Label">
+ <locator href="UML.ReusableParts.idgen#org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator"/>
+ </customDecorations>
+ <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_block_name" label="BlockLabelName" specificIconKey=""/>
+ <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_constraintblock_name" label="ConstraintBlockLabelName" specificIconKey=""/>
+ <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_dimension_name" label="DimensionLabelName" specificIconKey=""/>
+ <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_flowspecification_name" label="FlowSpecificationLabelName" specificIconKey=""/>
+ <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_unit_name" label="UnitLabelName" specificIconKey=""/>
+ <customDecorations xsi:type="idgen:CustomClassifierInnerLabel" id="label_sysml_valuetype_name" label="ValueTypeLabelName" specificIconKey=""/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.Block" name="Block" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.ConstraintBlock" name="ConstraintBlock" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintBlock.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.ConstraintProperty" name="ConstraintProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintProperty.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.Dimension" name="Dimension" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Dimension.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.FlowPort" name="FlowPort" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.FlowPort_In" name="FlowPort_In" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.FlowPort_Out" name="FlowPort_Out" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.FlowPort_InOut" name="FlowPort_InOut" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.FlowProperty" name="FlowProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowProperty.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.FlowSpecification" name="FlowSpecification" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowSpecification.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.PartProperty" name="PartProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.ReferenceProperty" name="ReferenceProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.Unit" name="Unit" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Unit.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.ValueProperty" name="ValueProperty" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.ValueType" name="ValueType" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.Association" name="Association" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.AssociationNone" name="AssociationNone" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.AssociationNoneDirected" name="AssociationNoneDirected" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.uml.service.types/icons/Association_none_directed.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.AssociationComposite" name="AssociationComposite" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association_composite.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.AssociationCompositeDirected" name="AssociationCompositeDirected" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.papyrus.uml.service.types/icons/Association_composite_directed.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.AssociationShared" name="AssociationShared" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association_shared.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.sysml.AssociationSharedDirected" name="AssociationSharedDirected" constantTypePackage="org.eclipse.papyrus.sysml.service.types.element" constantTypeClass="SysMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association_shared_directed.gif"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.NestedBlockPropertyCompositeEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.policy.StructuredClassifierCreationEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintPropertyChildLabelEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedLabelNameEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedNodeEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPropertyChildLabelEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortChildLabelEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintBlockPropertyCompositeEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.part.AssociationEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.figure.AssociationFigure"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ConstraintParameterCompartmentSemanticEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.PartCompartmentSemanticEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.PropertyCompartmentSemanticEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ReferenceCompartmentSemanticEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.StructureCompartmentSemanticEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.ValueCompartmentSemanticEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockPropertyStructureCompartmentSemanticEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockCompositeSemanticEditPolicy"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.sysml.diagram.common.edit.policy.FlowPortCompartmentSemanticEditPolicy"/>
+</idgen:Diagram>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen
index 14cc73df53b..94fb30a108a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen
@@ -1,86 +1,86 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<idgen:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:idgen="http://www.eclipse.org/papyrus/0.7.0/idgen" name="UML Reusable Parts" type="" icon="" label="" language="" javaPackagePrefix="org.eclipse.papyrus.uml.diagram.common" javaClassPrefix="UML" createCommandLabel="">
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_constraint_as_label" label="Constraint" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Constraint" labelMask="Name, Specification"/>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_enumerationliteral_as_label" label="EnumerationLiteral" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.EnumerationLiteral" labelMask=""/>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_operation_as_label" label="Operation" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Operation" labelMask="Visibility, Name, Type, Modifiers, Param_Direction, Param_Name, Param_Type, Param_Multiplicity, Param_DefaultValue, Param_Modifiers"/>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_port_as_label" label="Port" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Port" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_property_as_label" label="Property" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Property" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
- <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_reception_as_label" label="Reception" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Reception" labelMask="Name, Signal"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_actor_as_classifier" label="Actor" viewFactory="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory" semanticType="org.eclipse.papyrus.uml.Actor" labels="label_uml_namedelement_name" compartments="compartment_uml_property_as_list compartment_uml_operation_as_list"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_datatype_as_classifier" label="DataType" viewFactory="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory" semanticType="org.eclipse.papyrus.uml.DataType" tag="datatype" labels="label_uml_namedelement_name" compartments="compartment_uml_property_as_list compartment_uml_operation_as_list" visibleCompartments="compartment_uml_property_as_list"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_enumeration_as_classifier" label="Enumeration" semanticType="org.eclipse.papyrus.uml.Enumeration" labels="label_uml_namedelement_name" compartments="compartment_uml_enumerationliteral_as_list" visibleCompartments="compartment_uml_enumerationliteral_as_list"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_interface_as_classifier" label="Interface" viewFactory="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory" semanticType="org.eclipse.papyrus.uml.Interface" tag="" labels="label_uml_namedelement_name" compartments="compartment_uml_property_as_list compartment_uml_operation_as_list" visibleCompartments="compartment_uml_property_as_list compartment_uml_operation_as_list"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_primitivetype_as_classifier" label="PrimitiveType" semanticType="org.eclipse.papyrus.uml.PrimitiveType" tag="primitive" labels="label_uml_namedelement_name"/>
- <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_signal_as_classifier" label="Signal" viewFactory="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory" semanticType="org.eclipse.papyrus.uml.Signal" tag="" labels="label_uml_namedelement_name" compartments="compartment_uml_property_as_list compartment_uml_operation_as_list"/>
- <customNodes xsi:type="idgen:CustomAffixedNode" id="shape_uml_port_as_affixed" label="Port" semanticType="org.eclipse.papyrus.uml.Port" affixedLabels="affixedlabel_uml_port_label affixedlabel_uml_appliedstereotype" locator="org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator"/>
- <customEdges xsi:type="idgen:CustomLink" id="link_uml_dependency" label="Dependency" semanticType="org.eclipse.papyrus.uml.Dependency" labels="linklabel_uml_namedelement_name" figure="org.eclipse.papyrus.uml.diagram.common.figure.NamedElementEdgeFigure"/>
- <customEdges xsi:type="idgen:CustomLink" id="link_uml_connector" label="Connector" semanticType="org.eclipse.papyrus.uml.Connector" labels="linklabel_uml_connector_label linklabel_uml_connector_source_multiplicity linklabel_uml_connector_target_multiplicity" figure="org.eclipse.papyrus.uml.diagram.common.figure.ConnectorEdgeFigure"/>
- <customEdges xsi:type="idgen:CustomLink" id="link_uml_generalization" label="Generalization" semanticType="org.eclipse.papyrus.uml.Generalization" figure="org.eclipse.papyrus.uml.diagram.common.figure.GeneralizationFigure"/>
- <customEdges xsi:type="idgen:CustomLink" id="link_uml_interfacerealization" label="InterfaceRealization" semanticType="org.eclipse.papyrus.uml.InterfaceRealization" labels="linklabel_uml_namedelement_name" figure="org.eclipse.papyrus.uml.diagram.common.figure.InterfaceRealizationFigure"/>
- <customEdges xsi:type="idgen:CustomLink" id="link_uml_usage" label="Usage" semanticType="org.eclipse.papyrus.uml.Usage" tag="use" labels="linklabel_uml_namedelement_name" figure="org.eclipse.papyrus.uml.diagram.common.figure.NamedElementEdgeFigure"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_constraint_as_list" label="Constraint" title="constraints" children="shape_uml_constraint_as_label"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_enumerationliteral_as_list" label="EnumerationLiteral" title="literals" children="shape_uml_enumerationliteral_as_label"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_operation_as_list" label="Operation" title="operations" children="shape_uml_operation_as_label shape_uml_reception_as_label"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_port_as_list" label="Port" title="standard ports" children="shape_uml_port_as_label"/>
- <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_property_as_list" label="Property" title="properties" children="shape_uml_property_as_label shape_uml_port_as_label"/>
- <customDecorations xsi:type="idgen:CustomAffixedLabel" id="affixedlabel_uml_appliedstereotype" label="AppliedStereotypeAffixedLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeAffixedLabelEditPart" locator="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator" role="Name"/>
- <customDecorations xsi:type="idgen:CustomAffixedLabel" id="affixedlabel_uml_namedelement_name" label="NamedElementAffixedLabelName" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementAffixedLabelNameEditPart" locator="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator" role="Name"/>
- <customDecorations xsi:type="idgen:CustomAffixedLabel" id="affixedlabel_uml_port_label" label="PortAffixedLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedLabelNameEditPart" locator="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator" role="Label"/>
- <customDecorations xsi:type="idgen:CustomInnerLabel" id="label_uml_namedelement_name" label="NamedElementNodeLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementNodeLabelNameEditPart"/>
- <customDecorations xsi:type="idgen:CustomInnerLabel" id="label_uml_property_label" label="PropertyNodeLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.PropertyNodeLabelEditPart"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_connector_label" label="ConnectorLinkLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelEditPart" role="Name"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_namedelement_name" label="NamedElementLinkLabelName" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementLinkLabelNameEditPart" role="Name"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_appliedstereotype" label="AppliedStereotypeLinkLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeLinkLabelEditPart" role="Stereotype"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_association_source_role" label="AssociationLinkLabelSourceRole" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceRoleEditPart" role="SourceRole"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_association_source_multiplicity" label="AssociationLinkLabelSourceMultiplicity" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceMultiplicityEditPart" role="SourceMultiplicity"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_association_target_role" label="AssociationLinkLabelTargetRole" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelTargetRoleEditPart" role="TargetRole"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_association_target_multiplicity" label="AssociationLinkLabelTargetMultiplicity" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelTargetMultiplicityEditPart" role="TargetMultiplicity"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_connector_source_multiplicity" label="ConnectorLinkLabelSourceMultiplicity" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelSourceMultiplicityEditPart" role="SourceMultiplicity"/>
- <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_connector_target_multiplicity" label="ConnectorLinkLabelTargetMultiplicity" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelTargetMultiplicityEditPart" role="TargetMultiplicity"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Actor" name="Actor" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Actor.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Comment" name="Comment" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Connector" name="Connector" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Constraint" name="Constraint" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.DataType" name="DataType" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DataType.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Dependency" name="Dependency" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Enumeration" name="Enumeration" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Enumeration.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.EnumerationLiteral" name="EnumerationLiteral" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/EnumerationLiteral.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Generalization" name="Generalization" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Generalization.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.InstanceSpecification" name="InstanceSpecification" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InstanceSpecification.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Interface" name="Interface" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.InterfaceRealization" name="InterfaceRealization" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InterfaceRealization.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Model" name="Model" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Model.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Operation" name="Operation" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Operation.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Package" name="Package" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Port" name="Port" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Port.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.PrimitiveType" name="PrimitiveType" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/PrimitiveType.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Property" name="Property" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Reception" name="Reception" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Reception.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Signal" name="Signal" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Signal.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Slot" name="Slot" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Slot.gif"/>
- <semanticTypes id="org.eclipse.papyrus.uml.Usage" name="Usage" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Usage.gif"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeAffixedLabelEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeLinkLabelEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementAffixedLabelNameEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementLinkLabelNameEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementNodeLabelNameEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.PropertyNodeLabelEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedLabelNameEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceRoleEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceMultiplicityEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelTargetRoleEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelTargetMultiplicityEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelSourceMultiplicityEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelTargetMultiplicityEditPart"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.factory.AssociationLinkViewFactory"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.figure.GeneralizationFigure"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.figure.InterfaceRealizationFigure"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.figure.NamedElementEdgeFigure"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.figure.ConnectorEdgeFigure"/>
- <javaClasses qualifiedName="org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
-</idgen:Diagram>
+<?xml version="1.0" encoding="UTF-8"?>
+<idgen:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:idgen="http://www.eclipse.org/papyrus/0.7.0/idgen" name="UML Reusable Parts" type="" icon="" label="" language="" javaPackagePrefix="org.eclipse.papyrus.uml.diagram.common" javaClassPrefix="UML" createCommandLabel="">
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_constraint_as_label" label="Constraint" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Constraint" labelMask="Name, Specification"/>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_enumerationliteral_as_label" label="EnumerationLiteral" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.EnumerationLiteral" labelMask=""/>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_operation_as_label" label="Operation" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Operation" labelMask="Visibility, Name, Type, Modifiers, Param_Direction, Param_Name, Param_Type, Param_Multiplicity, Param_DefaultValue, Param_Modifiers"/>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_port_as_label" label="Port" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Port" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_property_as_label" label="Property" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Property" labelMask="Visibility, Derive, Name, Type, Undefined_Type, Multiplicity, Default_Multiplicity, DefaultValue, Modifiers"/>
+ <customNodes xsi:type="idgen:CustomLabelNode" id="shape_uml_reception_as_label" label="Reception" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart" semanticType="org.eclipse.papyrus.uml.Reception" labelMask="Name, Signal"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_actor_as_classifier" label="Actor" viewFactory="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory" semanticType="org.eclipse.papyrus.uml.Actor" labels="label_uml_namedelement_name" compartments="compartment_uml_property_as_list compartment_uml_operation_as_list"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_datatype_as_classifier" label="DataType" viewFactory="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory" semanticType="org.eclipse.papyrus.uml.DataType" tag="datatype" labels="label_uml_namedelement_name" compartments="compartment_uml_property_as_list compartment_uml_operation_as_list" visibleCompartments="compartment_uml_property_as_list"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_enumeration_as_classifier" label="Enumeration" semanticType="org.eclipse.papyrus.uml.Enumeration" labels="label_uml_namedelement_name" compartments="compartment_uml_enumerationliteral_as_list" visibleCompartments="compartment_uml_enumerationliteral_as_list"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_interface_as_classifier" label="Interface" viewFactory="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory" semanticType="org.eclipse.papyrus.uml.Interface" tag="" labels="label_uml_namedelement_name" compartments="compartment_uml_property_as_list compartment_uml_operation_as_list" visibleCompartments="compartment_uml_property_as_list compartment_uml_operation_as_list"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_primitivetype_as_classifier" label="PrimitiveType" semanticType="org.eclipse.papyrus.uml.PrimitiveType" tag="primitive" labels="label_uml_namedelement_name"/>
+ <customNodes xsi:type="idgen:CustomClassifierNode" id="shape_uml_signal_as_classifier" label="Signal" viewFactory="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory" semanticType="org.eclipse.papyrus.uml.Signal" tag="" labels="label_uml_namedelement_name" compartments="compartment_uml_property_as_list compartment_uml_operation_as_list"/>
+ <customNodes xsi:type="idgen:CustomAffixedNode" id="shape_uml_port_as_affixed" label="Port" semanticType="org.eclipse.papyrus.uml.Port" affixedLabels="affixedlabel_uml_port_label affixedlabel_uml_appliedstereotype" locator="org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator"/>
+ <customEdges xsi:type="idgen:CustomLink" id="link_uml_dependency" label="Dependency" semanticType="org.eclipse.papyrus.uml.Dependency" labels="linklabel_uml_namedelement_name" figure="org.eclipse.papyrus.uml.diagram.common.figure.NamedElementEdgeFigure"/>
+ <customEdges xsi:type="idgen:CustomLink" id="link_uml_connector" label="Connector" semanticType="org.eclipse.papyrus.uml.Connector" labels="linklabel_uml_connector_label linklabel_uml_connector_source_multiplicity linklabel_uml_connector_target_multiplicity" figure="org.eclipse.papyrus.uml.diagram.common.figure.ConnectorEdgeFigure"/>
+ <customEdges xsi:type="idgen:CustomLink" id="link_uml_generalization" label="Generalization" semanticType="org.eclipse.papyrus.uml.Generalization" figure="org.eclipse.papyrus.uml.diagram.common.figure.GeneralizationFigure"/>
+ <customEdges xsi:type="idgen:CustomLink" id="link_uml_interfacerealization" label="InterfaceRealization" semanticType="org.eclipse.papyrus.uml.InterfaceRealization" labels="linklabel_uml_namedelement_name" figure="org.eclipse.papyrus.uml.diagram.common.figure.InterfaceRealizationFigure"/>
+ <customEdges xsi:type="idgen:CustomLink" id="link_uml_usage" label="Usage" semanticType="org.eclipse.papyrus.uml.Usage" tag="use" labels="linklabel_uml_namedelement_name" figure="org.eclipse.papyrus.uml.diagram.common.figure.NamedElementEdgeFigure"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_constraint_as_list" label="Constraint" title="constraints" children="shape_uml_constraint_as_label"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_enumerationliteral_as_list" label="EnumerationLiteral" title="literals" children="shape_uml_enumerationliteral_as_label"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_operation_as_list" label="Operation" title="operations" children="shape_uml_operation_as_label shape_uml_reception_as_label"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_port_as_list" label="Port" title="standard ports" children="shape_uml_port_as_label"/>
+ <customDecorations xsi:type="idgen:CustomCompartment" id="compartment_uml_property_as_list" label="Property" title="properties" children="shape_uml_property_as_label shape_uml_port_as_label"/>
+ <customDecorations xsi:type="idgen:CustomAffixedLabel" id="affixedlabel_uml_appliedstereotype" label="AppliedStereotypeAffixedLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeAffixedLabelEditPart" locator="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator" role="Name"/>
+ <customDecorations xsi:type="idgen:CustomAffixedLabel" id="affixedlabel_uml_namedelement_name" label="NamedElementAffixedLabelName" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementAffixedLabelNameEditPart" locator="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator" role="Name"/>
+ <customDecorations xsi:type="idgen:CustomAffixedLabel" id="affixedlabel_uml_port_label" label="PortAffixedLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedLabelNameEditPart" locator="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator" role="Label"/>
+ <customDecorations xsi:type="idgen:CustomInnerLabel" id="label_uml_namedelement_name" label="NamedElementNodeLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementNodeLabelNameEditPart"/>
+ <customDecorations xsi:type="idgen:CustomInnerLabel" id="label_uml_property_label" label="PropertyNodeLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.PropertyNodeLabelEditPart"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_connector_label" label="ConnectorLinkLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelEditPart" role="Name"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_namedelement_name" label="NamedElementLinkLabelName" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementLinkLabelNameEditPart" role="Name"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_appliedstereotype" label="AppliedStereotypeLinkLabel" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeLinkLabelEditPart" role="Stereotype"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_association_source_role" label="AssociationLinkLabelSourceRole" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceRoleEditPart" role="SourceRole"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_association_source_multiplicity" label="AssociationLinkLabelSourceMultiplicity" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceMultiplicityEditPart" role="SourceMultiplicity"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_association_target_role" label="AssociationLinkLabelTargetRole" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelTargetRoleEditPart" role="TargetRole"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_association_target_multiplicity" label="AssociationLinkLabelTargetMultiplicity" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelTargetMultiplicityEditPart" role="TargetMultiplicity"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_connector_source_multiplicity" label="ConnectorLinkLabelSourceMultiplicity" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelSourceMultiplicityEditPart" role="SourceMultiplicity"/>
+ <customDecorations xsi:type="idgen:CustomLinkLabel" id="linklabel_uml_connector_target_multiplicity" label="ConnectorLinkLabelTargetMultiplicity" editPart="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelTargetMultiplicityEditPart" role="TargetMultiplicity"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Actor" name="Actor" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Actor.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Comment" name="Comment" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Connector" name="Connector" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Constraint" name="Constraint" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.DataType" name="DataType" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/DataType.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Dependency" name="Dependency" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Enumeration" name="Enumeration" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Enumeration.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.EnumerationLiteral" name="EnumerationLiteral" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/EnumerationLiteral.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Generalization" name="Generalization" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Generalization.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.InstanceSpecification" name="InstanceSpecification" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InstanceSpecification.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Interface" name="Interface" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Interface.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.InterfaceRealization" name="InterfaceRealization" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/InterfaceRealization.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Model" name="Model" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Model.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Operation" name="Operation" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Operation.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Package" name="Package" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Package.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Port" name="Port" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Port.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.PrimitiveType" name="PrimitiveType" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/PrimitiveType.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Property" name="Property" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Reception" name="Reception" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Reception.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Signal" name="Signal" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Signal.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Slot" name="Slot" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Slot.gif"/>
+ <semanticTypes id="org.eclipse.papyrus.uml.Usage" name="Usage" constantTypePackage="org.eclipse.papyrus.uml.service.types.element" constantTypeClass="UMLElementTypes" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Usage.gif"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeAffixedLabelEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeLinkLabelEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.DefaultChildLabelEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementAffixedLabelNameEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementLinkLabelNameEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementNodeLabelNameEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.PropertyNodeLabelEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedLabelNameEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceRoleEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelSourceMultiplicityEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelTargetRoleEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.AssociationLinkLabelTargetMultiplicityEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelSourceMultiplicityEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelTargetMultiplicityEditPart"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.factory.ClassifierViewFactory"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.factory.AssociationLinkViewFactory"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.figure.GeneralizationFigure"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.figure.InterfaceRealizationFigure"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.figure.NamedElementEdgeFigure"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.uml.diagram.common.figure.ConnectorEdgeFigure"/>
+ <javaClasses qualifiedName="org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure"/>
+</idgen:Diagram>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.properties
index dc047004a43..a140c69c616 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.properties
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.properties
@@ -1,12 +1,12 @@
-#################################################################################
-# Copyright (c) 2010 CEA LIST.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - initial API and implementation
-##################################################################################
-pluginName=UML Common diagram for SysML (Incubation)
-providerName=Eclipse Modeling Project
+#################################################################################
+# Copyright (c) 2010 CEA LIST.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - initial API and implementation
+##################################################################################
+pluginName=UML Common diagram for SysML (Incubation)
+providerName=Eclipse Modeling Project
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml
index 3118788f2ff..d04bf6abd85 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml
@@ -1,5 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
<plugin>
<extension point="org.eclipse.papyrus.infra.core.papyrusDiagram">
@@ -22,27 +22,27 @@
<test forcePluginActivation="true" property="org.eclipse.papyrus.SysMLSelectionTester.isSysMLModel" value="true"></test>
</with>
</and>
- </definition>
- <definition id="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysMLBlocks">
- <and>
- <with variable="activeEditorId">
- <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"></equals>
- </with>
- <with variable="selection">
- <test forcePluginActivation="true" property="org.eclipse.papyrus.SysMLSelectionTester.isSysMLBlocksModel" value="true"></test>
- </with>
- </and>
- </definition>
- <definition id="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysMLRequirements">
- <and>
- <with variable="activeEditorId">
- <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"></equals>
- </with>
- <with variable="selection">
- <test forcePluginActivation="true" property="org.eclipse.papyrus.SysMLSelectionTester.isSysMLRequirementsModel" value="true"></test>
- </with>
- </and>
+ </definition>
+ <definition id="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysMLBlocks">
+ <and>
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"></equals>
+ </with>
+ <with variable="selection">
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.SysMLSelectionTester.isSysMLBlocksModel" value="true"></test>
+ </with>
+ </and>
+ </definition>
+ <definition id="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysMLRequirements">
+ <and>
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"></equals>
+ </with>
+ <with variable="selection">
+ <test forcePluginActivation="true" property="org.eclipse.papyrus.SysMLSelectionTester.isSysMLRequirementsModel" value="true"></test>
+ </with>
+ </and>
</definition>
</extension>
-</plugin>
+</plugin>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/CreateViewCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/CreateViewCommand.java
index f68a9c37ecc..b877e3a2c73 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/CreateViewCommand.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/CreateViewCommand.java
@@ -1,62 +1,62 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.commands;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * A replacement for CreateCommand that avoids that takes into account the incorrect
- * generation of ViewProvider by GMFTooling and modifies SemanticAdapter in call to
- * {@link ViewService#provides(Class, org.eclipse.core.runtime.IAdaptable, View, String, int, boolean, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint)}
- * .
- */
-public class CreateViewCommand extends CreateCommand {
-
- /** Constructor */
- public CreateViewCommand(TransactionalEditingDomain editingDomain, ViewDescriptor viewDescriptor, View containerView) {
- super(editingDomain, viewDescriptor, containerView);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean canExecute() {
-
- // Warning the element adapter can possibly be null (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=353129)
- if(viewDescriptor.getElementAdapter() == null) {
- return false;
- }
-
- // Try to adapt the descriptor ElementAdapter in EObject
- EObject element = (EObject)viewDescriptor.getElementAdapter().getAdapter(EObject.class);
- IElementType elementType = (IElementType)viewDescriptor.getElementAdapter().getAdapter(IElementType.class);
-
- SemanticElementAdapter semanticAdapter = new SemanticElementAdapter(element, elementType);
-
- // Use the semanticAdapter instead of view descriptor element adapter to avoid the use of provides(ViewForKind) method
- // from ViewProvider which is incorrectly implemented in GMF Tooling generated editors (other editors may have undesired side-effect on each-other).
-
- return ViewService.getInstance().provides(viewDescriptor.getViewKind(), semanticAdapter, containerView, viewDescriptor.getSemanticHint(), viewDescriptor.getIndex(), viewDescriptor.isPersisted(), viewDescriptor.getPreferencesHint());
- }
-
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * A replacement for CreateCommand that avoids that takes into account the incorrect
+ * generation of ViewProvider by GMFTooling and modifies SemanticAdapter in call to
+ * {@link ViewService#provides(Class, org.eclipse.core.runtime.IAdaptable, View, String, int, boolean, org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint)}
+ * .
+ */
+public class CreateViewCommand extends CreateCommand {
+
+ /** Constructor */
+ public CreateViewCommand(TransactionalEditingDomain editingDomain, ViewDescriptor viewDescriptor, View containerView) {
+ super(editingDomain, viewDescriptor, containerView);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean canExecute() {
+
+ // Warning the element adapter can possibly be null (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=353129)
+ if(viewDescriptor.getElementAdapter() == null) {
+ return false;
+ }
+
+ // Try to adapt the descriptor ElementAdapter in EObject
+ EObject element = (EObject)viewDescriptor.getElementAdapter().getAdapter(EObject.class);
+ IElementType elementType = (IElementType)viewDescriptor.getElementAdapter().getAdapter(IElementType.class);
+
+ SemanticElementAdapter semanticAdapter = new SemanticElementAdapter(element, elementType);
+
+ // Use the semanticAdapter instead of view descriptor element adapter to avoid the use of provides(ViewForKind) method
+ // from ViewProvider which is incorrectly implemented in GMF Tooling generated editors (other editors may have undesired side-effect on each-other).
+
+ return ViewService.getInstance().provides(viewDescriptor.getViewKind(), semanticAdapter, containerView, viewDescriptor.getSemanticHint(), viewDescriptor.getIndex(), viewDescriptor.isPersisted(), viewDescriptor.getPreferencesHint());
+ }
+
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/ISemanticHintAdapter.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/ISemanticHintAdapter.java
index ca2558e0e23..cc0b896137a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/ISemanticHintAdapter.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/ISemanticHintAdapter.java
@@ -1,27 +1,27 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.commands;
-
-
-/**
- * Interface for an adapter that can give a semantic hint
- */
-public interface ISemanticHintAdapter {
-
- /**
- * Returns the semantic hint for this adapter
- * @return the semantic hint for this adapter
- */
- public String getSemanticHint();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.commands;
+
+
+/**
+ * Interface for an adapter that can give a semantic hint
+ */
+public interface ISemanticHintAdapter {
+
+ /**
+ * Returns the semantic hint for this adapter
+ * @return the semantic hint for this adapter
+ */
+ public String getSemanticHint();
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/IdentityCommandWithNotification.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/IdentityCommandWithNotification.java
index d43040da03d..cb65145164b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/IdentityCommandWithNotification.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/IdentityCommandWithNotification.java
@@ -1,89 +1,89 @@
-/******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * CEA LIST - Papyrus notification added in command execution
- ****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.util.StringStatics;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.Type;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.CombinedPopupAndViewBuilder;
-import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
-
-/**
- * A command that is always executable, undoable and redoable, but does nothing.
- * It always returns the same OK command result.
- *
- * @author ldamus
- */
-public class IdentityCommandWithNotification extends AbstractCommand {
-
- protected String title = "Papyrus notification";
-
- protected String message = "No message.";
-
- protected Type type = Type.INFO;
-
- /**
- * Public constructor.
- */
- public IdentityCommandWithNotification(String message) {
- this();
- this.message = message;
- }
-
- /**
- * Public constructor.
- */
- public IdentityCommandWithNotification(String title, String message, Type type) {
- this(message);
- this.title = title;
- this.type = type;
- }
-
- /**
- * Private constructor.
- */
- private IdentityCommandWithNotification() {
- super(StringStatics.BLANK, null);
- setResult(CommandResult.newOKCommandResult());
- }
-
- /**
- * Does nothing and returns an OK command result.
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- new NotificationBuilder().setBuilderClass(CombinedPopupAndViewBuilder.class).setType(type).setTitle(title).setMessage(message).run();
-
- return getCommandResult();
- }
-
- /**
- * Does nothing and returns an OK command result.
- */
- protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- return getCommandResult();
- }
-
- /**
- * Does nothing and returns an OK command result.
- */
- protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- return getCommandResult();
- }
-
-}
+/******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * CEA LIST - Papyrus notification added in command execution
+ ****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.util.StringStatics;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.Type;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.CombinedPopupAndViewBuilder;
+import org.eclipse.papyrus.infra.widgets.toolbox.notification.builders.NotificationBuilder;
+
+/**
+ * A command that is always executable, undoable and redoable, but does nothing.
+ * It always returns the same OK command result.
+ *
+ * @author ldamus
+ */
+public class IdentityCommandWithNotification extends AbstractCommand {
+
+ protected String title = "Papyrus notification";
+
+ protected String message = "No message.";
+
+ protected Type type = Type.INFO;
+
+ /**
+ * Public constructor.
+ */
+ public IdentityCommandWithNotification(String message) {
+ this();
+ this.message = message;
+ }
+
+ /**
+ * Public constructor.
+ */
+ public IdentityCommandWithNotification(String title, String message, Type type) {
+ this(message);
+ this.title = title;
+ this.type = type;
+ }
+
+ /**
+ * Private constructor.
+ */
+ private IdentityCommandWithNotification() {
+ super(StringStatics.BLANK, null);
+ setResult(CommandResult.newOKCommandResult());
+ }
+
+ /**
+ * Does nothing and returns an OK command result.
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ new NotificationBuilder().setBuilderClass(CombinedPopupAndViewBuilder.class).setType(type).setTitle(title).setMessage(message).run();
+
+ return getCommandResult();
+ }
+
+ /**
+ * Does nothing and returns an OK command result.
+ */
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ return getCommandResult();
+ }
+
+ /**
+ * Does nothing and returns an OK command result.
+ */
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ return getCommandResult();
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/SemanticElementAdapter.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/SemanticElementAdapter.java
index 649c5e38cd2..cbfbce3b15b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/SemanticElementAdapter.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/commands/SemanticElementAdapter.java
@@ -1,87 +1,87 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.commands;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
-
-/**
- * An adapter for {@link IElementType}, {@link EObject} or {@link View}.
- */
-public class SemanticElementAdapter extends SemanticAdapter implements ISemanticHintAdapter {
-
- /** The elementType. */
- private Object elementType;
-
- /** Constructor from EObject */
- public SemanticElementAdapter(EObject element) {
- super(element, null);
- this.elementType = null;
- }
-
- /** Constructor from IElementType */
- public SemanticElementAdapter(IElementType elementType) {
- super(null, null);
- this.elementType = elementType;
- }
-
- /** Constructor from EObject and IElementType */
- public SemanticElementAdapter(EObject element, IElementType elementType) {
- super(element, null);
- this.elementType = elementType;
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("rawtypes")
- @Override
- public Object getAdapter(Class adapter) {
- if(adapter.equals(IHintedType.class)) {
- if(elementType instanceof IHintedType) {
- return elementType;
- }
- }
-
- if(adapter.equals(IElementType.class)) {
- return elementType;
- }
- return super.getAdapter(adapter);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object getProxyClassID() {
- if(elementType !=null) {
- return PackageUtil.getID(((IElementType)elementType).getEClass());
- }
- return super.getProxyClassID();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getSemanticHint() {
- if(elementType instanceof IHintedType) {
- return ((IHintedType)elementType).getSemanticHint();
- }
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+
+/**
+ * An adapter for {@link IElementType}, {@link EObject} or {@link View}.
+ */
+public class SemanticElementAdapter extends SemanticAdapter implements ISemanticHintAdapter {
+
+ /** The elementType. */
+ private Object elementType;
+
+ /** Constructor from EObject */
+ public SemanticElementAdapter(EObject element) {
+ super(element, null);
+ this.elementType = null;
+ }
+
+ /** Constructor from IElementType */
+ public SemanticElementAdapter(IElementType elementType) {
+ super(null, null);
+ this.elementType = elementType;
+ }
+
+ /** Constructor from EObject and IElementType */
+ public SemanticElementAdapter(EObject element, IElementType elementType) {
+ super(element, null);
+ this.elementType = elementType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class adapter) {
+ if(adapter.equals(IHintedType.class)) {
+ if(elementType instanceof IHintedType) {
+ return elementType;
+ }
+ }
+
+ if(adapter.equals(IElementType.class)) {
+ return elementType;
+ }
+ return super.getAdapter(adapter);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object getProxyClassID() {
+ if(elementType !=null) {
+ return PackageUtil.getID(((IElementType)elementType).getEClass());
+ }
+ return super.getProxyClassID();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getSemanticHint() {
+ if(elementType instanceof IHintedType) {
+ return ((IHintedType)elementType).getSemanticHint();
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/DiagramVersioningUtils.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/DiagramVersioningUtils.java
index 046f030ab4a..906c4bab0ee 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/DiagramVersioningUtils.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/DiagramVersioningUtils.java
@@ -1,62 +1,62 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.compatibility;
-
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.StringValueStyle;
-
-/**
- * This class provide several convenience methods to tag a diagram with a version number
- * in a notation style, or retrieve this version number.
- */
-public class DiagramVersioningUtils {
-
- /**
- * The ID for the diagram internal version number stored in Notation model.
- */
- private static final String DIAGRAM_COMPATIBILITY_VERSION = "diagram_compatibility_version";
-
- /**
- * The ID for the diagram internal version number stored in Notation model.
- */
- public static final String UNDEFINED_VERSION = "undefined";
-
- /**
- * Get the diagram compatibility version.
- * @param diagram the diagram
- * @return the compatibility version.
- */
- public static String getCompatibilityVersion(Diagram diagram) {
- StringValueStyle semanticStyle = (StringValueStyle)diagram.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), DIAGRAM_COMPATIBILITY_VERSION);
- return semanticStyle == null ? UNDEFINED_VERSION : semanticStyle.getStringValue();
- }
-
- /**
- * Set the diagram compatibility version.
- * @param diagram the diagram
- * @param version the compatibility version
- */
- @SuppressWarnings("unchecked")
- public static void setCompatibilityVersion(Diagram diagram, String version) {
- StringValueStyle style = (StringValueStyle)diagram.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), DIAGRAM_COMPATIBILITY_VERSION);
- if (style == null) {
- style = NotationFactory.eINSTANCE.createStringValueStyle();
- style.setName(DIAGRAM_COMPATIBILITY_VERSION);
- diagram.getStyles().add(style);
- }
- style.setStringValue(version);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.compatibility;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.StringValueStyle;
+
+/**
+ * This class provide several convenience methods to tag a diagram with a version number
+ * in a notation style, or retrieve this version number.
+ */
+public class DiagramVersioningUtils {
+
+ /**
+ * The ID for the diagram internal version number stored in Notation model.
+ */
+ private static final String DIAGRAM_COMPATIBILITY_VERSION = "diagram_compatibility_version";
+
+ /**
+ * The ID for the diagram internal version number stored in Notation model.
+ */
+ public static final String UNDEFINED_VERSION = "undefined";
+
+ /**
+ * Get the diagram compatibility version.
+ * @param diagram the diagram
+ * @return the compatibility version.
+ */
+ public static String getCompatibilityVersion(Diagram diagram) {
+ StringValueStyle semanticStyle = (StringValueStyle)diagram.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), DIAGRAM_COMPATIBILITY_VERSION);
+ return semanticStyle == null ? UNDEFINED_VERSION : semanticStyle.getStringValue();
+ }
+
+ /**
+ * Set the diagram compatibility version.
+ * @param diagram the diagram
+ * @param version the compatibility version
+ */
+ @SuppressWarnings("unchecked")
+ public static void setCompatibilityVersion(Diagram diagram, String version) {
+ StringValueStyle style = (StringValueStyle)diagram.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), DIAGRAM_COMPATIBILITY_VERSION);
+ if (style == null) {
+ style = NotationFactory.eINSTANCE.createStringValueStyle();
+ style.setName(DIAGRAM_COMPATIBILITY_VERSION);
+ diagram.getStyles().add(style);
+ }
+ style.setStringValue(version);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/IDiagramVersionUpdater.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/IDiagramVersionUpdater.java
index d486348e073..a487396ac2f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/IDiagramVersionUpdater.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/compatibility/IDiagramVersionUpdater.java
@@ -1,31 +1,31 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.compatibility;
-
-import org.eclipse.gmf.runtime.notation.Diagram;
-
-/**
- * This interface provides an API for migration of diagram from a version to another.
- */
-public interface IDiagramVersionUpdater {
-
- /**
- * Update a diagram to a new version.
- * @param diagram the diagram to update
- * @param oldVersion the old version of the diagram
- * @param newVersion the new version of the diagram
- * @return TODO : should return a status, not int.
- */
- public int update(Diagram diagram, String oldVersion, String newVersion);
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.compatibility;
+
+import org.eclipse.gmf.runtime.notation.Diagram;
+
+/**
+ * This interface provides an API for migration of diagram from a version to another.
+ */
+public interface IDiagramVersionUpdater {
+
+ /**
+ * Update a diagram to a new version.
+ * @param diagram the diagram to update
+ * @param oldVersion the old version of the diagram
+ * @param newVersion the new version of the diagram
+ * @return TODO : should return a status, not int.
+ */
+ public int update(Diagram diagram, String oldVersion, String newVersion);
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/part/ITextAwareEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/part/ITextAwareEditPart.java
index 6d786423ff2..b887daaf6ed 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/part/ITextAwareEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/part/ITextAwareEditPart.java
@@ -1,37 +1,37 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-
-/**
- * Edit Part that contains editable text.
- */
-public interface ITextAwareEditPart extends org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart {
-
- /**
- * Get the parser elements.
- *
- * @return the element being parsed.
- */
- public EObject getParserElement();
-
- /**
- * Gets the default parser options (meaning parser options stored in preferences).
- *
- * @return ParserOptions the parser options
- */
- public ParserOptions getDefaultParserOptions();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.part;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+
+/**
+ * Edit Part that contains editable text.
+ */
+public interface ITextAwareEditPart extends org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart {
+
+ /**
+ * Get the parser elements.
+ *
+ * @return the element being parsed.
+ */
+ public EObject getParserElement();
+
+ /**
+ * Gets the default parser options (meaning parser options stored in preferences).
+ *
+ * @return ParserOptions the parser options
+ */
+ public ParserOptions getDefaultParserOptions();
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java
index b31c9cd819a..bc831f2b5f5 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/CommonDiagramDragDropEditPolicy.java
@@ -1,371 +1,371 @@
-/*****************************************************************************
- * Copyright (c) 2011-2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
- *
- * CEA LIST - Adapted to use a local graphical type registry.
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import static org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry.UNDEFINED_TYPE;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-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.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest;
-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.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RefreshConnectionsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.CommandProxyWithResult;
-import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.ViewDescriptorUtil;
-import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
-import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementBorderEditPart;
-import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.common.util.CrossReferencerUtil;
-
-/**
- * Abstract DND edit policy delegating the choice of the view to create for an EObject to a local
- * graphical type registry.
- */
-public abstract class CommonDiagramDragDropEditPolicy extends DiagramDragDropEditPolicy {
-
- /** The graphical type registry. */
- protected IGraphicalTypeRegistry registry;
-
- /** The list of element types that require a specific drop command. */
- private Set<String> specificDropList = null;
-
- /** The specified link mapping helper depending on the diagram */
- protected ILinkMappingHelper linkMappingHelper;
-
- /** Constructor */
- public CommonDiagramDragDropEditPolicy(ILinkMappingHelper linkMappingHelper) {
- this.linkMappingHelper = linkMappingHelper;
- }
-
- private Set<String> getSpecificDropList() {
- if(specificDropList == null) {
- specificDropList = getSpecificDropBehaviorTypes();
- }
- return specificDropList;
- }
-
- protected abstract Set<String> getSpecificDropBehaviorTypes();
-
- /**
- * <pre>
- * {@inheritedDoc}.
- *
- * Overridden method to fix some exception occurring while moving affixed element (nodes or labels)
- * (https://bugs.eclipse.org/bugs/show_bug.cgi?id=350680).
- * </pre>
- */
- @Override
- protected Command getDropCommand(ChangeBoundsRequest request) {
-
- Iterator<?> iter = request.getEditParts().iterator();
- EObject graphicalParentObject = ((GraphicalEditPart)getHost()).resolveSemanticElement();
- while((graphicalParentObject != null) && (iter.hasNext())) {
- EditPart droppedEditPart = (EditPart)iter.next();
- if(droppedEditPart instanceof AbstractElementBorderEditPart) {
- return UnexecutableCommand.INSTANCE;
- }
- if(droppedEditPart instanceof AbstractElementLabelEditPart) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- return super.getDropCommand(request);
- }
-
- /**
- * {@inheritedDoc}.
- */
- @Override
- public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
-
- CompoundCommand completeDropCommand = new CompoundCommand("DropObjectsAndArrange"); //$NON-NLS-1$
-
- // Detect file drop
- if((dropRequest.getObjects().size() > 0) && (dropRequest.getObjects().get(0) instanceof String)) {
- return getDropFileCommand(dropRequest);
- }
-
- // Create the drop command by composite drop command for each dropped elements
- CompositeCommand gmfDropCommand = new CompositeCommand("DropObjects"); //$NON-NLS-1$
- Iterator<?> iter = dropRequest.getObjects().iterator();
- while(iter.hasNext()) {
- EObject droppedObject = (EObject)iter.next();
- gmfDropCommand.add(getDropObjectCommand(dropRequest, droppedObject));
- }
-
- // Create the complete drop command by adding an arrange command after drop
- if(!gmfDropCommand.isEmpty()) {
-
- // Retrieve drop result (most probably created view but not necessarily) and update the request
- CommandResult result = gmfDropCommand.getCommandResult();
- List<?> newValues = (List<?>)result.getReturnValue();
- dropRequest.setResult(newValues);
-
- // Prepare refresh command
- RefreshConnectionsRequest refreshRequest = new RefreshConnectionsRequest(newValues);
- Command refreshCommand = getHost().getCommand(refreshRequest);
-
- // Prepare an arrange command to avoid every dropped view to appear at the same location
- ArrangeRequest arrangeRequest = new ArrangeRequest(RequestConstants.REQ_ARRANGE_DEFERRED);
- arrangeRequest.setViewAdaptersToArrange(newValues);
- Command arrangeCommand = getHost().getCommand(arrangeRequest);
-
- // Update the complete drop command (drop - refresh - arrange)
- Command dropCommand = new ICommandProxy(gmfDropCommand);
- completeDropCommand.add(dropCommand.chain(refreshCommand));
- completeDropCommand.add(arrangeCommand);
- }
-
- return completeDropCommand;
- }
-
- protected ICommand getDropObjectCommand(DropObjectsRequest dropRequest, EObject droppedObject) {
-
- Point location = dropRequest.getLocation().getCopy();
-
- View dropTargetView = ((IGraphicalEditPart)getHost()).getNotationView();
- EObject dropTargetElement = dropTargetView.getElement();
-
- String droppedNodeType = registry.getNodeGraphicalType(droppedObject, dropTargetView.getType());
- String droppedEdgeType = registry.getEdgeGraphicalType(droppedObject);
-
- // Test if a specific drop command should be used
- if(getSpecificDropList().contains(droppedNodeType) || getSpecificDropList().contains(droppedEdgeType)) {
- return getSpecificDropCommand(dropRequest, droppedObject, droppedNodeType, droppedEdgeType);
- }
-
- // Decide unknown type handling
- if(UNDEFINED_TYPE.equals(droppedNodeType) && UNDEFINED_TYPE.equals(droppedEdgeType)) {
- return getUnknownDropCommand(dropRequest, droppedObject);
- }
-
- // The dropped element is a node
- if(!UNDEFINED_TYPE.equals(droppedNodeType)) {
-
- // Drop restriction:
- // - no restriction when dropped on diagram
- // - require containment when dropped on any other EObject
- if((dropTargetView instanceof Diagram) || (dropTargetElement.eContents().contains(droppedObject))) {
- return getDefaultDropNodeCommand(droppedNodeType, location, droppedObject);
- }
-
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- // The dropped element is a edge
- if(!UNDEFINED_TYPE.equals(droppedEdgeType)) {
-
- Collection<?> sources = linkMappingHelper.getSource(droppedObject);
- Collection<?> targets = linkMappingHelper.getTarget(droppedObject);
-
- // Only manage binary link during drop
- if((sources.size() > 0) && (targets.size() > 0)) {
- EObject source = (EObject)sources.toArray()[0];
- EObject target = (EObject)targets.toArray()[0];
- return getDefaultDropEdgeCommand(droppedObject, source, target, droppedEdgeType, location);
- }
-
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- protected ICommand getDefaultDropNodeCommand(String droppedObjectGraphicalType, Point absoluteLocation, EObject droppedObject) {
-
- IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
-
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, droppedObjectGraphicalType, ViewUtil.APPEND, ViewDescriptorUtil.PERSISTED, getDiagramPreferencesHint());
- CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
- createViewRequest.setLocation(absoluteLocation);
-
- // Get view creation command for the dropped object
- Command command = getHost().getCommand(createViewRequest);
-
- // Use the ViewDescriptor as command result, it then can be used as an adaptable to retrieve the View
- return new CommandProxyWithResult(command, descriptor);
- }
-
- protected ICommand getDefaultDropEdgeCommand(EObject droppedObject, EObject source, EObject target, String droppedEdgeType, Point absoluteLocation) {
-
- CompositeCommand completeDropCommand = new CompositeCommand("CompleteDropEdge"); //$NON-NLS-1$
-
- // Find views in current diagram representing source and target
- Collection<View> sourceViews = getViews(source);
- Collection<View> targetViews = getViews(target);
-
- IAdaptable sourceViewAdapter = null;
- IAdaptable targetViewAdapter = null;
-
- // If either a source or target lacks create view for these elements
- // - using defaultDrop command (assumed to be a view creation)
- // - try to create view on host
- if(sourceViews.isEmpty() || targetViews.isEmpty()) {
-
- CompositeCommand createEndViewsCommand = new CompositeCommand("CreateSourceTargetViews"); //$NON-NLS-1$
-
- View dropContainerView = ((IGraphicalEditPart)getHost()).getNotationView();
- EObject dropContainerElement = dropContainerView.getElement();
-
- if(sourceViews.isEmpty()) {
- if(dropContainerElement.eContents().contains(source)) {
- ICommand dropSourceCommand = getDefaultDropNodeCommand(registry.getNodeGraphicalType(source, dropContainerView.getType()), absoluteLocation.getCopy(), source);
- CompositeCommand.compose(createEndViewsCommand, dropSourceCommand);
- sourceViewAdapter = (IAdaptable)dropSourceCommand.getCommandResult().getReturnValue();
- } else {
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
- }
-
- if(targetViews.isEmpty()) {
- if(dropContainerElement.eContents().contains(target)) {
- ICommand dropTargetCommand = getDefaultDropNodeCommand(registry.getNodeGraphicalType(target, dropContainerView.getType()), absoluteLocation.getCopy(), target);
- CompositeCommand.compose(createEndViewsCommand, dropTargetCommand);
- targetViewAdapter = (IAdaptable)dropTargetCommand.getCommandResult().getReturnValue();
- } else {
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
- }
-
- CompositeCommand.compose(completeDropCommand, createEndViewsCommand);
- }
-
- // Create source adapter
- if(!sourceViews.isEmpty()) { // sourceViewAdapter should still be null in this case
- sourceViewAdapter = new SemanticAdapter(null, sourceViews.toArray()[0]);
- }
-
- // Create target adapter
- if(!targetViews.isEmpty()) { // targetViewAdapter should still be null in this case
- targetViewAdapter = new SemanticAdapter(null, targetViews.toArray()[0]);
- }
-
- // Create a view for the dropped link between the source and target view adapters
- IAdaptable droppedObjectAdapter = new SemanticAdapter(droppedObject, null);
-
- CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(droppedObjectAdapter, droppedEdgeType, getDiagramPreferencesHint());
-
- CommonDeferredCreateConnectionViewCommand createConnectionViewCommand = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), droppedEdgeType, sourceViewAdapter, targetViewAdapter, getViewer(), getDiagramPreferencesHint(), linkdescriptor, null);
- createConnectionViewCommand.setElement(droppedObject);
-
- CompositeCommand.compose(completeDropCommand, createConnectionViewCommand);
-
- return completeDropCommand.reduce();
- }
-
- /**
- * <pre>
- * Sub-classes have to implement this method in order to provides specific drop command for
- * element which require a specific treatment.
- *
- * @param dropRequest current drop request
- * @param droppedEObject the dropped object
- * @param nodeType the graphical type of the dropped element (node representation)
- * @param edgeType the graphical type of the dropped element (edge representation)
- * @return the drop command
- * </pre>
- */
- protected ICommand getSpecificDropCommand(DropObjectsRequest dropRequest, EObject droppedEObject, String nodeType, String edgeType) {
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * <pre>
- * Sub-classes have to implement this method in order to provides drop command for
- * elements that are not natively known by the diagram.
- *
- * @param dropRequest current drop request
- * @param droppedEObject the dropped object
- * @return the drop command
- * </pre>
- */
- protected ICommand getUnknownDropCommand(DropObjectsRequest dropRequest, EObject droppedEObject) {
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- protected EditPartViewer getViewer() {
- return ((IGraphicalEditPart)getHost()).getViewer();
- }
-
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-
- protected PreferencesHint getDiagramPreferencesHint() {
- return ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint();
- }
-
- /**
- * This methods looks for views representing a given EObject in the host diagram.
- *
- * @param eObject
- * the {@link EObject} to look for.
- * @return the list of {@link View} representing the eObject.
- */
- private Set<View> getViews(EObject eObject) {
- Set<View> views = new HashSet<View>();
-
- // Retrieve host diagram
- View hostView = ((IGraphicalEditPart)getHost()).getNotationView();
- View hostDiagram = (hostView instanceof Diagram) ? hostView : hostView.getDiagram();
-
- // Retrieve all views for the eObject
- Collection<View> relatedViews = CrossReferencerUtil.getCrossReferencingViews(eObject, hostDiagram.getType());
-
- // Parse and select views from host diagram only
- Iterator<View> it = relatedViews.iterator();
- while(it.hasNext()) {
- View currentView = it.next();
- if(!(currentView instanceof Diagram) && (currentView.getDiagram() == hostDiagram)) {
- views.add(currentView);
- }
- }
-
- return views;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011-2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
+ *
+ * CEA LIST - Adapted to use a local graphical type registry.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import static org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry.UNDEFINED_TYPE;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+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.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest;
+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.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RefreshConnectionsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.CommandProxyWithResult;
+import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.ViewDescriptorUtil;
+import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementBorderEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.util.CrossReferencerUtil;
+
+/**
+ * Abstract DND edit policy delegating the choice of the view to create for an EObject to a local
+ * graphical type registry.
+ */
+public abstract class CommonDiagramDragDropEditPolicy extends DiagramDragDropEditPolicy {
+
+ /** The graphical type registry. */
+ protected IGraphicalTypeRegistry registry;
+
+ /** The list of element types that require a specific drop command. */
+ private Set<String> specificDropList = null;
+
+ /** The specified link mapping helper depending on the diagram */
+ protected ILinkMappingHelper linkMappingHelper;
+
+ /** Constructor */
+ public CommonDiagramDragDropEditPolicy(ILinkMappingHelper linkMappingHelper) {
+ this.linkMappingHelper = linkMappingHelper;
+ }
+
+ private Set<String> getSpecificDropList() {
+ if(specificDropList == null) {
+ specificDropList = getSpecificDropBehaviorTypes();
+ }
+ return specificDropList;
+ }
+
+ protected abstract Set<String> getSpecificDropBehaviorTypes();
+
+ /**
+ * <pre>
+ * {@inheritedDoc}.
+ *
+ * Overridden method to fix some exception occurring while moving affixed element (nodes or labels)
+ * (https://bugs.eclipse.org/bugs/show_bug.cgi?id=350680).
+ * </pre>
+ */
+ @Override
+ protected Command getDropCommand(ChangeBoundsRequest request) {
+
+ Iterator<?> iter = request.getEditParts().iterator();
+ EObject graphicalParentObject = ((GraphicalEditPart)getHost()).resolveSemanticElement();
+ while((graphicalParentObject != null) && (iter.hasNext())) {
+ EditPart droppedEditPart = (EditPart)iter.next();
+ if(droppedEditPart instanceof AbstractElementBorderEditPart) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if(droppedEditPart instanceof AbstractElementLabelEditPart) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ return super.getDropCommand(request);
+ }
+
+ /**
+ * {@inheritedDoc}.
+ */
+ @Override
+ public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
+
+ CompoundCommand completeDropCommand = new CompoundCommand("DropObjectsAndArrange"); //$NON-NLS-1$
+
+ // Detect file drop
+ if((dropRequest.getObjects().size() > 0) && (dropRequest.getObjects().get(0) instanceof String)) {
+ return getDropFileCommand(dropRequest);
+ }
+
+ // Create the drop command by composite drop command for each dropped elements
+ CompositeCommand gmfDropCommand = new CompositeCommand("DropObjects"); //$NON-NLS-1$
+ Iterator<?> iter = dropRequest.getObjects().iterator();
+ while(iter.hasNext()) {
+ EObject droppedObject = (EObject)iter.next();
+ gmfDropCommand.add(getDropObjectCommand(dropRequest, droppedObject));
+ }
+
+ // Create the complete drop command by adding an arrange command after drop
+ if(!gmfDropCommand.isEmpty()) {
+
+ // Retrieve drop result (most probably created view but not necessarily) and update the request
+ CommandResult result = gmfDropCommand.getCommandResult();
+ List<?> newValues = (List<?>)result.getReturnValue();
+ dropRequest.setResult(newValues);
+
+ // Prepare refresh command
+ RefreshConnectionsRequest refreshRequest = new RefreshConnectionsRequest(newValues);
+ Command refreshCommand = getHost().getCommand(refreshRequest);
+
+ // Prepare an arrange command to avoid every dropped view to appear at the same location
+ ArrangeRequest arrangeRequest = new ArrangeRequest(RequestConstants.REQ_ARRANGE_DEFERRED);
+ arrangeRequest.setViewAdaptersToArrange(newValues);
+ Command arrangeCommand = getHost().getCommand(arrangeRequest);
+
+ // Update the complete drop command (drop - refresh - arrange)
+ Command dropCommand = new ICommandProxy(gmfDropCommand);
+ completeDropCommand.add(dropCommand.chain(refreshCommand));
+ completeDropCommand.add(arrangeCommand);
+ }
+
+ return completeDropCommand;
+ }
+
+ protected ICommand getDropObjectCommand(DropObjectsRequest dropRequest, EObject droppedObject) {
+
+ Point location = dropRequest.getLocation().getCopy();
+
+ View dropTargetView = ((IGraphicalEditPart)getHost()).getNotationView();
+ EObject dropTargetElement = dropTargetView.getElement();
+
+ String droppedNodeType = registry.getNodeGraphicalType(droppedObject, dropTargetView.getType());
+ String droppedEdgeType = registry.getEdgeGraphicalType(droppedObject);
+
+ // Test if a specific drop command should be used
+ if(getSpecificDropList().contains(droppedNodeType) || getSpecificDropList().contains(droppedEdgeType)) {
+ return getSpecificDropCommand(dropRequest, droppedObject, droppedNodeType, droppedEdgeType);
+ }
+
+ // Decide unknown type handling
+ if(UNDEFINED_TYPE.equals(droppedNodeType) && UNDEFINED_TYPE.equals(droppedEdgeType)) {
+ return getUnknownDropCommand(dropRequest, droppedObject);
+ }
+
+ // The dropped element is a node
+ if(!UNDEFINED_TYPE.equals(droppedNodeType)) {
+
+ // Drop restriction:
+ // - no restriction when dropped on diagram
+ // - require containment when dropped on any other EObject
+ if((dropTargetView instanceof Diagram) || (dropTargetElement.eContents().contains(droppedObject))) {
+ return getDefaultDropNodeCommand(droppedNodeType, location, droppedObject);
+ }
+
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ // The dropped element is a edge
+ if(!UNDEFINED_TYPE.equals(droppedEdgeType)) {
+
+ Collection<?> sources = linkMappingHelper.getSource(droppedObject);
+ Collection<?> targets = linkMappingHelper.getTarget(droppedObject);
+
+ // Only manage binary link during drop
+ if((sources.size() > 0) && (targets.size() > 0)) {
+ EObject source = (EObject)sources.toArray()[0];
+ EObject target = (EObject)targets.toArray()[0];
+ return getDefaultDropEdgeCommand(droppedObject, source, target, droppedEdgeType, location);
+ }
+
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ protected ICommand getDefaultDropNodeCommand(String droppedObjectGraphicalType, Point absoluteLocation, EObject droppedObject) {
+
+ IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
+
+ ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, droppedObjectGraphicalType, ViewUtil.APPEND, ViewDescriptorUtil.PERSISTED, getDiagramPreferencesHint());
+ CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
+ createViewRequest.setLocation(absoluteLocation);
+
+ // Get view creation command for the dropped object
+ Command command = getHost().getCommand(createViewRequest);
+
+ // Use the ViewDescriptor as command result, it then can be used as an adaptable to retrieve the View
+ return new CommandProxyWithResult(command, descriptor);
+ }
+
+ protected ICommand getDefaultDropEdgeCommand(EObject droppedObject, EObject source, EObject target, String droppedEdgeType, Point absoluteLocation) {
+
+ CompositeCommand completeDropCommand = new CompositeCommand("CompleteDropEdge"); //$NON-NLS-1$
+
+ // Find views in current diagram representing source and target
+ Collection<View> sourceViews = getViews(source);
+ Collection<View> targetViews = getViews(target);
+
+ IAdaptable sourceViewAdapter = null;
+ IAdaptable targetViewAdapter = null;
+
+ // If either a source or target lacks create view for these elements
+ // - using defaultDrop command (assumed to be a view creation)
+ // - try to create view on host
+ if(sourceViews.isEmpty() || targetViews.isEmpty()) {
+
+ CompositeCommand createEndViewsCommand = new CompositeCommand("CreateSourceTargetViews"); //$NON-NLS-1$
+
+ View dropContainerView = ((IGraphicalEditPart)getHost()).getNotationView();
+ EObject dropContainerElement = dropContainerView.getElement();
+
+ if(sourceViews.isEmpty()) {
+ if(dropContainerElement.eContents().contains(source)) {
+ ICommand dropSourceCommand = getDefaultDropNodeCommand(registry.getNodeGraphicalType(source, dropContainerView.getType()), absoluteLocation.getCopy(), source);
+ CompositeCommand.compose(createEndViewsCommand, dropSourceCommand);
+ sourceViewAdapter = (IAdaptable)dropSourceCommand.getCommandResult().getReturnValue();
+ } else {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+ }
+
+ if(targetViews.isEmpty()) {
+ if(dropContainerElement.eContents().contains(target)) {
+ ICommand dropTargetCommand = getDefaultDropNodeCommand(registry.getNodeGraphicalType(target, dropContainerView.getType()), absoluteLocation.getCopy(), target);
+ CompositeCommand.compose(createEndViewsCommand, dropTargetCommand);
+ targetViewAdapter = (IAdaptable)dropTargetCommand.getCommandResult().getReturnValue();
+ } else {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+ }
+
+ CompositeCommand.compose(completeDropCommand, createEndViewsCommand);
+ }
+
+ // Create source adapter
+ if(!sourceViews.isEmpty()) { // sourceViewAdapter should still be null in this case
+ sourceViewAdapter = new SemanticAdapter(null, sourceViews.toArray()[0]);
+ }
+
+ // Create target adapter
+ if(!targetViews.isEmpty()) { // targetViewAdapter should still be null in this case
+ targetViewAdapter = new SemanticAdapter(null, targetViews.toArray()[0]);
+ }
+
+ // Create a view for the dropped link between the source and target view adapters
+ IAdaptable droppedObjectAdapter = new SemanticAdapter(droppedObject, null);
+
+ CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(droppedObjectAdapter, droppedEdgeType, getDiagramPreferencesHint());
+
+ CommonDeferredCreateConnectionViewCommand createConnectionViewCommand = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), droppedEdgeType, sourceViewAdapter, targetViewAdapter, getViewer(), getDiagramPreferencesHint(), linkdescriptor, null);
+ createConnectionViewCommand.setElement(droppedObject);
+
+ CompositeCommand.compose(completeDropCommand, createConnectionViewCommand);
+
+ return completeDropCommand.reduce();
+ }
+
+ /**
+ * <pre>
+ * Sub-classes have to implement this method in order to provides specific drop command for
+ * element which require a specific treatment.
+ *
+ * @param dropRequest current drop request
+ * @param droppedEObject the dropped object
+ * @param nodeType the graphical type of the dropped element (node representation)
+ * @param edgeType the graphical type of the dropped element (edge representation)
+ * @return the drop command
+ * </pre>
+ */
+ protected ICommand getSpecificDropCommand(DropObjectsRequest dropRequest, EObject droppedEObject, String nodeType, String edgeType) {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * <pre>
+ * Sub-classes have to implement this method in order to provides drop command for
+ * elements that are not natively known by the diagram.
+ *
+ * @param dropRequest current drop request
+ * @param droppedEObject the dropped object
+ * @return the drop command
+ * </pre>
+ */
+ protected ICommand getUnknownDropCommand(DropObjectsRequest dropRequest, EObject droppedEObject) {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ protected EditPartViewer getViewer() {
+ return ((IGraphicalEditPart)getHost()).getViewer();
+ }
+
+ protected TransactionalEditingDomain getEditingDomain() {
+ return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ }
+
+ protected PreferencesHint getDiagramPreferencesHint() {
+ return ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint();
+ }
+
+ /**
+ * This methods looks for views representing a given EObject in the host diagram.
+ *
+ * @param eObject
+ * the {@link EObject} to look for.
+ * @return the list of {@link View} representing the eObject.
+ */
+ private Set<View> getViews(EObject eObject) {
+ Set<View> views = new HashSet<View>();
+
+ // Retrieve host diagram
+ View hostView = ((IGraphicalEditPart)getHost()).getNotationView();
+ View hostDiagram = (hostView instanceof Diagram) ? hostView : hostView.getDiagram();
+
+ // Retrieve all views for the eObject
+ Collection<View> relatedViews = CrossReferencerUtil.getCrossReferencingViews(eObject, hostDiagram.getType());
+
+ // Parse and select views from host diagram only
+ Iterator<View> it = relatedViews.iterator();
+ while(it.hasNext()) {
+ View currentView = it.next();
+ if(!(currentView instanceof Diagram) && (currentView.getDiagram() == hostDiagram)) {
+ views.add(currentView);
+ }
+ }
+
+ return views;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultContainerNodeEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultContainerNodeEditPolicy.java
index c4d7c0ed7b9..2a845240b00 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultContainerNodeEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultContainerNodeEditPolicy.java
@@ -1,72 +1,72 @@
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.CreateConnectionRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.util.StringStatics;
-import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionAnchorsCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionEndsCommand;
-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.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerNodeEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.internal.commands.SetConnectionBendpointsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.commands.CreateViewCommand;
-
-/**
- * Default container node edit policy replacement used to replace {@link CreateCommand} by {@link CreateViewCommand},
- * different implementation of the canExecute() method.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=346739.
- */
-public class DefaultContainerNodeEditPolicy extends ContainerNodeEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
- if (!(request instanceof CreateConnectionViewRequest))
- return null;
- CreateConnectionViewRequest req = (CreateConnectionViewRequest) request;
- CompositeCommand cc = new CompositeCommand(
- DiagramUIMessages.Commands_CreateCommand_Connection_Label);
- Diagram diagramView = ((View)getHost().getModel())
- .getDiagram();
-
- // TransactionalEditingDomain editingDomain = getEditingDomain();
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
- CreateCommand createCommand = new CreateViewCommand(editingDomain, req
- .getConnectionViewDescriptor(), diagramView.getDiagram());
- //
- setViewAdapter((IAdaptable) createCommand.getCommandResult()
- .getReturnValue());
-
-
- SetConnectionEndsCommand sceCommand = new SetConnectionEndsCommand(editingDomain, StringStatics.BLANK);
- sceCommand.setEdgeAdaptor(getViewAdapter());
- sceCommand.setNewSourceAdaptor(new EObjectAdapter(getView()));
- ConnectionAnchor sourceAnchor = getConnectableEditPart()
- .getSourceConnectionAnchor(request);
- SetConnectionAnchorsCommand scaCommand = new SetConnectionAnchorsCommand(editingDomain, StringStatics.BLANK);
- scaCommand.setEdgeAdaptor(getViewAdapter());
- scaCommand.setNewSourceTerminal(getConnectableEditPart()
- .mapConnectionAnchorToTerminal(sourceAnchor));
- SetConnectionBendpointsCommand sbbCommand = new SetConnectionBendpointsCommand(editingDomain);
- sbbCommand.setEdgeAdapter(getViewAdapter());
- cc.compose(createCommand);
- cc.compose(sceCommand);
- cc.compose(scaCommand);
- cc.compose(sbbCommand);
- Command c = new ICommandProxy(cc);
- request.setStartCommand(c);
- return c;
- }
-}
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.CreateConnectionRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.util.StringStatics;
+import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionAnchorsCommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionEndsCommand;
+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.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerNodeEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.internal.commands.SetConnectionBendpointsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.commands.CreateViewCommand;
+
+/**
+ * Default container node edit policy replacement used to replace {@link CreateCommand} by {@link CreateViewCommand},
+ * different implementation of the canExecute() method.
+ * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=346739.
+ */
+public class DefaultContainerNodeEditPolicy extends ContainerNodeEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
+ if (!(request instanceof CreateConnectionViewRequest))
+ return null;
+ CreateConnectionViewRequest req = (CreateConnectionViewRequest) request;
+ CompositeCommand cc = new CompositeCommand(
+ DiagramUIMessages.Commands_CreateCommand_Connection_Label);
+ Diagram diagramView = ((View)getHost().getModel())
+ .getDiagram();
+
+ // TransactionalEditingDomain editingDomain = getEditingDomain();
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ CreateCommand createCommand = new CreateViewCommand(editingDomain, req
+ .getConnectionViewDescriptor(), diagramView.getDiagram());
+ //
+ setViewAdapter((IAdaptable) createCommand.getCommandResult()
+ .getReturnValue());
+
+
+ SetConnectionEndsCommand sceCommand = new SetConnectionEndsCommand(editingDomain, StringStatics.BLANK);
+ sceCommand.setEdgeAdaptor(getViewAdapter());
+ sceCommand.setNewSourceAdaptor(new EObjectAdapter(getView()));
+ ConnectionAnchor sourceAnchor = getConnectableEditPart()
+ .getSourceConnectionAnchor(request);
+ SetConnectionAnchorsCommand scaCommand = new SetConnectionAnchorsCommand(editingDomain, StringStatics.BLANK);
+ scaCommand.setEdgeAdaptor(getViewAdapter());
+ scaCommand.setNewSourceTerminal(getConnectableEditPart()
+ .mapConnectionAnchorToTerminal(sourceAnchor));
+ SetConnectionBendpointsCommand sbbCommand = new SetConnectionBendpointsCommand(editingDomain);
+ sbbCommand.setEdgeAdapter(getViewAdapter());
+ cc.compose(createCommand);
+ cc.compose(sceCommand);
+ cc.compose(scaCommand);
+ cc.compose(sbbCommand);
+ Command c = new ICommandProxy(cc);
+ request.setStartCommand(c);
+ return c;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultCreationEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultCreationEditPolicy.java
index daf2e75e55b..0e65f571fb5 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultCreationEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultCreationEditPolicy.java
@@ -1,111 +1,111 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.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.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.commands.CreateViewCommand;
-
-/**
- * Default creation edit policy replacement used to replace {@link CreateCommand} by {@link CreateViewCommand},
- * different implementation of the canExecute() method.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=346739
- */
-public class DefaultCreationEditPolicy extends CreationEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getReparentCommand(ChangeBoundsRequest request) {
- //the behavior has been changed in order to allow the move of element
- //that are not attached to a semantic element
- // so it Forbid re-parent in this edit policy (to be used by compartment)
- // in order to avoid node attached to semantic to be moved in compartments.
- @SuppressWarnings("rawtypes")
- Iterator editParts = request.getEditParts().iterator();
- CompositeCommand cc = new CompositeCommand(DiagramUIMessages.AddCommand_Label);
- while ( editParts.hasNext() ) {
- EditPart ep = (EditPart)editParts.next();
- if ( ep instanceof LabelEditPart ) {
- continue;
- }
- View view = (View)ep.getAdapter(View.class);
- if ( view == null ) {
- continue;
- }
-
- EObject semantic = ViewUtil.resolveSemanticElement(view);
- if ( semantic == null ) {
- cc.compose(getReparentViewCommand((IGraphicalEditPart)ep));
- }
- else{
- return UnexecutableCommand.INSTANCE;
- }
-
- }
- return cc.isEmpty() ? null : new ICommandProxy(cc.reduce());
-
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getCreateCommand(CreateViewRequest request) {
-
- // This overrides getCreatCommand in order to use a specific CreateViewCommand (instead of
- // org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand.
-
- // The original CreateCommand#canExecute() implementation rely on ViewProvider#provides(CreateViewForKindOperation op)
- // method to know if a view can be created. The problem is that this method is incorrectly generated by GMF Tooling and should be avoided.
-
- // CreateViewCommand replace the semantic adapter in its call to ViewService to know if a provider exists.
-
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
- CompositeTransactionalCommand cc = new CompositeTransactionalCommand(editingDomain, DiagramUIMessages.AddCommand_Label);
-
- Iterator<? extends ViewDescriptor> descriptors = request.getViewDescriptors().iterator();
- while (descriptors.hasNext()) {
-
- CreateViewRequest.ViewDescriptor descriptor = (CreateViewRequest.ViewDescriptor)descriptors.next();
- CreateCommand createCommand = new CreateViewCommand(editingDomain, descriptor, (View)(getHost().getModel()));
- cc.compose(createCommand);
-
- }
-
- return new ICommandProxy(cc.reduce());
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.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.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.commands.CreateViewCommand;
+
+/**
+ * Default creation edit policy replacement used to replace {@link CreateCommand} by {@link CreateViewCommand},
+ * different implementation of the canExecute() method.
+ * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=346739
+ */
+public class DefaultCreationEditPolicy extends CreationEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getReparentCommand(ChangeBoundsRequest request) {
+ //the behavior has been changed in order to allow the move of element
+ //that are not attached to a semantic element
+ // so it Forbid re-parent in this edit policy (to be used by compartment)
+ // in order to avoid node attached to semantic to be moved in compartments.
+ @SuppressWarnings("rawtypes")
+ Iterator editParts = request.getEditParts().iterator();
+ CompositeCommand cc = new CompositeCommand(DiagramUIMessages.AddCommand_Label);
+ while ( editParts.hasNext() ) {
+ EditPart ep = (EditPart)editParts.next();
+ if ( ep instanceof LabelEditPart ) {
+ continue;
+ }
+ View view = (View)ep.getAdapter(View.class);
+ if ( view == null ) {
+ continue;
+ }
+
+ EObject semantic = ViewUtil.resolveSemanticElement(view);
+ if ( semantic == null ) {
+ cc.compose(getReparentViewCommand((IGraphicalEditPart)ep));
+ }
+ else{
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ }
+ return cc.isEmpty() ? null : new ICommandProxy(cc.reduce());
+
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getCreateCommand(CreateViewRequest request) {
+
+ // This overrides getCreatCommand in order to use a specific CreateViewCommand (instead of
+ // org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand.
+
+ // The original CreateCommand#canExecute() implementation rely on ViewProvider#provides(CreateViewForKindOperation op)
+ // method to know if a view can be created. The problem is that this method is incorrectly generated by GMF Tooling and should be avoided.
+
+ // CreateViewCommand replace the semantic adapter in its call to ViewService to know if a provider exists.
+
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ CompositeTransactionalCommand cc = new CompositeTransactionalCommand(editingDomain, DiagramUIMessages.AddCommand_Label);
+
+ Iterator<? extends ViewDescriptor> descriptors = request.getViewDescriptors().iterator();
+ while (descriptors.hasNext()) {
+
+ CreateViewRequest.ViewDescriptor descriptor = (CreateViewRequest.ViewDescriptor)descriptors.next();
+ CreateCommand createCommand = new CreateViewCommand(editingDomain, descriptor, (View)(getHost().getModel()));
+ cc.compose(createCommand);
+
+ }
+
+ return new ICommandProxy(cc.reduce());
+
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java
index 33fe7af6f30..30b3d6bf709 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultGraphicalNodeEditPolicy.java
@@ -1,109 +1,109 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.CreateConnectionRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.util.StringStatics;
-import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionAnchorsCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionEndsCommand;
-import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
-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.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.internal.commands.SetConnectionBendpointsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.commands.CreateViewCommand;
-import org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants;
-
-/**
- * Default graphical node edit policy replacement used to replace {@link CreateCommand} by {@link CreateViewCommand},
- * different implementation of the canExecute() method.
- * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=346739.
- */
-public class DefaultGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getConnectionAndRelationshipCompleteCommand(CreateConnectionViewAndElementRequest request) {
-
- // Add parameter (source and target view to the CreateRelationshipRequest
- CreateElementRequestAdapter requestAdapter = request.getConnectionViewAndElementDescriptor().getCreateElementRequestAdapter();
- CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest)requestAdapter.getAdapter(CreateRelationshipRequest.class);
-
- View sourceView = (View) request.getSourceEditPart().getModel();
- createElementRequest.setParameter(RequestParameterConstants.EDGE_CREATE_REQUEST_SOURCE_VIEW, sourceView);
-
- View targetView = (View) request.getTargetEditPart().getModel();
- createElementRequest.setParameter(RequestParameterConstants.EDGE_CREATE_REQUEST_TARGET_VIEW, targetView);
-
- return super.getConnectionAndRelationshipCompleteCommand(request);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
- if (!(request instanceof CreateConnectionViewRequest))
- return null;
- CreateConnectionViewRequest req = (CreateConnectionViewRequest) request;
- CompositeCommand cc = new CompositeCommand(
- DiagramUIMessages.Commands_CreateCommand_Connection_Label);
- Diagram diagramView = ((View)getHost().getModel())
- .getDiagram();
-
- // TransactionalEditingDomain editingDomain = getEditingDomain();
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
- CreateCommand createCommand = new CreateViewCommand(editingDomain, req
- .getConnectionViewDescriptor(), diagramView.getDiagram());
- //
- setViewAdapter((IAdaptable) createCommand.getCommandResult()
- .getReturnValue());
-
-
- SetConnectionEndsCommand sceCommand = new SetConnectionEndsCommand(editingDomain, StringStatics.BLANK);
- sceCommand.setEdgeAdaptor(getViewAdapter());
- sceCommand.setNewSourceAdaptor(new EObjectAdapter(getView()));
- ConnectionAnchor sourceAnchor = getConnectableEditPart()
- .getSourceConnectionAnchor(request);
- SetConnectionAnchorsCommand scaCommand = new SetConnectionAnchorsCommand(editingDomain, StringStatics.BLANK);
- scaCommand.setEdgeAdaptor(getViewAdapter());
- scaCommand.setNewSourceTerminal(getConnectableEditPart()
- .mapConnectionAnchorToTerminal(sourceAnchor));
- SetConnectionBendpointsCommand sbbCommand = new SetConnectionBendpointsCommand(editingDomain);
- sbbCommand.setEdgeAdapter(getViewAdapter());
- cc.compose(createCommand);
- cc.compose(sceCommand);
- cc.compose(scaCommand);
- cc.compose(sbbCommand);
- Command c = new ICommandProxy(cc);
- request.setStartCommand(c);
- return c;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.CreateConnectionRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.util.StringStatics;
+import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionAnchorsCommand;
+import org.eclipse.gmf.runtime.diagram.core.commands.SetConnectionEndsCommand;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+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.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.internal.commands.SetConnectionBendpointsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.commands.CreateViewCommand;
+import org.eclipse.papyrus.uml.service.types.utils.RequestParameterConstants;
+
+/**
+ * Default graphical node edit policy replacement used to replace {@link CreateCommand} by {@link CreateViewCommand},
+ * different implementation of the canExecute() method.
+ * See https://bugs.eclipse.org/bugs/show_bug.cgi?id=346739.
+ */
+public class DefaultGraphicalNodeEditPolicy extends GraphicalNodeEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getConnectionAndRelationshipCompleteCommand(CreateConnectionViewAndElementRequest request) {
+
+ // Add parameter (source and target view to the CreateRelationshipRequest
+ CreateElementRequestAdapter requestAdapter = request.getConnectionViewAndElementDescriptor().getCreateElementRequestAdapter();
+ CreateRelationshipRequest createElementRequest = (CreateRelationshipRequest)requestAdapter.getAdapter(CreateRelationshipRequest.class);
+
+ View sourceView = (View) request.getSourceEditPart().getModel();
+ createElementRequest.setParameter(RequestParameterConstants.EDGE_CREATE_REQUEST_SOURCE_VIEW, sourceView);
+
+ View targetView = (View) request.getTargetEditPart().getModel();
+ createElementRequest.setParameter(RequestParameterConstants.EDGE_CREATE_REQUEST_TARGET_VIEW, targetView);
+
+ return super.getConnectionAndRelationshipCompleteCommand(request);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
+ if (!(request instanceof CreateConnectionViewRequest))
+ return null;
+ CreateConnectionViewRequest req = (CreateConnectionViewRequest) request;
+ CompositeCommand cc = new CompositeCommand(
+ DiagramUIMessages.Commands_CreateCommand_Connection_Label);
+ Diagram diagramView = ((View)getHost().getModel())
+ .getDiagram();
+
+ // TransactionalEditingDomain editingDomain = getEditingDomain();
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ CreateCommand createCommand = new CreateViewCommand(editingDomain, req
+ .getConnectionViewDescriptor(), diagramView.getDiagram());
+ //
+ setViewAdapter((IAdaptable) createCommand.getCommandResult()
+ .getReturnValue());
+
+
+ SetConnectionEndsCommand sceCommand = new SetConnectionEndsCommand(editingDomain, StringStatics.BLANK);
+ sceCommand.setEdgeAdaptor(getViewAdapter());
+ sceCommand.setNewSourceAdaptor(new EObjectAdapter(getView()));
+ ConnectionAnchor sourceAnchor = getConnectableEditPart()
+ .getSourceConnectionAnchor(request);
+ SetConnectionAnchorsCommand scaCommand = new SetConnectionAnchorsCommand(editingDomain, StringStatics.BLANK);
+ scaCommand.setEdgeAdaptor(getViewAdapter());
+ scaCommand.setNewSourceTerminal(getConnectableEditPart()
+ .mapConnectionAnchorToTerminal(sourceAnchor));
+ SetConnectionBendpointsCommand sbbCommand = new SetConnectionBendpointsCommand(editingDomain);
+ sbbCommand.setEdgeAdapter(getViewAdapter());
+ cc.compose(createCommand);
+ cc.compose(sceCommand);
+ cc.compose(scaCommand);
+ cc.compose(sbbCommand);
+ Command c = new ICommandProxy(cc);
+ request.setStartCommand(c);
+ return c;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSemanticEditPolicy.java
index 67cabdc7f3c..2cd79d07ac7 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSemanticEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSemanticEditPolicy.java
@@ -1,24 +1,24 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-/**
- * This class has been moved in infra.gmfdiag.common framework. Keeping it here for compatibility
- * @deprecated
- * @use {@link org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy}
- */
-@Deprecated
-public class DefaultSemanticEditPolicy extends org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy {
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+/**
+ * This class has been moved in infra.gmfdiag.common framework. Keeping it here for compatibility
+ * @deprecated
+ * @use {@link org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy}
+ */
+@Deprecated
+public class DefaultSemanticEditPolicy extends org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy {
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSnapBackEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSnapBackEditPolicy.java
index 7226ae7ed2b..a9410ae086b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSnapBackEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultSnapBackEditPolicy.java
@@ -1,108 +1,108 @@
-/******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * CEA LIST - Adaptation to support a different hint for SnapBack location storage.
- *
- ****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-
-
-/**
- * <pre>
- * EditPolicy which support the RequestConstants.REQ_SNAP_BACK request type.
- *
- * Returns a command to position a label's offset to it default set at creation.
- *
- * This edit policy is a copy of LabelSnapBackEditPolicy, which does not only use the label view type
- * to find the snap back position (also takes into account the diagram and parent view type).
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.LabelSnapBackEditPolicy
- * </pre>
- */
-@SuppressWarnings("restriction")
-public class DefaultSnapBackEditPolicy extends GraphicalNodeEditPolicy {
-
-
- /**
- * Understands RequestConstants.REQ_SNAP_BACK request types
- *
- * @param request
- * @return boolean
- */
- public boolean understandsRequest(Request request) {
- return RequestConstants.REQ_SNAP_BACK.equals(request.getType());
- }
-
- /**
- * Returns a <code>Command</code> which sets the label's offset to its
- * original position.
- *
- * @param request
- * the request
- * @return the command
- */
- public Command getCommand(Request request) {
- if(RequestConstants.REQ_SNAP_BACK.equals(request.getType())) {
- View view = (View)getHost().getModel();
-
- // YT - Use a snap back hint that takes into account the diagram
- // and parent view type.
- String hint = getSnapBackHint(view);
-
- Point offset = LabelEditPart.getSnapBackPosition(hint);
- if(offset == null)
- return null;
-
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
-
- ICommand moveCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(view), offset);
- return new ICommandProxy(moveCommand);
- }
- return null;
- }
-
- public EditPart getTargetEditPart(Request request) {
- if(understandsRequest(request))
- return getHost();
- return super.getTargetEditPart(request);
- }
-
- /**
- * Get the snap back hint for the view.
- *
- * @param view
- * the view to snap back.
- * @return the snap back hint.
- */
- private String getSnapBackHint(View view) {
-
- String diagramType = view.getDiagram().getType();
- String parentType = ViewUtil.getViewContainer(view).getType();
- String labelType = view.getType();
-
- return diagramType + "_" + parentType + "-" + labelType;
- }
-}
+/******************************************************************************
+ * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * CEA LIST - Adaptation to support a different hint for SnapBack location storage.
+ *
+ ****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.View;
+
+
+/**
+ * <pre>
+ * EditPolicy which support the RequestConstants.REQ_SNAP_BACK request type.
+ *
+ * Returns a command to position a label's offset to it default set at creation.
+ *
+ * This edit policy is a copy of LabelSnapBackEditPolicy, which does not only use the label view type
+ * to find the snap back position (also takes into account the diagram and parent view type).
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.internal.editpolicies.LabelSnapBackEditPolicy
+ * </pre>
+ */
+@SuppressWarnings("restriction")
+public class DefaultSnapBackEditPolicy extends GraphicalNodeEditPolicy {
+
+
+ /**
+ * Understands RequestConstants.REQ_SNAP_BACK request types
+ *
+ * @param request
+ * @return boolean
+ */
+ public boolean understandsRequest(Request request) {
+ return RequestConstants.REQ_SNAP_BACK.equals(request.getType());
+ }
+
+ /**
+ * Returns a <code>Command</code> which sets the label's offset to its
+ * original position.
+ *
+ * @param request
+ * the request
+ * @return the command
+ */
+ public Command getCommand(Request request) {
+ if(RequestConstants.REQ_SNAP_BACK.equals(request.getType())) {
+ View view = (View)getHost().getModel();
+
+ // YT - Use a snap back hint that takes into account the diagram
+ // and parent view type.
+ String hint = getSnapBackHint(view);
+
+ Point offset = LabelEditPart.getSnapBackPosition(hint);
+ if(offset == null)
+ return null;
+
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+
+ ICommand moveCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(view), offset);
+ return new ICommandProxy(moveCommand);
+ }
+ return null;
+ }
+
+ public EditPart getTargetEditPart(Request request) {
+ if(understandsRequest(request))
+ return getHost();
+ return super.getTargetEditPart(request);
+ }
+
+ /**
+ * Get the snap back hint for the view.
+ *
+ * @param view
+ * the view to snap back.
+ * @return the snap back hint.
+ */
+ private String getSnapBackHint(View view) {
+
+ String diagramType = view.getDiagram().getType();
+ String parentType = ViewUtil.getViewContainer(view).getType();
+ String labelType = view.getType();
+
+ return diagramType + "_" + parentType + "-" + labelType;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultXYLayoutEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultXYLayoutEditPolicy.java
index 700a7ae20b6..52bdf9c4860 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultXYLayoutEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/DefaultXYLayoutEditPolicy.java
@@ -1,87 +1,87 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.CreateRequest;
-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.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-
-/**
- * Avoid forcing (-1, -1) dimension in set bounds command (let the view factories deal with
- * size initialization if needed).
- */
-public class DefaultXYLayoutEditPolicy extends XYLayoutEditPolicy {
-
- /**
- * Called in response to a <tt>REQ_CREATE</tt> request. Returns a command
- * to set each created element bounds and auto-size properties.
- *
- * @param request a create request (understands instances of {@link CreateViewRequest}).
- * @return a command to satisfy the request; <tt>null</tt> if the request is not
- * understood.
- */
- protected Command getCreateCommand(CreateRequest request) {
- CreateViewRequest req = (CreateViewRequest) request;
-
-
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost())
- .getEditingDomain();
-
- CompositeTransactionalCommand cc = new CompositeTransactionalCommand(
- editingDomain, DiagramUIMessages.AddCommand_Label);
- Iterator<?> iter = req.getViewDescriptors().iterator();
-
- final Rectangle BOUNDS = (Rectangle) getConstraintFor(request);
-
-
-
- while (iter.hasNext()) {
- CreateViewRequest.ViewDescriptor viewDescriptor = (CreateViewRequest.ViewDescriptor)iter.next();
- Rectangle rect = getBoundsOffest(req, BOUNDS,viewDescriptor);
-
- if (rect.getSize().isEmpty()) {
- // Only set location and let the ViewFactory deal with dimension.
- cc.compose(new SetBoundsCommand(editingDomain,
- DiagramUIMessages.SetLocationCommand_Label_Resize,
- viewDescriptor,
- rect.getLocation().getCopy()));
-
- } else {
- // Default set bounds command.
- cc.compose(new SetBoundsCommand(editingDomain,
- DiagramUIMessages.SetLocationCommand_Label_Resize,
- viewDescriptor,
- rect));
-
- }
-
- }
-
- if( cc.reduce() == null )
- return null;
-
- return chainGuideAttachmentCommands( request,
- new ICommandProxy(cc.reduce()));
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import java.util.Iterator;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.CreateRequest;
+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.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+
+/**
+ * Avoid forcing (-1, -1) dimension in set bounds command (let the view factories deal with
+ * size initialization if needed).
+ */
+public class DefaultXYLayoutEditPolicy extends XYLayoutEditPolicy {
+
+ /**
+ * Called in response to a <tt>REQ_CREATE</tt> request. Returns a command
+ * to set each created element bounds and auto-size properties.
+ *
+ * @param request a create request (understands instances of {@link CreateViewRequest}).
+ * @return a command to satisfy the request; <tt>null</tt> if the request is not
+ * understood.
+ */
+ protected Command getCreateCommand(CreateRequest request) {
+ CreateViewRequest req = (CreateViewRequest) request;
+
+
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost())
+ .getEditingDomain();
+
+ CompositeTransactionalCommand cc = new CompositeTransactionalCommand(
+ editingDomain, DiagramUIMessages.AddCommand_Label);
+ Iterator<?> iter = req.getViewDescriptors().iterator();
+
+ final Rectangle BOUNDS = (Rectangle) getConstraintFor(request);
+
+
+
+ while (iter.hasNext()) {
+ CreateViewRequest.ViewDescriptor viewDescriptor = (CreateViewRequest.ViewDescriptor)iter.next();
+ Rectangle rect = getBoundsOffest(req, BOUNDS,viewDescriptor);
+
+ if (rect.getSize().isEmpty()) {
+ // Only set location and let the ViewFactory deal with dimension.
+ cc.compose(new SetBoundsCommand(editingDomain,
+ DiagramUIMessages.SetLocationCommand_Label_Resize,
+ viewDescriptor,
+ rect.getLocation().getCopy()));
+
+ } else {
+ // Default set bounds command.
+ cc.compose(new SetBoundsCommand(editingDomain,
+ DiagramUIMessages.SetLocationCommand_Label_Resize,
+ viewDescriptor,
+ rect));
+
+ }
+
+ }
+
+ if( cc.reduce() == null )
+ return null;
+
+ return chainGuideAttachmentCommands( request,
+ new ICommandProxy(cc.reduce()));
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ExternalLabelPrimaryDragRoleEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ExternalLabelPrimaryDragRoleEditPolicy.java
index cc86e1f4299..0a37dafeb78 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ExternalLabelPrimaryDragRoleEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ExternalLabelPrimaryDragRoleEditPolicy.java
@@ -1,75 +1,75 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * This policy provides the selection handles, feedback and move command for
- * external node label.
- * The expected behavior is to provide an external label that can freely move and with a link feedback
- * towards its parent figure during the move.
- */
-public class ExternalLabelPrimaryDragRoleEditPolicy extends NonResizableLabelEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getMoveCommand(ChangeBoundsRequest request) {
- LabelEditPart editPart = (LabelEditPart)getHost();
-
- // FeedBack - Parent + Delta
- Rectangle updatedRect = new Rectangle();
- PrecisionRectangle initialRect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
- updatedRect = initialRect.getTranslated(getHostFigure().getParent().getBounds().getLocation().getNegated());
- updatedRect = updatedRect.getTranslated(request.getMoveDelta());
-
- // translate the feedback figure
- PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
- getHostFigure().translateToAbsolute(rect);
- rect.translate(request.getMoveDelta());
- rect.resize(request.getSizeDelta());
- getHostFigure().translateToRelative(rect);
-
- ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View)editPart.getModel()), updatedRect);
- return new ICommandProxy(moveCommand);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * This policy provides the selection handles, feedback and move command for
+ * external node label.
+ * The expected behavior is to provide an external label that can freely move and with a link feedback
+ * towards its parent figure during the move.
+ */
+public class ExternalLabelPrimaryDragRoleEditPolicy extends NonResizableLabelEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getMoveCommand(ChangeBoundsRequest request) {
+ LabelEditPart editPart = (LabelEditPart)getHost();
+
+ // FeedBack - Parent + Delta
+ Rectangle updatedRect = new Rectangle();
+ PrecisionRectangle initialRect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
+ updatedRect = initialRect.getTranslated(getHostFigure().getParent().getBounds().getLocation().getNegated());
+ updatedRect = updatedRect.getTranslated(request.getMoveDelta());
+
+ // translate the feedback figure
+ PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
+ getHostFigure().translateToAbsolute(rect);
+ rect.translate(request.getMoveDelta());
+ rect.resize(request.getSizeDelta());
+ getHostFigure().translateToRelative(rect);
+
+ ICommand moveCommand = new SetBoundsCommand(editPart.getEditingDomain(), DiagramUIMessages.MoveLabelCommand_Label_Location, new EObjectAdapter((View)editPart.getModel()), updatedRect);
+ return new ICommandProxy(moveCommand);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ILinkMappingHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ILinkMappingHelper.java
index 1ea548da0f3..d3a8c0fe667 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ILinkMappingHelper.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/ILinkMappingHelper.java
@@ -1,43 +1,43 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- * CEA LIST - adapted in a non-UML specific manner.
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import java.util.Collection;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * Interface to map links at semantic level.
- */
-public interface ILinkMappingHelper {
-
- /**
- * Get the sources.
- *
- * @param link
- * the link.
- * @return the sources.
- */
- public Collection<?> getSource(EObject link);
-
- /**
- * Get the targets.
- *
- * @param link
- * the link.
- * @return the targets.
- */
- public Collection<?> getTarget(EObject link);
-}
+/*****************************************************************************
+ * 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:
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
+ * CEA LIST - adapted in a non-UML specific manner.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import java.util.Collection;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Interface to map links at semantic level.
+ */
+public interface ILinkMappingHelper {
+
+ /**
+ * Get the sources.
+ *
+ * @param link
+ * the link.
+ * @return the sources.
+ */
+ public Collection<?> getSource(EObject link);
+
+ /**
+ * Get the targets.
+ *
+ * @param link
+ * the link.
+ * @return the targets.
+ */
+ public Collection<?> getTarget(EObject link);
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDefaultSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDefaultSemanticEditPolicy.java
index 85e412dc187..8db6801563e 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDefaultSemanticEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDefaultSemanticEditPolicy.java
@@ -1,84 +1,84 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-
-/**
- * Semantic edit policy for label (affixed labels mainly), that allow correct destroy,
- * but forbid other edit actions.
- */
-public class LabelDefaultSemanticEditPolicy extends DefaultSemanticEditPolicy {
-
- @Override
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return super.getDestroyElementCommand(req);
- }
-
- @Override
- protected Command getConfigureCommand(ConfigureRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- @Override
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- @Override
- protected Command getCreateCommand(CreateElementRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- @Override
- protected Command getSetCommand(SetRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- @Override
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- @Override
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- @Override
- protected Command getMoveCommand(MoveRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- @Override
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- @Override
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+
+/**
+ * Semantic edit policy for label (affixed labels mainly), that allow correct destroy,
+ * but forbid other edit actions.
+ */
+public class LabelDefaultSemanticEditPolicy extends DefaultSemanticEditPolicy {
+
+ @Override
+ protected Command getDestroyElementCommand(DestroyElementRequest req) {
+ return super.getDestroyElementCommand(req);
+ }
+
+ @Override
+ protected Command getConfigureCommand(ConfigureRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ @Override
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ @Override
+ protected Command getCreateCommand(CreateElementRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ @Override
+ protected Command getSetCommand(SetRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ @Override
+ protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ @Override
+ protected Command getDuplicateCommand(DuplicateElementsRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ @Override
+ protected Command getMoveCommand(MoveRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ @Override
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ @Override
+ protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
+ return UnexecutableCommand.INSTANCE;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDirectEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDirectEditPolicy.java
index 0b2dff8cf48..a441c171db2 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDirectEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LabelDirectEditPolicy.java
@@ -1,109 +1,109 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
-
-/**
- * Overrides {@link org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy} in
- * order to pass parser options to the method that returns the modification command.
- * (always pass 0 - ParserOptions.NONE in the original class).
- *
- * Also this uses (or tries to) the EObject given by {@link org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart#getParserElement()} to
- * get the edit command instead of using the EObject associated to the edited edit part.
- */
-public class LabelDirectEditPolicy extends org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy {
-
- /**
- * We need an adapter that will be able to hold both a model
- * and an view
- */
- class EObjectAdapterEx extends EObjectAdapter {
-
- private View view = null;
-
- /**
- * constructor
- *
- * @param element
- * element to be wrapped
- * @param view
- * view to be wrapped
- */
- public EObjectAdapterEx(EObject element, View view) {
- super(element);
- this.view = view;
- }
-
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter) {
- Object o = super.getAdapter(adapter);
- if(o != null)
- return o;
- if(adapter.equals(View.class)) {
- return view;
- }
- return null;
- }
- }
-
- /**
- * @see DirectEditPolicy#getDirectEditCommand(DirectEditRequest)
- */
- protected Command getDirectEditCommand(DirectEditRequest edit) {
- if(edit.getCellEditor() instanceof TextCellEditorEx)
- if(!((TextCellEditorEx)edit.getCellEditor()).hasValueChanged())
- return null;
-
- String labelText = (String)edit.getCellEditor().getValue();
-
- //for CellEditor, null is always returned for invalid values
- if(labelText == null) {
- return null;
- }
-
- // Papyrus - using org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart here
- ITextAwareEditPart compartment = (ITextAwareEditPart)getHost();
- EObjectAdapter elementAdapter = new EObjectAdapterEx(compartment.getParserElement(), null);
- //
-
- // Papyrus - elementAdapter created with compartment.getParserElement(), no need to use the view here.
- // EObject model = (EObject)compartment.getModel();
- // EObjectAdapter elementAdapter = null;
- // if(model instanceof View) {
- // View view = (View)model;
- // elementAdapter = new EObjectAdapterEx(ViewUtil.resolveSemanticElement(view), view);
- // } else
- // elementAdapter = new EObjectAdapterEx(model, null);
-
- // check to make sure an edit has occurred before returning a command.
- String prevText = compartment.getParser().getEditString(elementAdapter, compartment.getParserOptions().intValue());
- if(!prevText.equals(labelText)) {
- ICommand iCommand = compartment.getParser().getParseCommand(elementAdapter, labelText, compartment.getParserOptions().intValue());
- // Papyrus - use parser options to build command
- // compartment.getParser().getParseCommand(elementAdapter, labelText, 0);
- return new ICommandProxy(iCommand);
- }
-
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
+
+/**
+ * Overrides {@link org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy} in
+ * order to pass parser options to the method that returns the modification command.
+ * (always pass 0 - ParserOptions.NONE in the original class).
+ *
+ * Also this uses (or tries to) the EObject given by {@link org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart#getParserElement()} to
+ * get the edit command instead of using the EObject associated to the edited edit part.
+ */
+public class LabelDirectEditPolicy extends org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy {
+
+ /**
+ * We need an adapter that will be able to hold both a model
+ * and an view
+ */
+ class EObjectAdapterEx extends EObjectAdapter {
+
+ private View view = null;
+
+ /**
+ * constructor
+ *
+ * @param element
+ * element to be wrapped
+ * @param view
+ * view to be wrapped
+ */
+ public EObjectAdapterEx(EObject element, View view) {
+ super(element);
+ this.view = view;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Object getAdapter(Class adapter) {
+ Object o = super.getAdapter(adapter);
+ if(o != null)
+ return o;
+ if(adapter.equals(View.class)) {
+ return view;
+ }
+ return null;
+ }
+ }
+
+ /**
+ * @see DirectEditPolicy#getDirectEditCommand(DirectEditRequest)
+ */
+ protected Command getDirectEditCommand(DirectEditRequest edit) {
+ if(edit.getCellEditor() instanceof TextCellEditorEx)
+ if(!((TextCellEditorEx)edit.getCellEditor()).hasValueChanged())
+ return null;
+
+ String labelText = (String)edit.getCellEditor().getValue();
+
+ //for CellEditor, null is always returned for invalid values
+ if(labelText == null) {
+ return null;
+ }
+
+ // Papyrus - using org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart here
+ ITextAwareEditPart compartment = (ITextAwareEditPart)getHost();
+ EObjectAdapter elementAdapter = new EObjectAdapterEx(compartment.getParserElement(), null);
+ //
+
+ // Papyrus - elementAdapter created with compartment.getParserElement(), no need to use the view here.
+ // EObject model = (EObject)compartment.getModel();
+ // EObjectAdapter elementAdapter = null;
+ // if(model instanceof View) {
+ // View view = (View)model;
+ // elementAdapter = new EObjectAdapterEx(ViewUtil.resolveSemanticElement(view), view);
+ // } else
+ // elementAdapter = new EObjectAdapterEx(model, null);
+
+ // check to make sure an edit has occurred before returning a command.
+ String prevText = compartment.getParser().getEditString(elementAdapter, compartment.getParserOptions().intValue());
+ if(!prevText.equals(labelText)) {
+ ICommand iCommand = compartment.getParser().getParseCommand(elementAdapter, labelText, compartment.getParserOptions().intValue());
+ // Papyrus - use parser options to build command
+ // compartment.getParser().getParseCommand(elementAdapter, labelText, 0);
+ return new ICommandProxy(iCommand);
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LinkLabelDragEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LinkLabelDragEditPolicy.java
index 984aad28dd4..4388650ac3b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LinkLabelDragEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/LinkLabelDragEditPolicy.java
@@ -1,39 +1,39 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
-
-/**
- * Abstract non-diagram specific drag edit policy for link labels.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public class LinkLabelDragEditPolicy extends NonResizableLabelEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
+
+/**
+ * Abstract non-diagram specific drag edit policy for link labels.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public class LinkLabelDragEditPolicy extends NonResizableLabelEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ @SuppressWarnings("rawtypes")
+ protected List createSelectionHandles() {
+ MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
+ mh.setBorder(null);
+ return Collections.singletonList(mh);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextNonResizableEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextNonResizableEditPolicy.java
index 2ca2ac00695..9ea6c944bac 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextNonResizableEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextNonResizableEditPolicy.java
@@ -1,209 +1,209 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * Non diagram-specific class generated by GMF Tooling.
- */
-public class TextNonResizableEditPolicy extends NonResizableEditPolicyEx {
-
- private IFigure selectionFeedbackFigure;
-
- private IFigure focusFeedbackFigure;
-
- private FigureListener hostPositionListener;
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected List createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
- moveHandle.setBorder(null);
- moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
- return Collections.singletonList(moveHandle);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ */
+public class TextNonResizableEditPolicy extends NonResizableEditPolicyEx {
+
+ private IFigure selectionFeedbackFigure;
+
+ private IFigure focusFeedbackFigure;
+
+ private FigureListener hostPositionListener;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showPrimarySelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ showSelection();
+ showFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void hideSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(false);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void hideFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+ }
+
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if(getHostFigure() instanceof Label) {
+ bounds = ((Label)getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ protected IFigure createSelectionFeedbackFigure() {
+ if(getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ protected void updateLabel(Label target) {
+ Label source = (Label)getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ protected void refreshSelectionFeedback() {
+ if(selectionFeedbackFigure != null) {
+ if(selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label)selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ protected void refreshFocusFeedback() {
+ if(focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+
+ private FigureListener getHostPositionListener() {
+ if(hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected List createSelectionHandles() {
+ MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
+ moveHandle.setBorder(null);
+ moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
+ return Collections.singletonList(moveHandle);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextSelectionEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextSelectionEditPolicy.java
index 2df2f703f1a..01392a52ad8 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextSelectionEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/edit/policy/TextSelectionEditPolicy.java
@@ -1,192 +1,192 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * Non diagram-specific class generated by GMF Tooling.
- */
-public class TextSelectionEditPolicy extends SelectionEditPolicy {
-
- private IFigure selectionFeedbackFigure;
-
- private IFigure focusFeedbackFigure;
-
- private FigureListener hostPositionListener;
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.edit.policy;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.editpolicies.SelectionEditPolicy;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ */
+public class TextSelectionEditPolicy extends SelectionEditPolicy {
+
+ private IFigure selectionFeedbackFigure;
+
+ private IFigure focusFeedbackFigure;
+
+ private FigureListener hostPositionListener;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showPrimarySelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ showSelection();
+ showFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void hideSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(false);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void hideFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+ }
+
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if(getHostFigure() instanceof Label) {
+ bounds = ((Label)getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ protected IFigure createSelectionFeedbackFigure() {
+ if(getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ protected void updateLabel(Label target) {
+ Label source = (Label)getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ protected void refreshSelectionFeedback() {
+ if(selectionFeedbackFigure != null) {
+ if(selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label)selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ protected void refreshFocusFeedback() {
+ if(focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+
+ private FigureListener getHostPositionListener() {
+ if(hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AbstractLabelViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AbstractLabelViewFactory.java
index 3e619ee6af1..c968ccd23d4 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AbstractLabelViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AbstractLabelViewFactory.java
@@ -1,32 +1,32 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-import org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.DecorationNodeViewFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
-
-/**
- * Default view Factory for Papyrus custom labels.
- */
-public abstract class AbstractLabelViewFactory extends DecorationNodeViewFactory {
-
- @Override
- protected void initializeFromPreferences(View view) {
- //Do not call initializeFromPreferences when the preference initializer is disabled (Typical use case: CSS are installed)
- if(ThemeInitializerManager.instance.usePreferenceInitializer(view)) {
- super.initializeFromPreferences(view);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+import org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.DecorationNodeViewFactory;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
+
+/**
+ * Default view Factory for Papyrus custom labels.
+ */
+public abstract class AbstractLabelViewFactory extends DecorationNodeViewFactory {
+
+ @Override
+ protected void initializeFromPreferences(View view) {
+ //Do not call initializeFromPreferences when the preference initializer is disabled (Typical use case: CSS are installed)
+ if(ThemeInitializerManager.instance.usePreferenceInitializer(view)) {
+ super.initializeFromPreferences(view);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AffixedLabelViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AffixedLabelViewFactory.java
index 76ceea16465..22f46d1feab 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AffixedLabelViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/AffixedLabelViewFactory.java
@@ -1,52 +1,52 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.LayoutConstraint;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-
-/**
- * Default view Factory for Papyrus custom affixed labels.
- */
-public class AffixedLabelViewFactory extends AbstractLabelViewFactory {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected LayoutConstraint createLayoutConstraint() {
- return NotationFactory.eINSTANCE.createLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeFromPreferences(View view) {
-
- super.initializeFromPreferences(view);
-
- IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
- if(store == null) {
- return;
- }
-
- String preferenceKey = ViewUtil.getViewContainer(view).getType() + "-" + view.getType();
- PreferenceInitializerForElementHelper.initLabelLocationFromPrefs(view, store, preferenceKey);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.LayoutConstraint;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
+
+/**
+ * Default view Factory for Papyrus custom affixed labels.
+ */
+public class AffixedLabelViewFactory extends AbstractLabelViewFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected LayoutConstraint createLayoutConstraint() {
+ return NotationFactory.eINSTANCE.createLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeFromPreferences(View view) {
+
+ super.initializeFromPreferences(view);
+
+ IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
+ if(store == null) {
+ return;
+ }
+
+ String preferenceKey = ViewUtil.getViewContainer(view).getType() + "-" + view.getType();
+ PreferenceInitializerForElementHelper.initLabelLocationFromPrefs(view, store, preferenceKey);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentListViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentListViewFactory.java
index 03c8f8ae0d1..221da6fb557 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentListViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentListViewFactory.java
@@ -1,33 +1,33 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-
-/**
- * Default compartment view Factory for custom list compartments.
- */
-public class CompartmentListViewFactory extends ListCompartmentViewFactory {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Node createNode() {
- return NotationFactory.eINSTANCE.createListCompartment();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+import org.eclipse.gmf.runtime.diagram.ui.view.factories.ListCompartmentViewFactory;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+
+/**
+ * Default compartment view Factory for custom list compartments.
+ */
+public class CompartmentListViewFactory extends ListCompartmentViewFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Node createNode() {
+ return NotationFactory.eINSTANCE.createListCompartment();
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentShapeViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentShapeViewFactory.java
index 30cb5eb97c0..584658f4138 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentShapeViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/CompartmentShapeViewFactory.java
@@ -1,37 +1,37 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-import java.util.List;
-
-import org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.BasicCompartmentViewFactory;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Default compartment view Factory for custom shape compartments.
- */
-public class CompartmentShapeViewFactory extends BasicCompartmentViewFactory {
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings({ "rawtypes", "unchecked" })
- @Override
- protected List createStyles(View view) {
- List styles = super.createStyles(view);
- styles.add(NotationFactory.eINSTANCE.createTitleStyle());
- return styles;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+import java.util.List;
+
+import org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.BasicCompartmentViewFactory;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Default compartment view Factory for custom shape compartments.
+ */
+public class CompartmentShapeViewFactory extends BasicCompartmentViewFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Override
+ protected List createStyles(View view) {
+ List styles = super.createStyles(view);
+ styles.add(NotationFactory.eINSTANCE.createTitleStyle());
+ return styles;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorLabelViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorLabelViewFactory.java
index 7ea8a3fc482..965660e57bb 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorLabelViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorLabelViewFactory.java
@@ -1,52 +1,52 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.LayoutConstraint;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-
-/**
- * Default view Factory for Papyrus custom affixed labels.
- */
-public class ConnectorLabelViewFactory extends AbstractLabelViewFactory {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected LayoutConstraint createLayoutConstraint() {
- return NotationFactory.eINSTANCE.createLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeFromPreferences(View view) {
-
- super.initializeFromPreferences(view);
-
- IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
- if(store == null) {
- return;
- }
-
- String preferenceKey = ViewUtil.getViewContainer(view).getType() + "-" + view.getType();
- PreferenceInitializerForElementHelper.initLabelLocationFromPrefs(view, store, preferenceKey);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.LayoutConstraint;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
+
+/**
+ * Default view Factory for Papyrus custom affixed labels.
+ */
+public class ConnectorLabelViewFactory extends AbstractLabelViewFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected LayoutConstraint createLayoutConstraint() {
+ return NotationFactory.eINSTANCE.createLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeFromPreferences(View view) {
+
+ super.initializeFromPreferences(view);
+
+ IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
+ if(store == null) {
+ return;
+ }
+
+ String preferenceKey = ViewUtil.getViewContainer(view).getType() + "-" + view.getType();
+ PreferenceInitializerForElementHelper.initLabelLocationFromPrefs(view, store, preferenceKey);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorViewFactory.java
index 07750ae94d6..8584e18bd81 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ConnectorViewFactory.java
@@ -1,62 +1,62 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.Style;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-
-/**
- * Default connector view Factory for Papyrus custom edges.
- */
-public class ConnectorViewFactory extends org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.ConnectorViewFactory {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected List createStyles(View view) {
- return Arrays.asList(new Style[]{ NotationFactory.eINSTANCE.createFontStyle() });
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeFromPreferences(View view) {
- //Do not call initializeFromPreferences when the preference initializer is disabled (Typical use case: CSS are installed)
- if(ThemeInitializerManager.instance.usePreferenceInitializer(view)) {
- super.initializeFromPreferences(view);
- }
-
- IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
- if(store == null) {
- return;
- }
-
- //The PreferenceInitializerForElementHelper already checks for usePreferenceInitializer() (When required)
- String elementName = view.getType();
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(view, store, elementName);
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(view, store, elementName);
- PreferenceInitializerForElementHelper.initRoutingFromPrefs(view, store, elementName);
- PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(view, store, elementName);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.Style;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
+import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
+
+/**
+ * Default connector view Factory for Papyrus custom edges.
+ */
+public class ConnectorViewFactory extends org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.ConnectorViewFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected List createStyles(View view) {
+ return Arrays.asList(new Style[]{ NotationFactory.eINSTANCE.createFontStyle() });
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeFromPreferences(View view) {
+ //Do not call initializeFromPreferences when the preference initializer is disabled (Typical use case: CSS are installed)
+ if(ThemeInitializerManager.instance.usePreferenceInitializer(view)) {
+ super.initializeFromPreferences(view);
+ }
+
+ IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
+ if(store == null) {
+ return;
+ }
+
+ //The PreferenceInitializerForElementHelper already checks for usePreferenceInitializer() (When required)
+ String elementName = view.getType();
+ PreferenceInitializerForElementHelper.initForegroundFromPrefs(view, store, elementName);
+ PreferenceInitializerForElementHelper.initFontStyleFromPrefs(view, store, elementName);
+ PreferenceInitializerForElementHelper.initRoutingFromPrefs(view, store, elementName);
+ PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(view, store, elementName);
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/InnerLabelViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/InnerLabelViewFactory.java
index d208f2962ea..5f160a0325a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/InnerLabelViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/InnerLabelViewFactory.java
@@ -1,21 +1,21 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-/**
- * Default label view Factory for Papyrus custom inner labels.
- */
-public class InnerLabelViewFactory extends AbstractLabelViewFactory {
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+/**
+ * Default label view Factory for Papyrus custom inner labels.
+ */
+public class InnerLabelViewFactory extends AbstractLabelViewFactory {
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeChildLabelViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeChildLabelViewFactory.java
index 1c6971c3155..4dc2596b2e0 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeChildLabelViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeChildLabelViewFactory.java
@@ -1,59 +1,59 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
-import org.eclipse.gmf.runtime.notation.LayoutConstraint;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-
-/**
- * Default Shape view Factory for Papyrus custom child label nodes.
- */
-public class ShapeChildLabelViewFactory extends AbstractShapeViewFactory {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected LayoutConstraint createLayoutConstraint() {
- return NotationFactory.eINSTANCE.createLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeFromPreferences(View view) {
- //Do not call initializeFromPreferences when the preference initializer is disabled (Typical use case: CSS are installed)
- if(ThemeInitializerManager.instance.usePreferenceInitializer(view)) {
- super.initializeFromPreferences(view);
- }
-
- IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
- if(store == null) {
- return;
- }
-
- //The PreferenceInitializerForElementHelper already checks for usePreferenceInitializer() (When required)
- String preferenceKey = view.getType();
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(view, store, preferenceKey);
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(view, store, preferenceKey);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(view, store, preferenceKey);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+import org.eclipse.gmf.runtime.diagram.ui.view.factories.AbstractShapeViewFactory;
+import org.eclipse.gmf.runtime.notation.LayoutConstraint;
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
+import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
+
+/**
+ * Default Shape view Factory for Papyrus custom child label nodes.
+ */
+public class ShapeChildLabelViewFactory extends AbstractShapeViewFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected LayoutConstraint createLayoutConstraint() {
+ return NotationFactory.eINSTANCE.createLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeFromPreferences(View view) {
+ //Do not call initializeFromPreferences when the preference initializer is disabled (Typical use case: CSS are installed)
+ if(ThemeInitializerManager.instance.usePreferenceInitializer(view)) {
+ super.initializeFromPreferences(view);
+ }
+
+ IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
+ if(store == null) {
+ return;
+ }
+
+ //The PreferenceInitializerForElementHelper already checks for usePreferenceInitializer() (When required)
+ String preferenceKey = view.getType();
+ PreferenceInitializerForElementHelper.initForegroundFromPrefs(view, store, preferenceKey);
+ PreferenceInitializerForElementHelper.initFontStyleFromPrefs(view, store, preferenceKey);
+
+ PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(view, store, preferenceKey);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeViewFactory.java
index 26f07e18587..a40f27caa39 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeViewFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/factory/ShapeViewFactory.java
@@ -1,59 +1,59 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.factory;
-
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-
-/**
- * Default Shape view Factory for Papyrus custom nodes.
- */
-public class ShapeViewFactory extends org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.ShapeViewFactory {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Shape createNode() {
- return NotationFactory.eINSTANCE.createShape();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeFromPreferences(View view) {
- //Do not call initializeFromPreferences when the preference initializer is disabled (Typical use case: CSS are installed)
- if(ThemeInitializerManager.instance.usePreferenceInitializer(view)) {
- super.initializeFromPreferences(view);
- }
-
- IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
- if(store == null) {
- return;
- }
-
- //The PreferenceInitializerForElementHelper already checks for usePreferenceInitializer() (When required)
- String elementName = view.getType();
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(view, store, elementName);
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(view, store, elementName);
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(view, store, elementName);
-
- PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(view, store, elementName);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.factory;
+
+import org.eclipse.gmf.runtime.notation.NotationFactory;
+import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
+import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
+
+/**
+ * Default Shape view Factory for Papyrus custom nodes.
+ */
+public class ShapeViewFactory extends org.eclipse.gmf.runtime.diagram.ui.view.factories.optimal.ShapeViewFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Shape createNode() {
+ return NotationFactory.eINSTANCE.createShape();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeFromPreferences(View view) {
+ //Do not call initializeFromPreferences when the preference initializer is disabled (Typical use case: CSS are installed)
+ if(ThemeInitializerManager.instance.usePreferenceInitializer(view)) {
+ super.initializeFromPreferences(view);
+ }
+
+ IPreferenceStore store = (IPreferenceStore)getPreferencesHint().getPreferenceStore();
+ if(store == null) {
+ return;
+ }
+
+ //The PreferenceInitializerForElementHelper already checks for usePreferenceInitializer() (When required)
+ String elementName = view.getType();
+ PreferenceInitializerForElementHelper.initForegroundFromPrefs(view, store, elementName);
+ PreferenceInitializerForElementHelper.initFontStyleFromPrefs(view, store, elementName);
+ PreferenceInitializerForElementHelper.initBackgroundFromPrefs(view, store, elementName);
+
+ PreferenceInitializerForElementHelper.initCompartmentsStatusFromPrefs(view, store, elementName);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/figure/SelectableBorderedNodeFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/figure/SelectableBorderedNodeFigure.java
index cc2b8f6d8b2..bd1f4c6e882 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/figure/SelectableBorderedNodeFigure.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/figure/SelectableBorderedNodeFigure.java
@@ -1,74 +1,74 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.figure;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.TreeSearch;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
-
-/**
- * <pre>
- * This class modifies findFigureAt method in order to make the figure responsive
- * when the cursor is located in a rectangle around the figure.
- * This behavior ease the creation of borderItem by allowing their creation even when
- * the selection is around the figure (not over it).
- * </pre>
- */
-public class SelectableBorderedNodeFigure extends BorderedNodeFigure {
-
- /** The size of the active margin around the figure */
- protected int MARGIN_SIZE = 10;
-
- /** Constructor */
- public SelectableBorderedNodeFigure(IFigure mainFigure) {
- super(mainFigure);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IFigure findFigureAt(int x, int y, TreeSearch search) {
- if(search.prune(this))
- return null;
-
- // Start by searching in the borderItemContainer
- IFigure result = getBorderItemContainer().findFigureAt(x, y, search);
- if(result != null) {
- return result;
- }
-
- // Then search over main figure borders with the specified MARGIN inside figure borders
- Rectangle unselectableArea = new Rectangle(getBounds().getCopy());
- unselectableArea.x = unselectableArea.x + MARGIN_SIZE;
- unselectableArea.y = unselectableArea.y + MARGIN_SIZE;
- unselectableArea.width = unselectableArea.width - 2*MARGIN_SIZE;
- unselectableArea.height = unselectableArea.height - 2*MARGIN_SIZE;
-
- Rectangle selectableArea = new Rectangle(getBounds().getCopy());
-
- if((selectableArea.contains(x, y)) && !(unselectableArea.contains(x, y))) {
- return this;
- }
-
- // Then search in the main figure
- result = getMainFigure().findFigureAt(x, y, search);
- if(result != null) {
- return result;
- }
-
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.figure;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.TreeSearch;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderedNodeFigure;
+
+/**
+ * <pre>
+ * This class modifies findFigureAt method in order to make the figure responsive
+ * when the cursor is located in a rectangle around the figure.
+ * This behavior ease the creation of borderItem by allowing their creation even when
+ * the selection is around the figure (not over it).
+ * </pre>
+ */
+public class SelectableBorderedNodeFigure extends BorderedNodeFigure {
+
+ /** The size of the active margin around the figure */
+ protected int MARGIN_SIZE = 10;
+
+ /** Constructor */
+ public SelectableBorderedNodeFigure(IFigure mainFigure) {
+ super(mainFigure);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IFigure findFigureAt(int x, int y, TreeSearch search) {
+ if(search.prune(this))
+ return null;
+
+ // Start by searching in the borderItemContainer
+ IFigure result = getBorderItemContainer().findFigureAt(x, y, search);
+ if(result != null) {
+ return result;
+ }
+
+ // Then search over main figure borders with the specified MARGIN inside figure borders
+ Rectangle unselectableArea = new Rectangle(getBounds().getCopy());
+ unselectableArea.x = unselectableArea.x + MARGIN_SIZE;
+ unselectableArea.y = unselectableArea.y + MARGIN_SIZE;
+ unselectableArea.width = unselectableArea.width - 2*MARGIN_SIZE;
+ unselectableArea.height = unselectableArea.height - 2*MARGIN_SIZE;
+
+ Rectangle selectableArea = new Rectangle(getBounds().getCopy());
+
+ if((selectableArea.contains(x, y)) && !(unselectableArea.contains(x, y))) {
+ return this;
+ }
+
+ // Then search in the main figure
+ result = getMainFigure().findFigureAt(x, y, search);
+ if(result != null) {
+ return result;
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/CellEditorLocatorUtil.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/CellEditorLocatorUtil.java
index 8cfbcb7a5d3..bad38357e77 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/CellEditorLocatorUtil.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/CellEditorLocatorUtil.java
@@ -1,36 +1,36 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.locator;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
-
-/**
- * Non diagram-specific class generated by GMF Tooling.
- */
-public class CellEditorLocatorUtil {
-
- public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
- if(source.getFigure() instanceof IMultilineEditableFigure)
- return new MultilineCellEditorLocator((IMultilineEditableFigure)source.getFigure());
- else if(source.getFigure() instanceof WrappingLabel)
- return new TextCellEditorLocator((WrappingLabel)source.getFigure());
- else {
- return new LabelCellEditorLocator((Label)source.getFigure());
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.locator;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ */
+public class CellEditorLocatorUtil {
+
+ public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
+ if(source.getFigure() instanceof IMultilineEditableFigure)
+ return new MultilineCellEditorLocator((IMultilineEditableFigure)source.getFigure());
+ else if(source.getFigure() instanceof WrappingLabel)
+ return new TextCellEditorLocator((WrappingLabel)source.getFigure());
+ else {
+ return new LabelCellEditorLocator((Label)source.getFigure());
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/LabelCellEditorLocator.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/LabelCellEditorLocator.java
index bbab13bbe16..1d2ca010a3b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/LabelCellEditorLocator.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/LabelCellEditorLocator.java
@@ -1,52 +1,52 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.locator;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Non diagram-specific class generated by GMF Tooling.
- */
-public class LabelCellEditorLocator implements CellEditorLocator {
-
- private Label label;
-
- public LabelCellEditorLocator(Label label) {
- this.label = label;
- }
-
- public Label getLabel() {
- return label;
- }
-
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getLabel().getTextBounds().getCopy();
- getLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.locator;
+
+import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ */
+public class LabelCellEditorLocator implements CellEditorLocator {
+
+ private Label label;
+
+ public LabelCellEditorLocator(Label label) {
+ this.label = label;
+ }
+
+ public Label getLabel() {
+ return label;
+ }
+
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Rectangle rect = getLabel().getTextBounds().getCopy();
+ getLabel().translateToAbsolute(rect);
+ if(!text.getFont().isDisposed()) {
+ int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
+ rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
+ }
+ if(!rect.equals(new Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/MultilineCellEditorLocator.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/MultilineCellEditorLocator.java
index 306634d3e26..74f283090b6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/MultilineCellEditorLocator.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/MultilineCellEditorLocator.java
@@ -1,52 +1,52 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.locator;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Non diagram-specific class generated by GMF Tooling.
- */
-public class MultilineCellEditorLocator implements CellEditorLocator {
-
- private IMultilineEditableFigure multilineEditableFigure;
-
- public MultilineCellEditorLocator(IMultilineEditableFigure figure) {
- this.multilineEditableFigure = figure;
- }
-
- public IMultilineEditableFigure getMultilineEditableFigure() {
- return multilineEditableFigure;
- }
-
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
- rect.x = getMultilineEditableFigure().getEditionLocation().x;
- rect.y = getMultilineEditableFigure().getEditionLocation().y;
- getMultilineEditableFigure().translateToAbsolute(rect);
- if(getMultilineEditableFigure().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.locator;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ */
+public class MultilineCellEditorLocator implements CellEditorLocator {
+
+ private IMultilineEditableFigure multilineEditableFigure;
+
+ public MultilineCellEditorLocator(IMultilineEditableFigure figure) {
+ this.multilineEditableFigure = figure;
+ }
+
+ public IMultilineEditableFigure getMultilineEditableFigure() {
+ return multilineEditableFigure;
+ }
+
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
+ rect.x = getMultilineEditableFigure().getEditionLocation().x;
+ rect.y = getMultilineEditableFigure().getEditionLocation().y;
+ getMultilineEditableFigure().translateToAbsolute(rect);
+ if(getMultilineEditableFigure().getText().length() > 0) {
+ rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
+ }
+ if(!rect.equals(new Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/TextCellEditorLocator.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/TextCellEditorLocator.java
index ed87c82282a..80e988c45a9 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/TextCellEditorLocator.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/locator/TextCellEditorLocator.java
@@ -1,56 +1,56 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.locator;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Non diagram-specific class generated by GMF Tooling.
- */
-public class TextCellEditorLocator implements CellEditorLocator {
-
- private WrappingLabel wrapLabel;
-
- public TextCellEditorLocator(WrappingLabel wrapLabel) {
- this.wrapLabel = wrapLabel;
- }
-
- public WrappingLabel getWrapLabel() {
- return wrapLabel;
- }
-
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getWrapLabel().getTextBounds().getCopy();
- getWrapLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- } else {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.locator;
+
+import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ */
+public class TextCellEditorLocator implements CellEditorLocator {
+
+ private WrappingLabel wrapLabel;
+
+ public TextCellEditorLocator(WrappingLabel wrapLabel) {
+ this.wrapLabel = wrapLabel;
+ }
+
+ public WrappingLabel getWrapLabel() {
+ return wrapLabel;
+ }
+
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Rectangle rect = getWrapLabel().getTextBounds().getCopy();
+ getWrapLabel().translateToAbsolute(rect);
+ if(!text.getFont().isDisposed()) {
+ if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
+ rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
+ } else {
+ int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
+ rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
+ }
+ }
+ if(!rect.equals(new Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/parser/IMaskManagedSemanticParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/parser/IMaskManagedSemanticParser.java
index dd26f3156a8..f6c49e06b49 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/parser/IMaskManagedSemanticParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/parser/IMaskManagedSemanticParser.java
@@ -1,34 +1,34 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.parser;
-
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-
-/**
- * Interface for semantic parsers that support mask options.
- */
-public interface IMaskManagedSemanticParser extends ISemanticParser {
-
- /** The label to show in case ParserOptions.None is passed as flag (avoid a fully masked label) */
- public static final String MaskedLabel = "<empty label>";
-
- /**
- * Get the {@link Map} of masks
- *
- * @return the {@link Map} of masks
- */
- public Map<Integer, String> getMasks();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.parser;
+
+import java.util.Map;
+
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+
+/**
+ * Interface for semantic parsers that support mask options.
+ */
+public interface IMaskManagedSemanticParser extends ISemanticParser {
+
+ /** The label to show in case ParserOptions.None is passed as flag (avoid a fully masked label) */
+ public static final String MaskedLabel = "<empty label>";
+
+ /**
+ * Get the {@link Map} of masks
+ *
+ * @return the {@link Map} of masks
+ */
+ public Map<Integer, String> getMasks();
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/AbstractViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/AbstractViewProvider.java
index 513cecb2831..ead0e3b9e60 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/AbstractViewProvider.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/AbstractViewProvider.java
@@ -1,313 +1,313 @@
-/******************************************************************************
- * Copyright (c) 2002, 2010 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *
- * CEA LIST - createNode and createEdge final statement removed
- * in order to provide different implementation in subclasses.
- * The original class is {@link AbstractViewProvider}.
- *
- ****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.provider;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.util.Log;
-import org.eclipse.gmf.runtime.diagram.core.internal.DiagramPlugin;
-import org.eclipse.gmf.runtime.diagram.core.internal.DiagramStatusCodes;
-import org.eclipse.gmf.runtime.diagram.core.internal.l10n.DiagramCoreMessages;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Implements of the <code>IViewProvider</code> interface. This
- * implementations invokes the appropriate factory method by inspecting the
- * supplied operation and provides the actual view creation functionality.
- */
-public class AbstractViewProvider extends AbstractProvider implements IViewProvider {
-
- private static String viewCreationMethodName = "createView"; //$NON-NLS-1$
-
- private static String diagramCreationMethodName = "createDiagram"; //$NON-NLS-1$
-
- static protected class ClassToCreationMethodMap extends HashMap {
-
- static final long serialVersionUID = 1;
-
- public void addMethod(Class clazz, Method method) {
- if(get(clazz) == null)
- put(clazz, method);
- }
-
- public Method getCreationMethod(Class clazz) {
- return (Method)get(clazz);
- }
- }
-
- public static ClassToCreationMethodMap classToCreateMethod = new ClassToCreationMethodMap();
-
- /**
- * Determines whether this view provider can provide for the required
- * operation It inspects the type of view operation and calls the
- * corresponding <code>provides</code> method.
- *
- * @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(IOperation)
- */
- public final boolean provides(IOperation operation) {
- /* if this is the CreateViewForKindOperation operation */
- if(operation instanceof CreateViewForKindOperation)
- return provides((CreateViewForKindOperation)operation);
-
- /* Make sure it is a view operation */
- assert operation instanceof CreateViewOperation : "operation is not CreateViewOperation in AbstractViewProvider";//$NON-NLS-1$
-
- /* call the specific provides method */
- if(operation instanceof CreateDiagramViewOperation)
- return provides((CreateDiagramViewOperation)operation);
- else if(operation instanceof CreateEdgeViewOperation)
- return provides((CreateEdgeViewOperation)operation);
- else if(operation instanceof CreateNodeViewOperation)
- return provides((CreateNodeViewOperation)operation);
- return false;
- }
-
- public final Diagram createDiagram(IAdaptable contextElement, String diagramKind, PreferencesHint preferencesHint) {
- return (Diagram)createNewView(getDiagramViewClass(contextElement, diagramKind), new Object[]{ contextElement, diagramKind, preferencesHint });
- }
-
- // Papyrus - final statement removed
- public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
-
- return (Edge)createNewView(getEdgeViewClass(semanticAdapter, containerView, semanticHint), new Object[]{ semanticAdapter, containerView, semanticHint, new Integer(index), Boolean.valueOf(persisted), preferencesHint });
- }
-
- // Papyrus - final statement removed
- public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
-
- return (Node)createNewView(getNodeViewClass(semanticAdapter, containerView, semanticHint), new Object[]{ semanticAdapter, containerView, semanticHint, new Integer(index), Boolean.valueOf(persisted), preferencesHint });
- }
-
- /**
- * Determines whether this provider can provide for the specified view
- * creation operation
- *
- * @param operation
- * Contains a semantic kind and a containerView
- * @return boolean
- */
- protected boolean provides(CreateViewForKindOperation op) {
- if(op.getViewKind() == Node.class)
- return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- if(op.getViewKind() == Edge.class)
- return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- return true;
- }
-
- /**
- * Determines whether this provider can provide for the specified diagram
- * view operation
- *
- * @param operation
- * @return boolean
- */
- protected boolean provides(CreateDiagramViewOperation operation) {
- return getDiagramViewClass(operation.getSemanticAdapter(), operation.getSemanticHint()) != null;
- }
-
- /**
- * Determines whether this provider can provide for the specified edge view
- * operation
- *
- * @param operation
- * @return boolean
- */
- protected boolean provides(CreateEdgeViewOperation operation) {
- return (getEdgeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint()) != null);
- }
-
- /**
- * Determines whether this provider can provide for the specified node view
- * operation
- *
- * @param operation
- * @return boolean
- */
- protected boolean provides(CreateNodeViewOperation operation) {
- return (getNodeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint()) != null);
- }
-
- /**
- * Returns the diagram view class to instantiate based on the passed params
- *
- * @param semanticAdapter
- * TODO
- * @param semanticAdapter
- * @return Class
- */
- protected Class getDiagramViewClass(IAdaptable semanticAdapter, String diagramKind) {
- return null;
- }
-
- /**
- * Returns the edge view class to instantiate based on the passed params
- *
- * @param semanticAdapter
- * @param containerView
- * @param semanticHint
- * @return Class
- */
- protected Class getEdgeViewClass(IAdaptable semanticAdapter, View containerView, String semanticHint) {
- return null;
- }
-
- /**
- * Returns the node view class to instantiate based on the passed params
- *
- * @param semanticAdapter
- * @param containerView
- * @param semanticHint
- * @return Class
- */
- protected Class getNodeViewClass(IAdaptable semanticAdapter, View containerView, String semanticHint) {
- return null;
- }
-
- /**
- * creates a view instance via reflection.
- *
- * @param constructorParams
- * the view's constructor parameters.
- */
- private View createNewView(Class viewClass, Object[] constructorParams) {
- try {
- assert null != viewClass : "Null viewClass in AbstractProvider";//$NON-NLS-1$
- assert null != constructorParams : "Null constructorParams in AbstractProvider";//$NON-NLS-1$
-
- Constructor constructor = getFactoryConstructor(viewClass);
- if(constructor == null) {
- Log.error(DiagramPlugin.getInstance(), DiagramStatusCodes.SERVICE_FAILURE, "View (" + viewClass + ") is missing a proper creation Factory"); //$NON-NLS-1$//$NON-NLS-2$
- return null;
- }
-
- Object factory = constructor.newInstance(new Object[]{});
- Method method = getCreationMethod(viewClass, constructorParams);
- if(method == null) {
- Log.error(DiagramPlugin.getInstance(), DiagramStatusCodes.SERVICE_FAILURE, "View (" + viewClass + ") is missing a proper creation Factory"); //$NON-NLS-1$//$NON-NLS-2$
- return null;
- }
- return (View)method.invoke(factory, constructorParams);
- } catch (Throwable e) {
- String eMsg = NLS.bind(DiagramCoreMessages.AbstractViewProvider_create_view_failed_ERROR_, viewClass.getName());
- Log.warning(DiagramPlugin.getInstance(), IStatus.WARNING, eMsg, e);
- return null;
- }
- }
-
- private Constructor getFactoryConstructor(Class viewClass) {
- if(viewClass != null) {
- Constructor[] ctors = viewClass.getConstructors();
- for(int i = 0; i < ctors.length; i++) {
- if(ctors[i].getParameterTypes().length == 0) {
- return ctors[i];
- }
- }
- }
- return null;
- }
-
- /** Return the <i>creation</i> constructor for the cached view class. */
- private Method getCreationMethod(Class viewClass, Object[] params) {
- if(viewClass != null) {
- Method method = classToCreateMethod.getCreationMethod(viewClass);
- if(method != null)
- return method;
-
- Method[] methods = viewClass.getMethods();
- for(int i = 0; i < methods.length; i++) {
- method = methods[i];
- String methodName = method.getName();
- if(methodName.equals(viewCreationMethodName) || methodName.equals(diagramCreationMethodName)) {
- classToCreateMethod.addMethod(viewClass, method);
- return method;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns the EClass associated with the semantic adapter
- *
- * @param semanticAdapter
- * @return EClass
- */
- protected EClass getSemanticEClass(IAdaptable semanticAdapter) {
- if(semanticAdapter == null)
- return null;
- EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(eObject != null)
- return EMFCoreUtil.getProxyClass(eObject);
- IElementType type = (IElementType)semanticAdapter.getAdapter(IElementType.class);
- if(type != null)
- return type.getEClass();
- return null;
- }
-
- /**
- * Returns the semantic element associated with the semantic adapter
- *
- * @param semanticAdapter
- * @return EClass
- */
- protected EObject getSemanticElement(IAdaptable semanticAdapter) {
- if(semanticAdapter == null)// TODO which MEditingDomain to use?
- return null;
- EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(eObject != null)
- return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject);
- return null;
- }
-
- /**
- * Returns the semantic element associated with the semantic adapter
- *
- * @param semanticAdapter
- * @return EClass
- */
- protected EObject getSemanticElement(IAdaptable semanticAdapter, TransactionalEditingDomain domain) {
- if(semanticAdapter == null)
- return null;
- EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(eObject != null)
- return EMFCoreUtil.resolve(domain, eObject);
- return null;
- }
-
-}
+/******************************************************************************
+ * Copyright (c) 2002, 2010 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *
+ * CEA LIST - createNode and createEdge final statement removed
+ * in order to provide different implementation in subclasses.
+ * The original class is {@link AbstractViewProvider}.
+ *
+ ****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.provider;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.common.core.util.Log;
+import org.eclipse.gmf.runtime.diagram.core.internal.DiagramPlugin;
+import org.eclipse.gmf.runtime.diagram.core.internal.DiagramStatusCodes;
+import org.eclipse.gmf.runtime.diagram.core.internal.l10n.DiagramCoreMessages;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation;
+import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Implements of the <code>IViewProvider</code> interface. This
+ * implementations invokes the appropriate factory method by inspecting the
+ * supplied operation and provides the actual view creation functionality.
+ */
+public class AbstractViewProvider extends AbstractProvider implements IViewProvider {
+
+ private static String viewCreationMethodName = "createView"; //$NON-NLS-1$
+
+ private static String diagramCreationMethodName = "createDiagram"; //$NON-NLS-1$
+
+ static protected class ClassToCreationMethodMap extends HashMap {
+
+ static final long serialVersionUID = 1;
+
+ public void addMethod(Class clazz, Method method) {
+ if(get(clazz) == null)
+ put(clazz, method);
+ }
+
+ public Method getCreationMethod(Class clazz) {
+ return (Method)get(clazz);
+ }
+ }
+
+ public static ClassToCreationMethodMap classToCreateMethod = new ClassToCreationMethodMap();
+
+ /**
+ * Determines whether this view provider can provide for the required
+ * operation It inspects the type of view operation and calls the
+ * corresponding <code>provides</code> method.
+ *
+ * @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(IOperation)
+ */
+ public final boolean provides(IOperation operation) {
+ /* if this is the CreateViewForKindOperation operation */
+ if(operation instanceof CreateViewForKindOperation)
+ return provides((CreateViewForKindOperation)operation);
+
+ /* Make sure it is a view operation */
+ assert operation instanceof CreateViewOperation : "operation is not CreateViewOperation in AbstractViewProvider";//$NON-NLS-1$
+
+ /* call the specific provides method */
+ if(operation instanceof CreateDiagramViewOperation)
+ return provides((CreateDiagramViewOperation)operation);
+ else if(operation instanceof CreateEdgeViewOperation)
+ return provides((CreateEdgeViewOperation)operation);
+ else if(operation instanceof CreateNodeViewOperation)
+ return provides((CreateNodeViewOperation)operation);
+ return false;
+ }
+
+ public final Diagram createDiagram(IAdaptable contextElement, String diagramKind, PreferencesHint preferencesHint) {
+ return (Diagram)createNewView(getDiagramViewClass(contextElement, diagramKind), new Object[]{ contextElement, diagramKind, preferencesHint });
+ }
+
+ // Papyrus - final statement removed
+ public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
+
+ return (Edge)createNewView(getEdgeViewClass(semanticAdapter, containerView, semanticHint), new Object[]{ semanticAdapter, containerView, semanticHint, new Integer(index), Boolean.valueOf(persisted), preferencesHint });
+ }
+
+ // Papyrus - final statement removed
+ public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
+
+ return (Node)createNewView(getNodeViewClass(semanticAdapter, containerView, semanticHint), new Object[]{ semanticAdapter, containerView, semanticHint, new Integer(index), Boolean.valueOf(persisted), preferencesHint });
+ }
+
+ /**
+ * Determines whether this provider can provide for the specified view
+ * creation operation
+ *
+ * @param operation
+ * Contains a semantic kind and a containerView
+ * @return boolean
+ */
+ protected boolean provides(CreateViewForKindOperation op) {
+ if(op.getViewKind() == Node.class)
+ return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
+ if(op.getViewKind() == Edge.class)
+ return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
+ return true;
+ }
+
+ /**
+ * Determines whether this provider can provide for the specified diagram
+ * view operation
+ *
+ * @param operation
+ * @return boolean
+ */
+ protected boolean provides(CreateDiagramViewOperation operation) {
+ return getDiagramViewClass(operation.getSemanticAdapter(), operation.getSemanticHint()) != null;
+ }
+
+ /**
+ * Determines whether this provider can provide for the specified edge view
+ * operation
+ *
+ * @param operation
+ * @return boolean
+ */
+ protected boolean provides(CreateEdgeViewOperation operation) {
+ return (getEdgeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint()) != null);
+ }
+
+ /**
+ * Determines whether this provider can provide for the specified node view
+ * operation
+ *
+ * @param operation
+ * @return boolean
+ */
+ protected boolean provides(CreateNodeViewOperation operation) {
+ return (getNodeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint()) != null);
+ }
+
+ /**
+ * Returns the diagram view class to instantiate based on the passed params
+ *
+ * @param semanticAdapter
+ * TODO
+ * @param semanticAdapter
+ * @return Class
+ */
+ protected Class getDiagramViewClass(IAdaptable semanticAdapter, String diagramKind) {
+ return null;
+ }
+
+ /**
+ * Returns the edge view class to instantiate based on the passed params
+ *
+ * @param semanticAdapter
+ * @param containerView
+ * @param semanticHint
+ * @return Class
+ */
+ protected Class getEdgeViewClass(IAdaptable semanticAdapter, View containerView, String semanticHint) {
+ return null;
+ }
+
+ /**
+ * Returns the node view class to instantiate based on the passed params
+ *
+ * @param semanticAdapter
+ * @param containerView
+ * @param semanticHint
+ * @return Class
+ */
+ protected Class getNodeViewClass(IAdaptable semanticAdapter, View containerView, String semanticHint) {
+ return null;
+ }
+
+ /**
+ * creates a view instance via reflection.
+ *
+ * @param constructorParams
+ * the view's constructor parameters.
+ */
+ private View createNewView(Class viewClass, Object[] constructorParams) {
+ try {
+ assert null != viewClass : "Null viewClass in AbstractProvider";//$NON-NLS-1$
+ assert null != constructorParams : "Null constructorParams in AbstractProvider";//$NON-NLS-1$
+
+ Constructor constructor = getFactoryConstructor(viewClass);
+ if(constructor == null) {
+ Log.error(DiagramPlugin.getInstance(), DiagramStatusCodes.SERVICE_FAILURE, "View (" + viewClass + ") is missing a proper creation Factory"); //$NON-NLS-1$//$NON-NLS-2$
+ return null;
+ }
+
+ Object factory = constructor.newInstance(new Object[]{});
+ Method method = getCreationMethod(viewClass, constructorParams);
+ if(method == null) {
+ Log.error(DiagramPlugin.getInstance(), DiagramStatusCodes.SERVICE_FAILURE, "View (" + viewClass + ") is missing a proper creation Factory"); //$NON-NLS-1$//$NON-NLS-2$
+ return null;
+ }
+ return (View)method.invoke(factory, constructorParams);
+ } catch (Throwable e) {
+ String eMsg = NLS.bind(DiagramCoreMessages.AbstractViewProvider_create_view_failed_ERROR_, viewClass.getName());
+ Log.warning(DiagramPlugin.getInstance(), IStatus.WARNING, eMsg, e);
+ return null;
+ }
+ }
+
+ private Constructor getFactoryConstructor(Class viewClass) {
+ if(viewClass != null) {
+ Constructor[] ctors = viewClass.getConstructors();
+ for(int i = 0; i < ctors.length; i++) {
+ if(ctors[i].getParameterTypes().length == 0) {
+ return ctors[i];
+ }
+ }
+ }
+ return null;
+ }
+
+ /** Return the <i>creation</i> constructor for the cached view class. */
+ private Method getCreationMethod(Class viewClass, Object[] params) {
+ if(viewClass != null) {
+ Method method = classToCreateMethod.getCreationMethod(viewClass);
+ if(method != null)
+ return method;
+
+ Method[] methods = viewClass.getMethods();
+ for(int i = 0; i < methods.length; i++) {
+ method = methods[i];
+ String methodName = method.getName();
+ if(methodName.equals(viewCreationMethodName) || methodName.equals(diagramCreationMethodName)) {
+ classToCreateMethod.addMethod(viewClass, method);
+ return method;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the EClass associated with the semantic adapter
+ *
+ * @param semanticAdapter
+ * @return EClass
+ */
+ protected EClass getSemanticEClass(IAdaptable semanticAdapter) {
+ if(semanticAdapter == null)
+ return null;
+ EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
+ if(eObject != null)
+ return EMFCoreUtil.getProxyClass(eObject);
+ IElementType type = (IElementType)semanticAdapter.getAdapter(IElementType.class);
+ if(type != null)
+ return type.getEClass();
+ return null;
+ }
+
+ /**
+ * Returns the semantic element associated with the semantic adapter
+ *
+ * @param semanticAdapter
+ * @return EClass
+ */
+ protected EObject getSemanticElement(IAdaptable semanticAdapter) {
+ if(semanticAdapter == null)// TODO which MEditingDomain to use?
+ return null;
+ EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
+ if(eObject != null)
+ return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject);
+ return null;
+ }
+
+ /**
+ * Returns the semantic element associated with the semantic adapter
+ *
+ * @param semanticAdapter
+ * @return EClass
+ */
+ protected EObject getSemanticElement(IAdaptable semanticAdapter, TransactionalEditingDomain domain) {
+ if(semanticAdapter == null)
+ return null;
+ EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
+ if(eObject != null)
+ return EMFCoreUtil.resolve(domain, eObject);
+ return null;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractEditPartProvider.java
index 100390f0c71..41a3cc8031b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractEditPartProvider.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractEditPartProvider.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.provider;
-
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
-
-/**
- * This abstract edit part provider restricts its contribution to view that are owned by
- * a given type of diagram.
- */
-public abstract class CustomAbstractEditPartProvider extends AbstractEditPartProvider {
-
- /** The provides only provides for this diagram type */
- protected String diagramType;
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean provides(IOperation operation) {
- if(operation instanceof CreateGraphicEditPartOperation) {
- String currentDiagramType = ((IEditPartOperation)operation).getView().getDiagram().getType();
-
- if((diagramType == null) || (!diagramType.equals(currentDiagramType))) {
- return false;
- }
- }
-
- return super.provides(operation);
- }
-
-
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.provider;
+
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
+
+/**
+ * This abstract edit part provider restricts its contribution to view that are owned by
+ * a given type of diagram.
+ */
+public abstract class CustomAbstractEditPartProvider extends AbstractEditPartProvider {
+
+ /** The provides only provides for this diagram type */
+ protected String diagramType;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean provides(IOperation operation) {
+ if(operation instanceof CreateGraphicEditPartOperation) {
+ String currentDiagramType = ((IEditPartOperation)operation).getView().getDiagram().getType();
+
+ if((diagramType == null) || (!diagramType.equals(currentDiagramType))) {
+ return false;
+ }
+ }
+
+ return super.provides(operation);
+ }
+
+
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractViewProvider.java
index 3464a7dd199..c112a1944a6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractViewProvider.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/CustomAbstractViewProvider.java
@@ -1,154 +1,154 @@
-/*****************************************************************************
- * Copyright (c) 2011-2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.provider;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * This abstract view provider retrieve the view type from the graphical type
- * registry and use it in edge and node view creation.
- */
-public abstract class CustomAbstractViewProvider extends AbstractViewProvider {
-
- /** Local graphical type registry */
- protected IGraphicalTypeRegistry registry;
-
- /** The provides only provides for this diagram type */
- protected String diagramType;
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
- String graphicalType = getEdgeGraphicalType(semanticAdapter, containerView, semanticHint);
- return super.createEdge(semanticAdapter, containerView, graphicalType, index, persisted, preferencesHint);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
- String graphicalType = getNodeGraphicalType(semanticAdapter, containerView, semanticHint);
- return super.createNode(semanticAdapter, containerView, graphicalType, index, persisted, preferencesHint);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean provides(CreateViewForKindOperation op) {
-
- // This method should generally not be called (https://bugs.eclipse.org/bugs/show_bug.cgi?id=346739).
-
- if((diagramType == null) || (!diagramType.equals(op.getContainerView().getDiagram().getType()))) {
- return false;
- }
-
-// if(op.getViewKind() == Node.class) {
-// String graphicalType = getNodeGraphicalType(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint());
-// return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), graphicalType) != null;
-// }
-//
-// if(op.getViewKind() == Edge.class) {
-// String graphicalType = getEdgeGraphicalType(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint());
-// return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), graphicalType) != null;
-// }
-
- throw new UnsupportedOperationException("Should never be called by the "+diagramType+" diagram.");
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean provides(CreateEdgeViewOperation operation) {
-
- if((diagramType == null) || (!diagramType.equals(operation.getContainerView().getDiagram().getType()))) {
- return false;
- }
-
- String graphicalType = getEdgeGraphicalType(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint());
- return (getEdgeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), graphicalType) != null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean provides(CreateNodeViewOperation operation) {
-
- if((diagramType == null) || (!diagramType.equals(operation.getContainerView().getDiagram().getType()))) {
- return false;
- }
-
- String graphicalType = getNodeGraphicalType(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint());
- return (getNodeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), graphicalType) != null);
- }
-
- private String getNodeGraphicalType(IAdaptable semanticAdapter, View containerView, String semanticHint) {
- String graphicalType = null;
-
- // Some ViewDescriptor constructors initialize unspecified semanticHint with ""
- if((semanticHint != null) && (! "".equals(semanticHint))) {
- graphicalType = registry.getNodeGraphicalType(semanticHint, containerView.getType());
-
- } else {
-
- EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(domainElement != null) {
- graphicalType = registry.getNodeGraphicalType(domainElement, containerView.getType());
- }
-
- IElementType elementType = (IElementType)semanticAdapter.getAdapter(IElementType.class);
- if(elementType != null) {
- graphicalType = registry.getNodeGraphicalType(elementType, containerView.getType());
-
- }
- }
- return graphicalType;
- }
-
- private String getEdgeGraphicalType(IAdaptable semanticAdapter, View containerView, String semanticHint) {
- String graphicalType = null;
- // Some ViewDescriptor constructors initialize unspecified semanticHint with ""
- if((semanticHint != null) && (! "".equals(semanticHint))) {
- graphicalType = registry.getEdgeGraphicalType(semanticHint);
-
- } else {
-
- EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(domainElement != null) {
- graphicalType = registry.getEdgeGraphicalType(domainElement);
- }
-
- IElementType elementType = (IElementType)semanticAdapter.getAdapter(IElementType.class);
- if(elementType != null) {
- graphicalType = registry.getEdgeGraphicalType(elementType);
-
- }
- }
- return graphicalType;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011-2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.provider;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * This abstract view provider retrieve the view type from the graphical type
+ * registry and use it in edge and node view creation.
+ */
+public abstract class CustomAbstractViewProvider extends AbstractViewProvider {
+
+ /** Local graphical type registry */
+ protected IGraphicalTypeRegistry registry;
+
+ /** The provides only provides for this diagram type */
+ protected String diagramType;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
+ String graphicalType = getEdgeGraphicalType(semanticAdapter, containerView, semanticHint);
+ return super.createEdge(semanticAdapter, containerView, graphicalType, index, persisted, preferencesHint);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
+ String graphicalType = getNodeGraphicalType(semanticAdapter, containerView, semanticHint);
+ return super.createNode(semanticAdapter, containerView, graphicalType, index, persisted, preferencesHint);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean provides(CreateViewForKindOperation op) {
+
+ // This method should generally not be called (https://bugs.eclipse.org/bugs/show_bug.cgi?id=346739).
+
+ if((diagramType == null) || (!diagramType.equals(op.getContainerView().getDiagram().getType()))) {
+ return false;
+ }
+
+// if(op.getViewKind() == Node.class) {
+// String graphicalType = getNodeGraphicalType(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint());
+// return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), graphicalType) != null;
+// }
+//
+// if(op.getViewKind() == Edge.class) {
+// String graphicalType = getEdgeGraphicalType(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint());
+// return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), graphicalType) != null;
+// }
+
+ throw new UnsupportedOperationException("Should never be called by the "+diagramType+" diagram.");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean provides(CreateEdgeViewOperation operation) {
+
+ if((diagramType == null) || (!diagramType.equals(operation.getContainerView().getDiagram().getType()))) {
+ return false;
+ }
+
+ String graphicalType = getEdgeGraphicalType(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint());
+ return (getEdgeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), graphicalType) != null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean provides(CreateNodeViewOperation operation) {
+
+ if((diagramType == null) || (!diagramType.equals(operation.getContainerView().getDiagram().getType()))) {
+ return false;
+ }
+
+ String graphicalType = getNodeGraphicalType(operation.getSemanticAdapter(), operation.getContainerView(), operation.getSemanticHint());
+ return (getNodeViewClass(operation.getSemanticAdapter(), operation.getContainerView(), graphicalType) != null);
+ }
+
+ private String getNodeGraphicalType(IAdaptable semanticAdapter, View containerView, String semanticHint) {
+ String graphicalType = null;
+
+ // Some ViewDescriptor constructors initialize unspecified semanticHint with ""
+ if((semanticHint != null) && (! "".equals(semanticHint))) {
+ graphicalType = registry.getNodeGraphicalType(semanticHint, containerView.getType());
+
+ } else {
+
+ EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class);
+ if(domainElement != null) {
+ graphicalType = registry.getNodeGraphicalType(domainElement, containerView.getType());
+ }
+
+ IElementType elementType = (IElementType)semanticAdapter.getAdapter(IElementType.class);
+ if(elementType != null) {
+ graphicalType = registry.getNodeGraphicalType(elementType, containerView.getType());
+
+ }
+ }
+ return graphicalType;
+ }
+
+ private String getEdgeGraphicalType(IAdaptable semanticAdapter, View containerView, String semanticHint) {
+ String graphicalType = null;
+ // Some ViewDescriptor constructors initialize unspecified semanticHint with ""
+ if((semanticHint != null) && (! "".equals(semanticHint))) {
+ graphicalType = registry.getEdgeGraphicalType(semanticHint);
+
+ } else {
+
+ EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class);
+ if(domainElement != null) {
+ graphicalType = registry.getEdgeGraphicalType(domainElement);
+ }
+
+ IElementType elementType = (IElementType)semanticAdapter.getAdapter(IElementType.class);
+ if(elementType != null) {
+ graphicalType = registry.getEdgeGraphicalType(elementType);
+
+ }
+ }
+ return graphicalType;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/DiagramEditorUtil.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/DiagramEditorUtil.java
index cd31b0530aa..e7a68cd2469 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/DiagramEditorUtil.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/DiagramEditorUtil.java
@@ -1,42 +1,42 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.provider;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-
-/**
- * Non diagram-specific class generated by GMF Tooling.
- */
-public class DiagramEditorUtil {
-
- public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
- diagramPart.getDiagramGraphicalViewer().deselectAll();
-
- EditPart firstPrimary = null;
- for(EditPart nextPart : editParts) {
- diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
- if(firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
- firstPrimary = nextPart;
- }
- }
-
- if(!editParts.isEmpty()) {
- diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart)editParts.get(0));
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.provider;
+
+import java.util.List;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ */
+public class DiagramEditorUtil {
+
+ public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
+ diagramPart.getDiagramGraphicalViewer().deselectAll();
+
+ EditPart firstPrimary = null;
+ for(EditPart nextPart : editParts) {
+ diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
+ if(firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
+ firstPrimary = nextPart;
+ }
+ }
+
+ if(!editParts.isEmpty()) {
+ diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart)editParts.get(0));
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/ElementTypeLabelProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/ElementTypeLabelProvider.java
index aba6a03b037..e5bd29f1d5a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/ElementTypeLabelProvider.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/ElementTypeLabelProvider.java
@@ -1,50 +1,50 @@
-/******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- ****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.provider;
-
-import org.eclipse.gmf.runtime.common.ui.services.icon.IconService;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A label provider that provides the name and image for <code>IElementType</code> objects.
- *
- * @author cmahoney
- */
-public class ElementTypeLabelProvider extends LabelProvider {
-
- /**
- * Retrieves the image for <code>IElementType</code> objects using
- * the <code>IconService</code>.
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- */
- public Image getImage(Object object) {
- if(object instanceof IElementType) {
- return IconService.getInstance().getIcon((IElementType)object);
- }
- return null;
- }
-
- /**
- * Uses <code>IElementType.getDisplayName()</code> for the text.
- *
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
- */
- public String getText(Object object) {
- if(object instanceof IElementType) {
- return ((IElementType)object).getDisplayName();
- } else {
- return object.toString();
- }
- }
-}
+/******************************************************************************
+ * Copyright (c) 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ ****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.provider;
+
+import org.eclipse.gmf.runtime.common.ui.services.icon.IconService;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * A label provider that provides the name and image for <code>IElementType</code> objects.
+ *
+ * @author cmahoney
+ */
+public class ElementTypeLabelProvider extends LabelProvider {
+
+ /**
+ * Retrieves the image for <code>IElementType</code> objects using
+ * the <code>IconService</code>.
+ *
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ */
+ public Image getImage(Object object) {
+ if(object instanceof IElementType) {
+ return IconService.getInstance().getIcon((IElementType)object);
+ }
+ return null;
+ }
+
+ /**
+ * Uses <code>IElementType.getDisplayName()</code> for the text.
+ *
+ * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ */
+ public String getText(Object object) {
+ if(object instanceof IElementType) {
+ return ((IElementType)object).getDisplayName();
+ } else {
+ return object.toString();
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/MarkerNavigationProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/MarkerNavigationProvider.java
index 891fe69d63d..969c80b1550 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/MarkerNavigationProvider.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-gmf/org/eclipse/papyrus/gmf/diagram/common/provider/MarkerNavigationProvider.java
@@ -1,91 +1,91 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.gmf.diagram.common.provider;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNavigationProvider;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-
-/**
- * Non diagram-specific class generated by GMF Tooling.
- */
-public class MarkerNavigationProvider extends AbstractModelMarkerNavigationProvider {
-
- public static final String MARKER_TYPE = Activator.PLUGIN_ID + ".diagnostic"; //$NON-NLS-1$
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void doGotoMarker(IMarker marker) {
- String elementId = marker.getAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, null);
- if(elementId == null || !(getEditor() instanceof DiagramEditor)) {
- return;
- }
- DiagramEditor editor = (DiagramEditor)getEditor();
- Map editPartRegistry = editor.getDiagramGraphicalViewer().getEditPartRegistry();
- EObject targetView = editor.getDiagram().eResource().getEObject(elementId);
- if(targetView == null) {
- return;
- }
- EditPart targetEditPart = (EditPart)editPartRegistry.get(targetView);
- if(targetEditPart != null) {
- DiagramEditorUtil.selectElementsInDiagram(editor, Arrays.asList(new EditPart[]{ targetEditPart }));
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public static void deleteMarkers(IResource resource) {
- try {
- resource.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO);
- } catch (CoreException e) {
- Activator.log.error("Failed to delete validation markers", e); //$NON-NLS-1$
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public static IMarker addMarker(IFile file, String elementId, String location, String message, int statusSeverity) {
- IMarker marker = null;
- try {
- marker = file.createMarker(MARKER_TYPE);
- marker.setAttribute(IMarker.MESSAGE, message);
- marker.setAttribute(IMarker.LOCATION, location);
- marker.setAttribute(org.eclipse.gmf.runtime.common.ui.resources.IMarker.ELEMENT_ID, elementId);
- int markerSeverity = IMarker.SEVERITY_INFO;
- if(statusSeverity == IStatus.WARNING) {
- markerSeverity = IMarker.SEVERITY_WARNING;
- } else if(statusSeverity == IStatus.ERROR || statusSeverity == IStatus.CANCEL) {
- markerSeverity = IMarker.SEVERITY_ERROR;
- }
- marker.setAttribute(IMarker.SEVERITY, markerSeverity);
- } catch (CoreException e) {
- Activator.log.error("Failed to create validation marker", e); //$NON-NLS-1$
- }
- return marker;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.gmf.diagram.common.provider;
+
+import java.util.Arrays;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNavigationProvider;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+
+/**
+ * Non diagram-specific class generated by GMF Tooling.
+ */
+public class MarkerNavigationProvider extends AbstractModelMarkerNavigationProvider {
+
+ public static final String MARKER_TYPE = Activator.PLUGIN_ID + ".diagnostic"; //$NON-NLS-1$
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void doGotoMarker(IMarker marker) {
+ String elementId = marker.getAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, null);
+ if(elementId == null || !(getEditor() instanceof DiagramEditor)) {
+ return;
+ }
+ DiagramEditor editor = (DiagramEditor)getEditor();
+ Map editPartRegistry = editor.getDiagramGraphicalViewer().getEditPartRegistry();
+ EObject targetView = editor.getDiagram().eResource().getEObject(elementId);
+ if(targetView == null) {
+ return;
+ }
+ EditPart targetEditPart = (EditPart)editPartRegistry.get(targetView);
+ if(targetEditPart != null) {
+ DiagramEditorUtil.selectElementsInDiagram(editor, Arrays.asList(new EditPart[]{ targetEditPart }));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public static void deleteMarkers(IResource resource) {
+ try {
+ resource.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO);
+ } catch (CoreException e) {
+ Activator.log.error("Failed to delete validation markers", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public static IMarker addMarker(IFile file, String elementId, String location, String message, int statusSeverity) {
+ IMarker marker = null;
+ try {
+ marker = file.createMarker(MARKER_TYPE);
+ marker.setAttribute(IMarker.MESSAGE, message);
+ marker.setAttribute(IMarker.LOCATION, location);
+ marker.setAttribute(org.eclipse.gmf.runtime.common.ui.resources.IMarker.ELEMENT_ID, elementId);
+ int markerSeverity = IMarker.SEVERITY_INFO;
+ if(statusSeverity == IStatus.WARNING) {
+ markerSeverity = IMarker.SEVERITY_WARNING;
+ } else if(statusSeverity == IStatus.ERROR || statusSeverity == IStatus.CANCEL) {
+ markerSeverity = IMarker.SEVERITY_ERROR;
+ }
+ marker.setAttribute(IMarker.SEVERITY, markerSeverity);
+ } catch (CoreException e) {
+ Activator.log.error("Failed to create validation marker", e); //$NON-NLS-1$
+ }
+ return marker;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/ConstraintExtendedDirectEditionDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/ConstraintExtendedDirectEditionDialog.java
new file mode 100644
index 00000000000..dbac0ce2dc4
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/ConstraintExtendedDirectEditionDialog.java
@@ -0,0 +1,16 @@
+package org.eclipse.papyrus.sysml.diagram.common.commands;
+
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.swt.widgets.Shell;
+
+public class ConstraintExtendedDirectEditionDialog extends ExtendedDirectEditionDialog {
+
+ public ConstraintExtendedDirectEditionDialog(Shell parentShell,
+ Object object, String initialValue,
+ IDirectEditorConfiguration configuration) {
+ super(parentShell, object, initialValue, configuration);
+ this.title = "Edit Constraint specification";
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateActorPartWithTypeConfigureCommandFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateActorPartWithTypeConfigureCommandFactory.java
index 886612c7d74..8a41c91511c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateActorPartWithTypeConfigureCommandFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateActorPartWithTypeConfigureCommandFactory.java
@@ -1,89 +1,89 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
-import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectActorPartTypeDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * This command factory provides a command that enable ActorPart type to be selected or created during creation.
- */
-public class CreateActorPartWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
-
- /**
- * {@inheritDoc}
- */
- public ICommand create(ConfigureRequest request) {
-
- ICommand configureCommand = null;
-
- Shell shell = Display.getDefault().getActiveShell();
- // Start dialog to identify the new part type
- Property part = (Property)request.getElementToConfigure();
- Package partPkg = part.getNearestPackage();
-
- CreateOrSelectActorPartTypeDialog dialog = new CreateOrSelectActorPartTypeDialog(shell, partPkg);
- dialog.open();
- if(dialog.getReturnCode() == CreateOrSelectActorPartTypeDialog.OK) {
-
- final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
- final Type actorPartType = (Type)dialog.getExistingType();
-
- // Abort if type creation command exists but is not executable
- if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
- return cancelCommand(request);
- } else {
- configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
- }
-
- // Create the configure command that will set the ActorPart type
- ICommand setTypeCommand = new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- Property actorPart = (Property)getElementToEdit();
- if(actorPartType != null) {
- actorPart.setType(actorPartType);
- } else {
- Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
- actorPart.setType(newType);
- }
-
- return CommandResult.newOKCommandResult(actorPart);
- }
-
- };
-
- configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
- return configureCommand;
- }
-
- return cancelCommand(request);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
+import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectActorPartTypeDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * This command factory provides a command that enable ActorPart type to be selected or created during creation.
+ */
+public class CreateActorPartWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand create(ConfigureRequest request) {
+
+ ICommand configureCommand = null;
+
+ Shell shell = Display.getDefault().getActiveShell();
+ // Start dialog to identify the new part type
+ Property part = (Property)request.getElementToConfigure();
+ Package partPkg = part.getNearestPackage();
+
+ CreateOrSelectActorPartTypeDialog dialog = new CreateOrSelectActorPartTypeDialog(shell, partPkg);
+ dialog.open();
+ if(dialog.getReturnCode() == CreateOrSelectActorPartTypeDialog.OK) {
+
+ final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
+ final Type actorPartType = (Type)dialog.getExistingType();
+
+ // Abort if type creation command exists but is not executable
+ if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
+ return cancelCommand(request);
+ } else {
+ configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
+ }
+
+ // Create the configure command that will set the ActorPart type
+ ICommand setTypeCommand = new ConfigureElementCommand(request) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Property actorPart = (Property)getElementToEdit();
+ if(actorPartType != null) {
+ actorPart.setType(actorPartType);
+ } else {
+ Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
+ actorPart.setType(newType);
+ }
+
+ return CommandResult.newOKCommandResult(actorPart);
+ }
+
+ };
+
+ configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
+ return configureCommand;
+ }
+
+ return cancelCommand(request);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateConstraintPropertyWithTypeConfigureCommandFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateConstraintPropertyWithTypeConfigureCommandFactory.java
new file mode 100644
index 00000000000..2371e626b6e
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateConstraintPropertyWithTypeConfigureCommandFactory.java
@@ -0,0 +1,154 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.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.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.commands.ConfigureFeatureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
+import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectConstraintPropertyTypeDialog;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This command factory provides a command that enable Part type to be selected or created during creation.
+ */
+public class CreateConstraintPropertyWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand create(ConfigureRequest request) {
+
+ ICommand configureCommand = null;
+
+ Shell shell = Display.getDefault().getActiveShell();
+ // Start dialog to identify the new part type
+ Property part = (Property)request.getElementToConfigure();
+ Package partPkg = part.getNearestPackage();
+
+ CreateOrSelectConstraintPropertyTypeDialog dialog = new CreateOrSelectConstraintPropertyTypeDialog(shell, partPkg);
+ dialog.open();
+ if(dialog.getReturnCode() == CreateOrSelectConstraintPropertyTypeDialog.OK) {
+
+ final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
+ final Type partType = (Type)dialog.getExistingType();
+
+ // Abort if type creation command exists but is not executable
+ if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
+ return cancelCommand(request);
+ } else {
+ configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
+ }
+
+ // Create the configure command that will set the constraint property type
+ ICommand setTypeCommand = new ConfigureElementCommand(request) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Property part = (Property)getElementToEdit();
+ if(partType != null) {
+ part.setType(partType);
+ } else {
+ Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
+ createConstraintBlockConstraint(newType, monitor, info);
+ part.setType(newType);
+ }
+ return CommandResult.newOKCommandResult(part);
+ }
+
+ private void createConstraintBlockConstraint(Type newType, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // Create the constraint attached to the ConstraintBlock
+ IElementEditService commandService = ElementEditServiceUtils.getCommandProvider(newType);
+ if(commandService != null) {
+ CreateElementRequest createTypeRequest = new CreateElementRequest(newType, UMLElementTypes.CONSTRAINT);
+ createTypeRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID,
+ new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getNamedElement_Name(), newType.getName() + "Specification"));
+ ICommand newConstraintCreateCommand = commandService.getEditCommand(createTypeRequest);
+ if (newConstraintCreateCommand.canExecute()) {
+ newConstraintCreateCommand.execute(monitor, info);
+ Object newObject = newConstraintCreateCommand.getCommandResult().getReturnValue();
+ // Create the constraint specification
+ if (newObject instanceof EObject) {
+ final EObject newElement = (EObject)newObject;
+ final IDirectEditorConfiguration configuration = initExtendedEditorConfiguration(newElement);
+ Dialog dialog = new ConstraintExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), newElement, configuration.getTextToEdit(newElement), configuration);
+ final Dialog finalDialog = dialog;
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Constraint specification") {
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(newElement, ((ILabelEditorDialog)finalDialog).getValue());
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+
+ }
+ }
+ }
+ };
+
+ configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
+ return configureCommand;
+ }
+
+ return cancelCommand(request);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ */
+ protected IDirectEditorConfiguration initExtendedEditorConfiguration(EObject element) {
+ IDirectEditorConfiguration configuration;
+ final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + element.eClass().getInstanceClassName());
+ if(languagePreferred != null && !languagePreferred.equals("")) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, element.eClass().getInstanceClassName());
+ } else {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, element.eClass().getInstanceClassName());
+ }
+ return configuration;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateFlowPortWithFlowSpecificationConfigureCommandFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateFlowPortWithFlowSpecificationConfigureCommandFactory.java
index 64ef05e8e81..ac62e065270 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateFlowPortWithFlowSpecificationConfigureCommandFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateFlowPortWithFlowSpecificationConfigureCommandFactory.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
-import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectNonAtomicFlowPortTypeDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * This command factory provides a command that enable FlowPort type (FlowSpecification) to be selected or created during creation.
- */
-public class CreateFlowPortWithFlowSpecificationConfigureCommandFactory extends AbstractConfigureCommandFactory {
-
- /**
- * {@inheritDoc}
- */
- public ICommand create(ConfigureRequest request) {
-
- ICommand configureCommand = null;
-
- Shell shell = Display.getDefault().getActiveShell();
- // Start dialog to identify the new port type
- Port port = (Port)request.getElementToConfigure();
- Package partPkg = port.getNearestPackage();
-
- CreateOrSelectNonAtomicFlowPortTypeDialog dialog = new CreateOrSelectNonAtomicFlowPortTypeDialog(shell, partPkg);
- dialog.open();
- if(dialog.getReturnCode() == CreateOrSelectNonAtomicFlowPortTypeDialog.OK) {
-
- final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
- final Type portType = (Type)dialog.getExistingType();
-
- // Abort if type creation command exists but is not executable
- if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
- return cancelCommand(request);
- } else {
- configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
- }
-
- // Create the configure command that will set the part type
- ICommand setTypeCommand = new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- Port port = (Port)getElementToEdit();
- if(portType != null) {
- port.setType(portType);
- } else {
- Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
- port.setType(newType);
- }
- return CommandResult.newOKCommandResult(port);
- }
-
- };
-
- configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
- return configureCommand;
- }
-
- return cancelCommand(request);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
+import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectNonAtomicFlowPortTypeDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * This command factory provides a command that enable FlowPort type (FlowSpecification) to be selected or created during creation.
+ */
+public class CreateFlowPortWithFlowSpecificationConfigureCommandFactory extends AbstractConfigureCommandFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand create(ConfigureRequest request) {
+
+ ICommand configureCommand = null;
+
+ Shell shell = Display.getDefault().getActiveShell();
+ // Start dialog to identify the new port type
+ Port port = (Port)request.getElementToConfigure();
+ Package partPkg = port.getNearestPackage();
+
+ CreateOrSelectNonAtomicFlowPortTypeDialog dialog = new CreateOrSelectNonAtomicFlowPortTypeDialog(shell, partPkg);
+ dialog.open();
+ if(dialog.getReturnCode() == CreateOrSelectNonAtomicFlowPortTypeDialog.OK) {
+
+ final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
+ final Type portType = (Type)dialog.getExistingType();
+
+ // Abort if type creation command exists but is not executable
+ if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
+ return cancelCommand(request);
+ } else {
+ configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
+ }
+
+ // Create the configure command that will set the part type
+ ICommand setTypeCommand = new ConfigureElementCommand(request) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Port port = (Port)getElementToEdit();
+ if(portType != null) {
+ port.setType(portType);
+ } else {
+ Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
+ port.setType(newType);
+ }
+ return CommandResult.newOKCommandResult(port);
+ }
+
+ };
+
+ configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
+ return configureCommand;
+ }
+
+ return cancelCommand(request);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreatePartWithTypeConfigureCommandFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreatePartWithTypeConfigureCommandFactory.java
index 96da614a4a2..2bd53e7f3dd 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreatePartWithTypeConfigureCommandFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreatePartWithTypeConfigureCommandFactory.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
-import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectBlockPropertyTypeDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * This command factory provides a command that enable Part type to be selected or created during creation.
- */
-public class CreatePartWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
-
- /**
- * {@inheritDoc}
- */
- public ICommand create(ConfigureRequest request) {
-
- ICommand configureCommand = null;
-
- Shell shell = Display.getDefault().getActiveShell();
- // Start dialog to identify the new part type
- Property part = (Property)request.getElementToConfigure();
- Package partPkg = part.getNearestPackage();
-
- CreateOrSelectBlockPropertyTypeDialog dialog = new CreateOrSelectBlockPropertyTypeDialog(shell, partPkg);
- dialog.open();
- if(dialog.getReturnCode() == CreateOrSelectBlockPropertyTypeDialog.OK) {
-
- final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
- final Type partType = (Type)dialog.getExistingType();
-
- // Abort if type creation command exists but is not executable
- if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
- return cancelCommand(request);
- } else {
- configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
- }
-
- // Create the configure command that will set the part type
- ICommand setTypeCommand = new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- Property part = (Property)getElementToEdit();
- if(partType != null) {
- part.setType(partType);
- } else {
- Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
- part.setType(newType);
- }
- return CommandResult.newOKCommandResult(part);
- }
-
- };
-
- configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
- return configureCommand;
- }
-
- return cancelCommand(request);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
+import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectBlockPropertyTypeDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * This command factory provides a command that enable Part type to be selected or created during creation.
+ */
+public class CreatePartWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand create(ConfigureRequest request) {
+
+ ICommand configureCommand = null;
+
+ Shell shell = Display.getDefault().getActiveShell();
+ // Start dialog to identify the new part type
+ Property part = (Property)request.getElementToConfigure();
+ Package partPkg = part.getNearestPackage();
+
+ CreateOrSelectBlockPropertyTypeDialog dialog = new CreateOrSelectBlockPropertyTypeDialog(shell, partPkg);
+ dialog.open();
+ if(dialog.getReturnCode() == CreateOrSelectBlockPropertyTypeDialog.OK) {
+
+ final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
+ final Type partType = (Type)dialog.getExistingType();
+
+ // Abort if type creation command exists but is not executable
+ if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
+ return cancelCommand(request);
+ } else {
+ configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
+ }
+
+ // Create the configure command that will set the part type
+ ICommand setTypeCommand = new ConfigureElementCommand(request) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Property part = (Property)getElementToEdit();
+ if(partType != null) {
+ part.setType(partType);
+ } else {
+ Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
+ part.setType(newType);
+ }
+ return CommandResult.newOKCommandResult(part);
+ }
+
+ };
+
+ configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
+ return configureCommand;
+ }
+
+ return cancelCommand(request);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateReferenceWithTypeConfigureCommandFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateReferenceWithTypeConfigureCommandFactory.java
index 49b35be177a..50b7889349d 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateReferenceWithTypeConfigureCommandFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateReferenceWithTypeConfigureCommandFactory.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
-import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectBlockPropertyTypeDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * This command factory provides a command that enable Reference type to be selected or created during creation.
- */
-public class CreateReferenceWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
-
- /**
- * {@inheritDoc}
- */
- public ICommand create(ConfigureRequest request) {
-
- ICommand configureCommand = null;
-
- Shell shell = Display.getDefault().getActiveShell();
- // Start dialog to identify the new part type
- Property part = (Property)request.getElementToConfigure();
- Package partPkg = part.getNearestPackage();
-
- CreateOrSelectBlockPropertyTypeDialog dialog = new CreateOrSelectBlockPropertyTypeDialog(shell, partPkg);
- dialog.open();
- if(dialog.getReturnCode() == CreateOrSelectBlockPropertyTypeDialog.OK) {
-
- final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
- final Type partType = (Type)dialog.getExistingType();
-
- // Abort if type creation command exists but is not executable
- if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
- return cancelCommand(request);
- } else {
- configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
- }
-
- // Create the configure command that will set the part type
- ICommand setTypeCommand = new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- Property part = (Property)getElementToEdit();
- if(partType != null) {
- part.setType(partType);
- } else {
- Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
- part.setType(newType);
- }
- return CommandResult.newOKCommandResult(part);
- }
-
- };
-
- configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
- return configureCommand;
- }
-
- return cancelCommand(request);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
+import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectBlockPropertyTypeDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * This command factory provides a command that enable Reference type to be selected or created during creation.
+ */
+public class CreateReferenceWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand create(ConfigureRequest request) {
+
+ ICommand configureCommand = null;
+
+ Shell shell = Display.getDefault().getActiveShell();
+ // Start dialog to identify the new part type
+ Property part = (Property)request.getElementToConfigure();
+ Package partPkg = part.getNearestPackage();
+
+ CreateOrSelectBlockPropertyTypeDialog dialog = new CreateOrSelectBlockPropertyTypeDialog(shell, partPkg);
+ dialog.open();
+ if(dialog.getReturnCode() == CreateOrSelectBlockPropertyTypeDialog.OK) {
+
+ final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
+ final Type partType = (Type)dialog.getExistingType();
+
+ // Abort if type creation command exists but is not executable
+ if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
+ return cancelCommand(request);
+ } else {
+ configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
+ }
+
+ // Create the configure command that will set the part type
+ ICommand setTypeCommand = new ConfigureElementCommand(request) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Property part = (Property)getElementToEdit();
+ if(partType != null) {
+ part.setType(partType);
+ } else {
+ Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
+ part.setType(newType);
+ }
+ return CommandResult.newOKCommandResult(part);
+ }
+
+ };
+
+ configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
+ return configureCommand;
+ }
+
+ return cancelCommand(request);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateValueWithTypeConfigureCommandFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateValueWithTypeConfigureCommandFactory.java
index e60996c8420..fc21e248d3f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateValueWithTypeConfigureCommandFactory.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/commands/CreateValueWithTypeConfigureCommandFactory.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
-import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectValuePropertyTypeDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * This command factory provides a command that enable Value type to be selected or created during creation.
- */
-public class CreateValueWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
-
- /**
- * {@inheritDoc}
- */
- public ICommand create(ConfigureRequest request) {
-
- ICommand configureCommand = null;
-
- Shell shell = Display.getDefault().getActiveShell();
- // Start dialog to identify the new part type
- Property part = (Property)request.getElementToConfigure();
- Package partPkg = part.getNearestPackage();
-
- CreateOrSelectValuePropertyTypeDialog dialog = new CreateOrSelectValuePropertyTypeDialog(shell, partPkg);
- dialog.open();
- if(dialog.getReturnCode() == CreateOrSelectValuePropertyTypeDialog.OK) {
-
- final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
- final Type partType = (Type)dialog.getExistingType();
-
- // Abort if type creation command exists but is not executable
- if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
- return cancelCommand(request);
- } else {
- configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
- }
-
- // Create the configure command that will set the part type
- ICommand setTypeCommand = new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- Property part = (Property)getElementToEdit();
- if(partType != null) {
- part.setType(partType);
- } else {
- Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
- part.setType(newType);
- }
- return CommandResult.newOKCommandResult(part);
- }
-
- };
-
- configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
- return configureCommand;
- }
-
- return cancelCommand(request);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.infra.services.edit.commands.AbstractConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
+import org.eclipse.papyrus.sysml.diagram.common.dialogs.CreateOrSelectValuePropertyTypeDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * This command factory provides a command that enable Value type to be selected or created during creation.
+ */
+public class CreateValueWithTypeConfigureCommandFactory extends AbstractConfigureCommandFactory {
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand create(ConfigureRequest request) {
+
+ ICommand configureCommand = null;
+
+ Shell shell = Display.getDefault().getActiveShell();
+ // Start dialog to identify the new part type
+ Property part = (Property)request.getElementToConfigure();
+ Package partPkg = part.getNearestPackage();
+
+ CreateOrSelectValuePropertyTypeDialog dialog = new CreateOrSelectValuePropertyTypeDialog(shell, partPkg);
+ dialog.open();
+ if(dialog.getReturnCode() == CreateOrSelectValuePropertyTypeDialog.OK) {
+
+ final ICommand typeCreationCommand = dialog.getNewTypeCreateCommand();
+ final Type partType = (Type)dialog.getExistingType();
+
+ // Abort if type creation command exists but is not executable
+ if((typeCreationCommand != null) && (!typeCreationCommand.canExecute())) {
+ return cancelCommand(request);
+ } else {
+ configureCommand = CompositeCommand.compose(configureCommand, typeCreationCommand);
+ }
+
+ // Create the configure command that will set the part type
+ ICommand setTypeCommand = new ConfigureElementCommand(request) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ Property part = (Property)getElementToEdit();
+ if(partType != null) {
+ part.setType(partType);
+ } else {
+ Type newType = (Type)GMFCommandUtils.getCommandEObjectResult(typeCreationCommand);
+ part.setType(newType);
+ }
+ return CommandResult.newOKCommandResult(part);
+ }
+
+ };
+
+ configureCommand = CompositeCommand.compose(configureCommand, setTypeCommand);
+ return configureCommand;
+ }
+
+ return cancelCommand(request);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectActorPartTypeDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectActorPartTypeDialog.java
index 18ea1e49a8c..d2e22627b71 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectActorPartTypeDialog.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectActorPartTypeDialog.java
@@ -1,119 +1,119 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.dialogs;
-
-import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Dialog for initialization of ActorPart (Property) type (the type is either selected or created).
- */
-public class CreateOrSelectActorPartTypeDialog extends CreateOrSelectTypeDialog {
-
- /** Constructor */
- public CreateOrSelectActorPartTypeDialog(Shell shell, NamedElement owner) {
- super(shell, owner, UMLElementTypes.ACTOR, UMLPackage.eINSTANCE.getTypedElement_Type(), UMLPackage.eINSTANCE.getActor(), UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getDialogTitle() {
- return Messages.CreateOrSelectActorPartTypeDialog_DialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getSelectionSectionTitle() {
- return Messages.CreateOrSelectActorPartTypeDialog_SelectionSectionTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getSelectionSectionRadioLabel() {
- return Messages.CreateOrSelectActorPartTypeDialog_SelectionSectionRadioLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getCreationSectionTitle() {
- return Messages.CreateOrSelectActorPartTypeDialog_CreationSectionTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getCreationSectionRadioLabel() {
- return Messages.CreateOrSelectActorPartTypeDialog_CreationSectionRadioLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeNameLabel() {
- return Messages.CreateOrSelectActorPartTypeDialog_NewTypeNameLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerNameLabel() {
- return Messages.CreateOrSelectActorPartTypeDialog_NewTypeContainerNameLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerDialogTitle() {
- return Messages.CreateOrSelectActorPartTypeDialog_SelectNewTypeContainerDialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerDialogMessage() {
- return Messages.CreateOrSelectActorPartTypeDialog_SelectNewTypeContainerDialogMessage;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getTypeDialogTitle() {
- return Messages.CreateOrSelectActorPartTypeDialog_SelectTypeDialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getTypeDialogMessage() {
- return Messages.CreateOrSelectActorPartTypeDialog_SelectTypeDialogMessage;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.dialogs;
+
+import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Dialog for initialization of ActorPart (Property) type (the type is either selected or created).
+ */
+public class CreateOrSelectActorPartTypeDialog extends CreateOrSelectTypeDialog {
+
+ /** Constructor */
+ public CreateOrSelectActorPartTypeDialog(Shell shell, NamedElement owner) {
+ super(shell, owner, UMLElementTypes.ACTOR, UMLPackage.eINSTANCE.getTypedElement_Type(), UMLPackage.eINSTANCE.getActor(), UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getDialogTitle() {
+ return Messages.CreateOrSelectActorPartTypeDialog_DialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionTitle() {
+ return Messages.CreateOrSelectActorPartTypeDialog_SelectionSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionRadioLabel() {
+ return Messages.CreateOrSelectActorPartTypeDialog_SelectionSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionTitle() {
+ return Messages.CreateOrSelectActorPartTypeDialog_CreationSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionRadioLabel() {
+ return Messages.CreateOrSelectActorPartTypeDialog_CreationSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeNameLabel() {
+ return Messages.CreateOrSelectActorPartTypeDialog_NewTypeNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerNameLabel() {
+ return Messages.CreateOrSelectActorPartTypeDialog_NewTypeContainerNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogTitle() {
+ return Messages.CreateOrSelectActorPartTypeDialog_SelectNewTypeContainerDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogMessage() {
+ return Messages.CreateOrSelectActorPartTypeDialog_SelectNewTypeContainerDialogMessage;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogTitle() {
+ return Messages.CreateOrSelectActorPartTypeDialog_SelectTypeDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogMessage() {
+ return Messages.CreateOrSelectActorPartTypeDialog_SelectTypeDialogMessage;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectBlockPropertyTypeDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectBlockPropertyTypeDialog.java
index a145efcc937..28ba0f980b3 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectBlockPropertyTypeDialog.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectBlockPropertyTypeDialog.java
@@ -1,121 +1,121 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.dialogs;
-
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
-import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Dialog for initialization of Part (Property) type (the type is either selected or created).
- */
-public class CreateOrSelectBlockPropertyTypeDialog extends CreateOrSelectTypeDialog {
-
- /** Constructor */
- public CreateOrSelectBlockPropertyTypeDialog(Shell shell, NamedElement owner) {
- super(shell, owner, SysMLElementTypes.BLOCK, UMLPackage.eINSTANCE.getTypedElement_Type(), BlocksPackage.eINSTANCE.getBlock(), UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getDialogTitle() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_DialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getSelectionSectionTitle() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectionSectionTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getSelectionSectionRadioLabel() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectionSectionRadioLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getCreationSectionTitle() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_CreationSectionTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getCreationSectionRadioLabel() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_CreationSectionRadioLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeNameLabel() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_NewTypeNameLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerNameLabel() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_NewTypeContainerNameLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerDialogTitle() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerDialogMessage() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogMessage;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getTypeDialogTitle() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getTypeDialogMessage() {
- return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogMessage;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.dialogs;
+
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Dialog for initialization of Part (Property) type (the type is either selected or created).
+ */
+public class CreateOrSelectBlockPropertyTypeDialog extends CreateOrSelectTypeDialog {
+
+ /** Constructor */
+ public CreateOrSelectBlockPropertyTypeDialog(Shell shell, NamedElement owner) {
+ super(shell, owner, SysMLElementTypes.BLOCK, UMLPackage.eINSTANCE.getTypedElement_Type(), BlocksPackage.eINSTANCE.getBlock(), UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getDialogTitle() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_DialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionTitle() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectionSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionRadioLabel() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectionSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionTitle() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_CreationSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionRadioLabel() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_CreationSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeNameLabel() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_NewTypeNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerNameLabel() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_NewTypeContainerNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogTitle() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogMessage() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogMessage;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogTitle() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogMessage() {
+ return Messages.CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogMessage;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectConstraintPropertyTypeDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectConstraintPropertyTypeDialog.java
new file mode 100644
index 00000000000..8e80820c06b
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectConstraintPropertyTypeDialog.java
@@ -0,0 +1,122 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.dialogs;
+
+import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
+import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Dialog for initialization of Part (Property) type (the type is either selected or created).
+ */
+public class CreateOrSelectConstraintPropertyTypeDialog extends CreateOrSelectTypeDialog {
+
+ /** Constructor */
+ public CreateOrSelectConstraintPropertyTypeDialog(Shell shell, NamedElement owner) {
+ super(shell, owner, SysMLElementTypes.CONSTRAINT_BLOCK, UMLPackage.eINSTANCE.getTypedElement_Type(), ConstraintsPackage.eINSTANCE.getConstraintBlock(), UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getDialogTitle() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_DialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionTitle() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_SelectionSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionRadioLabel() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_SelectionSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionTitle() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_CreationSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionRadioLabel() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_CreationSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeNameLabel() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_NewTypeNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerNameLabel() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_NewTypeContainerNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogTitle() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_SelectNewTypeContainerDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogMessage() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_SelectNewTypeContainerDialogMessage;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogTitle() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_SelectTypeDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogMessage() {
+ return Messages.CreateOrSelectConstraintPropertyTypeDialog_SelectTypeDialogMessage;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectNonAtomicFlowPortTypeDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectNonAtomicFlowPortTypeDialog.java
index d0651d2fb05..6976905cf7f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectNonAtomicFlowPortTypeDialog.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectNonAtomicFlowPortTypeDialog.java
@@ -1,121 +1,121 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.dialogs;
-
-import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Dialog for initialization of non atomic FlowPort type (the type is a FlowSpecification either selected or created).
- */
-public class CreateOrSelectNonAtomicFlowPortTypeDialog extends CreateOrSelectTypeDialog {
-
- /** Constructor */
- public CreateOrSelectNonAtomicFlowPortTypeDialog(Shell shell, NamedElement owner) {
- super(shell, owner, SysMLElementTypes.FLOW_SPECIFICATION, UMLPackage.eINSTANCE.getTypedElement_Type(), PortandflowsPackage.eINSTANCE.getFlowSpecification(), UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getDialogTitle() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_DialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getSelectionSectionTitle() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectionSectionTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getSelectionSectionRadioLabel() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectionSectionRadioLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getCreationSectionTitle() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_CreationSectionTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getCreationSectionRadioLabel() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_CreationSectionRadioLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeNameLabel() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_NewTypeNameLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerNameLabel() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_NewTypeContainerNameLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerDialogTitle() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectNewTypeContainerDialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerDialogMessage() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectNewTypeContainerDialogMessage;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getTypeDialogTitle() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectTypeDialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getTypeDialogMessage() {
- return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectTypeDialogMessage;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.dialogs;
+
+import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Dialog for initialization of non atomic FlowPort type (the type is a FlowSpecification either selected or created).
+ */
+public class CreateOrSelectNonAtomicFlowPortTypeDialog extends CreateOrSelectTypeDialog {
+
+ /** Constructor */
+ public CreateOrSelectNonAtomicFlowPortTypeDialog(Shell shell, NamedElement owner) {
+ super(shell, owner, SysMLElementTypes.FLOW_SPECIFICATION, UMLPackage.eINSTANCE.getTypedElement_Type(), PortandflowsPackage.eINSTANCE.getFlowSpecification(), UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getDialogTitle() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_DialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionTitle() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectionSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionRadioLabel() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectionSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionTitle() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_CreationSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionRadioLabel() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_CreationSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeNameLabel() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_NewTypeNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerNameLabel() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_NewTypeContainerNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogTitle() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectNewTypeContainerDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogMessage() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectNewTypeContainerDialogMessage;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogTitle() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectTypeDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogMessage() {
+ return Messages.CreateOrSelectNonAtomicFlowPortTypeDialog_SelectTypeDialogMessage;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectTypeDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectTypeDialog.java
index e19ab0e7724..2b1e9e15ef0 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectTypeDialog.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectTypeDialog.java
@@ -1,605 +1,605 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- * CEA LIST - Class Adaptation in SysML context, Content and Label provider replacement.
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.dialogs;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-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.ISpecializationType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.infra.services.edit.commands.ConfigureFeatureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-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.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-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.Namespace;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Dialog for initialization of Property type (the type is either selected or created).
- */
-public class CreateOrSelectTypeDialog extends FormDialog {
-
- protected Button creationRadio;
-
- protected Button selectionRadio;
-
- protected Text newTypeNameText;
-
- protected Text newTypeContainerNameText;
-
- protected Button newTypeContainerButton;
-
- protected String newTypeName = null;
-
- protected ICommand newTypeCreateCommand = null;
-
- protected EObject newTypeContainer = null;
-
- protected Text existingTypeNameText;
-
- protected Button existingTypeButton;
-
- protected EObject existingType = null;
-
- protected EObject defaultContainer;
-
- protected ILabelProvider labelProvider;
-
- protected IElementType elementType;
-
- protected EStructuralFeature editedFeature;
-
- protected EClass elementEClass;
-
- protected IElementType containerType;
-
- protected EStructuralFeature containerFeature;
-
- protected EClass containerEClass;
-
- /**
- * Create a new dialog to initialize an ActivityParameterNode.
- *
- * @param shell
- * parent shell
- * @param owner
- * the activity that owns the action
- */
- public CreateOrSelectTypeDialog(Shell shell, EObject defaultContainer, IElementType elementType, EStructuralFeature editedFeature, EClass elementEClass, IElementType containerType, EStructuralFeature containerFeature, EClass containerEClass) {
- super(shell);
- this.defaultContainer = defaultContainer;
- this.elementType = elementType;
- this.editedFeature = editedFeature;
- this.elementEClass = elementEClass;
- this.containerType = containerType;
- this.containerFeature = containerFeature;
- this.containerEClass = containerEClass;
- this.labelProvider = new UMLLabelProvider();
- }
-
- protected String getDialogTitle() {
- return Messages.CreateOrSelectTypeDialog_DialogTitle;
- }
-
- protected String getSelectionSectionTitle() {
- return Messages.CreateOrSelectTypeDialog_SelectionSectionTitle;
- }
-
- protected String getSelectionSectionRadioLabel() {
- return Messages.CreateOrSelectTypeDialog_SelectionSectionRadioLabel;
- }
-
- protected String getCreationSectionTitle() {
- return Messages.CreateOrSelectTypeDialog_CreationSectionTitle;
- }
-
- protected String getCreationSectionRadioLabel() {
- return Messages.CreateOrSelectTypeDialog_CreationSectionRadioLabel;
- }
-
- protected String getNewTypeNameLabel() {
- return Messages.CreateOrSelectTypeDialog_NewTypeNameLabel;
- }
-
- protected String getNewTypeContainerNameLabel() {
- return Messages.CreateOrSelectTypeDialog_NewTypeContainerNameLabel;
- }
-
- protected String getNewTypeContainerDialogTitle() {
- return Messages.CreateOrSelectTypeDialog_SelectNewTypeContainerDialogTitle;
- }
-
- protected String getNewTypeContainerDialogMessage() {
- return Messages.CreateOrSelectTypeDialog_SelectNewTypeContainerDialogMessage;
- }
-
- protected String getTypeDialogTitle() {
- return Messages.CreateOrSelectTypeDialog_SelectTypeDialogTitle;
- }
-
- protected String getTypeDialogMessage() {
- return Messages.CreateOrSelectTypeDialog_SelectTypeDialogMessage;
- }
-
- /**
- * Create the form to :
- *
- * - ask the user to choose or create an existing element.
- *
- * @see org.eclipse.ui.forms.FormDialog#createFormContent(org.eclipse.ui.forms.IManagedForm)
- */
- @Override
- protected void createFormContent(IManagedForm pForm) {
- pForm.getForm().setText(getDialogTitle());
- ScrolledForm scrolledForm = pForm.getForm();
- FormToolkit toolkit = pForm.getToolkit();
- Composite parent = scrolledForm.getBody();
- parent.setLayout(new GridLayout());
-
- createFormCreationSection(scrolledForm.getBody(), toolkit);
- createFormSelectionSection(scrolledForm.getBody(), toolkit);
-
- refreshSectionsEnable(false);
- hookListeners();
- // invoked name is set after listeners, since we count on listener to update it properly
- setNewTypeContainer(defaultContainer);
- setNewTypeName(null);
-
- scrolledForm.reflow(true);
- }
-
- /**
- * Adds buttons to this dialog's button bar.
- *
- * @param parent
- * the button bar composite
- */
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- refreshOkButton();
- }
-
- /**
- * Create the section to ask the user to choose an existing element.
- *
- * @param pParent
- * the section's parent widget
- * @param pToolkit
- * the form toolkit
- */
- protected void createFormSelectionSection(Composite pParent, FormToolkit pToolkit) {
- // create the section
- String lSectionTitle = getSelectionSectionTitle();
- Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
- lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- 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, getSelectionSectionRadioLabel(), SWT.RADIO);
- selectionRadio.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
-
- // manage elementType selection
- pToolkit.createLabel(lBody, elementType.getDisplayName(), SWT.NONE);
- existingTypeNameText = pToolkit.createText(lBody, "", SWT.BORDER | SWT.READ_ONLY);
- existingTypeNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- existingTypeButton = pToolkit.createButton(lBody, "...", SWT.FLAT);
-
- Image image = Activator.getInstance().getImage(elementType.getEClass());
- if(elementEClass != null) {
- image = Activator.getInstance().getImage(elementEClass);
- }
-
- existingTypeButton.setImage(image);
- existingTypeButton.setLayoutData(new GridData(SWT.NONE));
-
- lInsideScrolledForm.reflow(true);
- lSection.setClient(lInsideScrolledForm);
- }
-
- /**
- * Create the section to ask the user to create an invoked element.
- *
- * @param pParent
- * the section's parent widget
- * @param pToolkit
- * the form toolkit
- */
- protected void createFormCreationSection(Composite pParent, FormToolkit pToolkit) {
- // create the section
- String lSectionTitle = getCreationSectionTitle();
- Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
- lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- 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, getCreationSectionRadioLabel(), SWT.RADIO);
- creationRadio.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
-
- pToolkit.createLabel(lBody, getNewTypeNameLabel(), SWT.NONE);
- newTypeNameText = pToolkit.createText(lBody, "", SWT.BORDER);
- newTypeNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- newTypeNameText.setFocus();
-
- // manage type selection
- pToolkit.createLabel(lBody, getNewTypeContainerNameLabel(), SWT.NONE);
- newTypeContainerNameText = pToolkit.createText(lBody, labelProvider.getText(newTypeContainer), SWT.BORDER | SWT.READ_ONLY);
- newTypeContainerNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- newTypeContainerButton = pToolkit.createButton(lBody, "...", SWT.FLAT);
- Image image = Activator.getInstance().getImage(containerType.getEClass());
- if(containerEClass != null) {
- image = Activator.getInstance().getImage(containerEClass);
- }
- newTypeContainerButton.setImage(image);
- newTypeContainerButton.setLayoutData(new GridData(SWT.NONE));
-
- lInsideScrolledForm.reflow(true);
- lSection.setClient(lInsideScrolledForm);
- }
-
-
- @Override
- protected void okPressed() {
-
- // Build type creation command if needed
- boolean isSelectionMode = selectionRadio.getSelection();
- if(!isSelectionMode) {
- // Creation mode - Prepare type creation command and set existing type to null.
- existingType = null;
- buildNewTypeCreateCommand();
-
- } else {
- // Selection mode - Set the type creation command to null.
- newTypeCreateCommand = null;
- }
-
- super.okPressed();
- }
-
- protected void buildNewTypeCreateCommand() {
- // The new element is expected to be a NamedElement.
- IElementEditService commandService = ElementEditServiceUtils.getCommandProvider(newTypeContainer);
- if(commandService != null) {
- CreateElementRequest createTypeRequest = new CreateElementRequest(newTypeContainer, elementType);
- createTypeRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getNamedElement_Name(), newTypeNameText.getText()));
- newTypeCreateCommand = commandService.getEditCommand(createTypeRequest);
- }
- }
-
- public ICommand getNewTypeCreateCommand() {
- return newTypeCreateCommand;
- }
-
- public String getNewTypeName() {
- return newTypeNameText.getText();
- }
-
- public EObject getExistingType() {
- return existingType;
- }
-
- /**
- * Add listeners to widgets
- */
- protected 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) {
- handleChooseType();
- refreshOkButton();
- }
- };
- existingTypeButton.addSelectionListener(selectBtnListener);
-
- // listener to existing element name
- ModifyListener lNameListener = new ModifyListener() {
-
- /**
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- setNewTypeName(existingTypeNameText.getText());
- }
- };
- existingTypeNameText.addModifyListener(lNameListener);
-
- // listener to select new element type container
- SelectionListener selectTypeBtnListener = new SelectionAdapter() {
-
- /**
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- handleChooseNewTypeContainer();
- // reset name if not set
- if(newTypeName == null) {
- setNewTypeName(null);
- }
- refreshOkButton();
- }
- };
- newTypeContainerButton.addSelectionListener(selectTypeBtnListener);
-
- // listener to new element name
- ModifyListener lNewNameListener = new ModifyListener() {
-
- /**
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- validateNewTypeName();
- refreshOkButton();
- }
- };
- newTypeNameText.addModifyListener(lNewNameListener);
- }
-
- /**
- * Set the name of the new type
- *
- * @param text
- * the text string or null for auto-initialization
- */
- protected void setNewTypeName(String text) {
- String name = text;
- if(text == null) {
- name = NamedElementUtil.getDefaultNameWithIncrementFromBase(elementType.getEClass().getName(), newTypeContainer.eContents());
- if(elementEClass != null) {
- name = NamedElementUtil.getDefaultNameWithIncrementFromBase(elementEClass.getName(), newTypeContainer.eContents());
- }
- newTypeNameText.setText(name);
-
- } else {
- newTypeNameText.setText(name);
- newTypeName = name;
- }
-
- validateNewTypeName();
- refreshOkButton();
- }
-
- protected void validateNewTypeName() {
- if(isValidName(newTypeContainer, newTypeNameText.getText())) {
- Color black = newTypeNameText.getDisplay().getSystemColor(SWT.COLOR_BLACK);
- newTypeNameText.setForeground(black);
-
- } else {
- Color red = newTypeNameText.getDisplay().getSystemColor(SWT.COLOR_RED);
- newTypeNameText.setForeground(red);
- }
- }
-
- protected boolean isValidName(EObject container, String newName) {
- boolean isValid = true;
- if(container instanceof Namespace) {
- if(((Namespace)container).getOwnedMember(newName) != null) {
- isValid = false;
- }
- }
-
- return isValid;
- }
-
- /** Open the dialog to choose an existing type */
- protected void handleChooseType() {
-
- TreeSelectorDialog dialog = new TreeSelectorDialog(getShell());
-
- dialog.setMessage(getTypeDialogMessage());
- dialog.setTitle(getTypeDialogTitle());
- dialog.setInput(EcoreUtil.getRootContainer(defaultContainer));
-
- ServiceEditContentProvider provider = new ServiceEditContentProvider(elementType, editedFeature, EcoreUtil.getRootContainer(defaultContainer));
- dialog.setContentProvider(provider);
- dialog.setLabelProvider(labelProvider);
-
- if(dialog.open() == Window.OK) {
- Object result = dialog.getResult()[0];
- if(result instanceof IAdaptable) {
- result = ((IAdaptable)result).getAdapter(EObject.class);
- }
-
- if(result instanceof EObject) {
- setExistingTypeSelection((EObject)result);
- } else {
- setExistingTypeSelection(null);
- }
- }
- }
-
- /**
- * Set the existing type selected (if selection mode is chosen)
- *
- * @param invokedElement
- * the selected element
- */
- protected void setExistingTypeSelection(EObject type) {
- if(type == null) {
- existingTypeNameText.setText("");
- } else {
- existingType = type;
- existingTypeNameText.setText(labelProvider.getText(existingType));
- }
- }
-
- /** Open the dialog to choose new type container */
- protected void handleChooseNewTypeContainer() {
-
- TreeSelectorDialog dialog = new TreeSelectorDialog(getShell());
-
- dialog.setMessage(getNewTypeContainerDialogMessage());
- dialog.setTitle(getNewTypeContainerDialogTitle());
- dialog.setInput(EcoreUtil.getRootContainer(defaultContainer));
-
- ServiceEditContentProvider provider = new ServiceEditContentProvider(containerType, containerFeature, EcoreUtil.getRootContainer(defaultContainer));
- dialog.setContentProvider(provider);
- dialog.setLabelProvider(labelProvider);
-
- if(dialog.open() == Window.OK) {
- Object result = dialog.getResult()[0];
- if(result instanceof IAdaptable) {
- result = ((IAdaptable)result).getAdapter(EObject.class);
- }
-
- if(result instanceof EObject) {
- setNewTypeContainer((EObject)result);
- } else {
- setNewTypeContainer(null);
- }
- }
- }
-
- /**
- * Define the type of the object that will be created (if creation mode is chosen)
- *
- * @param the
- * selected parent
- */
- protected void setNewTypeContainer(EObject container) {
-
- if((containerType instanceof ISpecializationType) && ((ISpecializationType)containerType).getMatcher().matches(container)) {
- newTypeContainer = container;
- newTypeContainerNameText.setText(labelProvider.getText(newTypeContainer));
-
- } else if(containerType.getEClass().isInstance(container)) {
- newTypeContainer = container;
- newTypeContainerNameText.setText(labelProvider.getText(newTypeContainer));
-
- } else {
- newTypeContainer = null;
- newTypeContainerNameText.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);
- if(!selectionRadio.getSelection()) {
- selectionRadio.setSelection(true);
- }
- } else {
- selectionRadio.setSelection(false);
- if(!creationRadio.getSelection()) {
- creationRadio.setSelection(true);
- }
- }
- // handle disabled section
- existingTypeNameText.setEnabled(isSelectionSelected);
- existingTypeButton.setEnabled(isSelectionSelected);
- newTypeNameText.setEnabled(!isSelectionSelected);
- newTypeNameText.setFocus();
- newTypeContainerNameText.setEnabled(!isSelectionSelected);
- newTypeContainerButton.setEnabled(!isSelectionSelected);
- }
-
-
- /** Refresh the OK button activation */
- protected void refreshOkButton() {
- boolean isSelectionSelected = selectionRadio.getSelection();
- if(getButton(IDialogConstants.OK_ID) != null && !getButton(IDialogConstants.OK_ID).isDisposed()) {
- if(isSelectionSelected) {
- getButton(IDialogConstants.OK_ID).setEnabled(existingType != null);
- } else {
- getButton(IDialogConstants.OK_ID).setEnabled((newTypeContainer != null) && (isValidName(newTypeContainer, newTypeNameText.getText())));
- }
- }
- }
-}
+/*****************************************************************************
+ * 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:
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
+ *
+ * CEA LIST - Class Adaptation in SysML context, Content and Label provider replacement.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.dialogs;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+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.ISpecializationType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.infra.services.edit.commands.ConfigureFeatureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.infra.widgets.editors.TreeSelectorDialog;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+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.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+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.Namespace;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Dialog for initialization of Property type (the type is either selected or created).
+ */
+public class CreateOrSelectTypeDialog extends FormDialog {
+
+ protected Button creationRadio;
+
+ protected Button selectionRadio;
+
+ protected Text newTypeNameText;
+
+ protected Text newTypeContainerNameText;
+
+ protected Button newTypeContainerButton;
+
+ protected String newTypeName = null;
+
+ protected ICommand newTypeCreateCommand = null;
+
+ protected EObject newTypeContainer = null;
+
+ protected Text existingTypeNameText;
+
+ protected Button existingTypeButton;
+
+ protected EObject existingType = null;
+
+ protected EObject defaultContainer;
+
+ protected ILabelProvider labelProvider;
+
+ protected IElementType elementType;
+
+ protected EStructuralFeature editedFeature;
+
+ protected EClass elementEClass;
+
+ protected IElementType containerType;
+
+ protected EStructuralFeature containerFeature;
+
+ protected EClass containerEClass;
+
+ /**
+ * Create a new dialog to initialize an ActivityParameterNode.
+ *
+ * @param shell
+ * parent shell
+ * @param owner
+ * the activity that owns the action
+ */
+ public CreateOrSelectTypeDialog(Shell shell, EObject defaultContainer, IElementType elementType, EStructuralFeature editedFeature, EClass elementEClass, IElementType containerType, EStructuralFeature containerFeature, EClass containerEClass) {
+ super(shell);
+ this.defaultContainer = defaultContainer;
+ this.elementType = elementType;
+ this.editedFeature = editedFeature;
+ this.elementEClass = elementEClass;
+ this.containerType = containerType;
+ this.containerFeature = containerFeature;
+ this.containerEClass = containerEClass;
+ this.labelProvider = new UMLLabelProvider();
+ }
+
+ protected String getDialogTitle() {
+ return Messages.CreateOrSelectTypeDialog_DialogTitle;
+ }
+
+ protected String getSelectionSectionTitle() {
+ return Messages.CreateOrSelectTypeDialog_SelectionSectionTitle;
+ }
+
+ protected String getSelectionSectionRadioLabel() {
+ return Messages.CreateOrSelectTypeDialog_SelectionSectionRadioLabel;
+ }
+
+ protected String getCreationSectionTitle() {
+ return Messages.CreateOrSelectTypeDialog_CreationSectionTitle;
+ }
+
+ protected String getCreationSectionRadioLabel() {
+ return Messages.CreateOrSelectTypeDialog_CreationSectionRadioLabel;
+ }
+
+ protected String getNewTypeNameLabel() {
+ return Messages.CreateOrSelectTypeDialog_NewTypeNameLabel;
+ }
+
+ protected String getNewTypeContainerNameLabel() {
+ return Messages.CreateOrSelectTypeDialog_NewTypeContainerNameLabel;
+ }
+
+ protected String getNewTypeContainerDialogTitle() {
+ return Messages.CreateOrSelectTypeDialog_SelectNewTypeContainerDialogTitle;
+ }
+
+ protected String getNewTypeContainerDialogMessage() {
+ return Messages.CreateOrSelectTypeDialog_SelectNewTypeContainerDialogMessage;
+ }
+
+ protected String getTypeDialogTitle() {
+ return Messages.CreateOrSelectTypeDialog_SelectTypeDialogTitle;
+ }
+
+ protected String getTypeDialogMessage() {
+ return Messages.CreateOrSelectTypeDialog_SelectTypeDialogMessage;
+ }
+
+ /**
+ * Create the form to :
+ *
+ * - ask the user to choose or create an existing element.
+ *
+ * @see org.eclipse.ui.forms.FormDialog#createFormContent(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
+ protected void createFormContent(IManagedForm pForm) {
+ pForm.getForm().setText(getDialogTitle());
+ ScrolledForm scrolledForm = pForm.getForm();
+ FormToolkit toolkit = pForm.getToolkit();
+ Composite parent = scrolledForm.getBody();
+ parent.setLayout(new GridLayout());
+
+ createFormCreationSection(scrolledForm.getBody(), toolkit);
+ createFormSelectionSection(scrolledForm.getBody(), toolkit);
+
+ refreshSectionsEnable(false);
+ hookListeners();
+ // invoked name is set after listeners, since we count on listener to update it properly
+ setNewTypeContainer(defaultContainer);
+ setNewTypeName(null);
+
+ scrolledForm.reflow(true);
+ }
+
+ /**
+ * Adds buttons to this dialog's button bar.
+ *
+ * @param parent
+ * the button bar composite
+ */
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ super.createButtonsForButtonBar(parent);
+ refreshOkButton();
+ }
+
+ /**
+ * Create the section to ask the user to choose an existing element.
+ *
+ * @param pParent
+ * the section's parent widget
+ * @param pToolkit
+ * the form toolkit
+ */
+ protected void createFormSelectionSection(Composite pParent, FormToolkit pToolkit) {
+ // create the section
+ String lSectionTitle = getSelectionSectionTitle();
+ Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ 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, getSelectionSectionRadioLabel(), SWT.RADIO);
+ selectionRadio.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+
+ // manage elementType selection
+ pToolkit.createLabel(lBody, elementType.getDisplayName(), SWT.NONE);
+ existingTypeNameText = pToolkit.createText(lBody, "", SWT.BORDER | SWT.READ_ONLY);
+ existingTypeNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ existingTypeButton = pToolkit.createButton(lBody, "...", SWT.FLAT);
+
+ Image image = Activator.getInstance().getImage(elementType.getEClass());
+ if(elementEClass != null) {
+ image = Activator.getInstance().getImage(elementEClass);
+ }
+
+ existingTypeButton.setImage(image);
+ existingTypeButton.setLayoutData(new GridData(SWT.NONE));
+
+ lInsideScrolledForm.reflow(true);
+ lSection.setClient(lInsideScrolledForm);
+ }
+
+ /**
+ * Create the section to ask the user to create an invoked element.
+ *
+ * @param pParent
+ * the section's parent widget
+ * @param pToolkit
+ * the form toolkit
+ */
+ protected void createFormCreationSection(Composite pParent, FormToolkit pToolkit) {
+ // create the section
+ String lSectionTitle = getCreationSectionTitle();
+ Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ 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, getCreationSectionRadioLabel(), SWT.RADIO);
+ creationRadio.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+
+ pToolkit.createLabel(lBody, getNewTypeNameLabel(), SWT.NONE);
+ newTypeNameText = pToolkit.createText(lBody, "", SWT.BORDER);
+ newTypeNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ newTypeNameText.setFocus();
+
+ // manage type selection
+ pToolkit.createLabel(lBody, getNewTypeContainerNameLabel(), SWT.NONE);
+ newTypeContainerNameText = pToolkit.createText(lBody, labelProvider.getText(newTypeContainer), SWT.BORDER | SWT.READ_ONLY);
+ newTypeContainerNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ newTypeContainerButton = pToolkit.createButton(lBody, "...", SWT.FLAT);
+ Image image = Activator.getInstance().getImage(containerType.getEClass());
+ if(containerEClass != null) {
+ image = Activator.getInstance().getImage(containerEClass);
+ }
+ newTypeContainerButton.setImage(image);
+ newTypeContainerButton.setLayoutData(new GridData(SWT.NONE));
+
+ lInsideScrolledForm.reflow(true);
+ lSection.setClient(lInsideScrolledForm);
+ }
+
+
+ @Override
+ protected void okPressed() {
+
+ // Build type creation command if needed
+ boolean isSelectionMode = selectionRadio.getSelection();
+ if(!isSelectionMode) {
+ // Creation mode - Prepare type creation command and set existing type to null.
+ existingType = null;
+ buildNewTypeCreateCommand();
+
+ } else {
+ // Selection mode - Set the type creation command to null.
+ newTypeCreateCommand = null;
+ }
+
+ super.okPressed();
+ }
+
+ protected void buildNewTypeCreateCommand() {
+ // The new element is expected to be a NamedElement.
+ IElementEditService commandService = ElementEditServiceUtils.getCommandProvider(newTypeContainer);
+ if(commandService != null) {
+ CreateElementRequest createTypeRequest = new CreateElementRequest(newTypeContainer, elementType);
+ createTypeRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getNamedElement_Name(), newTypeNameText.getText()));
+ newTypeCreateCommand = commandService.getEditCommand(createTypeRequest);
+ }
+ }
+
+ public ICommand getNewTypeCreateCommand() {
+ return newTypeCreateCommand;
+ }
+
+ public String getNewTypeName() {
+ return newTypeNameText.getText();
+ }
+
+ public EObject getExistingType() {
+ return existingType;
+ }
+
+ /**
+ * Add listeners to widgets
+ */
+ protected 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) {
+ handleChooseType();
+ refreshOkButton();
+ }
+ };
+ existingTypeButton.addSelectionListener(selectBtnListener);
+
+ // listener to existing element name
+ ModifyListener lNameListener = new ModifyListener() {
+
+ /**
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ public void modifyText(ModifyEvent e) {
+ setNewTypeName(existingTypeNameText.getText());
+ }
+ };
+ existingTypeNameText.addModifyListener(lNameListener);
+
+ // listener to select new element type container
+ SelectionListener selectTypeBtnListener = new SelectionAdapter() {
+
+ /**
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleChooseNewTypeContainer();
+ // reset name if not set
+ if(newTypeName == null) {
+ setNewTypeName(null);
+ }
+ refreshOkButton();
+ }
+ };
+ newTypeContainerButton.addSelectionListener(selectTypeBtnListener);
+
+ // listener to new element name
+ ModifyListener lNewNameListener = new ModifyListener() {
+
+ /**
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ public void modifyText(ModifyEvent e) {
+ validateNewTypeName();
+ refreshOkButton();
+ }
+ };
+ newTypeNameText.addModifyListener(lNewNameListener);
+ }
+
+ /**
+ * Set the name of the new type
+ *
+ * @param text
+ * the text string or null for auto-initialization
+ */
+ protected void setNewTypeName(String text) {
+ String name = text;
+ if(text == null) {
+ name = NamedElementUtil.getDefaultNameWithIncrementFromBase(elementType.getEClass().getName(), newTypeContainer.eContents());
+ if(elementEClass != null) {
+ name = NamedElementUtil.getDefaultNameWithIncrementFromBase(elementEClass.getName(), newTypeContainer.eContents());
+ }
+ newTypeNameText.setText(name);
+
+ } else {
+ newTypeNameText.setText(name);
+ newTypeName = name;
+ }
+
+ validateNewTypeName();
+ refreshOkButton();
+ }
+
+ protected void validateNewTypeName() {
+ if(isValidName(newTypeContainer, newTypeNameText.getText())) {
+ Color black = newTypeNameText.getDisplay().getSystemColor(SWT.COLOR_BLACK);
+ newTypeNameText.setForeground(black);
+
+ } else {
+ Color red = newTypeNameText.getDisplay().getSystemColor(SWT.COLOR_RED);
+ newTypeNameText.setForeground(red);
+ }
+ }
+
+ protected boolean isValidName(EObject container, String newName) {
+ boolean isValid = true;
+ if(container instanceof Namespace) {
+ if(((Namespace)container).getOwnedMember(newName) != null) {
+ isValid = false;
+ }
+ }
+
+ return isValid;
+ }
+
+ /** Open the dialog to choose an existing type */
+ protected void handleChooseType() {
+
+ TreeSelectorDialog dialog = new TreeSelectorDialog(getShell());
+
+ dialog.setMessage(getTypeDialogMessage());
+ dialog.setTitle(getTypeDialogTitle());
+ dialog.setInput(EcoreUtil.getRootContainer(defaultContainer));
+
+ ServiceEditContentProvider provider = new ServiceEditContentProvider(elementType, editedFeature, EcoreUtil.getRootContainer(defaultContainer));
+ dialog.setContentProvider(provider);
+ dialog.setLabelProvider(labelProvider);
+
+ if(dialog.open() == Window.OK) {
+ Object result = dialog.getResult()[0];
+ if(result instanceof IAdaptable) {
+ result = ((IAdaptable)result).getAdapter(EObject.class);
+ }
+
+ if(result instanceof EObject) {
+ setExistingTypeSelection((EObject)result);
+ } else {
+ setExistingTypeSelection(null);
+ }
+ }
+ }
+
+ /**
+ * Set the existing type selected (if selection mode is chosen)
+ *
+ * @param invokedElement
+ * the selected element
+ */
+ protected void setExistingTypeSelection(EObject type) {
+ if(type == null) {
+ existingTypeNameText.setText("");
+ } else {
+ existingType = type;
+ existingTypeNameText.setText(labelProvider.getText(existingType));
+ }
+ }
+
+ /** Open the dialog to choose new type container */
+ protected void handleChooseNewTypeContainer() {
+
+ TreeSelectorDialog dialog = new TreeSelectorDialog(getShell());
+
+ dialog.setMessage(getNewTypeContainerDialogMessage());
+ dialog.setTitle(getNewTypeContainerDialogTitle());
+ dialog.setInput(EcoreUtil.getRootContainer(defaultContainer));
+
+ ServiceEditContentProvider provider = new ServiceEditContentProvider(containerType, containerFeature, EcoreUtil.getRootContainer(defaultContainer));
+ dialog.setContentProvider(provider);
+ dialog.setLabelProvider(labelProvider);
+
+ if(dialog.open() == Window.OK) {
+ Object result = dialog.getResult()[0];
+ if(result instanceof IAdaptable) {
+ result = ((IAdaptable)result).getAdapter(EObject.class);
+ }
+
+ if(result instanceof EObject) {
+ setNewTypeContainer((EObject)result);
+ } else {
+ setNewTypeContainer(null);
+ }
+ }
+ }
+
+ /**
+ * Define the type of the object that will be created (if creation mode is chosen)
+ *
+ * @param the
+ * selected parent
+ */
+ protected void setNewTypeContainer(EObject container) {
+
+ if((containerType instanceof ISpecializationType) && ((ISpecializationType)containerType).getMatcher().matches(container)) {
+ newTypeContainer = container;
+ newTypeContainerNameText.setText(labelProvider.getText(newTypeContainer));
+
+ } else if(containerType.getEClass().isInstance(container)) {
+ newTypeContainer = container;
+ newTypeContainerNameText.setText(labelProvider.getText(newTypeContainer));
+
+ } else {
+ newTypeContainer = null;
+ newTypeContainerNameText.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);
+ if(!selectionRadio.getSelection()) {
+ selectionRadio.setSelection(true);
+ }
+ } else {
+ selectionRadio.setSelection(false);
+ if(!creationRadio.getSelection()) {
+ creationRadio.setSelection(true);
+ }
+ }
+ // handle disabled section
+ existingTypeNameText.setEnabled(isSelectionSelected);
+ existingTypeButton.setEnabled(isSelectionSelected);
+ newTypeNameText.setEnabled(!isSelectionSelected);
+ newTypeNameText.setFocus();
+ newTypeContainerNameText.setEnabled(!isSelectionSelected);
+ newTypeContainerButton.setEnabled(!isSelectionSelected);
+ }
+
+
+ /** Refresh the OK button activation */
+ protected void refreshOkButton() {
+ boolean isSelectionSelected = selectionRadio.getSelection();
+ if(getButton(IDialogConstants.OK_ID) != null && !getButton(IDialogConstants.OK_ID).isDisposed()) {
+ if(isSelectionSelected) {
+ getButton(IDialogConstants.OK_ID).setEnabled(existingType != null);
+ } else {
+ getButton(IDialogConstants.OK_ID).setEnabled((newTypeContainer != null) && (isValidName(newTypeContainer, newTypeNameText.getText())));
+ }
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectValuePropertyTypeDialog.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectValuePropertyTypeDialog.java
index 5929dce3207..de014aa97a1 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectValuePropertyTypeDialog.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/CreateOrSelectValuePropertyTypeDialog.java
@@ -1,284 +1,284 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.dialogs;
-
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.gmf.diagram.common.provider.ElementTypeLabelProvider;
-import org.eclipse.papyrus.infra.services.edit.commands.ConfigureFeatureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-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.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Dialog for initialization of Value (Property) type (the type is either selected or created).
- */
-public class CreateOrSelectValuePropertyTypeDialog extends CreateOrSelectTypeDialog {
-
- protected ComboViewer newTypeKindComboViewer = null;
-
- protected Combo newTypeKindCombo = null;
-
- protected IElementType[] valueTypeKind = { UMLElementTypes.DATA_TYPE, SysMLElementTypes.VALUE_TYPE, UMLElementTypes.PRIMITIVE_TYPE, UMLElementTypes.ENUMERATION };
-
- protected IElementType newTypeKind = UMLElementTypes.DATA_TYPE;
-
- /** Constructor */
- public CreateOrSelectValuePropertyTypeDialog(Shell shell, NamedElement owner) {
- super(shell, owner, UMLElementTypes.DATA_TYPE, UMLPackage.eINSTANCE.getTypedElement_Type(), null, UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createFormCreationSection(Composite pParent, FormToolkit pToolkit) {
- // create the section
- String lSectionTitle = getCreationSectionTitle();
- Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
- lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- 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, getCreationSectionRadioLabel(), SWT.RADIO);
- creationRadio.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
-
- pToolkit.createLabel(lBody, getNewTypeNameLabel(), SWT.NONE);
- newTypeNameText = pToolkit.createText(lBody, "", SWT.BORDER);
- newTypeNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- newTypeNameText.setFocus();
-
- // manage type selection
- pToolkit.createLabel(lBody, getNewTypeContainerNameLabel(), SWT.NONE);
- newTypeContainerNameText = pToolkit.createText(lBody, labelProvider.getText(newTypeContainer), SWT.BORDER | SWT.READ_ONLY);
- newTypeContainerNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- newTypeContainerButton = pToolkit.createButton(lBody, "...", SWT.FLAT);
- Image image = Activator.getInstance().getImage(containerType.getEClass());
- if(containerEClass != null) {
- image = Activator.getInstance().getImage(containerEClass);
- }
- newTypeContainerButton.setImage(image);
- newTypeContainerButton.setLayoutData(new GridData(SWT.NONE));
-
- pToolkit.createLabel(lBody, getNewTypeKindLabel(), SWT.NONE);
- newTypeKindCombo = new Combo(lBody, SWT.DROP_DOWN | SWT.READ_ONLY);
- newTypeKindComboViewer = new ComboViewer(newTypeKindCombo);
- pToolkit.adapt(newTypeKindCombo);
- newTypeKindCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- newTypeKindComboViewer.setLabelProvider(new ElementTypeLabelProvider());
- newTypeKindComboViewer.add(valueTypeKind);
- newTypeKindComboViewer.setSelection(new StructuredSelection(valueTypeKind[0]));
-
- lInsideScrolledForm.reflow(true);
- lSection.setClient(lInsideScrolledForm);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void buildNewTypeCreateCommand() {
- // The new element is expected to be a NamedElement.
- IElementEditService commandService = ElementEditServiceUtils.getCommandProvider(newTypeContainer);
- if(commandService != null) {
- CreateElementRequest createTypeRequest = new CreateElementRequest(newTypeContainer, newTypeKind);
- createTypeRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getNamedElement_Name(), newTypeNameText.getText()));
- newTypeCreateCommand = commandService.getEditCommand(createTypeRequest);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void hookListeners() {
- super.hookListeners();
-
- // listener to select invocation type
- ModifyListener newTypeKindListener = new ModifyListener() {
-
- /**
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- ISelection sel = newTypeKindComboViewer.getSelection();
- if(sel instanceof StructuredSelection) {
- Object type = ((StructuredSelection)sel).getFirstElement();
- if(type instanceof IElementType) {
- newTypeKind = (IElementType)type;
- } else {
- newTypeKind = null;
- }
-
- // reset name
- setNewTypeName(null);
- }
- }
- };
- newTypeKindCombo.addModifyListener(newTypeKindListener);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void setNewTypeName(String text) {
- String name = text;
- if(text == null) {
- name = NamedElementUtil.getDefaultNameWithIncrementFromBase(newTypeKind.getEClass().getName(), newTypeContainer.eContents());
- if(newTypeKind == SysMLElementTypes.VALUE_TYPE) {
- name = NamedElementUtil.getDefaultNameWithIncrementFromBase(BlocksPackage.eINSTANCE.getValueType().getName(), newTypeContainer.eContents());
- }
- newTypeNameText.setText(name);
-
- } else {
- newTypeNameText.setText(name);
- newTypeName = name;
- }
-
- validateNewTypeName();
- refreshOkButton();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getDialogTitle() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_DialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getSelectionSectionTitle() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_SelectionSectionTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getSelectionSectionRadioLabel() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_SelectionSectionRadioLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getCreationSectionTitle() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_CreationSectionTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getCreationSectionRadioLabel() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_CreationSectionRadioLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeNameLabel() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_NewTypeNameLabel;
- }
-
- /**
- * Get the newTypeKind label.
- *
- * @return the label
- */
- protected String getNewTypeKindLabel() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_NewTypeKindLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerNameLabel() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_NewTypeContainerNameLabel;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerDialogTitle() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_SelectNewTypeContainerDialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getNewTypeContainerDialogMessage() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_SelectNewTypeContainerDialogMessage;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getTypeDialogTitle() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_SelectTypeDialogTitle;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected String getTypeDialogMessage() {
- return Messages.CreateOrSelectValuePropertyTypeDialog_SelectTypeDialogMessage;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.dialogs;
+
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.jface.viewers.ComboViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.gmf.diagram.common.provider.ElementTypeLabelProvider;
+import org.eclipse.papyrus.infra.services.edit.commands.ConfigureFeatureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.sysml.diagram.common.messages.Messages;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+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.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Dialog for initialization of Value (Property) type (the type is either selected or created).
+ */
+public class CreateOrSelectValuePropertyTypeDialog extends CreateOrSelectTypeDialog {
+
+ protected ComboViewer newTypeKindComboViewer = null;
+
+ protected Combo newTypeKindCombo = null;
+
+ protected IElementType[] valueTypeKind = { UMLElementTypes.DATA_TYPE, SysMLElementTypes.VALUE_TYPE, UMLElementTypes.PRIMITIVE_TYPE, UMLElementTypes.ENUMERATION };
+
+ protected IElementType newTypeKind = UMLElementTypes.DATA_TYPE;
+
+ /** Constructor */
+ public CreateOrSelectValuePropertyTypeDialog(Shell shell, NamedElement owner) {
+ super(shell, owner, UMLElementTypes.DATA_TYPE, UMLPackage.eINSTANCE.getTypedElement_Type(), null, UMLElementTypes.PACKAGE, UMLPackage.eINSTANCE.getPackage_PackagedElement(), null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createFormCreationSection(Composite pParent, FormToolkit pToolkit) {
+ // create the section
+ String lSectionTitle = getCreationSectionTitle();
+ Section lSection = pToolkit.createSection(pParent, Section.EXPANDED | Section.TITLE_BAR);
+ lSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ 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, getCreationSectionRadioLabel(), SWT.RADIO);
+ creationRadio.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+
+ pToolkit.createLabel(lBody, getNewTypeNameLabel(), SWT.NONE);
+ newTypeNameText = pToolkit.createText(lBody, "", SWT.BORDER);
+ newTypeNameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ newTypeNameText.setFocus();
+
+ // manage type selection
+ pToolkit.createLabel(lBody, getNewTypeContainerNameLabel(), SWT.NONE);
+ newTypeContainerNameText = pToolkit.createText(lBody, labelProvider.getText(newTypeContainer), SWT.BORDER | SWT.READ_ONLY);
+ newTypeContainerNameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ newTypeContainerButton = pToolkit.createButton(lBody, "...", SWT.FLAT);
+ Image image = Activator.getInstance().getImage(containerType.getEClass());
+ if(containerEClass != null) {
+ image = Activator.getInstance().getImage(containerEClass);
+ }
+ newTypeContainerButton.setImage(image);
+ newTypeContainerButton.setLayoutData(new GridData(SWT.NONE));
+
+ pToolkit.createLabel(lBody, getNewTypeKindLabel(), SWT.NONE);
+ newTypeKindCombo = new Combo(lBody, SWT.DROP_DOWN | SWT.READ_ONLY);
+ newTypeKindComboViewer = new ComboViewer(newTypeKindCombo);
+ pToolkit.adapt(newTypeKindCombo);
+ newTypeKindCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ newTypeKindComboViewer.setLabelProvider(new ElementTypeLabelProvider());
+ newTypeKindComboViewer.add(valueTypeKind);
+ newTypeKindComboViewer.setSelection(new StructuredSelection(valueTypeKind[0]));
+
+ lInsideScrolledForm.reflow(true);
+ lSection.setClient(lInsideScrolledForm);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void buildNewTypeCreateCommand() {
+ // The new element is expected to be a NamedElement.
+ IElementEditService commandService = ElementEditServiceUtils.getCommandProvider(newTypeContainer);
+ if(commandService != null) {
+ CreateElementRequest createTypeRequest = new CreateElementRequest(newTypeContainer, newTypeKind);
+ createTypeRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getNamedElement_Name(), newTypeNameText.getText()));
+ newTypeCreateCommand = commandService.getEditCommand(createTypeRequest);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void hookListeners() {
+ super.hookListeners();
+
+ // listener to select invocation type
+ ModifyListener newTypeKindListener = new ModifyListener() {
+
+ /**
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ public void modifyText(ModifyEvent e) {
+ ISelection sel = newTypeKindComboViewer.getSelection();
+ if(sel instanceof StructuredSelection) {
+ Object type = ((StructuredSelection)sel).getFirstElement();
+ if(type instanceof IElementType) {
+ newTypeKind = (IElementType)type;
+ } else {
+ newTypeKind = null;
+ }
+
+ // reset name
+ setNewTypeName(null);
+ }
+ }
+ };
+ newTypeKindCombo.addModifyListener(newTypeKindListener);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setNewTypeName(String text) {
+ String name = text;
+ if(text == null) {
+ name = NamedElementUtil.getDefaultNameWithIncrementFromBase(newTypeKind.getEClass().getName(), newTypeContainer.eContents());
+ if(newTypeKind == SysMLElementTypes.VALUE_TYPE) {
+ name = NamedElementUtil.getDefaultNameWithIncrementFromBase(BlocksPackage.eINSTANCE.getValueType().getName(), newTypeContainer.eContents());
+ }
+ newTypeNameText.setText(name);
+
+ } else {
+ newTypeNameText.setText(name);
+ newTypeName = name;
+ }
+
+ validateNewTypeName();
+ refreshOkButton();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getDialogTitle() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_DialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionTitle() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_SelectionSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getSelectionSectionRadioLabel() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_SelectionSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionTitle() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_CreationSectionTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getCreationSectionRadioLabel() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_CreationSectionRadioLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeNameLabel() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_NewTypeNameLabel;
+ }
+
+ /**
+ * Get the newTypeKind label.
+ *
+ * @return the label
+ */
+ protected String getNewTypeKindLabel() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_NewTypeKindLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerNameLabel() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_NewTypeContainerNameLabel;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogTitle() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_SelectNewTypeContainerDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getNewTypeContainerDialogMessage() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_SelectNewTypeContainerDialogMessage;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogTitle() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_SelectTypeDialogTitle;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getTypeDialogMessage() {
+ return Messages.CreateOrSelectValuePropertyTypeDialog_SelectTypeDialogMessage;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/ServiceEditContentProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/ServiceEditContentProvider.java
index 732de5fe9fd..a7df7258007 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/ServiceEditContentProvider.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/dialogs/ServiceEditContentProvider.java
@@ -1,42 +1,42 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.dialogs;
-
-import java.util.Collections;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.infra.services.edit.utils.ElementTypeValidator;
-import org.eclipse.papyrus.uml.tools.providers.SemanticUMLContentProvider;
-
-/**
- * A content provider that takes into account the nature of the searched element
- * (org.eclipse.papyrus.uml.tools.providers.ServiceEditFilteredContentProvider).
- */
-public class ServiceEditContentProvider extends SemanticUMLContentProvider {
-
- private ElementTypeValidator validator;
-
- public ServiceEditContentProvider(IElementType elementType, EStructuralFeature feature, EObject semanticRoot) {
- super(semanticRoot.eResource().getResourceSet());
- setWantedMetaclasses(Collections.singletonList(feature.getEType()));
- validator = new ElementTypeValidator(elementType);
- }
-
- @Override
- public boolean isValidValue(Object element) {
- return super.isValidValue(element) && validator.validate(new Object[]{ getAdaptedValue(element) }).isOK();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.dialogs;
+
+import java.util.Collections;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.papyrus.infra.services.edit.utils.ElementTypeValidator;
+import org.eclipse.papyrus.uml.tools.providers.SemanticUMLContentProvider;
+
+/**
+ * A content provider that takes into account the nature of the searched element
+ * (org.eclipse.papyrus.uml.tools.providers.ServiceEditFilteredContentProvider).
+ */
+public class ServiceEditContentProvider extends SemanticUMLContentProvider {
+
+ private ElementTypeValidator validator;
+
+ public ServiceEditContentProvider(IElementType elementType, EStructuralFeature feature, EObject semanticRoot) {
+ super(semanticRoot.eResource().getResourceSet());
+ setWantedMetaclasses(Collections.singletonList(feature.getEType()));
+ validator = new ElementTypeValidator(elementType);
+ }
+
+ @Override
+ public boolean isValidValue(Object element) {
+ return super.isValidValue(element) && validator.validate(new Object[]{ getAdaptedValue(element) }).isOK();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintBlockPropertyCompositeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintBlockPropertyCompositeEditPart.java
new file mode 100644
index 00000000000..a7521f85bf4
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintBlockPropertyCompositeEditPart.java
@@ -0,0 +1,222 @@
+/*****************************************************************************
+ * Copyright (c) 2011-2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.edit.part;
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+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.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.figure.SelectableBorderedNodeFigure;
+import org.eclipse.papyrus.sysml.diagram.common.edit.policy.BlockPropertyCompositeSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.common.figure.ConstraintBlockPropertyCompositeFigure;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintNodeLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintParameterAffixedNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PropertyNodeLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.policy.EncapsulatedClassifierResizableShapeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.edit.policy.StructuredClassifierCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeNodeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.BorderItemResizableEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.QualifiedNameDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideCompartmentEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideRelatedContentsEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
+import org.eclipse.papyrus.uml.diagram.common.locator.ConstraintParameterPositionLocator;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+
+public class ConstraintBlockPropertyCompositeEditPart extends AbstractElementEditPart {
+
+ public ConstraintBlockPropertyCompositeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new BlockPropertyCompositeSemanticEditPolicy());
+ installEditPolicy(ShowHideCompartmentEditPolicy.SHOW_HIDE_COMPARTMENT_POLICY, new ShowHideCompartmentEditPolicy());
+ installEditPolicy(ShowHideRelatedContentsEditPolicy.SHOW_HIDE_RELATED_CONTENTS_POLICY, new ShowHideRelatedContentsEditPolicy());
+ installEditPolicy(QualifiedNameDisplayEditPolicy.QUALIFIED_NAME_POLICY, new QualifiedNameDisplayEditPolicy());
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeNodeLabelDisplayEditPolicy());
+ installEditPolicy(AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE, new AffixedNodeAlignmentEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new StructuredClassifierCreationEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new EncapsulatedClassifierResizableShapeEditPolicy());
+ }
+
+ @Override
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
+
+ @Override
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if(child instanceof IBorderItemEditPart) {
+ return new BorderItemResizableEditPolicy();
+ }
+
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ @Override
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ @Override
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+ };
+ return lep;
+ }
+
+ @Override
+ protected boolean addFixedChild(EditPart childEditPart) {
+
+ if(childEditPart instanceof PropertyNodeLabelEditPart) {
+ ((PropertyNodeLabelEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ return true;
+ }
+ if(childEditPart instanceof ConstraintNodeLabelEditPart) {
+ ((ConstraintNodeLabelEditPart)childEditPart).setLabel((((ConstraintBlockPropertyCompositeFigure)getPrimaryShape()).getConstraintLabel()));
+ return true;
+ }
+
+ if(childEditPart instanceof ConstraintParameterAffixedNodeEditPart) {
+ IBorderItemLocator locator = new ConstraintParameterPositionLocator(getMainFigure(), PositionConstants.NONE);
+ getBorderedFigure().getBorderItemContainer().add(((ConstraintParameterAffixedNodeEditPart)childEditPart).getFigure(), locator);
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ protected boolean removeFixedChild(EditPart childEditPart) {
+
+ if(childEditPart instanceof PropertyNodeLabelEditPart) {
+ return true;
+ }
+
+ if(childEditPart instanceof FlowPortAffixedNodeEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((FlowPortAffixedNodeEditPart)childEditPart).getFigure());
+ return true;
+ }
+ if(childEditPart instanceof PortAffixedNodeEditPart) {
+ getBorderedFigure().getBorderItemContainer().remove(((PortAffixedNodeEditPart)childEditPart).getFigure());
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ if(editPart instanceof IBorderItemEditPart) {
+ return getBorderedFigure().getBorderItemContainer();
+ }
+
+ return getContentPane();
+ }
+
+ @Override
+ protected NodeFigure createNodeFigure() {
+ return new SelectableBorderedNodeFigure(createMainFigure());
+ }
+
+ @Override
+ protected IFigure createNodeShape() {
+ primaryShape = new ConstraintBlockPropertyCompositeFigure();
+ return primaryShape;
+ }
+
+
+ @Override
+ public NodeNamedElementFigure getPrimaryShape() {
+ return (NodeNamedElementFigure)primaryShape;
+ }
+
+ @Override
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID);
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ List children = getChildren();
+ for (Object editPart : children) {
+ if (editPart instanceof EditPart) {
+ ((EditPart) editPart).refresh();
+ }
+ }
+ }
+
+ /**
+ * <pre>
+ *
+ * {@inheritDoc}
+ * </pre>
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+
+ // A visual refresh may also be needed when the following properties are changing : aggregation, type, or the related association.
+ if(resolveSemanticElement() != null) {
+ EObject element = resolveSemanticElement();
+
+ if((element != null) && (element.equals(event.getNotifier())) && (element instanceof Property)) {
+
+ if(UMLPackage.eINSTANCE.getProperty_Aggregation().equals(event.getFeature())) {
+ refreshVisuals();
+ }
+
+ if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(event.getFeature())) {
+ refreshVisuals();
+ }
+
+ if(UMLPackage.eINSTANCE.getProperty_Association().equals(event.getFeature())) {
+ refreshVisuals();
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ refresh();
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintPropertyChildLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintPropertyChildLabelEditPart.java
index e7f665932c1..5200ba8e85f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintPropertyChildLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/ConstraintPropertyChildLabelEditPart.java
@@ -1,56 +1,56 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.edit.part;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementChildLabelEditPart;
-
-/**
- * Edit part for {@link ConstraintProperty} used as Child label node.
- */
-public class ConstraintPropertyChildLabelEditPart extends AbstractElementChildLabelEditPart {
-
- /** Constructor */
- public ConstraintPropertyChildLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // protected Image getLabelIcon() {
- // EObject parserElement = getParserElement();
- // if(parserElement == null) {
- // return null;
- // }
- //
- // List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- // for(View view : views) {
- // if(NameLabelIconHelper.showLabelIcon(view)) {
- // return Activator.getInstance().getLabelProvider().getImage(parserElement);
- // }
- // }
- //
- // return null;
- // }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementChildLabelEditPart;
+
+/**
+ * Edit part for {@link ConstraintProperty} used as Child label node.
+ */
+public class ConstraintPropertyChildLabelEditPart extends AbstractElementChildLabelEditPart {
+
+ /** Constructor */
+ public ConstraintPropertyChildLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // protected Image getLabelIcon() {
+ // EObject parserElement = getParserElement();
+ // if(parserElement == null) {
+ // return null;
+ // }
+ //
+ // List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ // for(View view : views) {
+ // if(NameLabelIconHelper.showLabelIcon(view)) {
+ // return Activator.getInstance().getLabelProvider().getImage(parserElement);
+ // }
+ // }
+ //
+ // return null;
+ // }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java
index 1fe6aafd21f..4b1bfeaffc7 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java
@@ -1,129 +1,129 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.edit.part;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This class implements a FlowPort affixed label edit part.
- */
-public class FlowPortAffixedLabelNameEditPart extends AbstractElementLabelEditPart implements IBorderItemEditPart {
-
- /** label provider for icons */
- private final ILabelProvider labelProvider;
-
- /** Constructor */
- public FlowPortAffixedLabelNameEditPart(View view) {
- super(view);
- addSnapBackLocation();
- labelProvider = Activator.getInstance().getLabelProvider();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- @Override
- public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
-
- // Update locator constraint
- IBorderItemLocator locator = getBorderItemLocator();
- locator.setConstraint(new Rectangle(x, y, width, height));
-
- // Set new constraint on parent figure
- getFigure().getParent().setConstraint(getFigure(), locator);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return labelProvider.getImage(parserElement);
- }
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- protected IFigure createFigurePrim() {
- return new PapyrusWrappingLabel();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getLabelRole() {
- return "Label"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.edit.part;
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This class implements a FlowPort affixed label edit part.
+ */
+public class FlowPortAffixedLabelNameEditPart extends AbstractElementLabelEditPart implements IBorderItemEditPart {
+
+ /** label provider for icons */
+ private final ILabelProvider labelProvider;
+
+ /** Constructor */
+ public FlowPortAffixedLabelNameEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ labelProvider = Activator.getInstance().getLabelProvider();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ @Override
+ public void refreshBounds() {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+
+ // Update locator constraint
+ IBorderItemLocator locator = getBorderItemLocator();
+ locator.setConstraint(new Rectangle(x, y, width, height));
+
+ // Set new constraint on parent figure
+ getFigure().getParent().setConstraint(getFigure(), locator);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Image getLabelIcon() {
+ EObject parserElement = getParserElement();
+ if(parserElement == null) {
+ return null;
+ }
+
+ List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ for(View view : views) {
+ if(NameLabelIconHelper.showLabelIcon(view)) {
+ return labelProvider.getImage(parserElement);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ protected IFigure createFigurePrim() {
+ return new PapyrusWrappingLabel();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getLabelRole() {
+ return "Label"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortChildLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortChildLabelEditPart.java
index 997892dfa86..5e0de40aa63 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortChildLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortChildLabelEditPart.java
@@ -1,56 +1,56 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.edit.part;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementChildLabelEditPart;
-
-/**
- * Edit part for {@link FlowPort} used as Child label node.
- */
-public class FlowPortChildLabelEditPart extends AbstractElementChildLabelEditPart {
-
- /** Constructor */
- public FlowPortChildLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // protected Image getLabelIcon() {
- // EObject parserElement = getParserElement();
- // if(parserElement == null) {
- // return null;
- // }
- //
- // List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- // for(View view : views) {
- // if(NameLabelIconHelper.showLabelIcon(view)) {
- // return labelProvider.getImage(parserElement);
- // }
- // }
- //
- // return null;
- // }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementChildLabelEditPart;
+
+/**
+ * Edit part for {@link FlowPort} used as Child label node.
+ */
+public class FlowPortChildLabelEditPart extends AbstractElementChildLabelEditPart {
+
+ /** Constructor */
+ public FlowPortChildLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // protected Image getLabelIcon() {
+ // EObject parserElement = getParserElement();
+ // if(parserElement == null) {
+ // return null;
+ // }
+ //
+ // List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ // for(View view : views) {
+ // if(NameLabelIconHelper.showLabelIcon(view)) {
+ // return labelProvider.getImage(parserElement);
+ // }
+ // }
+ //
+ // return null;
+ // }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPropertyChildLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPropertyChildLabelEditPart.java
index 3fd4ef7c400..a4dd8ede7fa 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPropertyChildLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPropertyChildLabelEditPart.java
@@ -1,56 +1,56 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.edit.part;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementChildLabelEditPart;
-
-/**
- * Edit part for {@link FlowProperty} used as Child label node.
- */
-public class FlowPropertyChildLabelEditPart extends AbstractElementChildLabelEditPart {
-
- /** Constructor */
- public FlowPropertyChildLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // protected Image getLabelIcon() {
- // EObject parserElement = getParserElement();
- // if(parserElement == null) {
- // return null;
- // }
- //
- // List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- // for(View view : views) {
- // if(NameLabelIconHelper.showLabelIcon(view)) {
- // return labelProvider.getImage(parserElement);
- // }
- // }
- //
- // return null;
- // }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementChildLabelEditPart;
+
+/**
+ * Edit part for {@link FlowProperty} used as Child label node.
+ */
+public class FlowPropertyChildLabelEditPart extends AbstractElementChildLabelEditPart {
+
+ /** Constructor */
+ public FlowPropertyChildLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // protected Image getLabelIcon() {
+ // EObject parserElement = getParserElement();
+ // if(parserElement == null) {
+ // return null;
+ // }
+ //
+ // List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ // for(View view : views) {
+ // if(NameLabelIconHelper.showLabelIcon(view)) {
+ // return labelProvider.getImage(parserElement);
+ // }
+ // }
+ //
+ // return null;
+ // }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/BlockPropertyStructureCompartmentSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/BlockPropertyStructureCompartmentSemanticEditPolicy.java
index 93daef1b1a9..5bcd7e72b9a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/BlockPropertyStructureCompartmentSemanticEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/BlockPropertyStructureCompartmentSemanticEditPolicy.java
@@ -23,6 +23,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.CompartmentSemanticEditPolicy;
import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateActorPartWithTypeConfigureCommandFactory;
+import org.eclipse.papyrus.sysml.diagram.common.commands.CreateConstraintPropertyWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreatePartWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateReferenceWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateValueWithTypeConfigureCommandFactory;
@@ -72,6 +73,11 @@ public class BlockPropertyStructureCompartmentSemanticEditPolicy extends Compart
if(UMLElementTypes.PROPERTY == req.getElementType()) {
req.setContainer(type);
}
+
+ if(SysMLElementTypes.CONSTRAINT_PROPERTY == req.getElementType()) {
+ req.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateConstraintPropertyWithTypeConfigureCommandFactory());
+ }
+
} else if ((UMLElementTypes.PROPERTY == req.getElementType()) || (Arrays.asList(req.getElementType().getAllSuperTypes()).contains(UMLElementTypes.PROPERTY))) {
// Forbid Property::qualifier creation
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/CustomDuplicatePasteEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/CustomDuplicatePasteEditPolicy.java
index 8921a3807e6..a65f4599b49 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/CustomDuplicatePasteEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/CustomDuplicatePasteEditPolicy.java
@@ -1,57 +1,57 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.edit.policy;
-
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DuplicateRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
-
-
-/**
- * Specific edit policy for compartment, to forbid the duplication of ports as affixed children.
- * @see bug 375041
- */
-public class CustomDuplicatePasteEditPolicy extends DuplicatePasteEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command constructDuplicationCommand(List notationViewsToDuplicate, Set elementsToDuplicate, DuplicateRequest request, TransactionalEditingDomain editingDomain) {
- if(notationViewsToDuplicate !=null && !notationViewsToDuplicate.isEmpty()) {
- for(Object o : notationViewsToDuplicate) {
- if(o instanceof View) {
- String type = ((View)o).getType();
- if(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID.equals(type) || UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID.equals(type)) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- }
- }
-
-
- return super.constructDuplicationCommand(notationViewsToDuplicate, elementsToDuplicate, request, editingDomain);
- }
-
-}
-
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.edit.policy;
+
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DuplicateRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+
+
+/**
+ * Specific edit policy for compartment, to forbid the duplication of ports as affixed children.
+ * @see bug 375041
+ */
+public class CustomDuplicatePasteEditPolicy extends DuplicatePasteEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command constructDuplicationCommand(List notationViewsToDuplicate, Set elementsToDuplicate, DuplicateRequest request, TransactionalEditingDomain editingDomain) {
+ if(notationViewsToDuplicate !=null && !notationViewsToDuplicate.isEmpty()) {
+ for(Object o : notationViewsToDuplicate) {
+ if(o instanceof View) {
+ String type = ((View)o).getType();
+ if(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID.equals(type) || UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID.equals(type)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ }
+ }
+
+
+ return super.constructDuplicationCommand(notationViewsToDuplicate, elementsToDuplicate, request, editingDomain);
+ }
+
+}
+
\ No newline at end of file
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PartCompartmentSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PartCompartmentSemanticEditPolicy.java
index 6c557f5c024..622dd608d3b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PartCompartmentSemanticEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PartCompartmentSemanticEditPolicy.java
@@ -17,6 +17,7 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.CompartmentSemanticEditPolicy;
import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
+import org.eclipse.papyrus.sysml.diagram.common.commands.CreateConstraintPropertyWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreatePartWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
@@ -35,6 +36,10 @@ public class PartCompartmentSemanticEditPolicy extends CompartmentSemanticEditPo
req.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreatePartWithTypeConfigureCommandFactory());
}
+ if(SysMLElementTypes.CONSTRAINT_PROPERTY == req.getElementType()) {
+ req.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateConstraintPropertyWithTypeConfigureCommandFactory());
+ }
+
return super.getCreateCommand(req);
}
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PropertyCompartmentSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PropertyCompartmentSemanticEditPolicy.java
index 823e18e85fc..ed795654df5 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PropertyCompartmentSemanticEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/PropertyCompartmentSemanticEditPolicy.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.CompartmentSemanticEditPolicy;
import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateActorPartWithTypeConfigureCommandFactory;
+import org.eclipse.papyrus.sysml.diagram.common.commands.CreateConstraintPropertyWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateFlowPortWithFlowSpecificationConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreatePartWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateReferenceWithTypeConfigureCommandFactory;
@@ -50,7 +51,10 @@ public class PropertyCompartmentSemanticEditPolicy extends CompartmentSemanticEd
if(SysMLElementTypes.FLOW_PORT_NA == req.getElementType()) {
req.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateFlowPortWithFlowSpecificationConfigureCommandFactory());
}
-
+ if(SysMLElementTypes.CONSTRAINT_PROPERTY == req.getElementType()) {
+ req.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateConstraintPropertyWithTypeConfigureCommandFactory());
+ }
+
return super.getCreateCommand(req);
}
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/StructureCompartmentSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/StructureCompartmentSemanticEditPolicy.java
index 2552f154514..f045b8976ee 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/StructureCompartmentSemanticEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/policy/StructureCompartmentSemanticEditPolicy.java
@@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.papyrus.gmf.diagram.common.edit.policy.CompartmentSemanticEditPolicy;
import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateActorPartWithTypeConfigureCommandFactory;
+import org.eclipse.papyrus.sysml.diagram.common.commands.CreateConstraintPropertyWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreatePartWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateReferenceWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.diagram.common.commands.CreateValueWithTypeConfigureCommandFactory;
@@ -50,6 +51,10 @@ public class StructureCompartmentSemanticEditPolicy extends CompartmentSemanticE
req.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateValueWithTypeConfigureCommandFactory());
}
+ if(SysMLElementTypes.CONSTRAINT_PROPERTY == req.getElementType()) {
+ req.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateConstraintPropertyWithTypeConfigureCommandFactory());
+ }
+
return super.getCreateCommand(req);
}
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/AssociationFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/AssociationFigure.java
index 7a99e59502e..3b3b4593fff 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/AssociationFigure.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/AssociationFigure.java
@@ -1,121 +1,121 @@
-/*****************************************************************************
- * Copyright (c) 2009-2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * CEA LIST - Adaptation for SysML purpose.
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.figure;
-
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.figure.NamedElementEdgeFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
-
-/**
- * This figure is used to represent {@link Association} in SysML diagrams.
- */
-public class AssociationFigure extends NamedElementEdgeFigure {
-
- /** The multiplicity source label. */
- private WrappingLabel fSourceMultiplicityLabel;
-
- /** The multiplicity target label. */
- private WrappingLabel fTargetMultiplicityLabel;
-
- /** The role source label. */
- private WrappingLabel fSourceRoleLabel;
-
- /** The role target label. */
- private WrappingLabel fTargetRoleLabel;
-
- /**
- * Instantiates a new association figure.
- */
- public AssociationFigure() {
- super();
- createContents();
- }
-
- /**
- * Creates the contents.
- */
- @Override
- protected void createContents() {
- super.createContents();
-
- fSourceRoleLabel = new PapyrusWrappingLabel();
- fSourceRoleLabel.setText("");
-
- this.add(fSourceRoleLabel);
-
- fSourceMultiplicityLabel = new PapyrusWrappingLabel();
- fSourceMultiplicityLabel.setText("");
-
- this.add(fSourceMultiplicityLabel);
-
- fTargetRoleLabel = new PapyrusWrappingLabel();
- fTargetRoleLabel.setText("");
-
- this.add(fTargetRoleLabel);
-
- fTargetMultiplicityLabel = new PapyrusWrappingLabel();
- fTargetMultiplicityLabel.setText("");
-
- this.add(fTargetMultiplicityLabel);
-
- }
-
- /**
- * Gets the applied stereotype association label.
- *
- * @return the applied stereotype association label
- */
- @Override
- public WrappingLabel getAppliedStereotypeLabel() {
- return appliedStereotypeLabel;
- }
-
- /**
- * Gets the multiplicity source label.
- *
- * @return the multiplicity source label
- */
- public WrappingLabel getSourceMultiplicityLabel() {
- return fSourceMultiplicityLabel;
- }
-
- /**
- * Gets the multiplicity target label.
- *
- * @return the multiplicity target label
- */
- public WrappingLabel getTargetMultiplicityLabel() {
- return fTargetMultiplicityLabel;
- }
-
- /**
- * Gets the role source label.
- *
- * @return the role source label
- */
- public WrappingLabel getSourceRoleLabel() {
- return fSourceRoleLabel;
- }
-
- /**
- * Gets the role target label.
- *
- * @return the role target label
- */
- public WrappingLabel getTargetRoleLabel() {
- return fTargetRoleLabel;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * CEA LIST - Adaptation for SysML purpose.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.figure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.figure.NamedElementEdgeFigure;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
+
+/**
+ * This figure is used to represent {@link Association} in SysML diagrams.
+ */
+public class AssociationFigure extends NamedElementEdgeFigure {
+
+ /** The multiplicity source label. */
+ private WrappingLabel fSourceMultiplicityLabel;
+
+ /** The multiplicity target label. */
+ private WrappingLabel fTargetMultiplicityLabel;
+
+ /** The role source label. */
+ private WrappingLabel fSourceRoleLabel;
+
+ /** The role target label. */
+ private WrappingLabel fTargetRoleLabel;
+
+ /**
+ * Instantiates a new association figure.
+ */
+ public AssociationFigure() {
+ super();
+ createContents();
+ }
+
+ /**
+ * Creates the contents.
+ */
+ @Override
+ protected void createContents() {
+ super.createContents();
+
+ fSourceRoleLabel = new PapyrusWrappingLabel();
+ fSourceRoleLabel.setText("");
+
+ this.add(fSourceRoleLabel);
+
+ fSourceMultiplicityLabel = new PapyrusWrappingLabel();
+ fSourceMultiplicityLabel.setText("");
+
+ this.add(fSourceMultiplicityLabel);
+
+ fTargetRoleLabel = new PapyrusWrappingLabel();
+ fTargetRoleLabel.setText("");
+
+ this.add(fTargetRoleLabel);
+
+ fTargetMultiplicityLabel = new PapyrusWrappingLabel();
+ fTargetMultiplicityLabel.setText("");
+
+ this.add(fTargetMultiplicityLabel);
+
+ }
+
+ /**
+ * Gets the applied stereotype association label.
+ *
+ * @return the applied stereotype association label
+ */
+ @Override
+ public WrappingLabel getAppliedStereotypeLabel() {
+ return appliedStereotypeLabel;
+ }
+
+ /**
+ * Gets the multiplicity source label.
+ *
+ * @return the multiplicity source label
+ */
+ public WrappingLabel getSourceMultiplicityLabel() {
+ return fSourceMultiplicityLabel;
+ }
+
+ /**
+ * Gets the multiplicity target label.
+ *
+ * @return the multiplicity target label
+ */
+ public WrappingLabel getTargetMultiplicityLabel() {
+ return fTargetMultiplicityLabel;
+ }
+
+ /**
+ * Gets the role source label.
+ *
+ * @return the role source label
+ */
+ public WrappingLabel getSourceRoleLabel() {
+ return fSourceRoleLabel;
+ }
+
+ /**
+ * Gets the role target label.
+ *
+ * @return the role target label
+ */
+ public WrappingLabel getTargetRoleLabel() {
+ return fTargetRoleLabel;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/FlowPortFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/FlowPortFigure.java
index e374ec6912e..8748a9c778f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/FlowPortFigure.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/figure/FlowPortFigure.java
@@ -1,34 +1,34 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.figure;
-
-import org.eclipse.papyrus.uml.diagram.common.figure.node.AffixedNamedElementFigure;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * Figure for Port representation.
- */
-public class FlowPortFigure extends AffixedNamedElementFigure {
-
- /**
- * Set the image in FlowPort figure.
- *
- * @param image
- * the image to show in the FlowPort
- */
- public void setImage(Image image) {
- setIcon(image);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.figure;
+
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AffixedNamedElementFigure;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * Figure for Port representation.
+ */
+public class FlowPortFigure extends AffixedNamedElementFigure {
+
+ /**
+ * Set the image in FlowPort figure.
+ *
+ * @param image
+ * the image to show in the FlowPort
+ */
+ public void setImage(Image image) {
+ setIcon(image);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/Messages.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/Messages.java
index 5be5e2b7217..d7b31fe3162 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/Messages.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/Messages.java
@@ -1,138 +1,160 @@
-/*****************************************************************************
- * Copyright (c) 2011-2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.messages;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- public static String CreateOrSelectTypeDialog_DialogTitle;
-
- public static String CreateOrSelectTypeDialog_SelectionSectionTitle;
-
- public static String CreateOrSelectTypeDialog_SelectionSectionRadioLabel;
-
- public static String CreateOrSelectTypeDialog_CreationSectionTitle;
-
- public static String CreateOrSelectTypeDialog_CreationSectionRadioLabel;
-
- public static String CreateOrSelectTypeDialog_NewTypeNameLabel;
-
- public static String CreateOrSelectTypeDialog_NewTypeContainerNameLabel;
-
- public static String CreateOrSelectTypeDialog_SelectTypeDialogTitle;
-
- public static String CreateOrSelectTypeDialog_SelectTypeDialogMessage;
-
- public static String CreateOrSelectTypeDialog_SelectNewTypeContainerDialogTitle;
-
- public static String CreateOrSelectTypeDialog_SelectNewTypeContainerDialogMessage;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_DialogTitle;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_SelectionSectionTitle;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_SelectionSectionRadioLabel;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_CreationSectionTitle;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_CreationSectionRadioLabel;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_NewTypeNameLabel;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_NewTypeContainerNameLabel;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogTitle;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogMessage;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogTitle;
-
- public static String CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogMessage;
-
- public static String CreateOrSelectActorPartTypeDialog_DialogTitle;
-
- public static String CreateOrSelectActorPartTypeDialog_SelectionSectionTitle;
-
- public static String CreateOrSelectActorPartTypeDialog_SelectionSectionRadioLabel;
-
- public static String CreateOrSelectActorPartTypeDialog_CreationSectionTitle;
-
- public static String CreateOrSelectActorPartTypeDialog_CreationSectionRadioLabel;
-
- public static String CreateOrSelectActorPartTypeDialog_NewTypeNameLabel;
-
- public static String CreateOrSelectActorPartTypeDialog_NewTypeContainerNameLabel;
-
- public static String CreateOrSelectActorPartTypeDialog_SelectTypeDialogTitle;
-
- public static String CreateOrSelectActorPartTypeDialog_SelectTypeDialogMessage;
-
- public static String CreateOrSelectActorPartTypeDialog_SelectNewTypeContainerDialogTitle;
-
- public static String CreateOrSelectActorPartTypeDialog_SelectNewTypeContainerDialogMessage;
-
- public static String CreateOrSelectValuePropertyTypeDialog_DialogTitle;
-
- public static String CreateOrSelectValuePropertyTypeDialog_SelectionSectionTitle;
-
- public static String CreateOrSelectValuePropertyTypeDialog_SelectionSectionRadioLabel;
-
- public static String CreateOrSelectValuePropertyTypeDialog_CreationSectionTitle;
-
- public static String CreateOrSelectValuePropertyTypeDialog_CreationSectionRadioLabel;
-
- public static String CreateOrSelectValuePropertyTypeDialog_NewTypeNameLabel;
-
- public static String CreateOrSelectValuePropertyTypeDialog_NewTypeContainerNameLabel;
-
- public static String CreateOrSelectValuePropertyTypeDialog_SelectTypeDialogTitle;
-
- public static String CreateOrSelectValuePropertyTypeDialog_SelectTypeDialogMessage;
-
- public static String CreateOrSelectValuePropertyTypeDialog_SelectNewTypeContainerDialogTitle;
-
- public static String CreateOrSelectValuePropertyTypeDialog_SelectNewTypeContainerDialogMessage;
-
- public static String CreateOrSelectValuePropertyTypeDialog_NewTypeKindLabel;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_DialogTitle;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectionSectionTitle;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectionSectionRadioLabel;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_CreationSectionTitle;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_CreationSectionRadioLabel;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_NewTypeNameLabel;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_NewTypeContainerNameLabel;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectTypeDialogTitle;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectTypeDialogMessage;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectNewTypeContainerDialogTitle;
-
- public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectNewTypeContainerDialogMessage;
-
- static {
- NLS.initializeMessages("org.eclipse.papyrus.sysml.diagram.common.messages.messages", Messages.class); //$NON-NLS-1$
- }
-
- private Messages() {
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011-2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ public static String CreateOrSelectTypeDialog_DialogTitle;
+
+ public static String CreateOrSelectTypeDialog_SelectionSectionTitle;
+
+ public static String CreateOrSelectTypeDialog_SelectionSectionRadioLabel;
+
+ public static String CreateOrSelectTypeDialog_CreationSectionTitle;
+
+ public static String CreateOrSelectTypeDialog_CreationSectionRadioLabel;
+
+ public static String CreateOrSelectTypeDialog_NewTypeNameLabel;
+
+ public static String CreateOrSelectTypeDialog_NewTypeContainerNameLabel;
+
+ public static String CreateOrSelectTypeDialog_SelectTypeDialogTitle;
+
+ public static String CreateOrSelectTypeDialog_SelectTypeDialogMessage;
+
+ public static String CreateOrSelectTypeDialog_SelectNewTypeContainerDialogTitle;
+
+ public static String CreateOrSelectTypeDialog_SelectNewTypeContainerDialogMessage;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_DialogTitle;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_SelectionSectionTitle;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_SelectionSectionRadioLabel;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_CreationSectionTitle;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_CreationSectionRadioLabel;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_NewTypeNameLabel;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_NewTypeContainerNameLabel;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogTitle;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogMessage;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogTitle;
+
+ public static String CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogMessage;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_DialogTitle;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_SelectionSectionTitle;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_SelectionSectionRadioLabel;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_CreationSectionTitle;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_CreationSectionRadioLabel;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_NewTypeNameLabel;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_NewTypeContainerNameLabel;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_SelectTypeDialogTitle;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_SelectTypeDialogMessage;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_SelectNewTypeContainerDialogTitle;
+
+ public static String CreateOrSelectConstraintPropertyTypeDialog_SelectNewTypeContainerDialogMessage;
+
+ public static String CreateOrSelectActorPartTypeDialog_DialogTitle;
+
+ public static String CreateOrSelectActorPartTypeDialog_SelectionSectionTitle;
+
+ public static String CreateOrSelectActorPartTypeDialog_SelectionSectionRadioLabel;
+
+ public static String CreateOrSelectActorPartTypeDialog_CreationSectionTitle;
+
+ public static String CreateOrSelectActorPartTypeDialog_CreationSectionRadioLabel;
+
+ public static String CreateOrSelectActorPartTypeDialog_NewTypeNameLabel;
+
+ public static String CreateOrSelectActorPartTypeDialog_NewTypeContainerNameLabel;
+
+ public static String CreateOrSelectActorPartTypeDialog_SelectTypeDialogTitle;
+
+ public static String CreateOrSelectActorPartTypeDialog_SelectTypeDialogMessage;
+
+ public static String CreateOrSelectActorPartTypeDialog_SelectNewTypeContainerDialogTitle;
+
+ public static String CreateOrSelectActorPartTypeDialog_SelectNewTypeContainerDialogMessage;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_DialogTitle;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_SelectionSectionTitle;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_SelectionSectionRadioLabel;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_CreationSectionTitle;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_CreationSectionRadioLabel;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_NewTypeNameLabel;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_NewTypeContainerNameLabel;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_SelectTypeDialogTitle;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_SelectTypeDialogMessage;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_SelectNewTypeContainerDialogTitle;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_SelectNewTypeContainerDialogMessage;
+
+ public static String CreateOrSelectValuePropertyTypeDialog_NewTypeKindLabel;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_DialogTitle;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectionSectionTitle;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectionSectionRadioLabel;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_CreationSectionTitle;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_CreationSectionRadioLabel;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_NewTypeNameLabel;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_NewTypeContainerNameLabel;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectTypeDialogTitle;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectTypeDialogMessage;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectNewTypeContainerDialogTitle;
+
+ public static String CreateOrSelectNonAtomicFlowPortTypeDialog_SelectNewTypeContainerDialogMessage;
+
+ static {
+ NLS.initializeMessages("org.eclipse.papyrus.sysml.diagram.common.messages.messages", Messages.class); //$NON-NLS-1$
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/messages.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/messages.properties
index cece3d4efbc..a5d917ce35c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/messages.properties
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/messages/messages.properties
@@ -29,6 +29,22 @@ CreateOrSelectBlockPropertyTypeDialog_SelectTypeDialogMessage=Select a Block to
CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogTitle=Type container selection
CreateOrSelectBlockPropertyTypeDialog_SelectNewTypeContainerDialogMessage=Select the container for the new Block
+CreateOrSelectConstraintPropertyTypeDialog_DialogTitle=ConstraintProperty type initialization
+CreateOrSelectConstraintPropertyTypeDialog_SelectionSectionTitle=Select an existing type (ConstraintBlock)
+CreateOrSelectConstraintPropertyTypeDialog_SelectionSectionRadioLabel=ConstraintBlock (type) selection mode
+
+CreateOrSelectConstraintPropertyTypeDialog_CreationSectionTitle=Create a new type (ConstraintBlock)
+CreateOrSelectConstraintPropertyTypeDialog_CreationSectionRadioLabel=ConstraintBlock (type) creation mode
+CreateOrSelectConstraintPropertyTypeDialog_NewTypeNameLabel=Select new ConstraintBlock name
+CreateOrSelectConstraintPropertyTypeDialog_NewTypeContainerNameLabel=Select new ConstraintBlock container
+
+CreateOrSelectConstraintPropertyTypeDialog_SelectTypeDialogTitle=Type selection
+CreateOrSelectConstraintPropertyTypeDialog_SelectTypeDialogMessage=Select a ConstraintBlock to use as new element type
+
+CreateOrSelectConstraintPropertyTypeDialog_SelectNewTypeContainerDialogTitle=Type container selection
+CreateOrSelectConstraintPropertyTypeDialog_SelectNewTypeContainerDialogMessage=Select the container for the new ConstraintBlock
+
+
CreateOrSelectActorPartTypeDialog_DialogTitle=ActorPart type initialization
CreateOrSelectActorPartTypeDialog_SelectionSectionTitle=Select an existing type (Actor)
CreateOrSelectActorPartTypeDialog_SelectionSectionRadioLabel=Actor (type) selection mode
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java
index 3936cdc2c9a..290d871a00a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPortLabelParser.java
@@ -1,251 +1,251 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.parser;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
-import org.eclipse.papyrus.sysml.portandflows.FlowPort;
-import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.uml.diagram.common.parser.PropertyLabelParser;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.InstanceValue;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.ValueSpecification;
-import org.eclipse.uml2.uml.VisibilityKind;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/**
- * Semantic Parser for {@link FlowPort}
- */
-public class FlowPortLabelParser extends PropertyLabelParser {
-
- /** The String format for displaying a FlowProperty with direction */
- protected static final String DIRECTION_FORMAT = "%s %s";
-
- /** The String format for displaying a FlowProperty with direction */
- protected static final String CONJUGATED_FORMAT = "~%s";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
-
- if(flags == 0) {
- return MaskedLabel;
- }
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Port)) {
-
- Property property = (Property)eObject;
-
- FlowPort flowPort = UMLUtil.getStereotypeApplication(property, FlowPort.class);
- if(flowPort != null) {
-
- int directionFlag = flags & ILabelPreferenceConstants.DISP_DIRECTION;
- // manage direction only if the FlowPort is type and type is not a FlowSpecification
- if((flags & ILabelPreferenceConstants.DISP_DIRECTION) == ILabelPreferenceConstants.DISP_DIRECTION) {
- String direction;
- switch(flowPort.getDirection().getValue()) {
- case FlowDirection.IN_VALUE:
- direction = "in";
- break;
- case FlowDirection.OUT_VALUE:
- direction = "out";
- break;
- case FlowDirection.INOUT_VALUE:
- direction = "inout";
- break;
- default:
- direction = "inout";
- break;
- }
-
- // manage direction only if the FlowPort is not a FlowSpecification
- if((property.getType() == null) || ((property.getType() != null) && (UMLUtil.getStereotypeApplication(property.getType(), FlowSpecification.class) == null))) {
- result = String.format(DIRECTION_FORMAT, direction, result);
- }
- }
- }
-
- // manage visibility
- if((flags & ILabelPreferenceConstants.DISP_VISIBILITY) == ILabelPreferenceConstants.DISP_VISIBILITY) {
- String visibility;
- switch(property.getVisibility().getValue()) {
- case VisibilityKind.PACKAGE:
- visibility = "~";
- break;
- case VisibilityKind.PUBLIC:
- visibility = "+";
- break;
- case VisibilityKind.PROTECTED:
- visibility = "#";
- break;
- case VisibilityKind.PRIVATE:
- visibility = "-";
- break;
- default:
- visibility = "+";
- break;
- }
- result = String.format(VISIBILITY_FORMAT, visibility, result);
- }
-
- // manage derived modifier
- if(((flags & ILabelPreferenceConstants.DISP_DERIVE) == ILabelPreferenceConstants.DISP_DERIVE) && (property.isDerived())) {
- result = String.format(DERIVED_FORMAT, result);
- }
-
- // manage name
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (property.isSetName())) {
- String name = property.getName();
- result = String.format(NAME_FORMAT, result, name);
- }
-
- // manage type and conjugated property
- if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
-
- String type = "<Undefined>";
- if(property.getType() != null) {
- type = property.getType().getName();
- }
-
- // If type is undefined only show "<Undefined>" when explicitly asked.
- if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
- if((flowPort != null) && (flowPort.isConjugated())) {
- type = String.format(CONJUGATED_FORMAT, type);
- }
- result = String.format(TYPE_FORMAT, result, type);
- }
- }
-
- // manage multiplicity
- if(((flags & ILabelPreferenceConstants.DISP_MULTIPLICITY) == ILabelPreferenceConstants.DISP_MULTIPLICITY)) {
-
- // If multiplicity is [1] (SysML default), only show when explicitly asked.
- // TODO : add a case for default with multiplicity not set.
- String lower = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getLowerValue()) : "1";
- String upper = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getUpperValue()) : "1";
- if(((flags & ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) == ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) || !("1".equals(lower) && "1".equals(upper))) {
-
- if(lower.equals(upper)) {
- result = String.format(MULTIPLICITY_FORMAT_ALT, result, lower, upper);
- } else {
- result = String.format(MULTIPLICITY_FORMAT, result, lower, upper);
- }
- }
- }
-
- // manage default value
- if(((flags & ILabelPreferenceConstants.DISP_DEFAULTVALUE) == ILabelPreferenceConstants.DISP_DEFAULTVALUE) && ((property.getDefaultValue() != null))) {
- ValueSpecification valueSpecification = property.getDefaultValue();
- if(valueSpecification instanceof InstanceValue && property.getType().equals(valueSpecification.getType())) {
- result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
- }
- }
-
- // manage modifier
- if((flags & ILabelPreferenceConstants.DISP_MODIFIERS) == ILabelPreferenceConstants.DISP_MODIFIERS) {
- StringBuffer sb = new StringBuffer();
- if(property.isReadOnly()) {
- sb.append(sb.length() == 0 ? "readOnly" : ", readOnly");
- }
- if(property.isOrdered()) {
- sb.append(sb.length() == 0 ? "ordered" : ", ordered");
- }
- if(property.isUnique()) {
- sb.append(sb.length() == 0 ? "unique" : ", unique");
- }
- if(property.isDerivedUnion()) {
- sb.append(sb.length() == 0 ? "union" : ", union");
- }
- EList<Property> redefinedProperties = property.getRedefinedProperties();
- if(redefinedProperties != null && !redefinedProperties.isEmpty()) {
- for(Property p : redefinedProperties) {
- sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
- }
- }
- if(sb.length() != 0) {
- result = String.format(MODIFIER_FORMAT, result, sb.toString());
- }
- }
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return PortandflowsPackage.eINSTANCE.getFlowPort_Direction().equals(feature) || PortandflowsPackage.eINSTANCE.getFlowPort_IsConjugated().equals(feature) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = super.getSemanticElementsBeingParsed(element);
-
- if((element != null) && (element instanceof Port)) {
- Port semElement = (Port)element;
-
- FlowPort flowPort = UMLUtil.getStereotypeApplication(semElement, FlowPort.class);
- if(flowPort != null) {
- semanticElementsBeingParsed.add(flowPort);
- }
- }
- return semanticElementsBeingParsed;
- }
-
- @Override
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(10);
- masks.put(ILabelPreferenceConstants.DISP_DIRECTION, "Direction");
- masks.put(ILabelPreferenceConstants.DISP_VISIBILITY, "Visibility");
- masks.put(ILabelPreferenceConstants.DISP_DERIVE, "Is Derived");
- masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
- masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
- masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
- masks.put(ILabelPreferenceConstants.DISP_MULTIPLICITY, "Multiplicity");
- masks.put(ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY, "Show default multiplicity");
- masks.put(ILabelPreferenceConstants.DISP_DEFAULTVALUE, "Default Value");
- masks.put(ILabelPreferenceConstants.DISP_MODIFIERS, "Modifiers");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.parser;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
+import org.eclipse.papyrus.sysml.portandflows.FlowPort;
+import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.uml.diagram.common.parser.PropertyLabelParser;
+import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.ValueSpecification;
+import org.eclipse.uml2.uml.VisibilityKind;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * Semantic Parser for {@link FlowPort}
+ */
+public class FlowPortLabelParser extends PropertyLabelParser {
+
+ /** The String format for displaying a FlowProperty with direction */
+ protected static final String DIRECTION_FORMAT = "%s %s";
+
+ /** The String format for displaying a FlowProperty with direction */
+ protected static final String CONJUGATED_FORMAT = "~%s";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if(flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Port)) {
+
+ Property property = (Property)eObject;
+
+ FlowPort flowPort = UMLUtil.getStereotypeApplication(property, FlowPort.class);
+ if(flowPort != null) {
+
+ int directionFlag = flags & ILabelPreferenceConstants.DISP_DIRECTION;
+ // manage direction only if the FlowPort is type and type is not a FlowSpecification
+ if((flags & ILabelPreferenceConstants.DISP_DIRECTION) == ILabelPreferenceConstants.DISP_DIRECTION) {
+ String direction;
+ switch(flowPort.getDirection().getValue()) {
+ case FlowDirection.IN_VALUE:
+ direction = "in";
+ break;
+ case FlowDirection.OUT_VALUE:
+ direction = "out";
+ break;
+ case FlowDirection.INOUT_VALUE:
+ direction = "inout";
+ break;
+ default:
+ direction = "inout";
+ break;
+ }
+
+ // manage direction only if the FlowPort is not a FlowSpecification
+ if((property.getType() == null) || ((property.getType() != null) && (UMLUtil.getStereotypeApplication(property.getType(), FlowSpecification.class) == null))) {
+ result = String.format(DIRECTION_FORMAT, direction, result);
+ }
+ }
+ }
+
+ // manage visibility
+ if((flags & ILabelPreferenceConstants.DISP_VISIBILITY) == ILabelPreferenceConstants.DISP_VISIBILITY) {
+ String visibility;
+ switch(property.getVisibility().getValue()) {
+ case VisibilityKind.PACKAGE:
+ visibility = "~";
+ break;
+ case VisibilityKind.PUBLIC:
+ visibility = "+";
+ break;
+ case VisibilityKind.PROTECTED:
+ visibility = "#";
+ break;
+ case VisibilityKind.PRIVATE:
+ visibility = "-";
+ break;
+ default:
+ visibility = "+";
+ break;
+ }
+ result = String.format(VISIBILITY_FORMAT, visibility, result);
+ }
+
+ // manage derived modifier
+ if(((flags & ILabelPreferenceConstants.DISP_DERIVE) == ILabelPreferenceConstants.DISP_DERIVE) && (property.isDerived())) {
+ result = String.format(DERIVED_FORMAT, result);
+ }
+
+ // manage name
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (property.isSetName())) {
+ String name = property.getName();
+ result = String.format(NAME_FORMAT, result, name);
+ }
+
+ // manage type and conjugated property
+ if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
+
+ String type = "<Undefined>";
+ if(property.getType() != null) {
+ type = property.getType().getName();
+ }
+
+ // If type is undefined only show "<Undefined>" when explicitly asked.
+ if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
+ if((flowPort != null) && (flowPort.isConjugated())) {
+ type = String.format(CONJUGATED_FORMAT, type);
+ }
+ result = String.format(TYPE_FORMAT, result, type);
+ }
+ }
+
+ // manage multiplicity
+ if(((flags & ILabelPreferenceConstants.DISP_MULTIPLICITY) == ILabelPreferenceConstants.DISP_MULTIPLICITY)) {
+
+ // If multiplicity is [1] (SysML default), only show when explicitly asked.
+ // TODO : add a case for default with multiplicity not set.
+ String lower = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getLowerValue()) : "1";
+ String upper = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getUpperValue()) : "1";
+ if(((flags & ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) == ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) || !("1".equals(lower) && "1".equals(upper))) {
+
+ if(lower.equals(upper)) {
+ result = String.format(MULTIPLICITY_FORMAT_ALT, result, lower, upper);
+ } else {
+ result = String.format(MULTIPLICITY_FORMAT, result, lower, upper);
+ }
+ }
+ }
+
+ // manage default value
+ if(((flags & ILabelPreferenceConstants.DISP_DEFAULTVALUE) == ILabelPreferenceConstants.DISP_DEFAULTVALUE) && ((property.getDefaultValue() != null))) {
+ ValueSpecification valueSpecification = property.getDefaultValue();
+ if(valueSpecification instanceof InstanceValue && property.getType().equals(valueSpecification.getType())) {
+ result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
+ }
+ }
+
+ // manage modifier
+ if((flags & ILabelPreferenceConstants.DISP_MODIFIERS) == ILabelPreferenceConstants.DISP_MODIFIERS) {
+ StringBuffer sb = new StringBuffer();
+ if(property.isReadOnly()) {
+ sb.append(sb.length() == 0 ? "readOnly" : ", readOnly");
+ }
+ if(property.isOrdered()) {
+ sb.append(sb.length() == 0 ? "ordered" : ", ordered");
+ }
+ if(property.isUnique()) {
+ sb.append(sb.length() == 0 ? "unique" : ", unique");
+ }
+ if(property.isDerivedUnion()) {
+ sb.append(sb.length() == 0 ? "union" : ", union");
+ }
+ EList<Property> redefinedProperties = property.getRedefinedProperties();
+ if(redefinedProperties != null && !redefinedProperties.isEmpty()) {
+ for(Property p : redefinedProperties) {
+ sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
+ }
+ }
+ if(sb.length() != 0) {
+ result = String.format(MODIFIER_FORMAT, result, sb.toString());
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return PortandflowsPackage.eINSTANCE.getFlowPort_Direction().equals(feature) || PortandflowsPackage.eINSTANCE.getFlowPort_IsConjugated().equals(feature) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = super.getSemanticElementsBeingParsed(element);
+
+ if((element != null) && (element instanceof Port)) {
+ Port semElement = (Port)element;
+
+ FlowPort flowPort = UMLUtil.getStereotypeApplication(semElement, FlowPort.class);
+ if(flowPort != null) {
+ semanticElementsBeingParsed.add(flowPort);
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ @Override
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(10);
+ masks.put(ILabelPreferenceConstants.DISP_DIRECTION, "Direction");
+ masks.put(ILabelPreferenceConstants.DISP_VISIBILITY, "Visibility");
+ masks.put(ILabelPreferenceConstants.DISP_DERIVE, "Is Derived");
+ masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
+ masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
+ masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
+ masks.put(ILabelPreferenceConstants.DISP_MULTIPLICITY, "Multiplicity");
+ masks.put(ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY, "Show default multiplicity");
+ masks.put(ILabelPreferenceConstants.DISP_DEFAULTVALUE, "Default Value");
+ masks.put(ILabelPreferenceConstants.DISP_MODIFIERS, "Modifiers");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPropertyLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPropertyLabelParser.java
index 8a4ae645c7e..9edb455a35f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPropertyLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/FlowPropertyLabelParser.java
@@ -1,132 +1,132 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.parser;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
-import org.eclipse.papyrus.sysml.portandflows.FlowProperty;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.uml.diagram.common.parser.PropertyLabelParser;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/**
- * Semantic Parser for {@link FlowProperty}
- */
-public class FlowPropertyLabelParser extends PropertyLabelParser {
-
- /** The String format for displaying a FlowProperty with direction */
- protected static final String DIRECTION_FORMAT = "%s %s";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
-
- if (flags == 0) {
- return MaskedLabel;
- }
-
- String result = super.getPrintString(element, flags);
-
- EObject eObject = (EObject)element.getAdapter(EObject.class);
- if((eObject != null) && (eObject instanceof Property)) {
-
- Property property = (Property)eObject;
- FlowProperty flowProperty = UMLUtil.getStereotypeApplication(property, FlowProperty.class);
- if(flowProperty != null) {
-
- // manage direction
- if((flags & ILabelPreferenceConstants.DISP_DIRECTION) == ILabelPreferenceConstants.DISP_DIRECTION) {
- String direction;
- switch(flowProperty.getDirection().getValue()) {
- case FlowDirection.IN_VALUE:
- direction = "in";
- break;
- case FlowDirection.OUT_VALUE:
- direction = "out";
- break;
- case FlowDirection.INOUT_VALUE:
- direction = "inout";
- break;
- default:
- direction = "inout";
- break;
- }
- result = String.format(DIRECTION_FORMAT, direction, result);
- }
- }
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return PortandflowsPackage.eINSTANCE.getFlowProperty_Direction().equals(feature) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = super.getSemanticElementsBeingParsed(element);
-
- if((element != null) && (element instanceof Property)) {
- Property semElement = (Property)element;
-
- FlowProperty flowProperty = UMLUtil.getStereotypeApplication(semElement, FlowProperty.class);
- if(flowProperty != null) {
- semanticElementsBeingParsed.add(flowProperty);
- }
- }
- return semanticElementsBeingParsed;
- }
-
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(10);
- masks.put(ILabelPreferenceConstants.DISP_DIRECTION, "Direction");
- masks.put(ILabelPreferenceConstants.DISP_VISIBILITY, "Visibility");
- masks.put(ILabelPreferenceConstants.DISP_DERIVE, "Is Derived");
- masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
- masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
- masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
- masks.put(ILabelPreferenceConstants.DISP_MULTIPLICITY, "Multiplicity");
- masks.put(ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY, "Show default multiplicity");
- masks.put(ILabelPreferenceConstants.DISP_DEFAULTVALUE, "Default Value");
- masks.put(ILabelPreferenceConstants.DISP_MODIFIERS, "Modifiers");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.parser;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
+import org.eclipse.papyrus.sysml.portandflows.FlowProperty;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.uml.diagram.common.parser.PropertyLabelParser;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * Semantic Parser for {@link FlowProperty}
+ */
+public class FlowPropertyLabelParser extends PropertyLabelParser {
+
+ /** The String format for displaying a FlowProperty with direction */
+ protected static final String DIRECTION_FORMAT = "%s %s";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if (flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = super.getPrintString(element, flags);
+
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+ if((eObject != null) && (eObject instanceof Property)) {
+
+ Property property = (Property)eObject;
+ FlowProperty flowProperty = UMLUtil.getStereotypeApplication(property, FlowProperty.class);
+ if(flowProperty != null) {
+
+ // manage direction
+ if((flags & ILabelPreferenceConstants.DISP_DIRECTION) == ILabelPreferenceConstants.DISP_DIRECTION) {
+ String direction;
+ switch(flowProperty.getDirection().getValue()) {
+ case FlowDirection.IN_VALUE:
+ direction = "in";
+ break;
+ case FlowDirection.OUT_VALUE:
+ direction = "out";
+ break;
+ case FlowDirection.INOUT_VALUE:
+ direction = "inout";
+ break;
+ default:
+ direction = "inout";
+ break;
+ }
+ result = String.format(DIRECTION_FORMAT, direction, result);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return PortandflowsPackage.eINSTANCE.getFlowProperty_Direction().equals(feature) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = super.getSemanticElementsBeingParsed(element);
+
+ if((element != null) && (element instanceof Property)) {
+ Property semElement = (Property)element;
+
+ FlowProperty flowProperty = UMLUtil.getStereotypeApplication(semElement, FlowProperty.class);
+ if(flowProperty != null) {
+ semanticElementsBeingParsed.add(flowProperty);
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(10);
+ masks.put(ILabelPreferenceConstants.DISP_DIRECTION, "Direction");
+ masks.put(ILabelPreferenceConstants.DISP_VISIBILITY, "Visibility");
+ masks.put(ILabelPreferenceConstants.DISP_DERIVE, "Is Derived");
+ masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
+ masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
+ masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
+ masks.put(ILabelPreferenceConstants.DISP_MULTIPLICITY, "Multiplicity");
+ masks.put(ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY, "Show default multiplicity");
+ masks.put(ILabelPreferenceConstants.DISP_DEFAULTVALUE, "Default Value");
+ masks.put(ILabelPreferenceConstants.DISP_MODIFIERS, "Modifiers");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java
index a67c76c689b..f41231b13cf 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/RequirementLabelParser.java
@@ -1,89 +1,89 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.sysml.requirements.Requirement;
-import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/**
- * Semantic Parser for {@link Requirement}
- */
-public class RequirementLabelParser extends NamedElementLabelParser {
-
- /** The String format for displaying a Requirement name */
- protected static final String NAME_FORMAT = "%s";
-
- /** The String format for displaying a FlowProperty with direction */
- protected static final String ID_FORMAT = "%s{id = %s}";
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Class)) {
-
- Class clazz = (Class)eObject;
- Requirement requirement = UMLUtil.getStereotypeApplication(clazz, Requirement.class);
-
- // manage name
- if((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) {
- String name = clazz.getName();
- result = String.format(NAME_FORMAT, name);
- }
-
-
- if(requirement != null) {
-
- // manage id
- if((flags & ILabelPreferenceConstants.DISP_ID) == ILabelPreferenceConstants.DISP_ID) {
- String id = requirement.getId();
- result = String.format(ID_FORMAT, result, id);
- }
- }
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof Class)) {
- Class semElement = (Class)element;
-
- semanticElementsBeingParsed.add(semElement);
-
- Requirement requirement = UMLUtil.getStereotypeApplication(semElement, Requirement.class);
- if(requirement != null) {
- semanticElementsBeingParsed.add(requirement);
- }
- }
- return semanticElementsBeingParsed;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.requirements.Requirement;
+import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * Semantic Parser for {@link Requirement}
+ */
+public class RequirementLabelParser extends NamedElementLabelParser {
+
+ /** The String format for displaying a Requirement name */
+ protected static final String NAME_FORMAT = "%s";
+
+ /** The String format for displaying a FlowProperty with direction */
+ protected static final String ID_FORMAT = "%s{id = %s}";
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Class)) {
+
+ Class clazz = (Class)eObject;
+ Requirement requirement = UMLUtil.getStereotypeApplication(clazz, Requirement.class);
+
+ // manage name
+ if((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) {
+ String name = clazz.getName();
+ result = String.format(NAME_FORMAT, name);
+ }
+
+
+ if(requirement != null) {
+
+ // manage id
+ if((flags & ILabelPreferenceConstants.DISP_ID) == ILabelPreferenceConstants.DISP_ID) {
+ String id = requirement.getId();
+ result = String.format(ID_FORMAT, result, id);
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof Class)) {
+ Class semElement = (Class)element;
+
+ semanticElementsBeingParsed.add(semElement);
+
+ Requirement requirement = UMLUtil.getStereotypeApplication(semElement, Requirement.class);
+ if(requirement != null) {
+ semanticElementsBeingParsed.add(requirement);
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java
index c0e335954f7..66141a680b9 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/parser/UnitLabelParser.java
@@ -1,126 +1,126 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
-import org.eclipse.papyrus.sysml.blocks.Dimension;
-import org.eclipse.papyrus.sysml.blocks.Unit;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
-import org.eclipse.uml2.uml.InstanceSpecification;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/**
- * Semantic Parser for {@link Unit}
- */
-public class UnitLabelParser extends NamedElementLabelParser {
-
- /** The String format for displaying a {@link Unit} label with its name */
- protected static final String NAME_FORMAT = "%s";
-
- /** The String format for displaying a {@link Unit} with direction */
- protected static final String DIMENSION_FORMAT = "%s {%s}";
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
-
- if (flags == 0) {
- return MaskedLabel;
- }
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof InstanceSpecification)) {
-
- InstanceSpecification iSpec = (InstanceSpecification)eObject;
-
- Unit unit = UMLUtil.getStereotypeApplication(iSpec, Unit.class);
-
- // manage name
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (iSpec.isSetName())) {
- String name = iSpec.getName();
- result = String.format(NAME_FORMAT, name);
- }
-
- // manage dimension
- if(((flags & ILabelPreferenceConstants.DISP_DIMENSION) == ILabelPreferenceConstants.DISP_DIMENSION)) {
- String dimensionName = "<Undefined>";
- if((unit != null) && (unit.getDimension() != null)) {
- Dimension dim = unit.getDimension();
- if((dim.getBase_InstanceSpecification() != null) && (dim.getBase_InstanceSpecification().isSetName())) {
- dimensionName = dim.getBase_InstanceSpecification().getName();
- }
- }
- result = String.format(DIMENSION_FORMAT, result, dimensionName);
- }
-
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return BlocksPackage.eINSTANCE.getUnit_Dimension().equals(feature) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof InstanceSpecification)) {
- InstanceSpecification semElement = (InstanceSpecification)element;
-
- semanticElementsBeingParsed.add(semElement);
-
- Unit unit = UMLUtil.getStereotypeApplication(semElement, Unit.class);
- if(unit != null) {
- semanticElementsBeingParsed.add(unit);
- }
- }
- return semanticElementsBeingParsed;
- }
-
-
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(2);
- masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
- masks.put(ILabelPreferenceConstants.DISP_DIMENSION, "Dimension");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.sysml.blocks.Dimension;
+import org.eclipse.papyrus.sysml.blocks.Unit;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
+import org.eclipse.uml2.uml.InstanceSpecification;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * Semantic Parser for {@link Unit}
+ */
+public class UnitLabelParser extends NamedElementLabelParser {
+
+ /** The String format for displaying a {@link Unit} label with its name */
+ protected static final String NAME_FORMAT = "%s";
+
+ /** The String format for displaying a {@link Unit} with direction */
+ protected static final String DIMENSION_FORMAT = "%s {%s}";
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if (flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof InstanceSpecification)) {
+
+ InstanceSpecification iSpec = (InstanceSpecification)eObject;
+
+ Unit unit = UMLUtil.getStereotypeApplication(iSpec, Unit.class);
+
+ // manage name
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (iSpec.isSetName())) {
+ String name = iSpec.getName();
+ result = String.format(NAME_FORMAT, name);
+ }
+
+ // manage dimension
+ if(((flags & ILabelPreferenceConstants.DISP_DIMENSION) == ILabelPreferenceConstants.DISP_DIMENSION)) {
+ String dimensionName = "<Undefined>";
+ if((unit != null) && (unit.getDimension() != null)) {
+ Dimension dim = unit.getDimension();
+ if((dim.getBase_InstanceSpecification() != null) && (dim.getBase_InstanceSpecification().isSetName())) {
+ dimensionName = dim.getBase_InstanceSpecification().getName();
+ }
+ }
+ result = String.format(DIMENSION_FORMAT, result, dimensionName);
+ }
+
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return BlocksPackage.eINSTANCE.getUnit_Dimension().equals(feature) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof InstanceSpecification)) {
+ InstanceSpecification semElement = (InstanceSpecification)element;
+
+ semanticElementsBeingParsed.add(semElement);
+
+ Unit unit = UMLUtil.getStereotypeApplication(semElement, Unit.class);
+ if(unit != null) {
+ semanticElementsBeingParsed.add(unit);
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(2);
+ masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
+ masks.put(ILabelPreferenceConstants.DISP_DIMENSION, "Dimension");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/ILabelPreferenceConstants.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/ILabelPreferenceConstants.java
index 8409519101e..6711d85583c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/ILabelPreferenceConstants.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/ILabelPreferenceConstants.java
@@ -1,89 +1,89 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.preferences;
-
-/**
- * Label constants for label mask preferences.
- */
-public interface ILabelPreferenceConstants {
-
- /** preference id for display labels */
- public String LABEL_DISPLAY_PREFERENCE = "label.display";
-
- /** Style constant for visibility display in labels. */
- public final static int DISP_VISIBILITY = 1 << 1;
-
- /** Style constant for isDerive display in labels. */
- public final static int DISP_DERIVE = 1 << 2;
-
- /** Style constant for name display in labels. */
- public final static int DISP_NAME = 1 << 3;
-
- /** Style constant for type display in labels. */
- public final static int DISP_TYPE = 1 << 4;
-
- /** Style constant for multiplicity display in labels. */
- public final static int DISP_MULTIPLICITY = 1 << 5;
-
- /** Style constant for default value display in labels. */
- public final static int DISP_DEFAULTVALUE = 1 << 6;
-
- /** Style constant for modifiers display in labels. */
- public final static int DISP_MODIFIERS = 1 << 7;
-
- /** Style constant for direction display in labels. */
- public final static int DISP_DIRECTION = 1 << 8;
-
- /** Style constant for conjugated info display in labels. */
- public final static int DISP_CONJUGATED = 1 << 9;
-
- /** Style constant for id info display in labels. */
- public final static int DISP_ID = 1 << 10;
-
- /** Style constant for dimension info display in labels. */
- public final static int DISP_DIMENSION = 1 << 11;
-
- /** Style constant for specification info display in labels. */
- public final static int DISP_SPECIFICATION = 1 << 12;
-
- /** Style constant for signal info display in labels. */
- public final static int DISP_SIGNAL = 1 << 13;
-
- /** Style constant for parameter name display in labels. */
- public final static int DISP_PARAM_NAME = 1 << 14;
-
- /** Style constant for parameter type display in labels. */
- public final static int DISP_PARAM_TYPE = 1 << 15;
-
- /** Style constant for parameter multiplicity display in labels. */
- public final static int DISP_PARAM_MULTIPLICITY = 1 << 16;
-
- /** Style constant for parameter default value display in labels. */
- public final static int DISP_PARAM_DEFAULTVALUE = 1 << 17;
-
- /** Style constant for parameter modifiers display in labels. */
- public final static int DISP_PARAM_MODIFIERS = 1 << 18;
-
- /** Style constant for parameter direction display in labels. */
- public final static int DISP_PARAM_DIRECTION = 1 << 19;
-
- /** Style constant forcing multiplicity display in labels. */
- public final static int DISP_DEFAULT_MULTIPLICITY = 1 << 20;
-
- /** Style constant forcing type display in labels. */
- public final static int DISP_UNDEFINED_TYPE = 1 << 21;
-
- /** Style constant forcing name display in labels. */
- public final static int DISP_NON_NAVIGABLE_ROLE = 1 << 22;
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.preferences;
+
+/**
+ * Label constants for label mask preferences.
+ */
+public interface ILabelPreferenceConstants {
+
+ /** preference id for display labels */
+ public String LABEL_DISPLAY_PREFERENCE = "label.display";
+
+ /** Style constant for visibility display in labels. */
+ public final static int DISP_VISIBILITY = 1 << 1;
+
+ /** Style constant for isDerive display in labels. */
+ public final static int DISP_DERIVE = 1 << 2;
+
+ /** Style constant for name display in labels. */
+ public final static int DISP_NAME = 1 << 3;
+
+ /** Style constant for type display in labels. */
+ public final static int DISP_TYPE = 1 << 4;
+
+ /** Style constant for multiplicity display in labels. */
+ public final static int DISP_MULTIPLICITY = 1 << 5;
+
+ /** Style constant for default value display in labels. */
+ public final static int DISP_DEFAULTVALUE = 1 << 6;
+
+ /** Style constant for modifiers display in labels. */
+ public final static int DISP_MODIFIERS = 1 << 7;
+
+ /** Style constant for direction display in labels. */
+ public final static int DISP_DIRECTION = 1 << 8;
+
+ /** Style constant for conjugated info display in labels. */
+ public final static int DISP_CONJUGATED = 1 << 9;
+
+ /** Style constant for id info display in labels. */
+ public final static int DISP_ID = 1 << 10;
+
+ /** Style constant for dimension info display in labels. */
+ public final static int DISP_DIMENSION = 1 << 11;
+
+ /** Style constant for specification info display in labels. */
+ public final static int DISP_SPECIFICATION = 1 << 12;
+
+ /** Style constant for signal info display in labels. */
+ public final static int DISP_SIGNAL = 1 << 13;
+
+ /** Style constant for parameter name display in labels. */
+ public final static int DISP_PARAM_NAME = 1 << 14;
+
+ /** Style constant for parameter type display in labels. */
+ public final static int DISP_PARAM_TYPE = 1 << 15;
+
+ /** Style constant for parameter multiplicity display in labels. */
+ public final static int DISP_PARAM_MULTIPLICITY = 1 << 16;
+
+ /** Style constant for parameter default value display in labels. */
+ public final static int DISP_PARAM_DEFAULTVALUE = 1 << 17;
+
+ /** Style constant for parameter modifiers display in labels. */
+ public final static int DISP_PARAM_MODIFIERS = 1 << 18;
+
+ /** Style constant for parameter direction display in labels. */
+ public final static int DISP_PARAM_DIRECTION = 1 << 19;
+
+ /** Style constant forcing multiplicity display in labels. */
+ public final static int DISP_DEFAULT_MULTIPLICITY = 1 << 20;
+
+ /** Style constant forcing type display in labels. */
+ public final static int DISP_UNDEFINED_TYPE = 1 << 21;
+
+ /** Style constant forcing name display in labels. */
+ public final static int DISP_NON_NAVIGABLE_ROLE = 1 << 22;
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/LabelPreferenceHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/LabelPreferenceHelper.java
index 0e17b58d5ea..b748bc77fe8 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/LabelPreferenceHelper.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/preferences/LabelPreferenceHelper.java
@@ -1,50 +1,50 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.preferences;
-
-/**
- * Utility class for building label preference constants.
- */
-public class LabelPreferenceHelper {
-
- /**
- * Create the preference constant for a label view.
- *
- * @param diagramType
- * the type of diagram
- * @param viewType
- * the type of the view
- * @param constantPreferenceKey
- * the constant key of the preference to retrieve
- * @return the complete preference key
- * @deprecated see https://bugs.eclipse.org/bugs/show_bug.cgi?id=353193
- */
- @Deprecated
- public static String getPreferenceConstant(String diagramType, String viewType, String constantPreferenceKey) {
- return diagramType + '_' + viewType + '.' + constantPreferenceKey;
- }
-
- /**
- * Create the preference constant for a label view.
- *
- * @param elementkey
- * the element key (including diagram hint)
- * @param constantPreferenceKey
- * the constant key of the preference to retrieve
- * @return the complete preference key
- */
- public static String getPreferenceConstant(String elementkey, String constantPreferenceKey) {
- return elementkey + '.' + constantPreferenceKey;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.preferences;
+
+/**
+ * Utility class for building label preference constants.
+ */
+public class LabelPreferenceHelper {
+
+ /**
+ * Create the preference constant for a label view.
+ *
+ * @param diagramType
+ * the type of diagram
+ * @param viewType
+ * the type of the view
+ * @param constantPreferenceKey
+ * the constant key of the preference to retrieve
+ * @return the complete preference key
+ * @deprecated see https://bugs.eclipse.org/bugs/show_bug.cgi?id=353193
+ */
+ @Deprecated
+ public static String getPreferenceConstant(String diagramType, String viewType, String constantPreferenceKey) {
+ return diagramType + '_' + viewType + '.' + constantPreferenceKey;
+ }
+
+ /**
+ * Create the preference constant for a label view.
+ *
+ * @param elementkey
+ * the element key (including diagram hint)
+ * @param constantPreferenceKey
+ * the constant key of the preference to retrieve
+ * @return the complete preference key
+ */
+ public static String getPreferenceConstant(String elementkey, String constantPreferenceKey) {
+ return elementkey + '.' + constantPreferenceKey;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/dnd/helper/LinkMappingHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/dnd/helper/LinkMappingHelper.java
index 3ca34d31c52..93dbf89a877 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/dnd/helper/LinkMappingHelper.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/dnd/helper/LinkMappingHelper.java
@@ -1,156 +1,156 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.dnd.helper;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.ILinkMappingHelper;
-import org.eclipse.uml2.uml.util.UMLSwitch;
-
-/**
- * Original class {@link org.eclipse.papyrus.uml.diagram.common.helper.LinkMappingHelper} slightly
- * modified to use EObject instead of UML Element in its interface.
- */
-public class LinkMappingHelper implements ILinkMappingHelper {
-
- /**
- * {@inheritDoc}
- */
- public Collection<?> getSource(EObject link) {
- CommonSourceUMLSwitch umlSwitch = new CommonSourceUMLSwitch();
- return umlSwitch.doSwitch(link);
- }
-
- /**
- * {@inheritDoc}
- */
- public Collection<?> getTarget(EObject link) {
- CommonTargetUMLSwitch umlSwitch = new CommonTargetUMLSwitch();
- return umlSwitch.doSwitch(link);
- }
-
- /**
- * Contains diagrams common behavior that need to be redefined
- *
- * @author eperico
- */
- public static class CommonSourceUMLSwitch extends UMLSwitch<Collection<?>> {
-
- @Override
- public java.util.Collection<?> caseAssociation(org.eclipse.uml2.uml.Association object) {
- return object.getEndTypes();
- };
-
- @Override
- public java.util.Collection<?> caseComment(org.eclipse.uml2.uml.Comment object) {
- ArrayList<EObject> result = new ArrayList<EObject>();
- result.add(object);
- return result;
- };
-
- @Override
- public Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
- return object.getClients();
- };
-
- @Override
- public java.util.Collection<?> caseGeneralization(org.eclipse.uml2.uml.Generalization object) {
- ArrayList<EObject> result = new ArrayList<EObject>();
- result.add(object.getOwner());
- return result;
- };
-
- @Override
- public java.util.Collection<?> casePackageMerge(org.eclipse.uml2.uml.PackageMerge object) {
- ArrayList<EObject> result = new ArrayList<EObject>();
- result.add(object.getReceivingPackage());
- return result;
- };
-
- @Override
- public java.util.Collection<?> casePackageImport(org.eclipse.uml2.uml.PackageImport object) {
- ArrayList<EObject> result = new ArrayList<EObject>();
- result.add(object.getImportingNamespace());
- return result;
- };
-
- @Override
- public Collection<?> caseInformationFlow(org.eclipse.uml2.uml.InformationFlow object) {
- return object.getInformationSources();
- };
-
- @Override
- public Collection<?> defaultCase(org.eclipse.emf.ecore.EObject object) {
- return Collections.EMPTY_LIST;
- };
- }
-
- /**
- * Contains diagrams common behavior that need to be redefined
- *
- * @author eperico
- */
- public static class CommonTargetUMLSwitch extends UMLSwitch<Collection<?>> {
-
- @Override
- public java.util.Collection<?> caseAssociation(org.eclipse.uml2.uml.Association object) {
- return object.getEndTypes();
- };
-
- @Override
- public java.util.Collection<?> caseComment(org.eclipse.uml2.uml.Comment object) {
- return object.getAnnotatedElements();
- };
-
- @Override
- public Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
- return object.getSuppliers();
- };
-
- @Override
- public java.util.Collection<?> caseGeneralization(org.eclipse.uml2.uml.Generalization object) {
- ArrayList<EObject> result = new ArrayList<EObject>();
- result.add(object.getGeneral());
- return result;
- };
-
- @Override
- public java.util.Collection<?> casePackageMerge(org.eclipse.uml2.uml.PackageMerge object) {
- ArrayList<EObject> result = new ArrayList<EObject>();
- result.add(object.getMergedPackage());
- return result;
- };
-
- @Override
- public java.util.Collection<?> casePackageImport(org.eclipse.uml2.uml.PackageImport object) {
- ArrayList<EObject> result = new ArrayList<EObject>();
- result.add(object.getImportedPackage());
- return result;
- };
-
- @Override
- public Collection<?> caseInformationFlow(org.eclipse.uml2.uml.InformationFlow object) {
- return object.getInformationTargets();
- };
-
- @Override
- public Collection<?> defaultCase(org.eclipse.emf.ecore.EObject object) {
- return Collections.EMPTY_LIST;
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dnd.helper;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.ILinkMappingHelper;
+import org.eclipse.uml2.uml.util.UMLSwitch;
+
+/**
+ * Original class {@link org.eclipse.papyrus.uml.diagram.common.helper.LinkMappingHelper} slightly
+ * modified to use EObject instead of UML Element in its interface.
+ */
+public class LinkMappingHelper implements ILinkMappingHelper {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Collection<?> getSource(EObject link) {
+ CommonSourceUMLSwitch umlSwitch = new CommonSourceUMLSwitch();
+ return umlSwitch.doSwitch(link);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Collection<?> getTarget(EObject link) {
+ CommonTargetUMLSwitch umlSwitch = new CommonTargetUMLSwitch();
+ return umlSwitch.doSwitch(link);
+ }
+
+ /**
+ * Contains diagrams common behavior that need to be redefined
+ *
+ * @author eperico
+ */
+ public static class CommonSourceUMLSwitch extends UMLSwitch<Collection<?>> {
+
+ @Override
+ public java.util.Collection<?> caseAssociation(org.eclipse.uml2.uml.Association object) {
+ return object.getEndTypes();
+ };
+
+ @Override
+ public java.util.Collection<?> caseComment(org.eclipse.uml2.uml.Comment object) {
+ ArrayList<EObject> result = new ArrayList<EObject>();
+ result.add(object);
+ return result;
+ };
+
+ @Override
+ public Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
+ return object.getClients();
+ };
+
+ @Override
+ public java.util.Collection<?> caseGeneralization(org.eclipse.uml2.uml.Generalization object) {
+ ArrayList<EObject> result = new ArrayList<EObject>();
+ result.add(object.getOwner());
+ return result;
+ };
+
+ @Override
+ public java.util.Collection<?> casePackageMerge(org.eclipse.uml2.uml.PackageMerge object) {
+ ArrayList<EObject> result = new ArrayList<EObject>();
+ result.add(object.getReceivingPackage());
+ return result;
+ };
+
+ @Override
+ public java.util.Collection<?> casePackageImport(org.eclipse.uml2.uml.PackageImport object) {
+ ArrayList<EObject> result = new ArrayList<EObject>();
+ result.add(object.getImportingNamespace());
+ return result;
+ };
+
+ @Override
+ public Collection<?> caseInformationFlow(org.eclipse.uml2.uml.InformationFlow object) {
+ return object.getInformationSources();
+ };
+
+ @Override
+ public Collection<?> defaultCase(org.eclipse.emf.ecore.EObject object) {
+ return Collections.EMPTY_LIST;
+ };
+ }
+
+ /**
+ * Contains diagrams common behavior that need to be redefined
+ *
+ * @author eperico
+ */
+ public static class CommonTargetUMLSwitch extends UMLSwitch<Collection<?>> {
+
+ @Override
+ public java.util.Collection<?> caseAssociation(org.eclipse.uml2.uml.Association object) {
+ return object.getEndTypes();
+ };
+
+ @Override
+ public java.util.Collection<?> caseComment(org.eclipse.uml2.uml.Comment object) {
+ return object.getAnnotatedElements();
+ };
+
+ @Override
+ public Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
+ return object.getSuppliers();
+ };
+
+ @Override
+ public java.util.Collection<?> caseGeneralization(org.eclipse.uml2.uml.Generalization object) {
+ ArrayList<EObject> result = new ArrayList<EObject>();
+ result.add(object.getGeneral());
+ return result;
+ };
+
+ @Override
+ public java.util.Collection<?> casePackageMerge(org.eclipse.uml2.uml.PackageMerge object) {
+ ArrayList<EObject> result = new ArrayList<EObject>();
+ result.add(object.getMergedPackage());
+ return result;
+ };
+
+ @Override
+ public java.util.Collection<?> casePackageImport(org.eclipse.uml2.uml.PackageImport object) {
+ ArrayList<EObject> result = new ArrayList<EObject>();
+ result.add(object.getImportedPackage());
+ return result;
+ };
+
+ @Override
+ public Collection<?> caseInformationFlow(org.eclipse.uml2.uml.InformationFlow object) {
+ return object.getInformationTargets();
+ };
+
+ @Override
+ public Collection<?> defaultCase(org.eclipse.emf.ecore.EObject object) {
+ return Collections.EMPTY_LIST;
+ };
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementBorderEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementBorderEditPart.java
index a140dd5beaf..e3f9c410d81 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementBorderEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementBorderEditPart.java
@@ -1,228 +1,228 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.StackLayout;
-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.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.Edge;
-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.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractBorderEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.AffixedNamedElementFigure;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Abstract non-diagram specific edit part for border node.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public abstract class AbstractElementBorderEditPart extends AbstractBorderEditPart {
-
- protected IFigure contentPane;
-
- protected IFigure primaryShape;
-
- public AbstractElementBorderEditPart(View view) {
- super(view);
- }
-
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- }
-
- protected abstract LayoutEditPolicy createLayoutEditPolicy();
-
- protected IFigure createNodeShape() {
- return primaryShape = new AffixedNamedElementFigure();
- }
-
- public AffixedNamedElementFigure getPrimaryShape() {
- return (AffixedNamedElementFigure)primaryShape;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- // When a node has external node labels, the methods refreshChildren() removes the label's
- // edit part from the registry. Once removed from the registry the visibility cannot be set back to visible.
-
- // Copied from generated code for Affixed nodes to fix:
- // 366504: [SysML Block Definition Diagram] Cannot make masked labels of border items (Port) visible
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=366504
- // 366503: [SysML Internal Block Diagram] Cannot make masked labels of border items (Port) visible
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=366503
-
- // (this sounds strange as the "Show all labels" manages to get labels back without trouble...).
- if(NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
- Object notifier = event.getNotifier();
- List<?> modelChildren = ((View)getModel()).getChildren();
- if(!(notifier instanceof Edge)) {
- if(modelChildren.contains(event.getNotifier())) {
- return;
- }
- }
- }
- super.handleNotificationEvent(event);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void refreshBounds() {
- if(getBorderItemLocator() != null) {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
-
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
-
- // Update locator constraint
- IBorderItemLocator locator = getBorderItemLocator();
- locator.setConstraint(new Rectangle(loc, size));
-
- // Set new constraint on parent figure
- getFigure().getParent().setConstraint(getFigure(), locator);
-
- } else {
- super.refreshBounds();
- }
- }
-
- protected NodeFigure createNodePlate() {
- String prefElementId = getNotationView().getType();
- IPreferenceStore store = Activator.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- //FIXME: workaround for #154536
- result.getBounds().setSize(result.getPreferredSize());
- return result;
- }
-
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- protected IFigure setupContentPane(IFigure nodeShape) {
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- public abstract EditPart getPrimaryChildEditPart();
-
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- String prefKey = getNotationView().getType();
-
- IPreferenceStore store = (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(prefKey, PreferenceConstantHelper.COLOR_LINE);
-
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_FONT);
-
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_FILL);
-
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)store, prefColor));
-
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
-
- String prefGradient = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.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;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.StackLayout;
+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.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.Edge;
+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.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractBorderEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AffixedNamedElementFigure;
+import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * Abstract non-diagram specific edit part for border node.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public abstract class AbstractElementBorderEditPart extends AbstractBorderEditPart {
+
+ protected IFigure contentPane;
+
+ protected IFigure primaryShape;
+
+ public AbstractElementBorderEditPart(View view) {
+ super(view);
+ }
+
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
+ }
+
+ protected abstract LayoutEditPolicy createLayoutEditPolicy();
+
+ protected IFigure createNodeShape() {
+ return primaryShape = new AffixedNamedElementFigure();
+ }
+
+ public AffixedNamedElementFigure getPrimaryShape() {
+ return (AffixedNamedElementFigure)primaryShape;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ // When a node has external node labels, the methods refreshChildren() removes the label's
+ // edit part from the registry. Once removed from the registry the visibility cannot be set back to visible.
+
+ // Copied from generated code for Affixed nodes to fix:
+ // 366504: [SysML Block Definition Diagram] Cannot make masked labels of border items (Port) visible
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=366504
+ // 366503: [SysML Internal Block Diagram] Cannot make masked labels of border items (Port) visible
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=366503
+
+ // (this sounds strange as the "Show all labels" manages to get labels back without trouble...).
+ if(NotationPackage.eINSTANCE.getView_Visible().equals(event.getFeature())) {
+ Object notifier = event.getNotifier();
+ List<?> modelChildren = ((View)getModel()).getChildren();
+ if(!(notifier instanceof Edge)) {
+ if(modelChildren.contains(event.getNotifier())) {
+ return;
+ }
+ }
+ }
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void refreshBounds() {
+ if(getBorderItemLocator() != null) {
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ Point loc = new Point(x, y);
+
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ Dimension size = new Dimension(width, height);
+
+ // Update locator constraint
+ IBorderItemLocator locator = getBorderItemLocator();
+ locator.setConstraint(new Rectangle(loc, size));
+
+ // Set new constraint on parent figure
+ getFigure().getParent().setConstraint(getFigure(), locator);
+
+ } else {
+ super.refreshBounds();
+ }
+ }
+
+ protected NodeFigure createNodePlate() {
+ String prefElementId = getNotationView().getType();
+ IPreferenceStore store = Activator.getInstance().getPreferenceStore();
+ String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
+ String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
+
+ //FIXME: workaround for #154536
+ result.getBounds().setSize(result.getPreferredSize());
+ return result;
+ }
+
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ protected IFigure setupContentPane(IFigure nodeShape) {
+ return nodeShape; // use nodeShape itself as contentPane
+ }
+
+ /**
+ * @generated
+ */
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ public abstract EditPart getPrimaryChildEditPart();
+
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ String prefKey = getNotationView().getType();
+
+ IPreferenceStore store = (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(prefKey, PreferenceConstantHelper.COLOR_LINE);
+
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_FONT);
+
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_FILL);
+
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)store, prefColor));
+
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+
+ String prefGradient = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java
index 56beab793a0..ffa1143c800 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementChildLabelEditPart.java
@@ -1,863 +1,863 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- * Arthur Daussy - arthur.daussy@atos.net - 395920: [Block Diagram Definition] All element contained by a block should be able to be linked to constraint or comment
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.requests.DropRequest;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gef.requests.SelectionRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gef.tools.SelectEditPartTracker;
-import org.eclipse.gmf.runtime.common.core.util.Log;
-import org.eclipse.gmf.runtime.common.core.util.Trace;
-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.common.ui.services.parser.ParserService;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-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.INodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionHandleEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIDebugOptions;
-import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
-import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIStatusCodes;
-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.IAnchorableFigure;
-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.Anchor;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.IdentityAnchor;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextNonResizableEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.locator.CellEditorLocatorUtil;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusAnchorableWrappingLabel;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Abstract non-diagram specific edit part for child label node.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public class AbstractElementChildLabelEditPart extends GraphicalEditPart implements ITextAwareEditPart, IPrimaryEditPart, INodeEditPart {
-
- private DirectEditManager manager;
-
- protected IParser parser;
-
- private List<?> parserElements;
-
- private String defaultText;
-
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- protected IDirectEditorConfiguration configuration;
-
- /** Constructor */
- public AbstractElementChildLabelEditPart(View view) {
- super(view);
- }
-
- @Override
- public DragTracker getDragTracker(Request request) {
- if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
- return null;
- }
- //return new DragEditPartsTrackerEx(this);
- // Disable current child label DnD as this is not correctly handled by Papyrus.
- return new SelectEditPartTracker(this);
- }
-
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedLabelEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new TextNonResizableEditPolicy());
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
- installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new ConnectionHandleEditPolicy());
- }
-
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- @Override
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- public EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return Activator.getInstance().getLabelProvider().getImage(parserElement);
- }
- }
- return null;
-
- }
-
- 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;
- }
-
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- 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;
- }
- };
- }
-
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- public ParserOptions getParserOptions() {
-
- if(getNotationView() == null || getNotationView().getDiagram() == null) {
- return ParserOptions.NONE;
- }
-
- EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
- if(display == null) {
- return getDefaultParserOptions();
- }
-
- // display != null
- int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
- return new ParserOptions(displayOptions);
- }
-
- public ParserOptions getDefaultParserOptions() {
-
- if(getNotationView() == null || getNotationView().getDiagram() == null) {
- return ParserOptions.NONE;
- }
-
- IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
- int displayOptions = store.getInt(LabelPreferenceHelper.getPreferenceConstant(getLabelPreferenceKey(), ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE));
- if(displayOptions == 0) {
- return ParserOptions.NONE;
- }
-
- return new ParserOptions(displayOptions);
- }
-
- public IParser getParser() {
- if(parser == null) {
- parser = ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), resolveSemanticElement(), getNotationView().getType()));
- }
- return parser;
- }
-
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), CellEditorLocatorUtil.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- @Override
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- protected void refreshLabel() {
-
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
-
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- @Override
- protected void refreshFont() {
- FontStyle style = (FontStyle)getView().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);
- }
- }
-
- @Override
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- @Override
- 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();
- }
- }
-
- @Override
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- @Override
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- private View getView() {
- return (View)getModel();
- }
-
- 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;
- }
-
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getInstance().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());
- }
- }
- }
-
- protected void updateExtendedEditorConfiguration() {
- String languagePreferred = Activator.getInstance().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;
- }
- }
-
- 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();
- }
- }
-
- @Override
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- @Override
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
- @Override
- 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(NotationPackage.eINSTANCE.getView_SourceEdges().equals(feature)) {
- refreshSourceConnections();
- } else if(NotationPackage.eINSTANCE.getView_TargetEdges().equals(feature)) {
- refreshTargetConnections();
- } 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);
- }
-
- @Override
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- protected IFigure createFigurePrim() {
- return new FigureDescriptor();
- }
-
- static final Font THIS_FONT = new Font(Display.getCurrent(), "Arial", 10, SWT.NORMAL);
-
- public class FigureDescriptor extends PapyrusAnchorableWrappingLabel {
-
- public FigureDescriptor() {
- this.setText("");
- this.setFont(THIS_FONT);
- }
- }
-
- private String getLabelPreferenceKey() {
- String diagramType = getNotationView().getDiagram().getType();
- String labelType = getNotationView().getType();
- return diagramType + "_" + labelType;
- }
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getModelSourceConnections()
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getModelSourceConnections()
- */
- protected List getModelSourceConnections() {
- return ViewUtil.getSourceConnectionsConnectingVisibleViews((View)getModel());
- }
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getModelTargetConnections()
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getModelTargetConnections()
- */
- protected List getModelTargetConnections() {
- return ViewUtil.getTargetConnectionsConnectingVisibleViews((View)getModel());
- }
-
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getSourceConnectionAnchor()
- *
- * @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
- */
- public ConnectionAnchor getSourceConnectionAnchor(org.eclipse.gef.ConnectionEditPart connEditPart) {
- final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
- String t = ""; //$NON-NLS-1$
- try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- Anchor a = ((Edge)connection.getModel()).getSourceAnchor();
- if(a instanceof IdentityAnchor)
- setResult(((IdentityAnchor)a).getId());
- else
- setResult(""); //$NON-NLS-1$
- }
- });
- } catch (InterruptedException e) {
- Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getSourceConnectionAnchor", e); //$NON-NLS-1$
- Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getSourceConnectionAnchor", e); //$NON-NLS-1$
- }
- return getAnchorableFigure().getConnectionAnchor(t);
- }
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getAnchorableFigure()
- *
- * @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
- */
- protected IAnchorableFigure getAnchorableFigure() {
- IFigure myFigure = getFigure();
- if(myFigure instanceof IAnchorableFigure) {
- return (IAnchorableFigure)myFigure;
- }
- throw new RuntimeException("The figure of this element should be an IAnchorable Figure");////$NON-NLS-0$
- }
-
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getSourceConnectionAnchor()
- *
- * @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
- */
- public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- if(request instanceof ReconnectRequest) {
- if(((DropRequest)request).getLocation() == null) {
- return getAnchorableFigure().getSourceConnectionAnchorAt(null);
- }
- Point pt = ((DropRequest)request).getLocation().getCopy();
- return getAnchorableFigure().getSourceConnectionAnchorAt(pt);
- } else if(request instanceof DropRequest) {
- return getAnchorableFigure().getSourceConnectionAnchorAt(((DropRequest)request).getLocation());
- }
- return getAnchorableFigure().getSourceConnectionAnchorAt(null);
- }
-
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getTargetConnectionAnchor()
- *
- * @see org.eclipse.gef.NodeEditPart#getTargetConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
- */
- public ConnectionAnchor getTargetConnectionAnchor(org.eclipse.gef.ConnectionEditPart connEditPart) {
- final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
-
- String t = ""; //$NON-NLS-1$
- try {
- t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
-
- public void run() {
- Anchor a = ((Edge)connection.getModel()).getTargetAnchor();
- if(a instanceof IdentityAnchor)
- setResult(((IdentityAnchor)a).getId());
- else
- setResult(""); //$NON-NLS-1$
- }
- });
- } catch (InterruptedException e) {
- Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getTargetConnectionAnchor", e); //$NON-NLS-1$
- Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getTargetConnectionAnchor", e); //$NON-NLS-1$
- }
-
- return getAnchorableFigure().getConnectionAnchor(t);
- }
-
-
-
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getTargetConnectionAnchor()
- *
- * @see org.eclipse.gef.NodeEditPart#getTargetConnectionAnchor(org.eclipse.gef.Request)
- */
- public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- if(request instanceof ReconnectRequest) {
- if(((DropRequest)request).getLocation() == null) {
- return getAnchorableFigure().getTargetConnectionAnchorAt(null);
- }
- Point pt = ((DropRequest)request).getLocation().getCopy();
- return getAnchorableFigure().getTargetConnectionAnchorAt(pt);
- } else if(request instanceof DropRequest) {
- return getAnchorableFigure().getTargetConnectionAnchorAt(((DropRequest)request).getLocation());
- }
- return getAnchorableFigure().getTargetConnectionAnchorAt(null);
- }
-
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#mapConnectionAnchorToTerminal()
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart#mapConnectionAnchorToTerminal(org.eclipse.draw2d.ConnectionAnchor)
- */
- final public String mapConnectionAnchorToTerminal(ConnectionAnchor c) {
- return getAnchorableFigure().getConnectionAnchorTerminal(c);
- }
-
- /*
- * (non-Javadoc)
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#mapTerminalToConnectionAnchor()
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart#mapTerminalToConnectionAnchor(java.lang.String)
- */
- final public ConnectionAnchor mapTerminalToConnectionAnchor(String terminal) {
- return getAnchorableFigure().getConnectionAnchor(terminal);
- }
-
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.INotableEditPart#canAttachNote()
- * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#canAttachNote()
- */
- public boolean canAttachNote() {
- return true;
- }
-
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ * Arthur Daussy - arthur.daussy@atos.net - 395920: [Block Diagram Definition] All element contained by a block should be able to be linked to constraint or comment
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.requests.DropRequest;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.gef.requests.SelectionRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gef.tools.SelectEditPartTracker;
+import org.eclipse.gmf.runtime.common.core.util.Log;
+import org.eclipse.gmf.runtime.common.core.util.Trace;
+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.common.ui.services.parser.ParserService;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+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.INodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionHandleEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ListItemComponentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIDebugOptions;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIStatusCodes;
+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.IAnchorableFigure;
+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.Anchor;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.IdentityAnchor;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextNonResizableEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.locator.CellEditorLocatorUtil;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusAnchorableWrappingLabel;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
+import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
+import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Abstract non-diagram specific edit part for child label node.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public class AbstractElementChildLabelEditPart extends GraphicalEditPart implements ITextAwareEditPart, IPrimaryEditPart, INodeEditPart {
+
+ private DirectEditManager manager;
+
+ protected IParser parser;
+
+ private List<?> parserElements;
+
+ private String defaultText;
+
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ protected IDirectEditorConfiguration configuration;
+
+ /** Constructor */
+ public AbstractElementChildLabelEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ public DragTracker getDragTracker(Request request) {
+ if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
+ return null;
+ }
+ //return new DragEditPartsTrackerEx(this);
+ // Disable current child label DnD as this is not correctly handled by Papyrus.
+ return new SelectEditPartTracker(this);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedLabelEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new TextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.COMPONENT_ROLE, new ListItemComponentEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+ installEditPolicy(EditPolicyRoles.CONNECTION_HANDLES_ROLE, new ConnectionHandleEditPolicy());
+ }
+
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ public void setLabel(IFigure figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ @Override
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ @Override
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ public EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ protected Image getLabelIcon() {
+ EObject parserElement = getParserElement();
+ if(parserElement == null) {
+ return null;
+ }
+
+ List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ for(View view : views) {
+ if(NameLabelIconHelper.showLabelIcon(view)) {
+ return Activator.getInstance().getLabelProvider().getImage(parserElement);
+ }
+ }
+ return null;
+
+ }
+
+ 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;
+ }
+
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ 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;
+ }
+ };
+ }
+
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ public ParserOptions getParserOptions() {
+
+ if(getNotationView() == null || getNotationView().getDiagram() == null) {
+ return ParserOptions.NONE;
+ }
+
+ EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
+ if(display == null) {
+ return getDefaultParserOptions();
+ }
+
+ // display != null
+ int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
+ return new ParserOptions(displayOptions);
+ }
+
+ public ParserOptions getDefaultParserOptions() {
+
+ if(getNotationView() == null || getNotationView().getDiagram() == null) {
+ return ParserOptions.NONE;
+ }
+
+ IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
+ int displayOptions = store.getInt(LabelPreferenceHelper.getPreferenceConstant(getLabelPreferenceKey(), ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE));
+ if(displayOptions == 0) {
+ return ParserOptions.NONE;
+ }
+
+ return new ParserOptions(displayOptions);
+ }
+
+ public IParser getParser() {
+ if(parser == null) {
+ parser = ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), resolveSemanticElement(), getNotationView().getType()));
+ }
+ return parser;
+ }
+
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), CellEditorLocatorUtil.getTextCellEditorLocator(this)));
+ }
+ return manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ /**
+ * @generated
+ */
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ Dialog dialog = null;
+ if(configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ helper.showEditor();
+ return;
+ } else if(configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if(configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } else {
+ return;
+ }
+ final Dialog finalDialog = dialog;
+
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ protected void refreshLabel() {
+
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ @Override
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getView().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);
+ }
+ }
+
+ @Override
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ @Override
+ 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();
+ }
+ }
+
+ @Override
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ @Override
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ @Override
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ private View getView() {
+ return (View)getModel();
+ }
+
+ 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;
+ }
+
+ protected boolean checkExtendedEditor() {
+ if(resolveSemanticElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ protected boolean checkDefaultEdition() {
+ return (getParser() != null);
+ }
+
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ final String languagePreferred = Activator.getInstance().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());
+ }
+ }
+ }
+
+ protected void updateExtendedEditorConfiguration() {
+ String languagePreferred = Activator.getInstance().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;
+ }
+ }
+
+ 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();
+ }
+ }
+
+ @Override
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+ @Override
+ 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(NotationPackage.eINSTANCE.getView_SourceEdges().equals(feature)) {
+ refreshSourceConnections();
+ } else if(NotationPackage.eINSTANCE.getView_TargetEdges().equals(feature)) {
+ refreshTargetConnections();
+ } 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);
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ protected IFigure createFigurePrim() {
+ return new FigureDescriptor();
+ }
+
+ static final Font THIS_FONT = new Font(Display.getCurrent(), "Arial", 10, SWT.NORMAL);
+
+ public class FigureDescriptor extends PapyrusAnchorableWrappingLabel {
+
+ public FigureDescriptor() {
+ this.setText("");
+ this.setFont(THIS_FONT);
+ }
+ }
+
+ private String getLabelPreferenceKey() {
+ String diagramType = getNotationView().getDiagram().getType();
+ String labelType = getNotationView().getType();
+ return diagramType + "_" + labelType;
+ }
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getModelSourceConnections()
+ *
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getModelSourceConnections()
+ */
+ protected List getModelSourceConnections() {
+ return ViewUtil.getSourceConnectionsConnectingVisibleViews((View)getModel());
+ }
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getModelTargetConnections()
+ *
+ * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#getModelTargetConnections()
+ */
+ protected List getModelTargetConnections() {
+ return ViewUtil.getTargetConnectionsConnectingVisibleViews((View)getModel());
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getSourceConnectionAnchor()
+ *
+ * @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
+ */
+ public ConnectionAnchor getSourceConnectionAnchor(org.eclipse.gef.ConnectionEditPart connEditPart) {
+ final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
+ String t = ""; //$NON-NLS-1$
+ try {
+ t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ Anchor a = ((Edge)connection.getModel()).getSourceAnchor();
+ if(a instanceof IdentityAnchor)
+ setResult(((IdentityAnchor)a).getId());
+ else
+ setResult(""); //$NON-NLS-1$
+ }
+ });
+ } catch (InterruptedException e) {
+ Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getSourceConnectionAnchor", e); //$NON-NLS-1$
+ Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getSourceConnectionAnchor", e); //$NON-NLS-1$
+ }
+ return getAnchorableFigure().getConnectionAnchor(t);
+ }
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getAnchorableFigure()
+ *
+ * @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
+ */
+ protected IAnchorableFigure getAnchorableFigure() {
+ IFigure myFigure = getFigure();
+ if(myFigure instanceof IAnchorableFigure) {
+ return (IAnchorableFigure)myFigure;
+ }
+ throw new RuntimeException("The figure of this element should be an IAnchorable Figure");////$NON-NLS-0$
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getSourceConnectionAnchor()
+ *
+ * @see org.eclipse.gef.NodeEditPart#getSourceConnectionAnchor(org.eclipse.gef.Request)
+ */
+ public ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ if(request instanceof ReconnectRequest) {
+ if(((DropRequest)request).getLocation() == null) {
+ return getAnchorableFigure().getSourceConnectionAnchorAt(null);
+ }
+ Point pt = ((DropRequest)request).getLocation().getCopy();
+ return getAnchorableFigure().getSourceConnectionAnchorAt(pt);
+ } else if(request instanceof DropRequest) {
+ return getAnchorableFigure().getSourceConnectionAnchorAt(((DropRequest)request).getLocation());
+ }
+ return getAnchorableFigure().getSourceConnectionAnchorAt(null);
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getTargetConnectionAnchor()
+ *
+ * @see org.eclipse.gef.NodeEditPart#getTargetConnectionAnchor(org.eclipse.gef.ConnectionEditPart)
+ */
+ public ConnectionAnchor getTargetConnectionAnchor(org.eclipse.gef.ConnectionEditPart connEditPart) {
+ final org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection = (org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart)connEditPart;
+
+ String t = ""; //$NON-NLS-1$
+ try {
+ t = (String)getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
+
+ public void run() {
+ Anchor a = ((Edge)connection.getModel()).getTargetAnchor();
+ if(a instanceof IdentityAnchor)
+ setResult(((IdentityAnchor)a).getId());
+ else
+ setResult(""); //$NON-NLS-1$
+ }
+ });
+ } catch (InterruptedException e) {
+ Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "getTargetConnectionAnchor", e); //$NON-NLS-1$
+ Log.error(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "getTargetConnectionAnchor", e); //$NON-NLS-1$
+ }
+
+ return getAnchorableFigure().getConnectionAnchor(t);
+ }
+
+
+
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#getTargetConnectionAnchor()
+ *
+ * @see org.eclipse.gef.NodeEditPart#getTargetConnectionAnchor(org.eclipse.gef.Request)
+ */
+ public ConnectionAnchor getTargetConnectionAnchor(Request request) {
+ if(request instanceof ReconnectRequest) {
+ if(((DropRequest)request).getLocation() == null) {
+ return getAnchorableFigure().getTargetConnectionAnchorAt(null);
+ }
+ Point pt = ((DropRequest)request).getLocation().getCopy();
+ return getAnchorableFigure().getTargetConnectionAnchorAt(pt);
+ } else if(request instanceof DropRequest) {
+ return getAnchorableFigure().getTargetConnectionAnchorAt(((DropRequest)request).getLocation());
+ }
+ return getAnchorableFigure().getTargetConnectionAnchorAt(null);
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#mapConnectionAnchorToTerminal()
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart#mapConnectionAnchorToTerminal(org.eclipse.draw2d.ConnectionAnchor)
+ */
+ final public String mapConnectionAnchorToTerminal(ConnectionAnchor c) {
+ return getAnchorableFigure().getConnectionAnchorTerminal(c);
+ }
+
+ /*
+ * (non-Javadoc)
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#mapTerminalToConnectionAnchor()
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.INodeEditPart#mapTerminalToConnectionAnchor(java.lang.String)
+ */
+ final public ConnectionAnchor mapTerminalToConnectionAnchor(String terminal) {
+ return getAnchorableFigure().getConnectionAnchor(terminal);
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.INotableEditPart#canAttachNote()
+ * Copied from @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#canAttachNote()
+ */
+ public boolean canAttachNote() {
+ return true;
+ }
+
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementEditPart.java
index 3cd4293daa1..6e2c6550ea0 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementEditPart.java
@@ -1,183 +1,183 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.IFigure;
-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.editpolicies.LayoutEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.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.gmf.diagram.common.edit.policy.DefaultCreationEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ClassifierFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
-import org.eclipse.papyrus.uml.diagram.common.helper.BasicClassifierCompartmentLayoutHelper;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Abstract non-diagram specific edit part for nodes.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public abstract class AbstractElementEditPart extends NamedElementEditPart {
-
- protected IFigure contentPane;
-
- protected IFigure primaryShape;
-
- public AbstractElementEditPart(View view) {
- super(view);
- setCompartmentLayoutHelper(BasicClassifierCompartmentLayoutHelper.getInstances());
- }
-
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
- }
-
- protected abstract LayoutEditPolicy createLayoutEditPolicy();
-
- protected IFigure createNodeShape() {
- return primaryShape = new ClassifierFigure();
- }
-
- public NodeNamedElementFigure getPrimaryShape() {
- return (NodeNamedElementFigure)primaryShape;
- }
-
- protected abstract boolean addFixedChild(EditPart childEditPart);
-
- protected abstract boolean removeFixedChild(EditPart childEditPart);
-
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- protected abstract IFigure getContentPaneFor(IGraphicalEditPart editPart);
-
- protected NodeFigure createNodePlate() {
- String prefElementId = getNotationView().getType();
- IPreferenceStore store = Activator.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- 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
- }
-
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- public abstract EditPart getPrimaryChildEditPart();
-
- public EditPart getTargetEditPart(Request request) {
- return super.getTargetEditPart(request);
- }
-
- @Override
- public Object getPreferredValue(EStructuralFeature feature) {
- String prefKey = getNotationView().getType();
-
- IPreferenceStore store = (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(prefKey, PreferenceConstantHelper.COLOR_LINE);
-
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_FONT);
-
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_FILL);
-
- }
- result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)store, prefColor));
-
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
-
- String prefGradient = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_GRADIENT);
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.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;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.IFigure;
+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.editpolicies.LayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.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.gmf.diagram.common.edit.policy.DefaultCreationEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ClassifierFigure;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
+import org.eclipse.papyrus.uml.diagram.common.helper.BasicClassifierCompartmentLayoutHelper;
+import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * Abstract non-diagram specific edit part for nodes.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public abstract class AbstractElementEditPart extends NamedElementEditPart {
+
+ protected IFigure contentPane;
+
+ protected IFigure primaryShape;
+
+ public AbstractElementEditPart(View view) {
+ super(view);
+ setCompartmentLayoutHelper(BasicClassifierCompartmentLayoutHelper.getInstances());
+ }
+
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
+ }
+
+ protected abstract LayoutEditPolicy createLayoutEditPolicy();
+
+ protected IFigure createNodeShape() {
+ return primaryShape = new ClassifierFigure();
+ }
+
+ public NodeNamedElementFigure getPrimaryShape() {
+ return (NodeNamedElementFigure)primaryShape;
+ }
+
+ protected abstract boolean addFixedChild(EditPart childEditPart);
+
+ protected abstract boolean removeFixedChild(EditPart childEditPart);
+
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ protected abstract IFigure getContentPaneFor(IGraphicalEditPart editPart);
+
+ protected NodeFigure createNodePlate() {
+ String prefElementId = getNotationView().getType();
+ IPreferenceStore store = Activator.getInstance().getPreferenceStore();
+ String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
+ String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
+ DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
+
+ return result;
+ }
+
+ protected NodeFigure createMainFigure() {
+ NodeFigure figure = createNodePlate();
+ figure.setLayoutManager(new StackLayout());
+ IFigure shape = createNodeShape();
+ figure.add(shape);
+ contentPane = setupContentPane(shape);
+ return figure;
+ }
+
+ 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
+ }
+
+ public IFigure getContentPane() {
+ if(contentPane != null) {
+ return contentPane;
+ }
+ return super.getContentPane();
+ }
+
+ protected void setForegroundColor(Color color) {
+ if(primaryShape != null) {
+ primaryShape.setForegroundColor(color);
+ }
+ }
+
+ public abstract EditPart getPrimaryChildEditPart();
+
+ public EditPart getTargetEditPart(Request request) {
+ return super.getTargetEditPart(request);
+ }
+
+ @Override
+ public Object getPreferredValue(EStructuralFeature feature) {
+ String prefKey = getNotationView().getType();
+
+ IPreferenceStore store = (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(prefKey, PreferenceConstantHelper.COLOR_LINE);
+
+ } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_FONT);
+
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
+ prefColor = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_FILL);
+
+ }
+ result = FigureUtilities.RGBToInteger(PreferenceConverter.getColor((IPreferenceStore)store, prefColor));
+
+ } else if(feature == NotationPackage.eINSTANCE.getFillStyle_Transparency() || feature == NotationPackage.eINSTANCE.getFillStyle_Gradient()) {
+
+ String prefGradient = PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.COLOR_GRADIENT);
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java
index cad3b2531dd..5a3c68781eb 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLabelEditPart.java
@@ -1,671 +1,671 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-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.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultSnapBackEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDefaultSemanticEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.locator.TextCellEditorLocator;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
-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;
-
-/**
- * Abstract non-diagram specific edit part for labels.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public abstract class AbstractElementLabelEditPart extends LabelEditPart implements ITextAwareEditPart, ILabelRoleProvider {
-
- private DirectEditManager manager;
-
- private IParser parser;
-
- private List<?> parserElements;
-
- protected 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;
-
- /** Constructor */
- public AbstractElementLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedLabelEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new TextSelectionEditPolicy());
- installEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE, new DefaultSnapBackEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new LabelDefaultSemanticEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- @Override
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- public EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- protected Image getLabelIcon() {
- return null;
- }
-
- 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;
- }
-
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- 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;
- }
- };
- }
-
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- public ParserOptions getParserOptions() {
-
- if(getNotationView() == null || getNotationView().getDiagram() == null) {
- return ParserOptions.NONE;
- }
-
- EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
- if(display == null) {
- return getDefaultParserOptions();
- }
-
- // display != null
- int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
- return new ParserOptions(displayOptions);
- }
-
- public ParserOptions getDefaultParserOptions() {
-
- if(getNotationView() == null || getNotationView().getDiagram() == null) {
- return ParserOptions.NONE;
- }
-
- IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
- int displayOptions = store.getInt(LabelPreferenceHelper.getPreferenceConstant(getLabelPreferenceKey(), ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE));
- if(displayOptions == 0) {
- return ParserOptions.NONE;
- }
-
- return new ParserOptions(displayOptions);
- }
-
- public IParser getParser() {
- if(parser == null) {
- parser = ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), getParserElement(), getNotationView().getType()));
- }
- return parser;
- }
-
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), new TextCellEditorLocator((WrappingLabel)this.getFigure())));
- }
- return manager;
- }
-
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- protected void performDirectEdit() {
- getManager().show();
- }
-
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- @Override
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- protected void refreshLabel() {
-
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
-
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- @Override
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- @Override
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- @Override
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = getParserElement();
- 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();
- }
- }
-
- @Override
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- @Override
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- 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.uml.diagram.common.editpolicies.IDirectEdition
- */
- 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.
- */
- 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
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- */
- 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();
- }
- }
-
- @Override
- 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);
- }
-
- @Override
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
- protected void addSnapBackLocation() {
- // Use default view position as snap back position
- IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
-
- String xKey = PreferenceConstantHelper.getElementConstant(getLabelPreferenceKey(), PreferenceConstantHelper.LOCATION_X);
- String yKey = PreferenceConstantHelper.getElementConstant(getLabelPreferenceKey(), PreferenceConstantHelper.LOCATION_Y);
-
- Point snapBackPosition = new Point(store.getInt(xKey), store.getInt(yKey));
-
- registerSnapBackPosition(getLabelPreferenceKey(), snapBackPosition);
- }
-
- private String getLabelPreferenceKey() {
- String diagramType = getNotationView().getDiagram().getType();
- String parentType = ViewUtil.getViewContainer(getNotationView()).getType();
- String labelType = getNotationView().getType();
- return diagramType + "_" + parentType + "-" + labelType;
- }
-
- /**
- * {@inheritDoc}
- */
- public abstract String getLabelRole();
-
- /**
- * {@inheritDoc}
- */
- public abstract String getIconPathRole();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+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.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultSnapBackEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDefaultSemanticEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.locator.TextCellEditorLocator;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
+import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
+import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
+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;
+
+/**
+ * Abstract non-diagram specific edit part for labels.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public abstract class AbstractElementLabelEditPart extends LabelEditPart implements ITextAwareEditPart, ILabelRoleProvider {
+
+ private DirectEditManager manager;
+
+ private IParser parser;
+
+ private List<?> parserElements;
+
+ protected 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;
+
+ /** Constructor */
+ public AbstractElementLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedLabelEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new TextSelectionEditPolicy());
+ installEditPolicy(EditPolicyRoles.SNAP_FEEDBACK_ROLE, new DefaultSnapBackEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new LabelDefaultSemanticEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getKeyPoint() {
+ return ConnectionLocator.MIDDLE;
+ }
+
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ public void setLabel(WrappingLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ @Override
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ @Override
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ public EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ protected Image getLabelIcon() {
+ return null;
+ }
+
+ 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;
+ }
+
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ 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;
+ }
+ };
+ }
+
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ public ParserOptions getParserOptions() {
+
+ if(getNotationView() == null || getNotationView().getDiagram() == null) {
+ return ParserOptions.NONE;
+ }
+
+ EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
+ if(display == null) {
+ return getDefaultParserOptions();
+ }
+
+ // display != null
+ int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
+ return new ParserOptions(displayOptions);
+ }
+
+ public ParserOptions getDefaultParserOptions() {
+
+ if(getNotationView() == null || getNotationView().getDiagram() == null) {
+ return ParserOptions.NONE;
+ }
+
+ IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
+ int displayOptions = store.getInt(LabelPreferenceHelper.getPreferenceConstant(getLabelPreferenceKey(), ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE));
+ if(displayOptions == 0) {
+ return ParserOptions.NONE;
+ }
+
+ return new ParserOptions(displayOptions);
+ }
+
+ public IParser getParser() {
+ if(parser == null) {
+ parser = ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), getParserElement(), getNotationView().getType()));
+ }
+ return parser;
+ }
+
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), new TextCellEditorLocator((WrappingLabel)this.getFigure())));
+ }
+ return manager;
+ }
+
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ @Override
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ Dialog dialog = null;
+ if(configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ helper.showEditor();
+ return;
+ } else if(configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if(configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } else {
+ return;
+ }
+ final Dialog finalDialog = dialog;
+
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ protected void refreshLabel() {
+
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ @Override
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ @Override
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ @Override
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = getParserElement();
+ 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();
+ }
+ }
+
+ @Override
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ @Override
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ @Override
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ 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.uml.diagram.common.editpolicies.IDirectEdition
+ */
+ 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.
+ */
+ 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
+ */
+ protected boolean checkDefaultEdition() {
+ return (getParser() != null);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ */
+ 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();
+ }
+ }
+
+ @Override
+ 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);
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+ protected void addSnapBackLocation() {
+ // Use default view position as snap back position
+ IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
+
+ String xKey = PreferenceConstantHelper.getElementConstant(getLabelPreferenceKey(), PreferenceConstantHelper.LOCATION_X);
+ String yKey = PreferenceConstantHelper.getElementConstant(getLabelPreferenceKey(), PreferenceConstantHelper.LOCATION_Y);
+
+ Point snapBackPosition = new Point(store.getInt(xKey), store.getInt(yKey));
+
+ registerSnapBackPosition(getLabelPreferenceKey(), snapBackPosition);
+ }
+
+ private String getLabelPreferenceKey() {
+ String diagramType = getNotationView().getDiagram().getType();
+ String parentType = ViewUtil.getViewContainer(getNotationView()).getType();
+ String labelType = getNotationView().getType();
+ return diagramType + "_" + parentType + "-" + labelType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public abstract String getLabelRole();
+
+ /**
+ * {@inheritDoc}
+ */
+ public abstract String getIconPathRole();
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLinkEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLinkEditPart.java
index 8ca3e9494f4..69c328e45b5 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLinkEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementLinkEditPart.java
@@ -1,245 +1,245 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineDecoration;
-import org.eclipse.draw2d.RotatableDecoration;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.EdgeDecorationType;
-
-/**
- * Abstract non-diagram specific edit part for links.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public abstract class AbstractElementLinkEditPart extends UMLConnectionNodeEditPart {
-
- /**
- * Constructor.
- */
- public AbstractElementLinkEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
- installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
- }
-
- /**
- * Add fixed child edit part.
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof AppliedStereotypeLinkLabelEditPart) {
- ((AppliedStereotypeLinkLabelEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
- return true;
- }
- return false;
- }
-
- /**
- * Remove fixed child edit part.
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof AppliedStereotypeLinkLabelEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- // Update the figure when the line width changes
- Object feature = event.getFeature();
- if((getModel() != null) && (getModel() == event.getNotifier())) {
-
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
- refreshLineWidth();
- refreshArrowSource();
- refreshArrowTarget();
- } else if(NotationPackage.eINSTANCE.getLineTypeStyle_LineType().equals(feature)) {
- refreshLineType();
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLineType();
- refreshLineWidth();
- refreshArrowSource();
- refreshArrowTarget();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void setLineWidth(int width) {
- if(width < 0) {
- width = 1;
- }
- getPrimaryShape().setLineWidth(width);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void setLineType(int style) {
- getPrimaryShape().setLineStyle(style);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void setArrowSource(RotatableDecoration arrowDecoration) {
- getPrimaryShape().setSourceDecoration(arrowDecoration);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void setArrowTarget(RotatableDecoration arrowDecoration) {
- getPrimaryShape().setTargetDecoration(arrowDecoration);
- }
-
- /**
- * <pre>
- * {@inheritDoc}
- *
- * This method override parent implementation to add a new set of
- * predefined decoration type.
- *
- * The arrowType available constants are given in {@link EdgeDecorationType}.
- * </pre>
- */
- @Override
- protected RotatableDecoration getArrowDecoration(int arrowType) {
- RotatableDecoration decoration = null;
- int width = getLineWidth();
- if(width < 0) {
- width = 1;
- }
- if(arrowType == EdgeDecorationType.OPEN_ARROW) {
- IMapMode mm = getMapMode();
- decoration = new PolylineDecoration();
- ((PolylineDecoration)decoration).setScale(mm.DPtoLP(15 + width), mm.DPtoLP(5 + width));
- ((PolylineDecoration)decoration).setTemplate(PolylineDecoration.TRIANGLE_TIP);
- ((PolylineDecoration)decoration).setLineWidth(mm.DPtoLP(width));
-
- } else if(arrowType == EdgeDecorationType.SOLID_ARROW_FILLED) {
- IMapMode mm = getMapMode();
- decoration = new PolygonDecoration();
- ((PolygonDecoration)decoration).setScale(mm.DPtoLP(15 + width), mm.DPtoLP(5 + width));
- ((PolygonDecoration)decoration).setTemplate(PolygonDecoration.TRIANGLE_TIP);
- ((PolygonDecoration)decoration).setLineWidth(mm.DPtoLP(width));
- ((PolygonDecoration)decoration).setFill(true);
-
- } else if(arrowType == EdgeDecorationType.SOLID_ARROW_EMPTY) {
- IMapMode mm = getMapMode();
- decoration = new PolygonDecoration();
- ((PolygonDecoration)decoration).setScale(mm.DPtoLP(15 + width), mm.DPtoLP(5 + width));
- ((PolygonDecoration)decoration).setTemplate(PolygonDecoration.TRIANGLE_TIP);
- ((PolygonDecoration)decoration).setLineWidth(mm.DPtoLP(width));
-
- // Not really empty... filled with white color.
- ((PolygonDecoration)decoration).setFill(true);
- ((PolygonDecoration)decoration).setBackgroundColor(ColorConstants.white);
-
- } else if(arrowType == EdgeDecorationType.SOLID_DIAMOND_FILLED) {
- IMapMode mm = getMapMode();
- decoration = new PolygonDecoration();
- ((PolygonDecoration)decoration).setScale(mm.DPtoLP(12 + width), mm.DPtoLP(6 + width));
-
- PointList diamondPointList = new PointList();
- diamondPointList.addPoint(0, 0);
- diamondPointList.addPoint(-1, 1);
- diamondPointList.addPoint(-2, 0);
- diamondPointList.addPoint(-1, -1);
-
- ((PolygonDecoration)decoration).setTemplate(diamondPointList);
- ((PolygonDecoration)decoration).setLineWidth(mm.DPtoLP(width));
- ((PolygonDecoration)decoration).setFill(true);
-
- } else if(arrowType == EdgeDecorationType.SOLID_DIAMOND_EMPTY) {
- IMapMode mm = getMapMode();
- decoration = new PolygonDecoration();
- ((PolygonDecoration)decoration).setScale(mm.DPtoLP(12 + width), mm.DPtoLP(6 + width));
-
- PointList diamondPointList = new PointList();
- diamondPointList.addPoint(0, 0);
- diamondPointList.addPoint(-1, 1);
- diamondPointList.addPoint(-2, 0);
- diamondPointList.addPoint(-1, -1);
-
- ((PolygonDecoration)decoration).setTemplate(diamondPointList);
- ((PolygonDecoration)decoration).setLineWidth(mm.DPtoLP(width));
-
- // Not really empty... filled with white color.
- ((PolygonDecoration)decoration).setFill(true);
- ((PolygonDecoration)decoration).setBackgroundColor(ColorConstants.white);
- }
-
- return decoration;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.PolylineDecoration;
+import org.eclipse.draw2d.RotatableDecoration;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLinkLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.EdgeDecorationType;
+
+/**
+ * Abstract non-diagram specific edit part for links.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public abstract class AbstractElementLinkEditPart extends UMLConnectionNodeEditPart {
+
+ /**
+ * Constructor.
+ */
+ public AbstractElementLinkEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+ installEditPolicy(AppliedStereotypeLinkLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeLinkLabelDisplayEditPolicy());
+ }
+
+ /**
+ * Add fixed child edit part.
+ */
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof AppliedStereotypeLinkLabelEditPart) {
+ ((AppliedStereotypeLinkLabelEditPart)childEditPart).setLabel(getPrimaryShape().getAppliedStereotypeLabel());
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Remove fixed child edit part.
+ */
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof AppliedStereotypeLinkLabelEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void addChildVisual(EditPart childEditPart, int index) {
+ if(addFixedChild(childEditPart)) {
+ return;
+ }
+ super.addChildVisual(childEditPart, -1);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void removeChildVisual(EditPart childEditPart) {
+ if(removeFixedChild(childEditPart)) {
+ return;
+ }
+ super.removeChildVisual(childEditPart);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ // Update the figure when the line width changes
+ Object feature = event.getFeature();
+ if((getModel() != null) && (getModel() == event.getNotifier())) {
+
+ if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ refreshLineWidth();
+ refreshArrowSource();
+ refreshArrowTarget();
+ } else if(NotationPackage.eINSTANCE.getLineTypeStyle_LineType().equals(feature)) {
+ refreshLineType();
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLineType();
+ refreshLineWidth();
+ refreshArrowSource();
+ refreshArrowTarget();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setLineWidth(int width) {
+ if(width < 0) {
+ width = 1;
+ }
+ getPrimaryShape().setLineWidth(width);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setLineType(int style) {
+ getPrimaryShape().setLineStyle(style);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setArrowSource(RotatableDecoration arrowDecoration) {
+ getPrimaryShape().setSourceDecoration(arrowDecoration);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setArrowTarget(RotatableDecoration arrowDecoration) {
+ getPrimaryShape().setTargetDecoration(arrowDecoration);
+ }
+
+ /**
+ * <pre>
+ * {@inheritDoc}
+ *
+ * This method override parent implementation to add a new set of
+ * predefined decoration type.
+ *
+ * The arrowType available constants are given in {@link EdgeDecorationType}.
+ * </pre>
+ */
+ @Override
+ protected RotatableDecoration getArrowDecoration(int arrowType) {
+ RotatableDecoration decoration = null;
+ int width = getLineWidth();
+ if(width < 0) {
+ width = 1;
+ }
+ if(arrowType == EdgeDecorationType.OPEN_ARROW) {
+ IMapMode mm = getMapMode();
+ decoration = new PolylineDecoration();
+ ((PolylineDecoration)decoration).setScale(mm.DPtoLP(15 + width), mm.DPtoLP(5 + width));
+ ((PolylineDecoration)decoration).setTemplate(PolylineDecoration.TRIANGLE_TIP);
+ ((PolylineDecoration)decoration).setLineWidth(mm.DPtoLP(width));
+
+ } else if(arrowType == EdgeDecorationType.SOLID_ARROW_FILLED) {
+ IMapMode mm = getMapMode();
+ decoration = new PolygonDecoration();
+ ((PolygonDecoration)decoration).setScale(mm.DPtoLP(15 + width), mm.DPtoLP(5 + width));
+ ((PolygonDecoration)decoration).setTemplate(PolygonDecoration.TRIANGLE_TIP);
+ ((PolygonDecoration)decoration).setLineWidth(mm.DPtoLP(width));
+ ((PolygonDecoration)decoration).setFill(true);
+
+ } else if(arrowType == EdgeDecorationType.SOLID_ARROW_EMPTY) {
+ IMapMode mm = getMapMode();
+ decoration = new PolygonDecoration();
+ ((PolygonDecoration)decoration).setScale(mm.DPtoLP(15 + width), mm.DPtoLP(5 + width));
+ ((PolygonDecoration)decoration).setTemplate(PolygonDecoration.TRIANGLE_TIP);
+ ((PolygonDecoration)decoration).setLineWidth(mm.DPtoLP(width));
+
+ // Not really empty... filled with white color.
+ ((PolygonDecoration)decoration).setFill(true);
+ ((PolygonDecoration)decoration).setBackgroundColor(ColorConstants.white);
+
+ } else if(arrowType == EdgeDecorationType.SOLID_DIAMOND_FILLED) {
+ IMapMode mm = getMapMode();
+ decoration = new PolygonDecoration();
+ ((PolygonDecoration)decoration).setScale(mm.DPtoLP(12 + width), mm.DPtoLP(6 + width));
+
+ PointList diamondPointList = new PointList();
+ diamondPointList.addPoint(0, 0);
+ diamondPointList.addPoint(-1, 1);
+ diamondPointList.addPoint(-2, 0);
+ diamondPointList.addPoint(-1, -1);
+
+ ((PolygonDecoration)decoration).setTemplate(diamondPointList);
+ ((PolygonDecoration)decoration).setLineWidth(mm.DPtoLP(width));
+ ((PolygonDecoration)decoration).setFill(true);
+
+ } else if(arrowType == EdgeDecorationType.SOLID_DIAMOND_EMPTY) {
+ IMapMode mm = getMapMode();
+ decoration = new PolygonDecoration();
+ ((PolygonDecoration)decoration).setScale(mm.DPtoLP(12 + width), mm.DPtoLP(6 + width));
+
+ PointList diamondPointList = new PointList();
+ diamondPointList.addPoint(0, 0);
+ diamondPointList.addPoint(-1, 1);
+ diamondPointList.addPoint(-2, 0);
+ diamondPointList.addPoint(-1, -1);
+
+ ((PolygonDecoration)decoration).setTemplate(diamondPointList);
+ ((PolygonDecoration)decoration).setLineWidth(mm.DPtoLP(width));
+
+ // Not really empty... filled with white color.
+ ((PolygonDecoration)decoration).setFill(true);
+ ((PolygonDecoration)decoration).setBackgroundColor(ColorConstants.white);
+ }
+
+ return decoration;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java
index ad94d8ff198..7ffbbe8e246 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractElementNodeLabelEditPart.java
@@ -1,727 +1,727 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPart;
-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.common.ui.services.parser.ParserService;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-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.TopGraphicEditPart;
-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.gef.ui.internal.tools.DelegatingDragEditPartsTracker;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextNonResizableEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.locator.TextCellEditorLocator;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-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;
-
-/**
- * Abstract non-diagram specific edit part for labels.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart implements ITextAwareEditPart, ILabelRoleProvider {
-
- private DirectEditManager manager;
-
- private IParser parser;
-
- private List<?> parserElements;
-
- protected 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;
-
- /** Constructor */
- public AbstractElementNodeLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * Compartment-like isSelectable implementation.
- *
- * By default, the edit parts get selectable only if
- * the compartment's top level container matches the top level
- * container of the editpart that currently has the keyboard focus
- * i.e: you need to select the shape first before selecting a this label.
- *
- * @see CompartmentEditPart#isSelectable()
- */
- @Override
- public boolean isSelectable() {
- if(super.isSelectable()) {
- EditPart focusPart = getViewer().getFocusEditPart();
- if(focusPart instanceof IGraphicalEditPart) {
- TopGraphicEditPart focusTopEP = ((IGraphicalEditPart)focusPart).getTopGraphicEditPart();
- TopGraphicEditPart myTopEP = getTopGraphicEditPart();
- if(myTopEP == focusTopEP) {
- // check if the selection contains only editparts belonging to
- // the same top level editpart
- Iterator<?> selection = getViewer().getSelectedEditParts().iterator();
- while(selection.hasNext()) {
- Object editPart = selection.next();
- if(editPart instanceof IGraphicalEditPart && (((IGraphicalEditPart)editPart).getTopGraphicEditPart() != myTopEP)) {
- return false;
- }
- }
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public DragTracker getDragTracker(Request request) {
- if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
- return null;
- }
- // Delegate to the main edit part.
- return new DelegatingDragEditPartsTracker(this, getTopGraphicEditPart());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedLabelEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new TextNonResizableEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- }
-
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- @Override
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- @Override
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- public EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return org.eclipse.papyrus.sysml.diagram.common.Activator.getInstance().getLabelProvider().getImage(parserElement);
- }
- }
- return null;
-
- }
-
- 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;
- }
-
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- public String getEditText() {
- if(getParserElement() == null || getParser() == null) {
- return ""; //$NON-NLS-1$
- }
- return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
- }
-
- protected boolean isEditable() {
- return getParser() != null;
- }
-
- 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;
- }
- };
- }
-
- public IContentAssistProcessor getCompletionProcessor() {
- if(getParserElement() == null || getParser() == null) {
- return null;
- }
- return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
- }
-
- public ParserOptions getParserOptions() {
-
- if(getNotationView() == null || getNotationView().getDiagram() == null) {
- return ParserOptions.NONE;
- }
-
- EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
- if(display == null) {
- return getDefaultParserOptions();
- }
-
- // display != null
- int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
- return new ParserOptions(displayOptions);
- }
-
- public ParserOptions getDefaultParserOptions() {
-
- if(getNotationView() == null || getNotationView().getDiagram() == null) {
- return ParserOptions.NONE;
- }
-
- IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
- int displayOptions = store.getInt(LabelPreferenceHelper.getPreferenceConstant(getLabelPreferenceKey(), ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE));
- if(displayOptions == 0) {
- return ParserOptions.NONE;
- }
-
- return new ParserOptions(displayOptions);
- }
-
- public IParser getParser() {
- if(parser == null) {
- parser = ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), getParserElement(), getNotationView().getType()));
- }
- return parser;
- }
-
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), new TextCellEditorLocator((WrappingLabel)this.getFigure())));
- }
- return manager;
- }
-
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- protected void performDirectEdit() {
- getManager().show();
- }
-
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- @Override
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- protected void refreshLabel() {
-
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
-
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof TextSelectionEditPolicy) {
- ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
- }
- }
-
- protected void refreshUnderline() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
- }
- }
-
- protected void refreshStrikeThrough() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null && getFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
- }
- }
-
- @Override
- protected void refreshFont() {
- FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
- if(style != null) {
- FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- setFont(fontData);
- }
- }
-
- @Override
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- @Override
- protected void addSemanticListeners() {
- if(getParser() instanceof ISemanticParser) {
- EObject element = getParserElement();
- 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();
- }
- }
-
- @Override
- protected void removeSemanticListeners() {
- if(parserElements != null) {
- for(int i = 0; i < parserElements.size(); i++) {
- removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
- }
- } else {
- super.removeSemanticListeners();
- }
- }
-
- @Override
- protected AccessibleEditPart getAccessibleEditPart() {
- if(accessibleEP == null) {
- accessibleEP = new AccessibleGraphicalEditPart() {
-
- @Override
- public void getName(AccessibleEvent e) {
- e.result = getLabelTextHelper(getFigure());
- }
- };
- }
- return accessibleEP;
- }
-
- 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.uml.diagram.common.editpolicies.IDirectEdition
- */
- 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.
- */
- 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
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- */
- 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();
- }
- }
-
- @Override
- 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();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- @Override
- protected void addNotationalListeners() {
- super.addNotationalListeners();
- addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
- }
-
- @Override
- protected void removeNotationalListeners() {
- super.removeNotationalListeners();
- removeListenerFilter("PrimaryView"); //$NON-NLS-1$
- }
-
- @Override
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
- public String getLabelPreferenceKey() {
- String diagramType = getNotationView().getDiagram().getType();
- String parentType = ViewUtil.getViewContainer(getNotationView()).getType();
- String labelType = getNotationView().getType();
- return diagramType + "_" + parentType + "-" + labelType;
- }
-
- /**
- * {@inheritDoc}
- */
- public abstract String getLabelRole();
-
- /**
- * {@inheritDoc}
- */
- public abstract String getIconPathRole();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.AccessibleEditPart;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPart;
+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.common.ui.services.parser.ParserService;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+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.TopGraphicEditPart;
+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.gef.ui.internal.tools.DelegatingDragEditPartsTracker;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.viewers.ICellEditorValidator;
+import org.eclipse.jface.window.Window;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
+import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
+import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
+import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LabelDirectEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextNonResizableEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.TextSelectionEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.locator.TextCellEditorLocator;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
+import org.eclipse.papyrus.uml.diagram.common.edit.policy.MaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
+import org.eclipse.papyrus.uml.diagram.common.parser.DefaultParserHintAdapter;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+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;
+
+/**
+ * Abstract non-diagram specific edit part for labels.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public abstract class AbstractElementNodeLabelEditPart extends GraphicalEditPart implements ITextAwareEditPart, ILabelRoleProvider {
+
+ private DirectEditManager manager;
+
+ private IParser parser;
+
+ private List<?> parserElements;
+
+ protected 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;
+
+ /** Constructor */
+ public AbstractElementNodeLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * Compartment-like isSelectable implementation.
+ *
+ * By default, the edit parts get selectable only if
+ * the compartment's top level container matches the top level
+ * container of the editpart that currently has the keyboard focus
+ * i.e: you need to select the shape first before selecting a this label.
+ *
+ * @see CompartmentEditPart#isSelectable()
+ */
+ @Override
+ public boolean isSelectable() {
+ if(super.isSelectable()) {
+ EditPart focusPart = getViewer().getFocusEditPart();
+ if(focusPart instanceof IGraphicalEditPart) {
+ TopGraphicEditPart focusTopEP = ((IGraphicalEditPart)focusPart).getTopGraphicEditPart();
+ TopGraphicEditPart myTopEP = getTopGraphicEditPart();
+ if(myTopEP == focusTopEP) {
+ // check if the selection contains only editparts belonging to
+ // the same top level editpart
+ Iterator<?> selection = getViewer().getSelectedEditParts().iterator();
+ while(selection.hasNext()) {
+ Object editPart = selection.next();
+ if(editPart instanceof IGraphicalEditPart && (((IGraphicalEditPart)editPart).getTopGraphicEditPart() != myTopEP)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public DragTracker getDragTracker(Request request) {
+ if(request instanceof SelectionRequest && ((SelectionRequest)request).getLastButtonPressed() == 3) {
+ return null;
+ }
+ // Delegate to the main edit part.
+ return new DelegatingDragEditPartsTracker(this, getTopGraphicEditPart());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY, new MaskManagedLabelEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new TextNonResizableEditPolicy());
+ installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
+ }
+
+ protected String getLabelTextHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getText();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getText();
+ } else {
+ return ((Label)figure).getText();
+ }
+ }
+
+ protected void setLabelTextHelper(IFigure figure, String text) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setText(text);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setText(text);
+ } else {
+ ((Label)figure).setText(text);
+ }
+ }
+
+ protected Image getLabelIconHelper(IFigure figure) {
+ if(figure instanceof WrappingLabel) {
+ return ((WrappingLabel)figure).getIcon();
+ } else if(figure instanceof ILabelFigure) {
+ return ((ILabelFigure)figure).getIcon();
+ } else {
+ return ((Label)figure).getIcon();
+ }
+ }
+
+ protected void setLabelIconHelper(IFigure figure, Image icon) {
+ if(figure instanceof WrappingLabel) {
+ ((WrappingLabel)figure).setIcon(icon);
+ } else if(figure instanceof ILabelFigure) {
+ ((ILabelFigure)figure).setIcon(icon);
+ } else {
+ ((Label)figure).setIcon(icon);
+ }
+ }
+
+ public void setLabel(WrappingLabel figure) {
+ unregisterVisuals();
+ setFigure(figure);
+ defaultText = getLabelTextHelper(figure);
+ registerVisuals();
+ refreshVisuals();
+ }
+
+ @Override
+ protected List getModelChildren() {
+ return Collections.EMPTY_LIST;
+ }
+
+ @Override
+ public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
+ return null;
+ }
+
+ public EObject getParserElement() {
+ return resolveSemanticElement();
+ }
+
+ protected Image getLabelIcon() {
+ EObject parserElement = getParserElement();
+ if(parserElement == null) {
+ return null;
+ }
+
+ List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ for(View view : views) {
+ if(NameLabelIconHelper.showLabelIcon(view)) {
+ return org.eclipse.papyrus.sysml.diagram.common.Activator.getInstance().getLabelProvider().getImage(parserElement);
+ }
+ }
+ return null;
+
+ }
+
+ 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;
+ }
+
+ public void setLabelText(String text) {
+ setLabelTextHelper(getFigure(), text);
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ public String getEditText() {
+ if(getParserElement() == null || getParser() == null) {
+ return ""; //$NON-NLS-1$
+ }
+ return getParser().getEditString(new EObjectAdapter(getParserElement()), getParserOptions().intValue());
+ }
+
+ protected boolean isEditable() {
+ return getParser() != null;
+ }
+
+ 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;
+ }
+ };
+ }
+
+ public IContentAssistProcessor getCompletionProcessor() {
+ if(getParserElement() == null || getParser() == null) {
+ return null;
+ }
+ return getParser().getCompletionProcessor(new EObjectAdapter(getParserElement()));
+ }
+
+ public ParserOptions getParserOptions() {
+
+ if(getNotationView() == null || getNotationView().getDiagram() == null) {
+ return ParserOptions.NONE;
+ }
+
+ EAnnotation display = getNotationView().getEAnnotation(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION);
+ if(display == null) {
+ return getDefaultParserOptions();
+ }
+
+ // display != null
+ int displayOptions = Integer.parseInt(display.getDetails().get(VisualInformationPapyrusConstants.CUSTOM_APPEARANCE_MASK_VALUE));
+ return new ParserOptions(displayOptions);
+ }
+
+ public ParserOptions getDefaultParserOptions() {
+
+ if(getNotationView() == null || getNotationView().getDiagram() == null) {
+ return ParserOptions.NONE;
+ }
+
+ IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
+ int displayOptions = store.getInt(LabelPreferenceHelper.getPreferenceConstant(getLabelPreferenceKey(), ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE));
+ if(displayOptions == 0) {
+ return ParserOptions.NONE;
+ }
+
+ return new ParserOptions(displayOptions);
+ }
+
+ public IParser getParser() {
+ if(parser == null) {
+ parser = ParserService.getInstance().getParser(new DefaultParserHintAdapter(getNotationView().getDiagram(), getParserElement(), getNotationView().getType()));
+ }
+ return parser;
+ }
+
+ protected DirectEditManager getManager() {
+ if(manager == null) {
+ setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), new TextCellEditorLocator((WrappingLabel)this.getFigure())));
+ }
+ return manager;
+ }
+
+ protected void setManager(DirectEditManager manager) {
+ this.manager = manager;
+ }
+
+ protected void performDirectEdit() {
+ getManager().show();
+ }
+
+ protected void performDirectEdit(Point eventLocation) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
+ }
+ }
+
+ private void performDirectEdit(char initialCharacter) {
+ if(getManager() instanceof TextDirectEditManager) {
+ ((TextDirectEditManager)getManager()).show(initialCharacter);
+ } else {
+ performDirectEdit();
+ }
+ }
+
+ @Override
+ protected void performDirectEditRequest(Request request) {
+
+ final Request theRequest = request;
+
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ updateExtendedEditorConfiguration();
+ if(configuration == null || configuration.getLanguage() == null) {
+ performDefaultDirectEditorEdit(theRequest);
+ } else {
+ configuration.preEditAction(resolveSemanticElement());
+ Dialog dialog = null;
+ if(configuration instanceof IPopupEditorConfiguration) {
+ IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
+ helper.showEditor();
+ return;
+ } else if(configuration instanceof IAdvancedEditorConfiguration) {
+ dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
+ } else if(configuration instanceof IDirectEditorConfiguration) {
+ dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()), configuration);
+ } else {
+ return;
+ }
+ final Dialog finalDialog = dialog;
+
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
+
+ @Override
+ protected void doExecute() {
+ configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
+
+ }
+ };
+ domain.getCommandStack().execute(command);
+ }
+ }
+ break;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+
+ // initialize the direct edit manager
+ try {
+ getEditingDomain().runExclusive(new Runnable() {
+
+ public void run() {
+ if(isActive() && isEditable()) {
+ if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
+ Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
+ performDirectEdit(initialChar.charValue());
+ } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
+ DirectEditRequest editRequest = (DirectEditRequest)theRequest;
+ performDirectEdit(editRequest.getLocation());
+ } else {
+ performDirectEdit();
+ }
+ }
+ }
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshLabel();
+ refreshFont();
+ refreshFontColor();
+ refreshUnderline();
+ refreshStrikeThrough();
+ }
+
+ protected void refreshLabel() {
+
+ setLabelTextHelper(getFigure(), getLabelText());
+ setLabelIconHelper(getFigure(), getLabelIcon());
+
+ Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(pdEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
+ }
+ Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
+ if(sfEditPolicy instanceof TextSelectionEditPolicy) {
+ ((TextSelectionEditPolicy)sfEditPolicy).refreshFeedback();
+ }
+ }
+
+ protected void refreshUnderline() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextUnderline(style.isUnderline());
+ }
+ }
+
+ protected void refreshStrikeThrough() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null && getFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getFigure()).setTextStrikeThrough(style.isStrikeThrough());
+ }
+ }
+
+ @Override
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getFontStyleOwnerView().getStyle(NotationPackage.eINSTANCE.getFontStyle());
+ if(style != null) {
+ FontData fontData = new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ setFont(fontData);
+ }
+ }
+
+ @Override
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ @Override
+ protected void addSemanticListeners() {
+ if(getParser() instanceof ISemanticParser) {
+ EObject element = getParserElement();
+ 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();
+ }
+ }
+
+ @Override
+ protected void removeSemanticListeners() {
+ if(parserElements != null) {
+ for(int i = 0; i < parserElements.size(); i++) {
+ removeListenerFilter("SemanticModel" + i); //$NON-NLS-1$
+ }
+ } else {
+ super.removeSemanticListeners();
+ }
+ }
+
+ @Override
+ protected AccessibleEditPart getAccessibleEditPart() {
+ if(accessibleEP == null) {
+ accessibleEP = new AccessibleGraphicalEditPart() {
+
+ @Override
+ public void getName(AccessibleEvent e) {
+ e.result = getLabelTextHelper(getFigure());
+ }
+ };
+ }
+ return accessibleEP;
+ }
+
+ 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.uml.diagram.common.editpolicies.IDirectEdition
+ */
+ 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.
+ */
+ 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
+ */
+ protected boolean checkDefaultEdition() {
+ return (getParser() != null);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ */
+ 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();
+ }
+ }
+
+ @Override
+ 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();
+ }
+ }
+ }
+
+ if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
+ refreshLabel();
+ }
+
+ super.handleNotificationEvent(event);
+ }
+
+ @Override
+ protected void addNotationalListeners() {
+ super.addNotationalListeners();
+ addListenerFilter("PrimaryView", this, getPrimaryView()); //$NON-NLS-1$
+ }
+
+ @Override
+ protected void removeNotationalListeners() {
+ super.removeNotationalListeners();
+ removeListenerFilter("PrimaryView"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected IFigure createFigure() {
+ // Parent should assign one using setLabel() method
+ return null;
+ }
+
+ public String getLabelPreferenceKey() {
+ String diagramType = getNotationView().getDiagram().getType();
+ String parentType = ViewUtil.getViewContainer(getNotationView()).getType();
+ String labelType = getNotationView().getType();
+ return diagramType + "_" + parentType + "-" + labelType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public abstract String getLabelRole();
+
+ /**
+ * {@inheritDoc}
+ */
+ public abstract String getIconPathRole();
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractShapeCompartmentEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractShapeCompartmentEditPart.java
index b11eb8c95f3..7202aa4da9e 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractShapeCompartmentEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AbstractShapeCompartmentEditPart.java
@@ -1,116 +1,116 @@
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gef.DragTracker;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.SelectionRequest;
-import org.eclipse.gef.tools.DeselectAllTracker;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.internal.tools.RubberbandDragTracker;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.CompartmentSemanticEditPolicy;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultCreationEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.CustomContainerEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-
-/**
- * Abstract non-diagram specific edit part for shape compartment.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public abstract class AbstractShapeCompartmentEditPart extends ShapeCompartmentEditPart {
-
- public AbstractShapeCompartmentEditPart(View view) {
- super(view);
- }
-
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CompartmentSemanticEditPolicy());
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
- }
-
- @Override
- protected void setRatio(Double ratio) {
- if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
- super.setRatio(ratio);
- }
- }
-
- @Override
- protected void handleNotificationEvent(Notification notification) {
- Object feature = notification.getFeature();
- if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
- refreshBounds();
- }
- super.handleNotificationEvent(notification);
- }
-
- protected void refreshBounds() {
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-
- /**
- * Install a drag tracker supporting double click (necessary for navigation).
- */
- public DragTracker getDragTracker(Request req) {
- if (!supportsDragSelection())
- return super.getDragTracker(req);
-
- if (req instanceof SelectionRequest
- && ((SelectionRequest) req).getLastButtonPressed() == 3)
- return new DeselectAllTracker(this) {
-
- protected boolean handleButtonDown(int button) {
- getCurrentViewer().select(AbstractShapeCompartmentEditPart.this);
- return true;
- }
- };
-
- return new RubberbandDragTracker() {
-
- /* this method has been respecified in order to allow double click
- * on the compartment.
- * hence it allows the navigation by double click
- */
- protected boolean handleDoubleClick(int button) {
- SelectionRequest request = new SelectionRequest();
- request.setLocation(getLocation());
- request.setType(RequestConstants.REQ_OPEN);
- performRequest(request);
- return true;
- }
-
- protected void handleFinished() {
- if (getViewer().getSelectedEditParts().isEmpty())
- getViewer().select(AbstractShapeCompartmentEditPart.this);
- }
-
- };
- }
-}
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.DragTracker;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.requests.SelectionRequest;
+import org.eclipse.gef.tools.DeselectAllTracker;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.internal.tools.RubberbandDragTracker;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.CompartmentSemanticEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultCreationEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.CustomContainerEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
+
+/**
+ * Abstract non-diagram specific edit part for shape compartment.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public abstract class AbstractShapeCompartmentEditPart extends ShapeCompartmentEditPart {
+
+ public AbstractShapeCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CompartmentSemanticEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ResizableCompartmentEditPolicy());
+ installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new CustomContainerEditPolicy());
+ }
+
+ @Override
+ protected void setRatio(Double ratio) {
+ if(getFigure().getParent().getLayoutManager() instanceof ConstrainedToolbarLayout) {
+ super.setRatio(ratio);
+ }
+ }
+
+ @Override
+ protected void handleNotificationEvent(Notification notification) {
+ Object feature = notification.getFeature();
+ if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ refreshBounds();
+ }
+ super.handleNotificationEvent(notification);
+ }
+
+ protected void refreshBounds() {
+ int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
+ int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
+ Dimension size = new Dimension(width, height);
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ Point loc = new Point(x, y);
+ ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshBounds();
+ }
+
+ /**
+ * Install a drag tracker supporting double click (necessary for navigation).
+ */
+ public DragTracker getDragTracker(Request req) {
+ if (!supportsDragSelection())
+ return super.getDragTracker(req);
+
+ if (req instanceof SelectionRequest
+ && ((SelectionRequest) req).getLastButtonPressed() == 3)
+ return new DeselectAllTracker(this) {
+
+ protected boolean handleButtonDown(int button) {
+ getCurrentViewer().select(AbstractShapeCompartmentEditPart.this);
+ return true;
+ }
+ };
+
+ return new RubberbandDragTracker() {
+
+ /* this method has been respecified in order to allow double click
+ * on the compartment.
+ * hence it allows the navigation by double click
+ */
+ protected boolean handleDoubleClick(int button) {
+ SelectionRequest request = new SelectionRequest();
+ request.setLocation(getLocation());
+ request.setType(RequestConstants.REQ_OPEN);
+ performRequest(request);
+ return true;
+ }
+
+ protected void handleFinished() {
+ if (getViewer().getSelectedEditParts().isEmpty())
+ getViewer().select(AbstractShapeCompartmentEditPart.this);
+ }
+
+ };
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java
index 17af6b88407..8e8baf3814f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java
@@ -1,127 +1,127 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-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.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure;
-
-/**
- * This class implements an affixed label edit part for applied stereotype representation on border items.
- */
-public class AppliedStereotypeAffixedLabelEditPart extends AbstractElementLabelEditPart implements IBorderItemEditPart, IPapyrusEditPart {
-
- /** Constructor */
- public AppliedStereotypeAffixedLabelEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeEditPolicy());
- }
-
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- 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();
-
- // Update locator constraint
- IBorderItemLocator locator = getBorderItemLocator();
- locator.setConstraint(new Rectangle(x, y, width, height));
-
- // Set new constraint on parent figure
- getFigure().getParent().setConstraint(getFigure(), locator);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- protected IFigure createFigurePrim() {
- return new AppliedStereotypeWrappingLabelFigure();
- }
-
- public IFigure getPrimaryShape() {
- return (IFigure)getFigure();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * Forbid direct edition on this label.
- */
- public int getDirectEditionType() {
- // The label is read-only (defined in GMFGen model)
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "Stereotype";//$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return "";//$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+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.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeExternalNodeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeWrappingLabelFigure;
+
+/**
+ * This class implements an affixed label edit part for applied stereotype representation on border items.
+ */
+public class AppliedStereotypeAffixedLabelEditPart extends AbstractElementLabelEditPart implements IBorderItemEditPart, IPapyrusEditPart {
+
+ /** Constructor */
+ public AppliedStereotypeAffixedLabelEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeExternalNodeEditPolicy());
+ }
+
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ 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();
+
+ // Update locator constraint
+ IBorderItemLocator locator = getBorderItemLocator();
+ locator.setConstraint(new Rectangle(x, y, width, height));
+
+ // Set new constraint on parent figure
+ getFigure().getParent().setConstraint(getFigure(), locator);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ protected IFigure createFigurePrim() {
+ return new AppliedStereotypeWrappingLabelFigure();
+ }
+
+ public IFigure getPrimaryShape() {
+ return (IFigure)getFigure();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isEditable() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * Forbid direct edition on this label.
+ */
+ public int getDirectEditionType() {
+ // The label is read-only (defined in GMFGen model)
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Stereotype";//$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return "";//$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeLinkLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeLinkLabelEditPart.java
index 57a9a3ba613..67b116897ff 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeLinkLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeLinkLabelEditPart.java
@@ -1,80 +1,80 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-
-/**
- * Abstract non-diagram specific edit part for link label representing applied stereotypes.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public class AppliedStereotypeLinkLabelEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public AppliedStereotypeLinkLabelEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ParserOptions getParserOptions() {
- return ParserOptions.NONE;
- }
-
- /**
- * Forbid direct edition on this label.
- */
- public int getDirectEditionType() {
- // The label is read-only (defined in GMFGen model)
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "Stereotype";//$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return "";//$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
+
+/**
+ * Abstract non-diagram specific edit part for link label representing applied stereotypes.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public class AppliedStereotypeLinkLabelEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public AppliedStereotypeLinkLabelEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isEditable() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ParserOptions getParserOptions() {
+ return ParserOptions.NONE;
+ }
+
+ /**
+ * Forbid direct edition on this label.
+ */
+ public int getDirectEditionType() {
+ // The label is read-only (defined in GMFGen model)
+ return IDirectEdition.NO_DIRECT_EDITION;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Stereotype";//$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return "";//$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceMultiplicityEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceMultiplicityEditPart.java
index b5b946ea73e..43448d1aabd 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceMultiplicityEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceMultiplicityEditPart.java
@@ -1,91 +1,91 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.utils.AssociationViewUtils;
-import org.eclipse.uml2.uml.Association;
-
-/**
- * Edit Part for link label showing {@link Association} source multiplicity.
- */
-public class AssociationLinkLabelSourceMultiplicityEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public AssociationLinkLabelSourceMultiplicityEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getKeyPoint() {
- return ConnectionLocator.SOURCE;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EObject getParserElement() {
- Association association = (Association)resolveSemanticElement();
- if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
- View owner = ViewUtil.getContainerView(getNotationView());
-
- if((association != null) && (association.getMemberEnds().size() == 2)) {
- return AssociationViewUtils.getSourceSemanticEnd(owner);
- }
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "SourceMultiplicity"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.utils.AssociationViewUtils;
+import org.eclipse.uml2.uml.Association;
+
+/**
+ * Edit Part for link label showing {@link Association} source multiplicity.
+ */
+public class AssociationLinkLabelSourceMultiplicityEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public AssociationLinkLabelSourceMultiplicityEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getKeyPoint() {
+ return ConnectionLocator.SOURCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EObject getParserElement() {
+ Association association = (Association)resolveSemanticElement();
+ if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
+ View owner = ViewUtil.getContainerView(getNotationView());
+
+ if((association != null) && (association.getMemberEnds().size() == 2)) {
+ return AssociationViewUtils.getSourceSemanticEnd(owner);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isEditable() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "SourceMultiplicity"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceRoleEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceRoleEditPart.java
index bd0ad9e0313..671884e9b8e 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceRoleEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelSourceRoleEditPart.java
@@ -1,83 +1,83 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.utils.AssociationViewUtils;
-import org.eclipse.uml2.uml.Association;
-
-/**
- * Edit Part for link label showing {@link Association} source role.
- */
-public class AssociationLinkLabelSourceRoleEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public AssociationLinkLabelSourceRoleEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getKeyPoint() {
- return ConnectionLocator.SOURCE;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EObject getParserElement() {
- Association association = (Association)resolveSemanticElement();
- if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
- View owner = ViewUtil.getContainerView(getNotationView());
-
- if((association != null) && (association.getMemberEnds().size() == 2)) {
- return AssociationViewUtils.getSourceSemanticEnd(owner);
- }
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "SourceRole"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.utils.AssociationViewUtils;
+import org.eclipse.uml2.uml.Association;
+
+/**
+ * Edit Part for link label showing {@link Association} source role.
+ */
+public class AssociationLinkLabelSourceRoleEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public AssociationLinkLabelSourceRoleEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getKeyPoint() {
+ return ConnectionLocator.SOURCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EObject getParserElement() {
+ Association association = (Association)resolveSemanticElement();
+ if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
+ View owner = ViewUtil.getContainerView(getNotationView());
+
+ if((association != null) && (association.getMemberEnds().size() == 2)) {
+ return AssociationViewUtils.getSourceSemanticEnd(owner);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "SourceRole"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetMultiplicityEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetMultiplicityEditPart.java
index 215c28c24a1..0a43778ac63 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetMultiplicityEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetMultiplicityEditPart.java
@@ -1,91 +1,91 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.utils.AssociationViewUtils;
-import org.eclipse.uml2.uml.Association;
-
-/**
- * Edit Part for link label showing {@link Association} target multiplicity.
- */
-public class AssociationLinkLabelTargetMultiplicityEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public AssociationLinkLabelTargetMultiplicityEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getKeyPoint() {
- return ConnectionLocator.TARGET;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EObject getParserElement() {
- Association association = (Association)resolveSemanticElement();
- if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
- View owner = ViewUtil.getContainerView(getNotationView());
-
- if((association != null) && (association.getMemberEnds().size() == 2)) {
- return AssociationViewUtils.getTargetSemanticEnd(owner);
- }
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "TargetMultiplicity"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.utils.AssociationViewUtils;
+import org.eclipse.uml2.uml.Association;
+
+/**
+ * Edit Part for link label showing {@link Association} target multiplicity.
+ */
+public class AssociationLinkLabelTargetMultiplicityEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public AssociationLinkLabelTargetMultiplicityEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getKeyPoint() {
+ return ConnectionLocator.TARGET;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EObject getParserElement() {
+ Association association = (Association)resolveSemanticElement();
+ if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
+ View owner = ViewUtil.getContainerView(getNotationView());
+
+ if((association != null) && (association.getMemberEnds().size() == 2)) {
+ return AssociationViewUtils.getTargetSemanticEnd(owner);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isEditable() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "TargetMultiplicity"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetRoleEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetRoleEditPart.java
index 662f7999e76..fa7651eccf5 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetRoleEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AssociationLinkLabelTargetRoleEditPart.java
@@ -1,83 +1,83 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.utils.AssociationViewUtils;
-import org.eclipse.uml2.uml.Association;
-
-/**
- * Edit Part for link label showing {@link Association} target role.
- */
-public class AssociationLinkLabelTargetRoleEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public AssociationLinkLabelTargetRoleEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getKeyPoint() {
- return ConnectionLocator.TARGET;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EObject getParserElement() {
- Association association = (Association)resolveSemanticElement();
- if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
- View owner = ViewUtil.getContainerView(getNotationView());
-
- if((association != null) && (association.getMemberEnds().size() == 2)) {
- return AssociationViewUtils.getTargetSemanticEnd(owner);
- }
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "TargetRole"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.utils.AssociationViewUtils;
+import org.eclipse.uml2.uml.Association;
+
+/**
+ * Edit Part for link label showing {@link Association} target role.
+ */
+public class AssociationLinkLabelTargetRoleEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public AssociationLinkLabelTargetRoleEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getKeyPoint() {
+ return ConnectionLocator.TARGET;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EObject getParserElement() {
+ Association association = (Association)resolveSemanticElement();
+ if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
+ View owner = ViewUtil.getContainerView(getNotationView());
+
+ if((association != null) && (association.getMemberEnds().size() == 2)) {
+ return AssociationViewUtils.getTargetSemanticEnd(owner);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "TargetRole"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelEditPart.java
index eeeacc84599..a4e327cf875 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelEditPart.java
@@ -1,53 +1,53 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-
-/**
- * Edit Part for link label showing {@link Connector} label.
- */
-public class ConnectorLinkLabelEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public ConnectorLinkLabelEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "Label"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+
+/**
+ * Edit Part for link label showing {@link Connector} label.
+ */
+public class ConnectorLinkLabelEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public ConnectorLinkLabelEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Label"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelSourceMultiplicityEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelSourceMultiplicityEditPart.java
index 9e0f8a406e8..d007ac11ad8 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelSourceMultiplicityEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelSourceMultiplicityEditPart.java
@@ -1,90 +1,90 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-import org.eclipse.uml2.uml.Connector;
-
-/**
- * Edit Part for link label showing {@link Connector} source {@link ConnectorEnd} multiplicity.
- */
-public class ConnectorLinkLabelSourceMultiplicityEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public ConnectorLinkLabelSourceMultiplicityEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getKeyPoint() {
- return ConnectionLocator.SOURCE;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EObject getParserElement() {
- Connector connector = (Connector)resolveSemanticElement();
- if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
- View owner = ViewUtil.getContainerView(getNotationView());
-
- if((connector != null) && (connector.getEnds().size() == 2)) {
- return connector.getEnds().get(0);
- }
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "SourceMultiplicity"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+import org.eclipse.uml2.uml.Connector;
+
+/**
+ * Edit Part for link label showing {@link Connector} source {@link ConnectorEnd} multiplicity.
+ */
+public class ConnectorLinkLabelSourceMultiplicityEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public ConnectorLinkLabelSourceMultiplicityEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getKeyPoint() {
+ return ConnectionLocator.SOURCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EObject getParserElement() {
+ Connector connector = (Connector)resolveSemanticElement();
+ if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
+ View owner = ViewUtil.getContainerView(getNotationView());
+
+ if((connector != null) && (connector.getEnds().size() == 2)) {
+ return connector.getEnds().get(0);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isEditable() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "SourceMultiplicity"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelTargetMultiplicityEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelTargetMultiplicityEditPart.java
index 888977f319d..189a7163b72 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelTargetMultiplicityEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorLinkLabelTargetMultiplicityEditPart.java
@@ -1,90 +1,90 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.draw2d.ConnectionLocator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-import org.eclipse.uml2.uml.Connector;
-
-/**
- * Edit Part for link label showing {@link Connector} target {@link ConnectorEnd} multiplicity.
- */
-public class ConnectorLinkLabelTargetMultiplicityEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public ConnectorLinkLabelTargetMultiplicityEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getKeyPoint() {
- return ConnectionLocator.TARGET;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EObject getParserElement() {
- Connector connector = (Connector)resolveSemanticElement();
- if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
- View owner = ViewUtil.getContainerView(getNotationView());
-
- if((connector != null) && (connector.getEnds().size() == 2)) {
- connector.getEnds().get(1);
- }
- }
-
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean isEditable() {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "TargetMultiplicity"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.ConnectionLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+import org.eclipse.uml2.uml.Connector;
+
+/**
+ * Edit Part for link label showing {@link Connector} target {@link ConnectorEnd} multiplicity.
+ */
+public class ConnectorLinkLabelTargetMultiplicityEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public ConnectorLinkLabelTargetMultiplicityEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getKeyPoint() {
+ return ConnectionLocator.TARGET;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EObject getParserElement() {
+ Connector connector = (Connector)resolveSemanticElement();
+ if((getNotationView() != null) && (ViewUtil.getContainerView(getNotationView()) != null)) {
+ View owner = ViewUtil.getContainerView(getNotationView());
+
+ if((connector != null) && (connector.getEnds().size() == 2)) {
+ connector.getEnds().get(1);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean isEditable() {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "TargetMultiplicity"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConstraintNodeLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConstraintNodeLabelEditPart.java
new file mode 100644
index 00000000000..6609dcb8f8d
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/ConstraintNodeLabelEditPart.java
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.Constraint;
+
+/**
+ * Abstract non-diagram specific edit part for node label representing {@link Constraint}.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public class ConstraintNodeLabelEditPart extends AbstractElementNodeLabelEditPart {
+
+ protected static final String LEFT_BRACE = "{";
+ protected static final String RIGHT_BRACE = "}";
+
+ public ConstraintNodeLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Label"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ IFigure figure = getFigure();
+ if (figure instanceof WrappingLabel) {
+ EObject resolveSemanticElement = resolveSemanticElement();
+ if (resolveSemanticElement instanceof Constraint) {
+ String specificationValue = ValueSpecificationUtil.getSpecificationValue(((Constraint) resolveSemanticElement).getSpecification());
+ specificationValue = (specificationValue == null ? "" : specificationValue);
+ ((WrappingLabel) figure).setText(LEFT_BRACE + specificationValue + RIGHT_BRACE);
+ }
+ }
+ }
+
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ // do nothing else refresh
+ refresh();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/DefaultChildLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/DefaultChildLabelEditPart.java
index ba8fbcd03f6..1007e6ea660 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/DefaultChildLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/DefaultChildLabelEditPart.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultSemanticEditPolicy;
-
-/**
- * Default implementation for child label node.
- */
-public class DefaultChildLabelEditPart extends AbstractElementChildLabelEditPart {
-
- /** Constructor */
- public DefaultChildLabelEditPart(View view) {
- super(view);
- }
-
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultSemanticEditPolicy;
+
+/**
+ * Default implementation for child label node.
+ */
+public class DefaultChildLabelEditPart extends AbstractElementChildLabelEditPart {
+
+ /** Constructor */
+ public DefaultChildLabelEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DefaultSemanticEditPolicy());
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java
index 46f35bcf19d..686ca733116 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementAffixedLabelNameEditPart.java
@@ -1,121 +1,121 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Abstract non-diagram specific edit part for border node label representing {@link NamedElement}.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public class NamedElementAffixedLabelNameEditPart extends AbstractElementLabelEditPart implements IBorderItemEditPart {
-
- /** Constructor */
- public NamedElementAffixedLabelNameEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- 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();
-
- // Update locator constraint
- IBorderItemLocator locator = getBorderItemLocator();
- locator.setConstraint(new Rectangle(x, y, width, height));
-
- // Set new constraint on parent figure
- getFigure().getParent().setConstraint(getFigure(), locator);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return Activator.getInstance().getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- protected IFigure createFigurePrim() {
- return new PapyrusWrappingLabel();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "Name"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Abstract non-diagram specific edit part for border node label representing {@link NamedElement}.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public class NamedElementAffixedLabelNameEditPart extends AbstractElementLabelEditPart implements IBorderItemEditPart {
+
+ /** Constructor */
+ public NamedElementAffixedLabelNameEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ 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();
+
+ // Update locator constraint
+ IBorderItemLocator locator = getBorderItemLocator();
+ locator.setConstraint(new Rectangle(x, y, width, height));
+
+ // Set new constraint on parent figure
+ getFigure().getParent().setConstraint(getFigure(), locator);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Image getLabelIcon() {
+ EObject parserElement = getParserElement();
+ if(parserElement == null) {
+ return null;
+ }
+
+ List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ for(View view : views) {
+ if(NameLabelIconHelper.showLabelIcon(view)) {
+ return Activator.getInstance().getImage(parserElement.eClass());
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ protected IFigure createFigurePrim() {
+ return new PapyrusWrappingLabel();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Name"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementLinkLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementLinkLabelNameEditPart.java
index 19146e0d83c..804b3a2f8d9 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementLinkLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementLinkLabelNameEditPart.java
@@ -1,53 +1,53 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
-
-/**
- * Edit Part for link label showing {@link NamedElement} name.
- */
-public class NamedElementLinkLabelNameEditPart extends AbstractElementLabelEditPart {
-
- /** Constructor */
- public NamedElementLinkLabelNameEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "Name"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.LinkLabelDragEditPolicy;
+
+/**
+ * Edit Part for link label showing {@link NamedElement} name.
+ */
+public class NamedElementLinkLabelNameEditPart extends AbstractElementLabelEditPart {
+
+ /** Constructor */
+ public NamedElementLinkLabelNameEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new LinkLabelDragEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Name"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementNodeLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementNodeLabelNameEditPart.java
index 51376fb423a..4579e5d48fc 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementNodeLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/NamedElementNodeLabelNameEditPart.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Abstract non-diagram specific edit part for node label representing {@link NamedElement}.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public class NamedElementNodeLabelNameEditPart extends AbstractElementNodeLabelEditPart {
-
- public NamedElementNodeLabelNameEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "Name"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Abstract non-diagram specific edit part for node label representing {@link NamedElement}.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public class NamedElementNodeLabelNameEditPart extends AbstractElementNodeLabelEditPart {
+
+ public NamedElementNodeLabelNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Name"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java
index 760a7e51f50..6834dc1ad6b 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PortAffixedLabelNameEditPart.java
@@ -1,120 +1,120 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This class implements a {@link Port} affixed label edit part.
- */
-public class PortAffixedLabelNameEditPart extends AbstractElementLabelEditPart implements IBorderItemEditPart {
-
- /** Constructor */
- public PortAffixedLabelNameEditPart(View view) {
- super(view);
- addSnapBackLocation();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- 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();
-
- // Update locator constraint
- IBorderItemLocator locator = getBorderItemLocator();
- locator.setConstraint(new Rectangle(x, y, width, height));
-
- // Set new constraint on parent figure
- getFigure().getParent().setConstraint(getFigure(), locator);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return Activator.getInstance().getLabelProvider().getImage(parserElement);
- }
- }
- return null;
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected IFigure createFigure() {
- IFigure label = createFigurePrim();
- defaultText = getLabelTextHelper(label);
- return label;
- }
-
- protected IFigure createFigurePrim() {
- return new PapyrusWrappingLabel();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "Label"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This class implements a {@link Port} affixed label edit part.
+ */
+public class PortAffixedLabelNameEditPart extends AbstractElementLabelEditPart implements IBorderItemEditPart {
+
+ /** Constructor */
+ public PortAffixedLabelNameEditPart(View view) {
+ super(view);
+ addSnapBackLocation();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+
+ public IBorderItemLocator getBorderItemLocator() {
+ IFigure parentFigure = getFigure().getParent();
+ if(parentFigure != null && parentFigure.getLayoutManager() != null) {
+ Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
+ return (IBorderItemLocator)constraint;
+ }
+ return null;
+ }
+
+ 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();
+
+ // Update locator constraint
+ IBorderItemLocator locator = getBorderItemLocator();
+ locator.setConstraint(new Rectangle(x, y, width, height));
+
+ // Set new constraint on parent figure
+ getFigure().getParent().setConstraint(getFigure(), locator);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Image getLabelIcon() {
+ EObject parserElement = getParserElement();
+ if(parserElement == null) {
+ return null;
+ }
+
+ List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
+ for(View view : views) {
+ if(NameLabelIconHelper.showLabelIcon(view)) {
+ return Activator.getInstance().getLabelProvider().getImage(parserElement);
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected IFigure createFigure() {
+ IFigure label = createFigurePrim();
+ defaultText = getLabelTextHelper(label);
+ return label;
+ }
+
+ protected IFigure createFigurePrim() {
+ return new PapyrusWrappingLabel();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Label"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PropertyNodeLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PropertyNodeLabelEditPart.java
index a5920c09eda..1f828e0f627 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PropertyNodeLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/PropertyNodeLabelEditPart.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Abstract non-diagram specific edit part for node label representing {@link Property}.
- * This class is adapted from edit parts generated by GMF Tooling.
- */
-public class PropertyNodeLabelEditPart extends AbstractElementNodeLabelEditPart {
-
- public PropertyNodeLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLabelRole() {
- return "Label"; //$NON-NLS-1$
- }
-
- /**
- * {@inheritDoc}
- */
- public String getIconPathRole() {
- return ""; //$NON-NLS-1$
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Abstract non-diagram specific edit part for node label representing {@link Property}.
+ * This class is adapted from edit parts generated by GMF Tooling.
+ */
+public class PropertyNodeLabelEditPart extends AbstractElementNodeLabelEditPart {
+
+ public PropertyNodeLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLabelRole() {
+ return "Label"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getIconPathRole() {
+ return ""; //$NON-NLS-1$
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/SlotChildLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/SlotChildLabelEditPart.java
index 3c314be121a..effec08a44f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/SlotChildLabelEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/SlotChildLabelEditPart.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.part;
-
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Edit part for {@link Slot} used as Child label node.
- */
-public class SlotChildLabelEditPart extends AbstractElementChildLabelEditPart {
-
- /** Constructor */
- public SlotChildLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Edit part for {@link Slot} used as Child label node.
+ */
+public class SlotChildLabelEditPart extends AbstractElementChildLabelEditPart {
+
+ /** Constructor */
+ public SlotChildLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/EncapsulatedClassifierResizableShapeEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/EncapsulatedClassifierResizableShapeEditPolicy.java
index 6418c5b76c4..b20af1110d0 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/EncapsulatedClassifierResizableShapeEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/EncapsulatedClassifierResizableShapeEditPolicy.java
@@ -1,126 +1,126 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.policy;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.papyrus.uml.diagram.common.commands.FixPortLocationCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.UpdatePortLocationCommand;
-
-/**
- * <pre>
- * This class modifies EncapsulatedClassifier default resize command in order to move
- * any Port IBorderItem possibly attached.
- * See. bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=354814
- * Could not find a more general way to do this without making any assumption about
- * the kind of attached IBorderItem and that would only rely on its IBorderItemLocator.
- * </pre>
- */
-public class EncapsulatedClassifierResizableShapeEditPolicy extends ResizableShapeEditPolicy {
-
- /**
- * <pre>
- * {@inheritDoc}
- *
- * Forbid AutoSize for elements that can hold Port, it currently
- * leads to Port (FlowPort) with incorrect location stored in notation,
- * and possible incorrect visual representation (FlowPort).
- * </pre>
- */
- @Override
- protected Command getAutoSizeCommand(Request request) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * <pre>
- * {@inheritDoc}
- *
- * Extends the default resize command by :
- * - fixing possible Port location issues before resizing parent
- * - make the default parent resize
- * - update the Port location after resize (uses the side of the parent where the Port is attached before resize)
- * </pre>
- */
- @Override
- protected Command getResizeCommand(ChangeBoundsRequest request) {
-
- // Prepare command to move the affixed children as well (and an optional fix command)
- CompoundCommand updatePortLocationsCommand = new CompoundCommand("Update border items location");
- CompoundCommand fixPortLocationsCommand = new CompoundCommand("Fix border items location");
-
- Iterator<?> it = getHost().getChildren().iterator();
- while(it.hasNext()) {
- Object tmp = it.next();
- if(!(tmp instanceof IBorderItemEditPart)) {
- continue;
- }
-
- IBorderItemEditPart borderItem = (IBorderItemEditPart)tmp;
- Shape borderItemView = (Shape)borderItem.getNotationView();
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(borderItemView);
-
- // Fix possible location issue in BorderItem bounds in notation model
- ICommand fixPortLocationCommand = new FixPortLocationCommand(editingDomain, borderItem, (GraphicalEditPart)getHost());
- if(fixPortLocationCommand.canExecute()) {
- fixPortLocationsCommand.add(new ICommandProxy(fixPortLocationCommand));
- }
-
- ICommand updatePortLocationCommand = new UpdatePortLocationCommand(editingDomain, (GraphicalEditPart)getHost(), borderItem, borderItem.getBorderItemLocator().getCurrentSideOfParent());
- if(updatePortLocationCommand.canExecute()) {
- updatePortLocationsCommand.add(new ICommandProxy(updatePortLocationCommand));
- }
- }
-
-
- // Create the complete resize command
- CompoundCommand resizeCommand = new CompoundCommand("Resize command");
-
- // Add command to fix border item locations.
- // The role of this command is to make sure that the Port is correctly located (here this means
- // that the figure and the view have the same location) before resizing its parent.
- // See bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=354814.
- if(!fixPortLocationsCommand.isEmpty()) {
- resizeCommand.add(fixPortLocationsCommand);
- }
-
- // Add command to update locations
- resizeCommand.add(super.getResizeCommand(request));
-
- // Add command to update border item locations.
- // This command uses the border side of the border item before the resize action, and thus
- // requires that the Port location is correct. Previous versions did not move the IBorderItem, this is the reason
- // why a fix on the fly may be required.
- // See bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=354814.
- if(!updatePortLocationsCommand.isEmpty()) {
- resizeCommand.add(updatePortLocationsCommand);
- }
-
- return resizeCommand;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.policy;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
+import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.papyrus.uml.diagram.common.commands.FixPortLocationCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.UpdatePortLocationCommand;
+
+/**
+ * <pre>
+ * This class modifies EncapsulatedClassifier default resize command in order to move
+ * any Port IBorderItem possibly attached.
+ * See. bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=354814
+ * Could not find a more general way to do this without making any assumption about
+ * the kind of attached IBorderItem and that would only rely on its IBorderItemLocator.
+ * </pre>
+ */
+public class EncapsulatedClassifierResizableShapeEditPolicy extends ResizableShapeEditPolicy {
+
+ /**
+ * <pre>
+ * {@inheritDoc}
+ *
+ * Forbid AutoSize for elements that can hold Port, it currently
+ * leads to Port (FlowPort) with incorrect location stored in notation,
+ * and possible incorrect visual representation (FlowPort).
+ * </pre>
+ */
+ @Override
+ protected Command getAutoSizeCommand(Request request) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * <pre>
+ * {@inheritDoc}
+ *
+ * Extends the default resize command by :
+ * - fixing possible Port location issues before resizing parent
+ * - make the default parent resize
+ * - update the Port location after resize (uses the side of the parent where the Port is attached before resize)
+ * </pre>
+ */
+ @Override
+ protected Command getResizeCommand(ChangeBoundsRequest request) {
+
+ // Prepare command to move the affixed children as well (and an optional fix command)
+ CompoundCommand updatePortLocationsCommand = new CompoundCommand("Update border items location");
+ CompoundCommand fixPortLocationsCommand = new CompoundCommand("Fix border items location");
+
+ Iterator<?> it = getHost().getChildren().iterator();
+ while(it.hasNext()) {
+ Object tmp = it.next();
+ if(!(tmp instanceof IBorderItemEditPart)) {
+ continue;
+ }
+
+ IBorderItemEditPart borderItem = (IBorderItemEditPart)tmp;
+ Shape borderItemView = (Shape)borderItem.getNotationView();
+ TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(borderItemView);
+
+ // Fix possible location issue in BorderItem bounds in notation model
+ ICommand fixPortLocationCommand = new FixPortLocationCommand(editingDomain, borderItem, (GraphicalEditPart)getHost());
+ if(fixPortLocationCommand.canExecute()) {
+ fixPortLocationsCommand.add(new ICommandProxy(fixPortLocationCommand));
+ }
+
+ ICommand updatePortLocationCommand = new UpdatePortLocationCommand(editingDomain, (GraphicalEditPart)getHost(), borderItem, borderItem.getBorderItemLocator().getCurrentSideOfParent());
+ if(updatePortLocationCommand.canExecute()) {
+ updatePortLocationsCommand.add(new ICommandProxy(updatePortLocationCommand));
+ }
+ }
+
+
+ // Create the complete resize command
+ CompoundCommand resizeCommand = new CompoundCommand("Resize command");
+
+ // Add command to fix border item locations.
+ // The role of this command is to make sure that the Port is correctly located (here this means
+ // that the figure and the view have the same location) before resizing its parent.
+ // See bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=354814.
+ if(!fixPortLocationsCommand.isEmpty()) {
+ resizeCommand.add(fixPortLocationsCommand);
+ }
+
+ // Add command to update locations
+ resizeCommand.add(super.getResizeCommand(request));
+
+ // Add command to update border item locations.
+ // This command uses the border side of the border item before the resize action, and thus
+ // requires that the Port location is correct. Previous versions did not move the IBorderItem, this is the reason
+ // why a fix on the fly may be required.
+ // See bug. https://bugs.eclipse.org/bugs/show_bug.cgi?id=354814.
+ if(!updatePortLocationsCommand.isEmpty()) {
+ resizeCommand.add(updatePortLocationsCommand);
+ }
+
+ return resizeCommand;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java
index 3f07f190931..016d9c0ced1 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/MaskManagedLabelEditPolicy.java
@@ -1,126 +1,126 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.policy;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
-import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
-import org.eclipse.papyrus.infra.emf.appearance.commands.AddMaskManagedLabelDisplayCommand;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.emf.commands.RemoveEAnnotationCommand;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-
-
-/**
- * <pre>
- * Generic mask manage edit policy for {@link ITextAwareEditPart}, managed masks are assumed to be given by the
- * {@link ITextAwareEditPart} parser (must implement {@link IMaskManagedSemanticParser}).
- * </pre>
- */
-public class MaskManagedLabelEditPolicy extends GraphicalEditPolicy implements IMaskManagedLabelEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>();
-
- IParser parser = getHostLabelEditPart().getParser();
- if(parser instanceof IMaskManagedSemanticParser) {
- masks = ((IMaskManagedSemanticParser)parser).getMasks();
- }
-
- return masks;
- }
-
- /**
- * {@inheritDoc}
- */
- public int getCurrentDisplayValue() {
- return getHostLabelEditPart().getParserOptions().intValue();
- }
-
- /**
- * {@inheritDoc}
- */
- public int getDefaultDisplayValue() {
- return getHostLabelEditPart().getDefaultParserOptions().intValue();
- }
-
- /**
- * {@inheritDoc}
- */
- public void updateDisplayValue(int newValue) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(editingDomain != null) {
- editingDomain.getCommandStack().execute(new AddMaskManagedLabelDisplayCommand(editingDomain, (EModelElement)getHost().getModel(), newValue));
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void setDefaultDisplayValue() {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(editingDomain != null) {
- editingDomain.getCommandStack().execute(new RemoveEAnnotationCommand(editingDomain, (EModelElement)getHost().getModel(), VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION));
- }
- }
-
- // @unused.
- public String getMaskLabel(int value) {
- // Not implemented.
- return null;
- }
-
- // @unused.
- public Collection<String> getMaskLabels() {
- // Not implemented.
- return null;
- }
-
- // @unused.
- public Collection<Integer> getMaskValues() {
- // Not implemented.
- return null;
- }
-
- // @unused.
- public void refreshDisplay() {
- // Not implemented.
- }
-
- // @unused.
- public String getPreferencePageID() {
- // Not implemented.
- return null;
- }
-
- /**
- * Get the host label edit part (has to implement {@link ITextAwareEditPart}).
- *
- * @return the host label edit part.
- */
- private ITextAwareEditPart getHostLabelEditPart() {
- return (ITextAwareEditPart)getHost();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.policy;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.gmf.diagram.common.edit.part.ITextAwareEditPart;
+import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
+import org.eclipse.papyrus.infra.emf.appearance.commands.AddMaskManagedLabelDisplayCommand;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.emf.commands.RemoveEAnnotationCommand;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+
+
+/**
+ * <pre>
+ * Generic mask manage edit policy for {@link ITextAwareEditPart}, managed masks are assumed to be given by the
+ * {@link ITextAwareEditPart} parser (must implement {@link IMaskManagedSemanticParser}).
+ * </pre>
+ */
+public class MaskManagedLabelEditPolicy extends GraphicalEditPolicy implements IMaskManagedLabelEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>();
+
+ IParser parser = getHostLabelEditPart().getParser();
+ if(parser instanceof IMaskManagedSemanticParser) {
+ masks = ((IMaskManagedSemanticParser)parser).getMasks();
+ }
+
+ return masks;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getCurrentDisplayValue() {
+ return getHostLabelEditPart().getParserOptions().intValue();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getDefaultDisplayValue() {
+ return getHostLabelEditPart().getDefaultParserOptions().intValue();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateDisplayValue(int newValue) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(editingDomain != null) {
+ editingDomain.getCommandStack().execute(new AddMaskManagedLabelDisplayCommand(editingDomain, (EModelElement)getHost().getModel(), newValue));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setDefaultDisplayValue() {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(editingDomain != null) {
+ editingDomain.getCommandStack().execute(new RemoveEAnnotationCommand(editingDomain, (EModelElement)getHost().getModel(), VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION));
+ }
+ }
+
+ // @unused.
+ public String getMaskLabel(int value) {
+ // Not implemented.
+ return null;
+ }
+
+ // @unused.
+ public Collection<String> getMaskLabels() {
+ // Not implemented.
+ return null;
+ }
+
+ // @unused.
+ public Collection<Integer> getMaskValues() {
+ // Not implemented.
+ return null;
+ }
+
+ // @unused.
+ public void refreshDisplay() {
+ // Not implemented.
+ }
+
+ // @unused.
+ public String getPreferencePageID() {
+ // Not implemented.
+ return null;
+ }
+
+ /**
+ * Get the host label edit part (has to implement {@link ITextAwareEditPart}).
+ *
+ * @return the host label edit part.
+ */
+ private ITextAwareEditPart getHostLabelEditPart() {
+ return (ITextAwareEditPart)getHost();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/StructuredClassifierCreationEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/StructuredClassifierCreationEditPolicy.java
index 2fd52d215d0..258fa384432 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/StructuredClassifierCreationEditPolicy.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/policy/StructuredClassifierCreationEditPolicy.java
@@ -1,140 +1,140 @@
-/*****************************************************************************
- * Copyright (c) 2011-2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.edit.policy;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.IFigure;
-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.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.commands.CreateViewCommand;
-import org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator;
-
-/**
- * Replaces the {@link DefaultCreationEditPolicy} in order to manage Affixed Port position on creation or on drop.
- */
-public class StructuredClassifierCreationEditPolicy extends CreationEditPolicy {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getReparentCommand(ChangeBoundsRequest request) {
- // Forbid re-parent in this edit policy (to be used by compartment)
- // in order to avoid node to be moved in compartments.
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * <pre>
- * {@inheritDoc}
- *
- * The goal here is to create the view and to move it at the mouse location,
- * respecting a given locator. It is assumed that only affixed Port can be created on
- * edit part that have this edit policy, and the locator is a {@link PortPositionLocator}.
- *
- * @see DefaultCreationEditPolicy#getCreateCommand().
- * </pre>
- */
- @Override
- protected Command getCreateCommand(CreateViewRequest request) {
-
- // This overrides getCreateCommand in order to use a specific CreateViewCommand (instead of
- // org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand.
-
- // The original CreateCommand#canExecute() implementation rely on ViewProvider#provides(CreateViewForKindOperation op)
- // method to know if a view can be created. The problem is that this method is incorrectly generated by GMF Tooling and should be avoided.
-
- // CreateViewCommand replace the semantic adapter in its call to ViewService to know if a provider exists.
-
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- CompositeTransactionalCommand cc = new CompositeTransactionalCommand(editingDomain, DiagramUIMessages.AddCommand_Label);
-
- Iterator<? extends ViewDescriptor> descriptors = request.getViewDescriptors().iterator();
- while(descriptors.hasNext()) {
-
- CreateViewRequest.ViewDescriptor descriptor = (CreateViewRequest.ViewDescriptor)descriptors.next();
- ICommand createCommand = new CreateViewCommand(editingDomain, descriptor, (View)(getHost().getModel()));
-
- // Add SetBounds
- createCommand = CompositeCommand.compose(createCommand, getSetBoundsCommand(request, descriptor));
- //
-
- cc.compose(createCommand);
-
- }
-
- return new ICommandProxy(cc.reduce());
-
- }
-
- /**
- * Get a SetBoundsCommand to move a new view at current mouse position.
- *
- * @param request
- * The creation request.
- * @param descriptor
- * The descriptor of the new element.
- * @return The set bounds command.
- */
- private ICommand getSetBoundsCommand(CreateViewRequest request, CreateViewRequest.ViewDescriptor descriptor) {
- ICommand setBoundsCommand = null;
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
-
- // Retrieve parent location
- Point parentLoc = getHostFigure().getBounds().getLocation().getCopy();
-
- // Compute relative creation location
- Point requestedLocation = request.getLocation().getCopy();
- getHostFigure().translateToRelative(requestedLocation);
-
- // Create proposed creation bounds and use the locator to find the expected position
- PortPositionLocator locator = new PortPositionLocator(getHostFigure(), PositionConstants.NONE);
- Rectangle proposedBounds = new Rectangle(requestedLocation, new Dimension(20, 20));
- Rectangle preferredBounds = locator.getPreferredLocation(proposedBounds);
-
- // Convert the calculated preferred bounds as relative to parent location
- Rectangle creationBounds = preferredBounds.getTranslated(parentLoc.getNegated());
- setBoundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, descriptor, creationBounds);
-
- return setBoundsCommand;
- }
-
- /**
- * Convenience method to return the host's Figure.
- *
- * @return The host GraphicalEditPart's Figure
- */
- private IFigure getHostFigure() {
- return ((GraphicalEditPart)getHost()).getFigure();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011-2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.policy;
+
+import java.util.Iterator;
+
+import org.eclipse.draw2d.IFigure;
+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.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.commands.CreateViewCommand;
+import org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocator;
+
+/**
+ * Replaces the {@link DefaultCreationEditPolicy} in order to manage Affixed Port position on creation or on drop.
+ */
+public class StructuredClassifierCreationEditPolicy extends CreationEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getReparentCommand(ChangeBoundsRequest request) {
+ // Forbid re-parent in this edit policy (to be used by compartment)
+ // in order to avoid node to be moved in compartments.
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * <pre>
+ * {@inheritDoc}
+ *
+ * The goal here is to create the view and to move it at the mouse location,
+ * respecting a given locator. It is assumed that only affixed Port can be created on
+ * edit part that have this edit policy, and the locator is a {@link PortPositionLocator}.
+ *
+ * @see DefaultCreationEditPolicy#getCreateCommand().
+ * </pre>
+ */
+ @Override
+ protected Command getCreateCommand(CreateViewRequest request) {
+
+ // This overrides getCreateCommand in order to use a specific CreateViewCommand (instead of
+ // org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand.
+
+ // The original CreateCommand#canExecute() implementation rely on ViewProvider#provides(CreateViewForKindOperation op)
+ // method to know if a view can be created. The problem is that this method is incorrectly generated by GMF Tooling and should be avoided.
+
+ // CreateViewCommand replace the semantic adapter in its call to ViewService to know if a provider exists.
+
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ CompositeTransactionalCommand cc = new CompositeTransactionalCommand(editingDomain, DiagramUIMessages.AddCommand_Label);
+
+ Iterator<? extends ViewDescriptor> descriptors = request.getViewDescriptors().iterator();
+ while(descriptors.hasNext()) {
+
+ CreateViewRequest.ViewDescriptor descriptor = (CreateViewRequest.ViewDescriptor)descriptors.next();
+ ICommand createCommand = new CreateViewCommand(editingDomain, descriptor, (View)(getHost().getModel()));
+
+ // Add SetBounds
+ createCommand = CompositeCommand.compose(createCommand, getSetBoundsCommand(request, descriptor));
+ //
+
+ cc.compose(createCommand);
+
+ }
+
+ return new ICommandProxy(cc.reduce());
+
+ }
+
+ /**
+ * Get a SetBoundsCommand to move a new view at current mouse position.
+ *
+ * @param request
+ * The creation request.
+ * @param descriptor
+ * The descriptor of the new element.
+ * @return The set bounds command.
+ */
+ private ICommand getSetBoundsCommand(CreateViewRequest request, CreateViewRequest.ViewDescriptor descriptor) {
+ ICommand setBoundsCommand = null;
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+
+ // Retrieve parent location
+ Point parentLoc = getHostFigure().getBounds().getLocation().getCopy();
+
+ // Compute relative creation location
+ Point requestedLocation = request.getLocation().getCopy();
+ getHostFigure().translateToRelative(requestedLocation);
+
+ // Create proposed creation bounds and use the locator to find the expected position
+ PortPositionLocator locator = new PortPositionLocator(getHostFigure(), PositionConstants.NONE);
+ Rectangle proposedBounds = new Rectangle(requestedLocation, new Dimension(20, 20));
+ Rectangle preferredBounds = locator.getPreferredLocation(proposedBounds);
+
+ // Convert the calculated preferred bounds as relative to parent location
+ Rectangle creationBounds = preferredBounds.getTranslated(parentLoc.getNegated());
+ setBoundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, descriptor, creationBounds);
+
+ return setBoundsCommand;
+ }
+
+ /**
+ * Convenience method to return the host's Figure.
+ *
+ * @return The host GraphicalEditPart's Figure
+ */
+ private IFigure getHostFigure() {
+ return ((GraphicalEditPart)getHost()).getFigure();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/ConnectorEdgeFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/ConnectorEdgeFigure.java
index 2b26fabdf65..a23a64ba4f3 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/ConnectorEdgeFigure.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/ConnectorEdgeFigure.java
@@ -1,83 +1,83 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure;
-
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
-
-/**
- * Figure for UML {@link Connector} Edges.
- */
-public class ConnectorEdgeFigure extends NamedElementEdgeFigure {
-
- /** The multiplicity source label. */
- private WrappingLabel fSourceMultiplicityLabel;
-
- /** The multiplicity target label. */
- private WrappingLabel fTargetMultiplicityLabel;
-
- /**
- * Instantiates a new association figure.
- */
- public ConnectorEdgeFigure() {
- super();
- createContents();
- }
-
- /**
- * Creates the contents.
- */
- protected void createContents() {
- super.createContents();
-
- fSourceMultiplicityLabel = new PapyrusWrappingLabel();
- fSourceMultiplicityLabel.setText("");
-
- this.add(fSourceMultiplicityLabel);
-
- fTargetMultiplicityLabel = new PapyrusWrappingLabel();
- fTargetMultiplicityLabel.setText("");
-
- this.add(fTargetMultiplicityLabel);
-
- }
-
- /**
- * Gets the applied stereotype association label.
- *
- * @return the applied stereotype association label
- */
- public WrappingLabel getAppliedStereotypeLabel() {
- return appliedStereotypeLabel;
- }
-
- /**
- * Gets the multiplicity source label.
- *
- * @return the multiplicity source label
- */
- public WrappingLabel getSourceMultiplicityLabel() {
- return fSourceMultiplicityLabel;
- }
-
- /**
- * Gets the multiplicity target label.
- *
- * @return the multiplicity target label
- */
- public WrappingLabel getTargetMultiplicityLabel() {
- return fTargetMultiplicityLabel;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
+
+/**
+ * Figure for UML {@link Connector} Edges.
+ */
+public class ConnectorEdgeFigure extends NamedElementEdgeFigure {
+
+ /** The multiplicity source label. */
+ private WrappingLabel fSourceMultiplicityLabel;
+
+ /** The multiplicity target label. */
+ private WrappingLabel fTargetMultiplicityLabel;
+
+ /**
+ * Instantiates a new association figure.
+ */
+ public ConnectorEdgeFigure() {
+ super();
+ createContents();
+ }
+
+ /**
+ * Creates the contents.
+ */
+ protected void createContents() {
+ super.createContents();
+
+ fSourceMultiplicityLabel = new PapyrusWrappingLabel();
+ fSourceMultiplicityLabel.setText("");
+
+ this.add(fSourceMultiplicityLabel);
+
+ fTargetMultiplicityLabel = new PapyrusWrappingLabel();
+ fTargetMultiplicityLabel.setText("");
+
+ this.add(fTargetMultiplicityLabel);
+
+ }
+
+ /**
+ * Gets the applied stereotype association label.
+ *
+ * @return the applied stereotype association label
+ */
+ public WrappingLabel getAppliedStereotypeLabel() {
+ return appliedStereotypeLabel;
+ }
+
+ /**
+ * Gets the multiplicity source label.
+ *
+ * @return the multiplicity source label
+ */
+ public WrappingLabel getSourceMultiplicityLabel() {
+ return fSourceMultiplicityLabel;
+ }
+
+ /**
+ * Gets the multiplicity target label.
+ *
+ * @return the multiplicity target label
+ */
+ public WrappingLabel getTargetMultiplicityLabel() {
+ return fTargetMultiplicityLabel;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/EdgeDecorationType.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/EdgeDecorationType.java
index cca2b77d2f6..c6b19b64614 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/EdgeDecorationType.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/EdgeDecorationType.java
@@ -1,39 +1,39 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure;
-
-import org.eclipse.gmf.runtime.notation.ArrowType;
-
-/**
- * <pre>
- * The class provides a list of predefined ids to create edge decorations.
- *
- * Also see : org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLinkEditPart#getArrowDecoration().
- * </pre>
- */
-public final class EdgeDecorationType {
-
- public static final int NONE = ArrowType.NONE; //0
-
- public static final int OPEN_ARROW = ArrowType.OPEN_ARROW; // 1
-
- public static final int SOLID_ARROW_FILLED = ArrowType.SOLID_ARROW; // 2
-
- public static final int SOLID_ARROW_EMPTY = 3;
-
- public static final int SOLID_DIAMOND_FILLED = 4;
-
- public static final int SOLID_DIAMOND_EMPTY = 5;
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure;
+
+import org.eclipse.gmf.runtime.notation.ArrowType;
+
+/**
+ * <pre>
+ * The class provides a list of predefined ids to create edge decorations.
+ *
+ * Also see : org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLinkEditPart#getArrowDecoration().
+ * </pre>
+ */
+public final class EdgeDecorationType {
+
+ public static final int NONE = ArrowType.NONE; //0
+
+ public static final int OPEN_ARROW = ArrowType.OPEN_ARROW; // 1
+
+ public static final int SOLID_ARROW_FILLED = ArrowType.SOLID_ARROW; // 2
+
+ public static final int SOLID_ARROW_EMPTY = 3;
+
+ public static final int SOLID_DIAMOND_FILLED = 4;
+
+ public static final int SOLID_DIAMOND_EMPTY = 5;
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/GeneralizationFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/GeneralizationFigure.java
index c966821252d..78e43a20bf9 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/GeneralizationFigure.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/GeneralizationFigure.java
@@ -1,26 +1,26 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure;
-
-import org.eclipse.papyrus.uml.diagram.common.figure.edge.UMLEdgeFigure;
-
-/**
- * Figure for UML Generalization Edges.
- */
-public class GeneralizationFigure extends UMLEdgeFigure {
-
- public GeneralizationFigure() {
- super();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure;
+
+import org.eclipse.papyrus.uml.diagram.common.figure.edge.UMLEdgeFigure;
+
+/**
+ * Figure for UML Generalization Edges.
+ */
+public class GeneralizationFigure extends UMLEdgeFigure {
+
+ public GeneralizationFigure() {
+ super();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/InterfaceRealizationFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/InterfaceRealizationFigure.java
index 83e671d5c56..f18f823633f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/InterfaceRealizationFigure.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/InterfaceRealizationFigure.java
@@ -1,24 +1,24 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure;
-
-/**
- * Figure for UML InterfaceRealization Edges.
- */
-public class InterfaceRealizationFigure extends NamedElementEdgeFigure {
-
- public InterfaceRealizationFigure() {
- super();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure;
+
+/**
+ * Figure for UML InterfaceRealization Edges.
+ */
+public class InterfaceRealizationFigure extends NamedElementEdgeFigure {
+
+ public InterfaceRealizationFigure() {
+ super();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/NamedElementEdgeFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/NamedElementEdgeFigure.java
index e66121a4923..2d0b95a3dec 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/NamedElementEdgeFigure.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/figure/NamedElementEdgeFigure.java
@@ -1,64 +1,64 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure;
-
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.figure.edge.UMLEdgeFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
-
-/**
- * <pre>
- * This edge figure support stereotype application and name labels,
- * and does not make any assumption on style, decorations, and width.
- * These properties are managed by the edit part.
- *
- * This figure also provides its own custom dash pattern that can be use calling
- * setLineType(Graphics.LINE_CUSTOM);
- * </pre>
- */
-public class NamedElementEdgeFigure extends UMLEdgeFigure {
-
- private WrappingLabel nameLabel;
-
- /** Dashes used to paint line. */
- private final int[] dashes = new int[10];
-
- public NamedElementEdgeFigure() {
- super();
-
- // set dashes
- for(int i = 0; i < 10; i++) {
- dashes[i] = 5;
- }
- setLineDash(dashes);
-
- createContents();
- }
-
- public WrappingLabel getNameLabel() {
- return nameLabel;
- }
-
- /**
- * @generated
- */
- @Override
- protected void createContents() {
- super.createContents();
- nameLabel = new PapyrusWrappingLabel();
- nameLabel.setText("");
-
- this.add(nameLabel);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.figure.edge.UMLEdgeFigure;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusWrappingLabel;
+
+/**
+ * <pre>
+ * This edge figure support stereotype application and name labels,
+ * and does not make any assumption on style, decorations, and width.
+ * These properties are managed by the edit part.
+ *
+ * This figure also provides its own custom dash pattern that can be use calling
+ * setLineType(Graphics.LINE_CUSTOM);
+ * </pre>
+ */
+public class NamedElementEdgeFigure extends UMLEdgeFigure {
+
+ private WrappingLabel nameLabel;
+
+ /** Dashes used to paint line. */
+ private final int[] dashes = new int[10];
+
+ public NamedElementEdgeFigure() {
+ super();
+
+ // set dashes
+ for(int i = 0; i < 10; i++) {
+ dashes[i] = 5;
+ }
+ setLineDash(dashes);
+
+ createContents();
+ }
+
+ public WrappingLabel getNameLabel() {
+ return nameLabel;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void createContents() {
+ super.createContents();
+ nameLabel = new PapyrusWrappingLabel();
+ nameLabel.setText("");
+
+ this.add(nameLabel);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java
index 03a21c5fca4..3714a8a30c5 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/AssociationEndLabelParser.java
@@ -1,169 +1,169 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.InstanceValue;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.ValueSpecification;
-import org.eclipse.uml2.uml.VisibilityKind;
-
-/**
- * Semantic Parser for {@link Property} used as {@link Association} end.
- */
-public class AssociationEndLabelParser extends PropertyLabelParser {
-
- /** The String format for displaying a {@link Property} label with modifiers */
- protected static final String ALT_MODIFIER_FORMAT = "{%s}%s";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
-
- if(flags == 0) {
- return MaskedLabel;
- }
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Property)) {
-
- Property property = (Property)eObject;
-
- // manage visibility
- if((flags & ILabelPreferenceConstants.DISP_VISIBILITY) == ILabelPreferenceConstants.DISP_VISIBILITY) {
- String visibility;
- switch(property.getVisibility().getValue()) {
- case VisibilityKind.PACKAGE:
- visibility = "~";
- break;
- case VisibilityKind.PUBLIC:
- visibility = "+";
- break;
- case VisibilityKind.PROTECTED:
- visibility = "#";
- break;
- case VisibilityKind.PRIVATE:
- visibility = "-";
- break;
- default:
- visibility = "+";
- break;
- }
- result = String.format(VISIBILITY_FORMAT, visibility, result);
- }
-
- // manage derived modifier
- if(((flags & ILabelPreferenceConstants.DISP_DERIVE) == ILabelPreferenceConstants.DISP_DERIVE) && (property.isDerived())) {
- result = String.format(DERIVED_FORMAT, result);
- }
-
- // manage name
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (property.isSetName())) {
- String name = property.getName();
-
- // If property is owned by Association (non navigable) only show the name when explicitly asked.
-
- if(((flags & ILabelPreferenceConstants.DISP_NON_NAVIGABLE_ROLE) == ILabelPreferenceConstants.DISP_NON_NAVIGABLE_ROLE) || !((property.getOwningAssociation() != null) && (property.getOwningAssociation().getOwnedEnds().contains(property)))) {
-
- result = String.format(NAME_FORMAT, result, name);
- }
- }
-
- // manage type
- if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
- String type = "<Undefined>";
- if(property.getType() != null) {
- type = property.getType().getName();
- }
-
- // If type is undefined only show "<Undefined>" when explicitly asked.
-
- if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
-
- result = String.format(TYPE_FORMAT, result, type);
- }
- }
-
- // manage multiplicity
- if(((flags & ILabelPreferenceConstants.DISP_MULTIPLICITY) == ILabelPreferenceConstants.DISP_MULTIPLICITY)) {
-
- // If multiplicity is [1] (SysML default), only show when explicitly asked.
- String lower = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getLowerValue()) : "1";
- String upper = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getUpperValue()) : "1";
- if(((flags & ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) == ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) || !("1".equals(lower) && "1".equals(upper))) {
-
- if(lower.equals(upper)) {
- result = String.format(MULTIPLICITY_FORMAT_ALT, result, lower, upper);
- } else {
- result = String.format(MULTIPLICITY_FORMAT, result, lower, upper);
- }
- }
- }
-
- // manage default value
- if(((flags & ILabelPreferenceConstants.DISP_DEFAULTVALUE) == ILabelPreferenceConstants.DISP_DEFAULTVALUE) && ((property.getDefaultValue() != null))) {
- ValueSpecification valueSpecification = property.getDefaultValue();
- if((valueSpecification instanceof InstanceValue && property.getType().equals(valueSpecification.getType())) || !(valueSpecification instanceof InstanceValue)) {
- result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
- }
- }
-
- // manage modifier
- if((flags & ILabelPreferenceConstants.DISP_MODIFIERS) == ILabelPreferenceConstants.DISP_MODIFIERS) {
- StringBuffer sb = new StringBuffer();
- if(property.isReadOnly()) {
- sb.append(sb.length() == 0 ? "readOnly" : ", readOnly");
- }
- if(property.isOrdered()) {
- sb.append(sb.length() == 0 ? "ordered" : ", ordered");
- }
- if(property.isUnique()) {
- sb.append(sb.length() == 0 ? "unique" : ", unique");
- }
- if(property.isDerivedUnion()) {
- sb.append(sb.length() == 0 ? "union" : ", union");
- }
- EList<Property> redefinedProperties = property.getRedefinedProperties();
- if(redefinedProperties != null && !redefinedProperties.isEmpty()) {
- for(Property p : redefinedProperties) {
- sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
- }
- }
- if(sb.length() != 0) {
- result = String.format(ALT_MODIFIER_FORMAT, sb.toString(), result);
- }
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Map<Integer, String> getMasks() {
- return Collections.emptyMap();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.ValueSpecification;
+import org.eclipse.uml2.uml.VisibilityKind;
+
+/**
+ * Semantic Parser for {@link Property} used as {@link Association} end.
+ */
+public class AssociationEndLabelParser extends PropertyLabelParser {
+
+ /** The String format for displaying a {@link Property} label with modifiers */
+ protected static final String ALT_MODIFIER_FORMAT = "{%s}%s";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if(flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Property)) {
+
+ Property property = (Property)eObject;
+
+ // manage visibility
+ if((flags & ILabelPreferenceConstants.DISP_VISIBILITY) == ILabelPreferenceConstants.DISP_VISIBILITY) {
+ String visibility;
+ switch(property.getVisibility().getValue()) {
+ case VisibilityKind.PACKAGE:
+ visibility = "~";
+ break;
+ case VisibilityKind.PUBLIC:
+ visibility = "+";
+ break;
+ case VisibilityKind.PROTECTED:
+ visibility = "#";
+ break;
+ case VisibilityKind.PRIVATE:
+ visibility = "-";
+ break;
+ default:
+ visibility = "+";
+ break;
+ }
+ result = String.format(VISIBILITY_FORMAT, visibility, result);
+ }
+
+ // manage derived modifier
+ if(((flags & ILabelPreferenceConstants.DISP_DERIVE) == ILabelPreferenceConstants.DISP_DERIVE) && (property.isDerived())) {
+ result = String.format(DERIVED_FORMAT, result);
+ }
+
+ // manage name
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (property.isSetName())) {
+ String name = property.getName();
+
+ // If property is owned by Association (non navigable) only show the name when explicitly asked.
+
+ if(((flags & ILabelPreferenceConstants.DISP_NON_NAVIGABLE_ROLE) == ILabelPreferenceConstants.DISP_NON_NAVIGABLE_ROLE) || !((property.getOwningAssociation() != null) && (property.getOwningAssociation().getOwnedEnds().contains(property)))) {
+
+ result = String.format(NAME_FORMAT, result, name);
+ }
+ }
+
+ // manage type
+ if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
+ String type = "<Undefined>";
+ if(property.getType() != null) {
+ type = property.getType().getName();
+ }
+
+ // If type is undefined only show "<Undefined>" when explicitly asked.
+
+ if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
+
+ result = String.format(TYPE_FORMAT, result, type);
+ }
+ }
+
+ // manage multiplicity
+ if(((flags & ILabelPreferenceConstants.DISP_MULTIPLICITY) == ILabelPreferenceConstants.DISP_MULTIPLICITY)) {
+
+ // If multiplicity is [1] (SysML default), only show when explicitly asked.
+ String lower = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getLowerValue()) : "1";
+ String upper = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getUpperValue()) : "1";
+ if(((flags & ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) == ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) || !("1".equals(lower) && "1".equals(upper))) {
+
+ if(lower.equals(upper)) {
+ result = String.format(MULTIPLICITY_FORMAT_ALT, result, lower, upper);
+ } else {
+ result = String.format(MULTIPLICITY_FORMAT, result, lower, upper);
+ }
+ }
+ }
+
+ // manage default value
+ if(((flags & ILabelPreferenceConstants.DISP_DEFAULTVALUE) == ILabelPreferenceConstants.DISP_DEFAULTVALUE) && ((property.getDefaultValue() != null))) {
+ ValueSpecification valueSpecification = property.getDefaultValue();
+ if((valueSpecification instanceof InstanceValue && property.getType().equals(valueSpecification.getType())) || !(valueSpecification instanceof InstanceValue)) {
+ result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
+ }
+ }
+
+ // manage modifier
+ if((flags & ILabelPreferenceConstants.DISP_MODIFIERS) == ILabelPreferenceConstants.DISP_MODIFIERS) {
+ StringBuffer sb = new StringBuffer();
+ if(property.isReadOnly()) {
+ sb.append(sb.length() == 0 ? "readOnly" : ", readOnly");
+ }
+ if(property.isOrdered()) {
+ sb.append(sb.length() == 0 ? "ordered" : ", ordered");
+ }
+ if(property.isUnique()) {
+ sb.append(sb.length() == 0 ? "unique" : ", unique");
+ }
+ if(property.isDerivedUnion()) {
+ sb.append(sb.length() == 0 ? "union" : ", union");
+ }
+ EList<Property> redefinedProperties = property.getRedefinedProperties();
+ if(redefinedProperties != null && !redefinedProperties.isEmpty()) {
+ for(Property p : redefinedProperties) {
+ sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
+ }
+ }
+ if(sb.length() != 0) {
+ result = String.format(ALT_MODIFIER_FORMAT, sb.toString(), result);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Map<Integer, String> getMasks() {
+ return Collections.emptyMap();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java
index 142c542bda5..96c30980bda 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConnectorLabelParser.java
@@ -1,121 +1,121 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Semantic Parser for {@link Connector}
- */
-public class ConnectorLabelParser extends NamedElementLabelParser {
-
- /** The String format for displaying a {@link Connector} label with its name */
- protected static final String NAME_FORMAT = "%s";
-
- /** The String format for displaying a {@link Connector} label with its type */
- protected static final String TYPE_FORMAT = "%s: %s";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
-
- if (flags == 0) {
- return MaskedLabel;
- }
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Connector)) {
-
- Connector connector = (Connector)eObject;
-
- // manage name
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (connector.isSetName())) {
- String name = connector.getName();
- result = String.format(NAME_FORMAT, name);
- }
-
- // manage type
- if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
- String type = "<Undefined>";
- if(connector.getType() != null) {
- type = connector.getType().getName();
- }
-
- // If type is undefined only show "<Undefined>" when explicitly asked.
- if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
- result = String.format(TYPE_FORMAT, result, type);
- }
- }
-
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof Connector)) {
- Connector semElement = (Connector)element;
-
- semanticElementsBeingParsed.add(semElement);
- if(semElement.getType() != null) {
- semanticElementsBeingParsed.add(semElement.getType());
- }
- }
- return semanticElementsBeingParsed;
- }
-
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(2);
- masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
- masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
- masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Semantic Parser for {@link Connector}
+ */
+public class ConnectorLabelParser extends NamedElementLabelParser {
+
+ /** The String format for displaying a {@link Connector} label with its name */
+ protected static final String NAME_FORMAT = "%s";
+
+ /** The String format for displaying a {@link Connector} label with its type */
+ protected static final String TYPE_FORMAT = "%s: %s";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if (flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Connector)) {
+
+ Connector connector = (Connector)eObject;
+
+ // manage name
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (connector.isSetName())) {
+ String name = connector.getName();
+ result = String.format(NAME_FORMAT, name);
+ }
+
+ // manage type
+ if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
+ String type = "<Undefined>";
+ if(connector.getType() != null) {
+ type = connector.getType().getName();
+ }
+
+ // If type is undefined only show "<Undefined>" when explicitly asked.
+ if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
+ result = String.format(TYPE_FORMAT, result, type);
+ }
+ }
+
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof Connector)) {
+ Connector semElement = (Connector)element;
+
+ semanticElementsBeingParsed.add(semElement);
+ if(semElement.getType() != null) {
+ semanticElementsBeingParsed.add(semElement.getType());
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(2);
+ masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
+ masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
+ masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java
index 164d737f561..49d7500ce8c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintLabelParser.java
@@ -1,207 +1,207 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * Semantic Parser for {@link Constraint}.
- */
-public class ConstraintLabelParser extends NamedElementLabelParser {
-
- /** The String format for displaying a Property label with derived modifier */
- protected static final String NAME_FORMAT = "%s";
-
- /** The String format for displaying a Property with visibility */
- protected static final String SPECIFICATION_FORMAT = "%s{%s}";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getEditString(IAdaptable element, int flags) {
-
- if (flags == 0) {
- return MaskedLabel;
- }
-
- String editString = "";
-
- EObject eObject = (EObject)element.getAdapter(EObject.class);
- if((eObject != null) && (eObject instanceof Constraint)) {
- Constraint semElement = (Constraint)eObject;
-
- // edit name
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME)) {
- if(semElement.isSetName()) {
- editString = semElement.getName();
- }
-
- // (try to) edit constraint specification
- } else if(((flags & ILabelPreferenceConstants.DISP_SPECIFICATION) == ILabelPreferenceConstants.DISP_SPECIFICATION)) {
- if(semElement.getSpecification() != null) {
- editString = ValueSpecificationUtil.getSpecificationValue(semElement.getSpecification());
- if(editString == null) {
- editString = "";
- }
- }
- }
- }
- return editString;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Constraint)) {
-
- Constraint semElement = (Constraint)eObject;
-
- // manage name
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (semElement.isSetName())) {
- String name = semElement.getName();
- result = String.format(NAME_FORMAT, name);
- }
-
- // manage specification
- if(((flags & ILabelPreferenceConstants.DISP_SPECIFICATION) == ILabelPreferenceConstants.DISP_SPECIFICATION)) {
- String spec = "<Undefined>";
- if(semElement.getSpecification() != null) {
- spec = ValueSpecificationUtil.getSpecificationValue(semElement.getSpecification());
- if(spec == null || "".equals(spec)) {
- spec = "<Undefined>";
- }
- }
- result = String.format(SPECIFICATION_FORMAT, result, spec);
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
-
- ICommand command = UnexecutableCommand.INSTANCE;
- SetRequest updateRequest = null;
-
- Constraint constraint = (Constraint)element.getAdapter(EObject.class);
- if(constraint == null) {
- return UnexecutableCommand.INSTANCE;
- }
-
- // prepare set name request
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME)) {
- updateRequest = new SetRequest(constraint, UMLPackage.eINSTANCE.getNamedElement_Name(), newString);
- updateRequest.setLabel("Update Constraint Label");
-
- // prepare set specification request
- } else if(((flags & ILabelPreferenceConstants.DISP_SPECIFICATION) == ILabelPreferenceConstants.DISP_SPECIFICATION)) {
- ValueSpecification spec = constraint.getSpecification();
- if(spec == null) {
- return UnexecutableCommand.INSTANCE;
- }
-
- ValueSpecification specCopy = EcoreUtil.copy(spec);
- ValueSpecificationUtil.restoreSpecificationValue(specCopy, newString);
-
- updateRequest = new SetRequest(constraint, UMLPackage.eINSTANCE.getConstraint_Specification(), specCopy);
- updateRequest.setLabel("Update Constraint Label");
- }
-
- try {
- if(updateRequest != null) {
- command = ElementEditServiceUtils.getEditServiceProvider().getEditService(constraint).getEditCommand(updateRequest);
- }
-
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
-
-
- return command;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return UMLPackage.eINSTANCE.getValueSpecification__BooleanValue().equals(feature) || UMLPackage.eINSTANCE.getValueSpecification__IntegerValue().equals(feature) || UMLPackage.eINSTANCE.getValueSpecification__StringValue().equals(feature) || UMLPackage.eINSTANCE.getValueSpecification__UnlimitedValue().equals(feature) || UMLPackage.eINSTANCE.getOpaqueExpression_Body().equals(feature) || UMLPackage.eINSTANCE.getOpaqueExpression_Language().equals(feature) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof Constraint)) {
- Constraint semElement = (Constraint)element;
-
- semanticElementsBeingParsed.add(semElement);
- if(semElement.getSpecification() != null) {
- semanticElementsBeingParsed.add(semElement.getSpecification());
- }
- }
- return semanticElementsBeingParsed;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(2);
- masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
- masks.put(ILabelPreferenceConstants.DISP_SPECIFICATION, "Specification");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+/**
+ * Semantic Parser for {@link Constraint}.
+ */
+public class ConstraintLabelParser extends NamedElementLabelParser {
+
+ /** The String format for displaying a Property label with derived modifier */
+ protected static final String NAME_FORMAT = "%s";
+
+ /** The String format for displaying a Property with visibility */
+ protected static final String SPECIFICATION_FORMAT = "%s{%s}";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getEditString(IAdaptable element, int flags) {
+
+ if (flags == 0) {
+ return MaskedLabel;
+ }
+
+ String editString = "";
+
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+ if((eObject != null) && (eObject instanceof Constraint)) {
+ Constraint semElement = (Constraint)eObject;
+
+ // edit name
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME)) {
+ if(semElement.isSetName()) {
+ editString = semElement.getName();
+ }
+
+ // (try to) edit constraint specification
+ } else if(((flags & ILabelPreferenceConstants.DISP_SPECIFICATION) == ILabelPreferenceConstants.DISP_SPECIFICATION)) {
+ if(semElement.getSpecification() != null) {
+ editString = ValueSpecificationUtil.getSpecificationValue(semElement.getSpecification());
+ if(editString == null) {
+ editString = "";
+ }
+ }
+ }
+ }
+ return editString;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Constraint)) {
+
+ Constraint semElement = (Constraint)eObject;
+
+ // manage name
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (semElement.isSetName())) {
+ String name = semElement.getName();
+ result = String.format(NAME_FORMAT, name);
+ }
+
+ // manage specification
+ if(((flags & ILabelPreferenceConstants.DISP_SPECIFICATION) == ILabelPreferenceConstants.DISP_SPECIFICATION)) {
+ String spec = "<Undefined>";
+ if(semElement.getSpecification() != null) {
+ spec = ValueSpecificationUtil.getSpecificationValue(semElement.getSpecification());
+ if(spec == null || "".equals(spec)) {
+ spec = "<Undefined>";
+ }
+ }
+ result = String.format(SPECIFICATION_FORMAT, result, spec);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+
+ ICommand command = UnexecutableCommand.INSTANCE;
+ SetRequest updateRequest = null;
+
+ Constraint constraint = (Constraint)element.getAdapter(EObject.class);
+ if(constraint == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ // prepare set name request
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME)) {
+ updateRequest = new SetRequest(constraint, UMLPackage.eINSTANCE.getNamedElement_Name(), newString);
+ updateRequest.setLabel("Update Constraint Label");
+
+ // prepare set specification request
+ } else if(((flags & ILabelPreferenceConstants.DISP_SPECIFICATION) == ILabelPreferenceConstants.DISP_SPECIFICATION)) {
+ ValueSpecification spec = constraint.getSpecification();
+ if(spec == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ ValueSpecification specCopy = EcoreUtil.copy(spec);
+ ValueSpecificationUtil.restoreSpecificationValue(specCopy, newString);
+
+ updateRequest = new SetRequest(constraint, UMLPackage.eINSTANCE.getConstraint_Specification(), specCopy);
+ updateRequest.setLabel("Update Constraint Label");
+ }
+
+ try {
+ if(updateRequest != null) {
+ command = ElementEditServiceUtils.getEditServiceProvider().getEditService(constraint).getEditCommand(updateRequest);
+ }
+
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ }
+
+
+ return command;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return UMLPackage.eINSTANCE.getValueSpecification__BooleanValue().equals(feature) || UMLPackage.eINSTANCE.getValueSpecification__IntegerValue().equals(feature) || UMLPackage.eINSTANCE.getValueSpecification__StringValue().equals(feature) || UMLPackage.eINSTANCE.getValueSpecification__UnlimitedValue().equals(feature) || UMLPackage.eINSTANCE.getOpaqueExpression_Body().equals(feature) || UMLPackage.eINSTANCE.getOpaqueExpression_Language().equals(feature) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof Constraint)) {
+ Constraint semElement = (Constraint)element;
+
+ semanticElementsBeingParsed.add(semElement);
+ if(semElement.getSpecification() != null) {
+ semanticElementsBeingParsed.add(semElement.getSpecification());
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(2);
+ masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
+ masks.put(ILabelPreferenceConstants.DISP_SPECIFICATION, "Specification");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/DefaultParserHintAdapter.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/DefaultParserHintAdapter.java
index 46ee6f7d289..4ad4430074c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/DefaultParserHintAdapter.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/DefaultParserHintAdapter.java
@@ -1,43 +1,43 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-
-public class DefaultParserHintAdapter extends ParserHintAdapter {
-
- private Diagram diagram = null;
-
- /** Constructor */
- public DefaultParserHintAdapter(Diagram diagram, EObject element, String parserHint) {
- super(element, parserHint);
- this.diagram = diagram;
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("rawtypes")
- @Override
- public Object getAdapter(Class adapter) {
-
- if(adapter.equals(Diagram.class)) {
- return diagram;
- }
-
- return super.getAdapter(adapter);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
+import org.eclipse.gmf.runtime.notation.Diagram;
+
+public class DefaultParserHintAdapter extends ParserHintAdapter {
+
+ private Diagram diagram = null;
+
+ /** Constructor */
+ public DefaultParserHintAdapter(Diagram diagram, EObject element, String parserHint) {
+ super(element, parserHint);
+ this.diagram = diagram;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Object getAdapter(Class adapter) {
+
+ if(adapter.equals(Diagram.class)) {
+ return diagram;
+ }
+
+ return super.getAdapter(adapter);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/MultiplicityElementLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/MultiplicityElementLabelParser.java
index ba994405757..93f3ee3cf94 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/MultiplicityElementLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/MultiplicityElementLabelParser.java
@@ -1,160 +1,160 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.MultiplicityElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Semantic Parser for {@link MultiplicityElement}
- */
-public class MultiplicityElementLabelParser implements IMaskManagedSemanticParser {
-
- /** The String format for displaying a {@link Property} label with multiplicity */
- protected static final String MULTIPLICITY_FORMAT = "[%s..%s]";
-
- /** The String format for displaying a {@link Property} label with multiplicity */
- protected static final String MULTIPLICITY_FORMAT_ALT = "[%s]";
-
- /**
- * {@inheritDoc}
- */
- public String getEditString(IAdaptable element, int flags) {
- return getPrintString(element, flags);
- }
-
- /**
- * {@inheritDoc}
- */
- public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
- return ParserEditStatus.UNEDITABLE_STATUS;
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
-
- if (flags == 0) {
- return MaskedLabel;
- }
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof MultiplicityElement)) {
-
- MultiplicityElement multElt = (MultiplicityElement)eObject;
-
- // manage multiplicity
- if(((flags & ILabelPreferenceConstants.DISP_MULTIPLICITY) == ILabelPreferenceConstants.DISP_MULTIPLICITY)) {
-
- // If multiplicity is [1] (SysML default), only show when explicitly asked.
- // TODO : add a case for default with multiplicity not set.
- String lower = (multElt.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(multElt.getLowerValue()) : "1";
- String upper = (multElt.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(multElt.getUpperValue()) : "1";
- if(((flags & ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) == ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) || !("1".equals(lower) && "1".equals(upper))) {
-
- if(lower.equals(upper)) {
- result = String.format(MULTIPLICITY_FORMAT_ALT, lower, upper);
- } else {
- result = String.format(MULTIPLICITY_FORMAT, lower, upper);
- }
- }
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return EcorePackage.eINSTANCE.getEAnnotation_Details().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof MultiplicityElement)) {
- MultiplicityElement semElement = (MultiplicityElement)element;
-
- semanticElementsBeingParsed.add(semElement);
- if(semElement.getLowerValue() != null) {
- semanticElementsBeingParsed.add(semElement.getLowerValue());
- }
- if(semElement.getUpperValue() != null) {
- semanticElementsBeingParsed.add(semElement.getUpperValue());
- }
- }
- return semanticElementsBeingParsed;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- return true;
- }
-
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(2);
- masks.put(ILabelPreferenceConstants.DISP_MULTIPLICITY, "Multiplicity");
- masks.put(ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY, "Show default multiplicity");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.MultiplicityElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Semantic Parser for {@link MultiplicityElement}
+ */
+public class MultiplicityElementLabelParser implements IMaskManagedSemanticParser {
+
+ /** The String format for displaying a {@link Property} label with multiplicity */
+ protected static final String MULTIPLICITY_FORMAT = "[%s..%s]";
+
+ /** The String format for displaying a {@link Property} label with multiplicity */
+ protected static final String MULTIPLICITY_FORMAT_ALT = "[%s]";
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEditString(IAdaptable element, int flags) {
+ return getPrintString(element, flags);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ return ParserEditStatus.UNEDITABLE_STATUS;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if (flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof MultiplicityElement)) {
+
+ MultiplicityElement multElt = (MultiplicityElement)eObject;
+
+ // manage multiplicity
+ if(((flags & ILabelPreferenceConstants.DISP_MULTIPLICITY) == ILabelPreferenceConstants.DISP_MULTIPLICITY)) {
+
+ // If multiplicity is [1] (SysML default), only show when explicitly asked.
+ // TODO : add a case for default with multiplicity not set.
+ String lower = (multElt.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(multElt.getLowerValue()) : "1";
+ String upper = (multElt.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(multElt.getUpperValue()) : "1";
+ if(((flags & ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) == ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) || !("1".equals(lower) && "1".equals(upper))) {
+
+ if(lower.equals(upper)) {
+ result = String.format(MULTIPLICITY_FORMAT_ALT, lower, upper);
+ } else {
+ result = String.format(MULTIPLICITY_FORMAT, lower, upper);
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return EcorePackage.eINSTANCE.getEAnnotation_Details().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof MultiplicityElement)) {
+ MultiplicityElement semElement = (MultiplicityElement)element;
+
+ semanticElementsBeingParsed.add(semElement);
+ if(semElement.getLowerValue() != null) {
+ semanticElementsBeingParsed.add(semElement.getLowerValue());
+ }
+ if(semElement.getUpperValue() != null) {
+ semanticElementsBeingParsed.add(semElement.getUpperValue());
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ return true;
+ }
+
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(2);
+ masks.put(ILabelPreferenceConstants.DISP_MULTIPLICITY, "Multiplicity");
+ masks.put(ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY, "Show default multiplicity");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java
index ef7385fe4e3..298f5ce826c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/NamedElementLabelParser.java
@@ -1,147 +1,147 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Semantic Parser for {@link NamedElement} name.
- */
-public class NamedElementLabelParser implements IMaskManagedSemanticParser {
-
- /**
- * {@inheritDoc}
- */
- public String getEditString(IAdaptable element, int flags) {
- String editString = "";
-
- EObject eObject = (EObject)element.getAdapter(EObject.class);
- if((eObject != null) && (eObject instanceof NamedElement)) {
- NamedElement semElement = (NamedElement)eObject;
- if(semElement.isSetName()) {
- editString = semElement.getName();
- }
- }
- return editString;
- }
-
- /**
- * {@inheritDoc}
- */
- public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
- return ParserEditStatus.EDITABLE_STATUS;
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
-
- ICommand command = UnexecutableCommand.INSTANCE;
-
- EObject objectToEdit = (EObject)element.getAdapter(EObject.class);
- if(objectToEdit == null) {
- return UnexecutableCommand.INSTANCE;
- }
-
- try {
- command = ElementEditServiceUtils.getEditServiceProvider().getEditService(objectToEdit).getEditCommand(new SetRequest(objectToEdit, UMLPackage.eINSTANCE.getNamedElement_Name(), newString));
- } catch (ServiceException e) {
- Activator.log.error(e);
- }
-
- return command;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if(eObject instanceof NamedElement) {
- return ((NamedElement)eObject).getName();
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return EcorePackage.eINSTANCE.getEAnnotation_Details().equals(feature) || UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
- semanticElementsBeingParsed.add(element);
-
- return semanticElementsBeingParsed;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- return true;
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<Integer, String> getMasks() {
- return Collections.emptyMap();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Semantic Parser for {@link NamedElement} name.
+ */
+public class NamedElementLabelParser implements IMaskManagedSemanticParser {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEditString(IAdaptable element, int flags) {
+ String editString = "";
+
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+ if((eObject != null) && (eObject instanceof NamedElement)) {
+ NamedElement semElement = (NamedElement)eObject;
+ if(semElement.isSetName()) {
+ editString = semElement.getName();
+ }
+ }
+ return editString;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ return ParserEditStatus.EDITABLE_STATUS;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+
+ ICommand command = UnexecutableCommand.INSTANCE;
+
+ EObject objectToEdit = (EObject)element.getAdapter(EObject.class);
+ if(objectToEdit == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ try {
+ command = ElementEditServiceUtils.getEditServiceProvider().getEditService(objectToEdit).getEditCommand(new SetRequest(objectToEdit, UMLPackage.eINSTANCE.getNamedElement_Name(), newString));
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ }
+
+ return command;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if(eObject instanceof NamedElement) {
+ return ((NamedElement)eObject).getName();
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return EcorePackage.eINSTANCE.getEAnnotation_Details().equals(feature) || UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+ semanticElementsBeingParsed.add(element);
+
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Map<Integer, String> getMasks() {
+ return Collections.emptyMap();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java
index 7e1b157c27b..dffc5c0fadd 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/OperationLabelParser.java
@@ -1,198 +1,198 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
-import org.eclipse.uml2.uml.Operation;
-import org.eclipse.uml2.uml.Parameter;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.VisibilityKind;
-
-/**
- * Semantic Parser for {@link Operation}
- */
-public class OperationLabelParser extends NamedElementLabelParser {
-
- /** Parameter parser */
- protected IMaskManagedSemanticParser parameterParser = new ParameterLabelParser();
-
- /** The String format for displaying {@link Operation} label with visibility */
- protected static final String VISIBILITY_FORMAT = "%s ";
-
- /** The String format for displaying a {@link Operation} label with its name */
- protected static final String NAME_FORMAT = "%s%s(%s)";
-
- /** The String format for displaying a {@link Operation} label with its type */
- protected static final String TYPE_FORMAT = "%s: %s";
-
- /** The String format for displaying a {@link Operation} label with modifiers */
- protected static final String MODIFIER_FORMAT = "%s{%s}";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
-
- if (flags == 0) {
- return MaskedLabel;
- }
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Operation)) {
-
- Operation operation = (Operation)eObject;
-
- // manage visibility
- if((flags & ILabelPreferenceConstants.DISP_VISIBILITY) == ILabelPreferenceConstants.DISP_VISIBILITY) {
- String visibility;
- switch(operation.getVisibility().getValue()) {
- case VisibilityKind.PACKAGE:
- visibility = "~";
- break;
- case VisibilityKind.PUBLIC:
- visibility = "+";
- break;
- case VisibilityKind.PROTECTED:
- visibility = "#";
- break;
- case VisibilityKind.PRIVATE:
- visibility = "-";
- break;
- default:
- visibility = "+";
- break;
- }
- result = String.format(VISIBILITY_FORMAT, visibility);
- }
-
- // manage name and parameters
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (operation.isSetName())) {
- String name = operation.getName();
-
- StringBuffer params = new StringBuffer();
- for(Parameter parameter : operation.getOwnedParameters()) {
- String currentParamLabel = parameterParser.getPrintString(new SemanticAdapter(parameter, null), flags);
- params.append(params.length() == 0 ? currentParamLabel : ", " + currentParamLabel);
- }
-
- result = String.format(NAME_FORMAT, result, name, params);
- }
-
- // manage type
- if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
- String type = "<Undefined>";
- if(operation.getType() != null) {
- type = operation.getType().getName();
- }
-
- // If type is undefined only show "<Undefined>" when explicitly asked.
- if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
- result = String.format(TYPE_FORMAT, result, type);
- }
- }
-
- // manage modifier
- if((flags & ILabelPreferenceConstants.DISP_MODIFIERS) == ILabelPreferenceConstants.DISP_MODIFIERS) {
- StringBuffer sb = new StringBuffer();
- if(operation.isAbstract()) {
- sb.append(sb.length() == 0 ? "abstract" : ", abstract");
- }
- if(operation.isStatic()) {
- sb.append(sb.length() == 0 ? "static" : ", static");
- }
- if(operation.isUnique()) {
- sb.append(sb.length() == 0 ? "unique" : ", unique");
- }
- if(operation.isQuery()) {
- sb.append(sb.length() == 0 ? "query" : ", query");
- }
- if(operation.isLeaf()) {
- sb.append(sb.length() == 0 ? "leaf" : ", leaf");
- }
-
- if(sb.length() != 0) {
- result = String.format(MODIFIER_FORMAT, result, sb.toString());
- }
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return UMLPackage.eINSTANCE.getNamedElement_Visibility().equals(feature) || UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getBehavioralFeature_IsAbstract().equals(feature) || UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature) || UMLPackage.eINSTANCE.getOperation_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getOperation_IsQuery().equals(feature) || UMLPackage.eINSTANCE.getRedefinableElement_IsLeaf().equals(feature) || parameterParser.isAffectingEvent(event, flags) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- @Override
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof Operation)) {
- Operation semElement = (Operation)element;
-
- semanticElementsBeingParsed.add(semElement);
- if(semElement.getType() != null) {
- semanticElementsBeingParsed.add(semElement.getType());
- }
- for(Parameter parameter : semElement.getOwnedParameters()) {
- semanticElementsBeingParsed.addAll(parameterParser.getSemanticElementsBeingParsed(parameter));
- }
- }
- return semanticElementsBeingParsed;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(5);
- masks.put(ILabelPreferenceConstants.DISP_VISIBILITY, "Visibility");
- masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
- masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
- masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
- masks.put(ILabelPreferenceConstants.DISP_MODIFIERS, "Modifiers");
- masks.putAll(parameterParser.getMasks());
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.VisibilityKind;
+
+/**
+ * Semantic Parser for {@link Operation}
+ */
+public class OperationLabelParser extends NamedElementLabelParser {
+
+ /** Parameter parser */
+ protected IMaskManagedSemanticParser parameterParser = new ParameterLabelParser();
+
+ /** The String format for displaying {@link Operation} label with visibility */
+ protected static final String VISIBILITY_FORMAT = "%s ";
+
+ /** The String format for displaying a {@link Operation} label with its name */
+ protected static final String NAME_FORMAT = "%s%s(%s)";
+
+ /** The String format for displaying a {@link Operation} label with its type */
+ protected static final String TYPE_FORMAT = "%s: %s";
+
+ /** The String format for displaying a {@link Operation} label with modifiers */
+ protected static final String MODIFIER_FORMAT = "%s{%s}";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if (flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Operation)) {
+
+ Operation operation = (Operation)eObject;
+
+ // manage visibility
+ if((flags & ILabelPreferenceConstants.DISP_VISIBILITY) == ILabelPreferenceConstants.DISP_VISIBILITY) {
+ String visibility;
+ switch(operation.getVisibility().getValue()) {
+ case VisibilityKind.PACKAGE:
+ visibility = "~";
+ break;
+ case VisibilityKind.PUBLIC:
+ visibility = "+";
+ break;
+ case VisibilityKind.PROTECTED:
+ visibility = "#";
+ break;
+ case VisibilityKind.PRIVATE:
+ visibility = "-";
+ break;
+ default:
+ visibility = "+";
+ break;
+ }
+ result = String.format(VISIBILITY_FORMAT, visibility);
+ }
+
+ // manage name and parameters
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (operation.isSetName())) {
+ String name = operation.getName();
+
+ StringBuffer params = new StringBuffer();
+ for(Parameter parameter : operation.getOwnedParameters()) {
+ String currentParamLabel = parameterParser.getPrintString(new SemanticAdapter(parameter, null), flags);
+ params.append(params.length() == 0 ? currentParamLabel : ", " + currentParamLabel);
+ }
+
+ result = String.format(NAME_FORMAT, result, name, params);
+ }
+
+ // manage type
+ if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
+ String type = "<Undefined>";
+ if(operation.getType() != null) {
+ type = operation.getType().getName();
+ }
+
+ // If type is undefined only show "<Undefined>" when explicitly asked.
+ if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
+ result = String.format(TYPE_FORMAT, result, type);
+ }
+ }
+
+ // manage modifier
+ if((flags & ILabelPreferenceConstants.DISP_MODIFIERS) == ILabelPreferenceConstants.DISP_MODIFIERS) {
+ StringBuffer sb = new StringBuffer();
+ if(operation.isAbstract()) {
+ sb.append(sb.length() == 0 ? "abstract" : ", abstract");
+ }
+ if(operation.isStatic()) {
+ sb.append(sb.length() == 0 ? "static" : ", static");
+ }
+ if(operation.isUnique()) {
+ sb.append(sb.length() == 0 ? "unique" : ", unique");
+ }
+ if(operation.isQuery()) {
+ sb.append(sb.length() == 0 ? "query" : ", query");
+ }
+ if(operation.isLeaf()) {
+ sb.append(sb.length() == 0 ? "leaf" : ", leaf");
+ }
+
+ if(sb.length() != 0) {
+ result = String.format(MODIFIER_FORMAT, result, sb.toString());
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return UMLPackage.eINSTANCE.getNamedElement_Visibility().equals(feature) || UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getBehavioralFeature_IsAbstract().equals(feature) || UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature) || UMLPackage.eINSTANCE.getOperation_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getOperation_IsQuery().equals(feature) || UMLPackage.eINSTANCE.getRedefinableElement_IsLeaf().equals(feature) || parameterParser.isAffectingEvent(event, flags) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof Operation)) {
+ Operation semElement = (Operation)element;
+
+ semanticElementsBeingParsed.add(semElement);
+ if(semElement.getType() != null) {
+ semanticElementsBeingParsed.add(semElement.getType());
+ }
+ for(Parameter parameter : semElement.getOwnedParameters()) {
+ semanticElementsBeingParsed.addAll(parameterParser.getSemanticElementsBeingParsed(parameter));
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(5);
+ masks.put(ILabelPreferenceConstants.DISP_VISIBILITY, "Visibility");
+ masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
+ masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
+ masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
+ masks.put(ILabelPreferenceConstants.DISP_MODIFIERS, "Modifiers");
+ masks.putAll(parameterParser.getMasks());
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ParameterLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ParameterLabelParser.java
index 5e17b05dd39..307e05a75c9 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ParameterLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ParameterLabelParser.java
@@ -1,210 +1,210 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.InstanceValue;
-import org.eclipse.uml2.uml.Parameter;
-import org.eclipse.uml2.uml.ParameterDirectionKind;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * Semantic Parser for {@link Parameter}
- */
-public class ParameterLabelParser extends NamedElementLabelParser {
-
- /** The String format for displaying a {@link Parameter} with direction */
- protected static final String DIRECTION_FORMAT = "%s %s";
-
- /** The String format for displaying a {@link Parameter} label with its name */
- protected static final String NAME_FORMAT = "%s%s";
-
- /** The String format for displaying a {@link Parameter} label with its type */
- protected static final String TYPE_FORMAT = "%s: %s";
-
- /** The String format for displaying a {@link Parameter} label with its multiplicity */
- protected static final String MULTIPLICITY_FORMAT = "%s [%s..%s]";
-
- /** The String format for displaying a {@link Parameter} label with its default value */
- protected static final String DEFAULT_VALUE_FORMAT = "%s= %s";
-
- /** The String format for displaying a {@link Parameter} label with its modifiers */
- protected static final String MODIFIER_FORMAT = "%s{%s}";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
-
- if (flags == 0) {
- return MaskedLabel;
- }
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Parameter)) {
-
- Parameter parameter = (Parameter)eObject;
-
- // manage direction
- if((flags & ILabelPreferenceConstants.DISP_PARAM_DIRECTION) == ILabelPreferenceConstants.DISP_PARAM_DIRECTION) {
- String direction;
- switch(parameter.getDirection().getValue()) {
- case ParameterDirectionKind.IN:
- direction = "in";
- break;
- case ParameterDirectionKind.OUT:
- direction = "out";
- break;
- case ParameterDirectionKind.INOUT:
- direction = "inout";
- break;
- case ParameterDirectionKind.RETURN:
- direction = "return";
- break;
- default:
- direction = "in";
- break;
- }
- result = String.format(DIRECTION_FORMAT, direction, result);
-
- // manage name
- if(((flags & ILabelPreferenceConstants.DISP_PARAM_NAME) == ILabelPreferenceConstants.DISP_PARAM_NAME) && (parameter.isSetName())) {
- String name = parameter.getName();
- result = String.format(NAME_FORMAT, result, name);
- }
-
- // manage type
- if(((flags & ILabelPreferenceConstants.DISP_PARAM_TYPE) == ILabelPreferenceConstants.DISP_PARAM_TYPE)) {
- String type = "<Undefined>";
- if(parameter.getType() != null) {
- type = parameter.getType().getName();
- }
-
- // If type is undefined only show "<Undefined>" when explicitly asked.
- if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
- result = String.format(TYPE_FORMAT, result, type);
- }
- }
-
- // manage multiplicity
- String lower = (parameter.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(parameter.getLowerValue()) : "1";
- String upper = (parameter.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(parameter.getUpperValue()) : "1";
- if(((flags & ILabelPreferenceConstants.DISP_PARAM_MULTIPLICITY) == ILabelPreferenceConstants.DISP_PARAM_MULTIPLICITY) && !("1".equals(lower) && "1".equals(upper))) {
- result = String.format(MULTIPLICITY_FORMAT, result, lower, upper);
- }
-
- // manage default value
- if(((flags & ILabelPreferenceConstants.DISP_PARAM_DEFAULTVALUE) == ILabelPreferenceConstants.DISP_PARAM_DEFAULTVALUE) && ((parameter.getDefaultValue() != null))) {
- ValueSpecification valueSpecification = parameter.getDefaultValue();
- if((valueSpecification instanceof InstanceValue && parameter.getType().equals(valueSpecification.getType())) || !(valueSpecification instanceof InstanceValue)) {
- result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
- }
- }
-
- // manage modifier
- if((flags & ILabelPreferenceConstants.DISP_PARAM_MODIFIERS) == ILabelPreferenceConstants.DISP_PARAM_MODIFIERS) {
- StringBuffer sb = new StringBuffer();
- if(parameter.isOrdered()) {
- sb.append(sb.length() == 0 ? "ordered" : ", ordered");
- }
- if(parameter.isUnique()) {
- sb.append(sb.length() == 0 ? "unique" : ", unique");
- }
- if(parameter.isStream()) {
- sb.append(sb.length() == 0 ? "stream" : ", stream");
- }
- if(parameter.isException()) {
- sb.append(sb.length() == 0 ? "exception" : ", exception");
- }
- if(sb.length() != 0) {
- result = String.format(MODIFIER_FORMAT, result, sb.toString());
- }
- }
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getParameter_Direction().equals(feature) || UMLPackage.eINSTANCE.getParameter_DefaultValue().equals(feature) || UMLPackage.eINSTANCE.getParameter_IsStream().equals(feature) || UMLPackage.eINSTANCE.getParameter_IsException().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof Parameter)) {
- Parameter semElement = (Parameter)element;
-
- semanticElementsBeingParsed.add(semElement);
- if(semElement.getType() != null) {
- semanticElementsBeingParsed.add(semElement.getType());
- }
- if(semElement.getDefaultValue() != null) {
- semanticElementsBeingParsed.add(semElement.getDefaultValue());
- }
- if(semElement.getLowerValue() != null) {
- semanticElementsBeingParsed.add(semElement.getLowerValue());
- }
- if(semElement.getUpperValue() != null) {
- semanticElementsBeingParsed.add(semElement.getUpperValue());
- }
- }
- return semanticElementsBeingParsed;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(6);
- masks.put(ILabelPreferenceConstants.DISP_PARAM_DIRECTION, "Parameter direction");
- masks.put(ILabelPreferenceConstants.DISP_PARAM_NAME, "Parameter name");
- masks.put(ILabelPreferenceConstants.DISP_PARAM_TYPE, "Parameter type");
- masks.put(ILabelPreferenceConstants.DISP_PARAM_MULTIPLICITY, "Parameter multiplicity");
- masks.put(ILabelPreferenceConstants.DISP_PARAM_DEFAULTVALUE, "Parameter default value");
- masks.put(ILabelPreferenceConstants.DISP_PARAM_MODIFIERS, "Parameter modifiers");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.Parameter;
+import org.eclipse.uml2.uml.ParameterDirectionKind;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+/**
+ * Semantic Parser for {@link Parameter}
+ */
+public class ParameterLabelParser extends NamedElementLabelParser {
+
+ /** The String format for displaying a {@link Parameter} with direction */
+ protected static final String DIRECTION_FORMAT = "%s %s";
+
+ /** The String format for displaying a {@link Parameter} label with its name */
+ protected static final String NAME_FORMAT = "%s%s";
+
+ /** The String format for displaying a {@link Parameter} label with its type */
+ protected static final String TYPE_FORMAT = "%s: %s";
+
+ /** The String format for displaying a {@link Parameter} label with its multiplicity */
+ protected static final String MULTIPLICITY_FORMAT = "%s [%s..%s]";
+
+ /** The String format for displaying a {@link Parameter} label with its default value */
+ protected static final String DEFAULT_VALUE_FORMAT = "%s= %s";
+
+ /** The String format for displaying a {@link Parameter} label with its modifiers */
+ protected static final String MODIFIER_FORMAT = "%s{%s}";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if (flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Parameter)) {
+
+ Parameter parameter = (Parameter)eObject;
+
+ // manage direction
+ if((flags & ILabelPreferenceConstants.DISP_PARAM_DIRECTION) == ILabelPreferenceConstants.DISP_PARAM_DIRECTION) {
+ String direction;
+ switch(parameter.getDirection().getValue()) {
+ case ParameterDirectionKind.IN:
+ direction = "in";
+ break;
+ case ParameterDirectionKind.OUT:
+ direction = "out";
+ break;
+ case ParameterDirectionKind.INOUT:
+ direction = "inout";
+ break;
+ case ParameterDirectionKind.RETURN:
+ direction = "return";
+ break;
+ default:
+ direction = "in";
+ break;
+ }
+ result = String.format(DIRECTION_FORMAT, direction, result);
+
+ // manage name
+ if(((flags & ILabelPreferenceConstants.DISP_PARAM_NAME) == ILabelPreferenceConstants.DISP_PARAM_NAME) && (parameter.isSetName())) {
+ String name = parameter.getName();
+ result = String.format(NAME_FORMAT, result, name);
+ }
+
+ // manage type
+ if(((flags & ILabelPreferenceConstants.DISP_PARAM_TYPE) == ILabelPreferenceConstants.DISP_PARAM_TYPE)) {
+ String type = "<Undefined>";
+ if(parameter.getType() != null) {
+ type = parameter.getType().getName();
+ }
+
+ // If type is undefined only show "<Undefined>" when explicitly asked.
+ if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
+ result = String.format(TYPE_FORMAT, result, type);
+ }
+ }
+
+ // manage multiplicity
+ String lower = (parameter.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(parameter.getLowerValue()) : "1";
+ String upper = (parameter.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(parameter.getUpperValue()) : "1";
+ if(((flags & ILabelPreferenceConstants.DISP_PARAM_MULTIPLICITY) == ILabelPreferenceConstants.DISP_PARAM_MULTIPLICITY) && !("1".equals(lower) && "1".equals(upper))) {
+ result = String.format(MULTIPLICITY_FORMAT, result, lower, upper);
+ }
+
+ // manage default value
+ if(((flags & ILabelPreferenceConstants.DISP_PARAM_DEFAULTVALUE) == ILabelPreferenceConstants.DISP_PARAM_DEFAULTVALUE) && ((parameter.getDefaultValue() != null))) {
+ ValueSpecification valueSpecification = parameter.getDefaultValue();
+ if((valueSpecification instanceof InstanceValue && parameter.getType().equals(valueSpecification.getType())) || !(valueSpecification instanceof InstanceValue)) {
+ result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
+ }
+ }
+
+ // manage modifier
+ if((flags & ILabelPreferenceConstants.DISP_PARAM_MODIFIERS) == ILabelPreferenceConstants.DISP_PARAM_MODIFIERS) {
+ StringBuffer sb = new StringBuffer();
+ if(parameter.isOrdered()) {
+ sb.append(sb.length() == 0 ? "ordered" : ", ordered");
+ }
+ if(parameter.isUnique()) {
+ sb.append(sb.length() == 0 ? "unique" : ", unique");
+ }
+ if(parameter.isStream()) {
+ sb.append(sb.length() == 0 ? "stream" : ", stream");
+ }
+ if(parameter.isException()) {
+ sb.append(sb.length() == 0 ? "exception" : ", exception");
+ }
+ if(sb.length() != 0) {
+ result = String.format(MODIFIER_FORMAT, result, sb.toString());
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getParameter_Direction().equals(feature) || UMLPackage.eINSTANCE.getParameter_DefaultValue().equals(feature) || UMLPackage.eINSTANCE.getParameter_IsStream().equals(feature) || UMLPackage.eINSTANCE.getParameter_IsException().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof Parameter)) {
+ Parameter semElement = (Parameter)element;
+
+ semanticElementsBeingParsed.add(semElement);
+ if(semElement.getType() != null) {
+ semanticElementsBeingParsed.add(semElement.getType());
+ }
+ if(semElement.getDefaultValue() != null) {
+ semanticElementsBeingParsed.add(semElement.getDefaultValue());
+ }
+ if(semElement.getLowerValue() != null) {
+ semanticElementsBeingParsed.add(semElement.getLowerValue());
+ }
+ if(semElement.getUpperValue() != null) {
+ semanticElementsBeingParsed.add(semElement.getUpperValue());
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(6);
+ masks.put(ILabelPreferenceConstants.DISP_PARAM_DIRECTION, "Parameter direction");
+ masks.put(ILabelPreferenceConstants.DISP_PARAM_NAME, "Parameter name");
+ masks.put(ILabelPreferenceConstants.DISP_PARAM_TYPE, "Parameter type");
+ masks.put(ILabelPreferenceConstants.DISP_PARAM_MULTIPLICITY, "Parameter multiplicity");
+ masks.put(ILabelPreferenceConstants.DISP_PARAM_DEFAULTVALUE, "Parameter default value");
+ masks.put(ILabelPreferenceConstants.DISP_PARAM_MODIFIERS, "Parameter modifiers");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java
index 618b7701015..d2f57ade3b0 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/PropertyLabelParser.java
@@ -1,242 +1,242 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.InstanceValue;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-import org.eclipse.uml2.uml.VisibilityKind;
-
-/**
- * Semantic Parser for {@link Property}
- */
-public class PropertyLabelParser extends NamedElementLabelParser {
-
- /** The String format for displaying a {@link Property} with visibility */
- protected static final String VISIBILITY_FORMAT = "%s %s";
-
- /** The String format for displaying a {@link Property} label with derived modifier */
- protected static final String DERIVED_FORMAT = "%s/";
-
- /** The String format for displaying a {@link Property} label with its name */
- protected static final String NAME_FORMAT = "%s%s";
-
- /** The String format for displaying a {@link Property} label with its type */
- protected static final String TYPE_FORMAT = "%s: %s";
-
- /** The String format for displaying a {@link Property} label with multiplicity */
- protected static final String MULTIPLICITY_FORMAT = "%s [%s..%s]";
-
- /** The String format for displaying a {@link Property} label with multiplicity */
- protected static final String MULTIPLICITY_FORMAT_ALT = "%s [%s]";
-
- /** The String format for displaying a {@link Property} label with default value */
- protected static final String DEFAULT_VALUE_FORMAT = "%s= %s";
-
- /** The String format for displaying a {@link Property} label with modifiers */
- protected static final String MODIFIER_FORMAT = "%s{%s}";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
-
- if(flags == 0) {
- return MaskedLabel;
- }
-
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Property)) {
-
- Property property = (Property)eObject;
-
- // manage visibility
- if((flags & ILabelPreferenceConstants.DISP_VISIBILITY) == ILabelPreferenceConstants.DISP_VISIBILITY) {
- String visibility;
- switch(property.getVisibility().getValue()) {
- case VisibilityKind.PACKAGE:
- visibility = "~";
- break;
- case VisibilityKind.PUBLIC:
- visibility = "+";
- break;
- case VisibilityKind.PROTECTED:
- visibility = "#";
- break;
- case VisibilityKind.PRIVATE:
- visibility = "-";
- break;
- default:
- visibility = "+";
- break;
- }
- result = String.format(VISIBILITY_FORMAT, visibility, result);
- }
-
- // manage derived modifier
- if(((flags & ILabelPreferenceConstants.DISP_DERIVE) == ILabelPreferenceConstants.DISP_DERIVE) && (property.isDerived())) {
- result = String.format(DERIVED_FORMAT, result);
- }
-
- // manage name
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (property.isSetName())) {
- String name = property.getName();
- result = String.format(NAME_FORMAT, result, name);
- }
-
- // manage type
- if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
- String type = "<Undefined>";
- if(property.getType() != null) {
- type = property.getType().getName();
- }
-
- // If type is undefined only show "<Undefined>" when explicitly asked.
- if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
- result = String.format(TYPE_FORMAT, result, type);
- }
- }
-
- // manage multiplicity
- if(((flags & ILabelPreferenceConstants.DISP_MULTIPLICITY) == ILabelPreferenceConstants.DISP_MULTIPLICITY)) {
-
- // If multiplicity is [1] (SysML default), only show when explicitly asked.
- // TODO : add a case for default with multiplicity not set.
- String lower = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getLowerValue()) : "1";
- String upper = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getUpperValue()) : "1";
- if(((flags & ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) == ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) || !("1".equals(lower) && "1".equals(upper))) {
-
- if(lower.equals(upper)) {
- result = String.format(MULTIPLICITY_FORMAT_ALT, result, lower, upper);
- } else {
- result = String.format(MULTIPLICITY_FORMAT, result, lower, upper);
- }
- }
- }
-
- // manage default value
- if(((flags & ILabelPreferenceConstants.DISP_DEFAULTVALUE) == ILabelPreferenceConstants.DISP_DEFAULTVALUE) && ((property.getDefaultValue() != null))) {
- ValueSpecification valueSpecification = property.getDefaultValue();
- if((valueSpecification instanceof InstanceValue && property.getType().equals(valueSpecification.getType())) || !(valueSpecification instanceof InstanceValue)) {
- result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
- }
- }
-
- // manage modifier
- if((flags & ILabelPreferenceConstants.DISP_MODIFIERS) == ILabelPreferenceConstants.DISP_MODIFIERS) {
- StringBuffer sb = new StringBuffer();
- if(property.isReadOnly()) {
- sb.append(sb.length() == 0 ? "readOnly" : ", readOnly");
- }
- if(property.isOrdered()) {
- sb.append(sb.length() == 0 ? "ordered" : ", ordered");
- }
- if(property.isUnique()) {
- sb.append(sb.length() == 0 ? "unique" : ", unique");
- }
- if(property.isDerivedUnion()) {
- sb.append(sb.length() == 0 ? "union" : ", union");
- }
- EList<Property> redefinedProperties = property.getRedefinedProperties();
- if(redefinedProperties != null && !redefinedProperties.isEmpty()) {
- for(Property p : redefinedProperties) {
- sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
- }
- }
- if(sb.length() != 0) {
- result = String.format(MODIFIER_FORMAT, result, sb.toString());
- }
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
-
- if(feature instanceof EStructuralFeature) { // UMLPackage.eINSTANCE.getLiteralString_Value().equals(feature) ||
- return UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getInstanceValue_Instance().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature) || UMLPackage.eINSTANCE.getStructuralFeature_IsReadOnly().equals(feature) || UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerived().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerivedUnion().equals(feature) || UMLPackage.eINSTANCE.getProperty_RedefinedProperty().equals(feature) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof Property)) {
- Property semElement = (Property)element;
-
- semanticElementsBeingParsed.add(semElement);
- if(semElement.getType() != null) {
- semanticElementsBeingParsed.add(semElement.getType());
- }
- if(semElement.getLowerValue() != null) {
- semanticElementsBeingParsed.add(semElement.getLowerValue());
- }
- if(semElement.getUpperValue() != null) {
- semanticElementsBeingParsed.add(semElement.getUpperValue());
- }
- if(semElement.getDefaultValue() != null) {
- semanticElementsBeingParsed.add(semElement.getDefaultValue());
- }
- }
- return semanticElementsBeingParsed;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(9);
- masks.put(ILabelPreferenceConstants.DISP_VISIBILITY, "Visibility");
- masks.put(ILabelPreferenceConstants.DISP_DERIVE, "Is Derived");
- masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
- masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
- masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
- masks.put(ILabelPreferenceConstants.DISP_MULTIPLICITY, "Multiplicity");
- masks.put(ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY, "Show default multiplicity");
- masks.put(ILabelPreferenceConstants.DISP_DEFAULTVALUE, "Default Value");
- masks.put(ILabelPreferenceConstants.DISP_MODIFIERS, "Modifiers");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+import org.eclipse.uml2.uml.VisibilityKind;
+
+/**
+ * Semantic Parser for {@link Property}
+ */
+public class PropertyLabelParser extends NamedElementLabelParser {
+
+ /** The String format for displaying a {@link Property} with visibility */
+ protected static final String VISIBILITY_FORMAT = "%s %s";
+
+ /** The String format for displaying a {@link Property} label with derived modifier */
+ protected static final String DERIVED_FORMAT = "%s/";
+
+ /** The String format for displaying a {@link Property} label with its name */
+ protected static final String NAME_FORMAT = "%s%s";
+
+ /** The String format for displaying a {@link Property} label with its type */
+ protected static final String TYPE_FORMAT = "%s: %s";
+
+ /** The String format for displaying a {@link Property} label with multiplicity */
+ protected static final String MULTIPLICITY_FORMAT = "%s [%s..%s]";
+
+ /** The String format for displaying a {@link Property} label with multiplicity */
+ protected static final String MULTIPLICITY_FORMAT_ALT = "%s [%s]";
+
+ /** The String format for displaying a {@link Property} label with default value */
+ protected static final String DEFAULT_VALUE_FORMAT = "%s= %s";
+
+ /** The String format for displaying a {@link Property} label with modifiers */
+ protected static final String MODIFIER_FORMAT = "%s{%s}";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if(flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Property)) {
+
+ Property property = (Property)eObject;
+
+ // manage visibility
+ if((flags & ILabelPreferenceConstants.DISP_VISIBILITY) == ILabelPreferenceConstants.DISP_VISIBILITY) {
+ String visibility;
+ switch(property.getVisibility().getValue()) {
+ case VisibilityKind.PACKAGE:
+ visibility = "~";
+ break;
+ case VisibilityKind.PUBLIC:
+ visibility = "+";
+ break;
+ case VisibilityKind.PROTECTED:
+ visibility = "#";
+ break;
+ case VisibilityKind.PRIVATE:
+ visibility = "-";
+ break;
+ default:
+ visibility = "+";
+ break;
+ }
+ result = String.format(VISIBILITY_FORMAT, visibility, result);
+ }
+
+ // manage derived modifier
+ if(((flags & ILabelPreferenceConstants.DISP_DERIVE) == ILabelPreferenceConstants.DISP_DERIVE) && (property.isDerived())) {
+ result = String.format(DERIVED_FORMAT, result);
+ }
+
+ // manage name
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (property.isSetName())) {
+ String name = property.getName();
+ result = String.format(NAME_FORMAT, result, name);
+ }
+
+ // manage type
+ if(((flags & ILabelPreferenceConstants.DISP_TYPE) == ILabelPreferenceConstants.DISP_TYPE)) {
+ String type = "<Undefined>";
+ if(property.getType() != null) {
+ type = property.getType().getName();
+ }
+
+ // If type is undefined only show "<Undefined>" when explicitly asked.
+ if(((flags & ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) == ILabelPreferenceConstants.DISP_UNDEFINED_TYPE) || (!"<Undefined>".equals(type))) {
+ result = String.format(TYPE_FORMAT, result, type);
+ }
+ }
+
+ // manage multiplicity
+ if(((flags & ILabelPreferenceConstants.DISP_MULTIPLICITY) == ILabelPreferenceConstants.DISP_MULTIPLICITY)) {
+
+ // If multiplicity is [1] (SysML default), only show when explicitly asked.
+ // TODO : add a case for default with multiplicity not set.
+ String lower = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getLowerValue()) : "1";
+ String upper = (property.getLowerValue() != null) ? ValueSpecificationUtil.getSpecificationValue(property.getUpperValue()) : "1";
+ if(((flags & ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) == ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY) || !("1".equals(lower) && "1".equals(upper))) {
+
+ if(lower.equals(upper)) {
+ result = String.format(MULTIPLICITY_FORMAT_ALT, result, lower, upper);
+ } else {
+ result = String.format(MULTIPLICITY_FORMAT, result, lower, upper);
+ }
+ }
+ }
+
+ // manage default value
+ if(((flags & ILabelPreferenceConstants.DISP_DEFAULTVALUE) == ILabelPreferenceConstants.DISP_DEFAULTVALUE) && ((property.getDefaultValue() != null))) {
+ ValueSpecification valueSpecification = property.getDefaultValue();
+ if((valueSpecification instanceof InstanceValue && property.getType().equals(valueSpecification.getType())) || !(valueSpecification instanceof InstanceValue)) {
+ result = String.format(DEFAULT_VALUE_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
+ }
+ }
+
+ // manage modifier
+ if((flags & ILabelPreferenceConstants.DISP_MODIFIERS) == ILabelPreferenceConstants.DISP_MODIFIERS) {
+ StringBuffer sb = new StringBuffer();
+ if(property.isReadOnly()) {
+ sb.append(sb.length() == 0 ? "readOnly" : ", readOnly");
+ }
+ if(property.isOrdered()) {
+ sb.append(sb.length() == 0 ? "ordered" : ", ordered");
+ }
+ if(property.isUnique()) {
+ sb.append(sb.length() == 0 ? "unique" : ", unique");
+ }
+ if(property.isDerivedUnion()) {
+ sb.append(sb.length() == 0 ? "union" : ", union");
+ }
+ EList<Property> redefinedProperties = property.getRedefinedProperties();
+ if(redefinedProperties != null && !redefinedProperties.isEmpty()) {
+ for(Property p : redefinedProperties) {
+ sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
+ }
+ }
+ if(sb.length() != 0) {
+ result = String.format(MODIFIER_FORMAT, result, sb.toString());
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+
+ if(feature instanceof EStructuralFeature) { // UMLPackage.eINSTANCE.getLiteralString_Value().equals(feature) ||
+ return UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getInstanceValue_Instance().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature) || UMLPackage.eINSTANCE.getStructuralFeature_IsReadOnly().equals(feature) || UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerived().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerivedUnion().equals(feature) || UMLPackage.eINSTANCE.getProperty_RedefinedProperty().equals(feature) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof Property)) {
+ Property semElement = (Property)element;
+
+ semanticElementsBeingParsed.add(semElement);
+ if(semElement.getType() != null) {
+ semanticElementsBeingParsed.add(semElement.getType());
+ }
+ if(semElement.getLowerValue() != null) {
+ semanticElementsBeingParsed.add(semElement.getLowerValue());
+ }
+ if(semElement.getUpperValue() != null) {
+ semanticElementsBeingParsed.add(semElement.getUpperValue());
+ }
+ if(semElement.getDefaultValue() != null) {
+ semanticElementsBeingParsed.add(semElement.getDefaultValue());
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(9);
+ masks.put(ILabelPreferenceConstants.DISP_VISIBILITY, "Visibility");
+ masks.put(ILabelPreferenceConstants.DISP_DERIVE, "Is Derived");
+ masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
+ masks.put(ILabelPreferenceConstants.DISP_TYPE, "Type");
+ masks.put(ILabelPreferenceConstants.DISP_UNDEFINED_TYPE, "Show <Undefined> type");
+ masks.put(ILabelPreferenceConstants.DISP_MULTIPLICITY, "Multiplicity");
+ masks.put(ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY, "Show default multiplicity");
+ masks.put(ILabelPreferenceConstants.DISP_DEFAULTVALUE, "Default Value");
+ masks.put(ILabelPreferenceConstants.DISP_MODIFIERS, "Modifiers");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java
index c0d696db8fc..b5a7b690391 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/ReceptionLabelParser.java
@@ -1,124 +1,124 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
-import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
-import org.eclipse.uml2.uml.Reception;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Semantic Parser for {@link Reception}
- */
-public class ReceptionLabelParser extends NamedElementLabelParser implements IMaskManagedSemanticParser {
-
- /** The String format for displaying a Property with visibility */
- protected static final String PREFIX = "\u00ABsignal\u00BB ";
-
- /** The String format for displaying a Property label with its name */
- protected static final String NAME_FORMAT = "%s%s";
-
- /** The String format for displaying a Property label with its type */
- protected static final String TYPE_FORMAT = "%s: %s";
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getPrintString(IAdaptable element, int flags) {
-
- if (flags == 0) {
- return MaskedLabel;
- }
-
- String result = PREFIX;
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if((eObject != null) && (eObject instanceof Reception)) {
-
- Reception reception = (Reception)eObject;
-
- // manage name
- if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (reception.isSetName())) {
- String name = reception.getName();
- result = String.format(NAME_FORMAT, result, name);
- }
-
- // manage signal
- if(((flags & ILabelPreferenceConstants.DISP_SIGNAL) == ILabelPreferenceConstants.DISP_SIGNAL)) {
- String type = "<Undefined>";
- if(reception.getSignal() != null) {
- type = reception.getSignal().getName();
- }
- result = String.format(TYPE_FORMAT, result, type);
- }
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isAffectingEvent(Object event, int flags) {
-
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return UMLPackage.eINSTANCE.getReception_Signal().equals(feature) || super.isAffectingEvent(event, flags);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
-
- if((element != null) && (element instanceof Reception)) {
- Reception semElement = (Reception)element;
-
- semanticElementsBeingParsed.add(semElement);
- if(semElement.getSignal() != null) {
- semanticElementsBeingParsed.add(semElement.getSignal());
- }
- }
- return semanticElementsBeingParsed;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Map<Integer, String> getMasks() {
- Map<Integer, String> masks = new HashMap<Integer, String>(2);
- masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
- masks.put(ILabelPreferenceConstants.DISP_SIGNAL, "Signel");
- return masks;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.gmf.diagram.common.parser.IMaskManagedSemanticParser;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.uml2.uml.Reception;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Semantic Parser for {@link Reception}
+ */
+public class ReceptionLabelParser extends NamedElementLabelParser implements IMaskManagedSemanticParser {
+
+ /** The String format for displaying a Property with visibility */
+ protected static final String PREFIX = "\u00ABsignal\u00BB ";
+
+ /** The String format for displaying a Property label with its name */
+ protected static final String NAME_FORMAT = "%s%s";
+
+ /** The String format for displaying a Property label with its type */
+ protected static final String TYPE_FORMAT = "%s: %s";
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if (flags == 0) {
+ return MaskedLabel;
+ }
+
+ String result = PREFIX;
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if((eObject != null) && (eObject instanceof Reception)) {
+
+ Reception reception = (Reception)eObject;
+
+ // manage name
+ if(((flags & ILabelPreferenceConstants.DISP_NAME) == ILabelPreferenceConstants.DISP_NAME) && (reception.isSetName())) {
+ String name = reception.getName();
+ result = String.format(NAME_FORMAT, result, name);
+ }
+
+ // manage signal
+ if(((flags & ILabelPreferenceConstants.DISP_SIGNAL) == ILabelPreferenceConstants.DISP_SIGNAL)) {
+ String type = "<Undefined>";
+ if(reception.getSignal() != null) {
+ type = reception.getSignal().getName();
+ }
+ result = String.format(TYPE_FORMAT, result, type);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return UMLPackage.eINSTANCE.getReception_Signal().equals(feature) || super.isAffectingEvent(event, flags);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+
+ if((element != null) && (element instanceof Reception)) {
+ Reception semElement = (Reception)element;
+
+ semanticElementsBeingParsed.add(semElement);
+ if(semElement.getSignal() != null) {
+ semanticElementsBeingParsed.add(semElement.getSignal());
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Map<Integer, String> getMasks() {
+ Map<Integer, String> masks = new HashMap<Integer, String>(2);
+ masks.put(ILabelPreferenceConstants.DISP_NAME, "Name");
+ masks.put(ILabelPreferenceConstants.DISP_SIGNAL, "Signel");
+ return masks;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/SlotLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/SlotLabelParser.java
index bc88f2128cc..bd13fef47b3 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/SlotLabelParser.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/parser/SlotLabelParser.java
@@ -1,142 +1,142 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.uml2.uml.InstanceValue;
-import org.eclipse.uml2.uml.Slot;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * Semantic Parser for {@link Slot}
- */
-public class SlotLabelParser implements ISemanticParser {
-
- /**
- * {@inheritDoc}
- */
- public String getEditString(IAdaptable element, int flags) {
- return getPrintString(element, flags);
- }
-
- /**
- * {@inheritDoc}
- */
- public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
- return ParserEditStatus.UNEDITABLE_STATUS;
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- String result = "";
- EObject eObject = (EObject)element.getAdapter(EObject.class);
-
- if(eObject instanceof Slot) {
- Slot slot = (Slot)eObject;
- result = "<UNDEFINED>";
-
- if(slot.getDefiningFeature() != null) {
-
- // Add defining feature
- result = slot.getDefiningFeature().getName();
-
- // Add values
- if(!slot.getValues().isEmpty()) {
-
- String values = "";
- Iterator<ValueSpecification> iter = slot.getValues().iterator();
- while(iter.hasNext()) {
- ValueSpecification currentSpecification = iter.next();
-
- String currentValue = currentSpecification.stringValue();
- if((currentSpecification instanceof InstanceValue) && ((InstanceValue)currentSpecification).getInstance() != null) {
- currentValue = ((InstanceValue)currentSpecification).getInstance().getName();
- }
-
- values = values + currentValue;
- if(iter.hasNext()) {
- result = result + ", ";
- }
- }
-
- result = result + ": " + values;
- }
- }
- }
-
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
- if(event instanceof Notification) {
- Object feature = ((Notification)event).getFeature();
- if(feature instanceof EStructuralFeature) {
- return UMLPackage.eINSTANCE.getSlot_DefiningFeature().equals(feature);
- }
- }
-
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public List<EObject> getSemanticElementsBeingParsed(EObject element) {
- List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
- semanticElementsBeingParsed.add(element);
-
- return semanticElementsBeingParsed;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.uml2.uml.InstanceValue;
+import org.eclipse.uml2.uml.Slot;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+/**
+ * Semantic Parser for {@link Slot}
+ */
+public class SlotLabelParser implements ISemanticParser {
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEditString(IAdaptable element, int flags) {
+ return getPrintString(element, flags);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ return ParserEditStatus.UNEDITABLE_STATUS;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ String result = "";
+ EObject eObject = (EObject)element.getAdapter(EObject.class);
+
+ if(eObject instanceof Slot) {
+ Slot slot = (Slot)eObject;
+ result = "<UNDEFINED>";
+
+ if(slot.getDefiningFeature() != null) {
+
+ // Add defining feature
+ result = slot.getDefiningFeature().getName();
+
+ // Add values
+ if(!slot.getValues().isEmpty()) {
+
+ String values = "";
+ Iterator<ValueSpecification> iter = slot.getValues().iterator();
+ while(iter.hasNext()) {
+ ValueSpecification currentSpecification = iter.next();
+
+ String currentValue = currentSpecification.stringValue();
+ if((currentSpecification instanceof InstanceValue) && ((InstanceValue)currentSpecification).getInstance() != null) {
+ currentValue = ((InstanceValue)currentSpecification).getInstance().getName();
+ }
+
+ values = values + currentValue;
+ if(iter.hasNext()) {
+ result = result + ", ";
+ }
+ }
+
+ result = result + ": " + values;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ if(event instanceof Notification) {
+ Object feature = ((Notification)event).getFeature();
+ if(feature instanceof EStructuralFeature) {
+ return UMLPackage.eINSTANCE.getSlot_DefiningFeature().equals(feature);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<EObject> getSemanticElementsBeingParsed(EObject element) {
+ List<EObject> semanticElementsBeingParsed = new ArrayList<EObject>();
+ semanticElementsBeingParsed.add(element);
+
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ return true;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/AssociationViewUtils.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/AssociationViewUtils.java
index c98ad4b68b4..e1fbb0682f6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/AssociationViewUtils.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/utils/AssociationViewUtils.java
@@ -1,81 +1,81 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.utils;
-
-import org.eclipse.gmf.runtime.notation.EObjectValueStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Utility class for Association graphical end - property mapping.
- */
-public class AssociationViewUtils {
-
- /** ID for the source end - property mapping of an association */
- public static final String SEMANTIC_SOURCE_END = "semantic_source_end";
-
- /** ID for the target end - property mapping of an association */
- public static final String SEMANTIC_TARGET_END = "semantic_target_end";
-
- /**
- * Get the semantic end from the source of an edge representing an Association.
- *
- * @param view
- * the Association view.
- * @return the Property corresponding to the source of the graphical end.
- */
- public static Property getSourceSemanticEnd(View view) {
- EObjectValueStyle semanticStyle = (EObjectValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), SEMANTIC_SOURCE_END);
- return semanticStyle == null ? null : (Property)semanticStyle.getEObjectValue();
- }
-
- /**
- * Get the semantic end from the target of an edge representing an Association.
- *
- * @param view
- * the Association view.
- * @return the Property corresponding to the target of the graphical end.
- */
- public static Property getTargetSemanticEnd(View view) {
- EObjectValueStyle semanticStyle = (EObjectValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), SEMANTIC_TARGET_END);
- return semanticStyle == null ? null : (Property)semanticStyle.getEObjectValue();
- }
-
- /**
- * Set the semantic end for the source of an edge representing an Association.
- *
- * @param view
- * the Association view.
- * @param end
- * the Property corresponding to the source of the graphical end.
- */
- public static void setSourceSemanticEnd(View view, Property end) {
- EObjectValueStyle semanticStyle = (EObjectValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), SEMANTIC_SOURCE_END);
- semanticStyle.setEObjectValue(end);
- }
-
- /**
- * Set the semantic end for the target of an edge representing an Association.
- *
- * @param view
- * the Association view.
- * @param end
- * the Property corresponding to the target of the graphical end.
- */
- public static void setTargetSemanticEnd(View view, Property end) {
- EObjectValueStyle semanticStyle = (EObjectValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), SEMANTIC_TARGET_END);
- semanticStyle.setEObjectValue(end);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.utils;
+
+import org.eclipse.gmf.runtime.notation.EObjectValueStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.uml2.uml.Property;
+
+/**
+ * Utility class for Association graphical end - property mapping.
+ */
+public class AssociationViewUtils {
+
+ /** ID for the source end - property mapping of an association */
+ public static final String SEMANTIC_SOURCE_END = "semantic_source_end";
+
+ /** ID for the target end - property mapping of an association */
+ public static final String SEMANTIC_TARGET_END = "semantic_target_end";
+
+ /**
+ * Get the semantic end from the source of an edge representing an Association.
+ *
+ * @param view
+ * the Association view.
+ * @return the Property corresponding to the source of the graphical end.
+ */
+ public static Property getSourceSemanticEnd(View view) {
+ EObjectValueStyle semanticStyle = (EObjectValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), SEMANTIC_SOURCE_END);
+ return semanticStyle == null ? null : (Property)semanticStyle.getEObjectValue();
+ }
+
+ /**
+ * Get the semantic end from the target of an edge representing an Association.
+ *
+ * @param view
+ * the Association view.
+ * @return the Property corresponding to the target of the graphical end.
+ */
+ public static Property getTargetSemanticEnd(View view) {
+ EObjectValueStyle semanticStyle = (EObjectValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), SEMANTIC_TARGET_END);
+ return semanticStyle == null ? null : (Property)semanticStyle.getEObjectValue();
+ }
+
+ /**
+ * Set the semantic end for the source of an edge representing an Association.
+ *
+ * @param view
+ * the Association view.
+ * @param end
+ * the Property corresponding to the source of the graphical end.
+ */
+ public static void setSourceSemanticEnd(View view, Property end) {
+ EObjectValueStyle semanticStyle = (EObjectValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), SEMANTIC_SOURCE_END);
+ semanticStyle.setEObjectValue(end);
+ }
+
+ /**
+ * Set the semantic end for the target of an edge representing an Association.
+ *
+ * @param view
+ * the Association view.
+ * @param end
+ * the Property corresponding to the target of the graphical end.
+ */
+ public static void setTargetSemanticEnd(View view, Property end) {
+ EObjectValueStyle semanticStyle = (EObjectValueStyle)view.getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), SEMANTIC_TARGET_END);
+ semanticStyle.setEObjectValue(end);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/factory/ConstraintBlockPropertyCompositeClassifierViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/factory/ConstraintBlockPropertyCompositeClassifierViewFactory.java
new file mode 100644
index 00000000000..203ac674fe6
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/factory/ConstraintBlockPropertyCompositeClassifierViewFactory.java
@@ -0,0 +1,83 @@
+package org.eclipse.papyrus.sysml.diagram.common.factory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.factory.ShapeViewFactory;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
+import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+public class ConstraintBlockPropertyCompositeClassifierViewFactory extends ShapeViewFactory {
+
+ /**
+ * Creates ConstraintBlockPropertyComposite view and add Label and Compartment nodes
+ */
+ @Override
+ protected void decorateView(View containerView, View view, IAdaptable element, String semanticHint, int index, boolean persisted) {
+
+ getViewService().createNode(element, view, UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID, ViewUtil.APPEND, persisted, getPreferencesHint());
+ getViewService().createNode(element, view, SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID, ViewUtil.APPEND, persisted, getPreferencesHint());
+
+ if (element != null) {
+ EObject newElement = EMFHelper.getEObject(element);
+ if (newElement instanceof Property && UMLUtil.getStereotypeApplication((Property)newElement, ConstraintProperty.class) != null) {
+ Property constraintProperty = (Property) newElement;
+
+ ViewService.createNode(view, getConstraint(constraintProperty), UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID, getPreferencesHint());
+
+
+ List<Property> constraintParameters = getConstraintParameters(constraintProperty);
+ for (Property constraintParameter : constraintParameters) {
+ ViewService.createNode(view, constraintParameter, UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID, getPreferencesHint());
+ }
+ }
+ }
+
+ // this action needs to be done after the compartments creation
+ super.decorateView(containerView, view, element, semanticHint, index, persisted);
+ }
+
+ private List<Property> getConstraintParameters(Property constraintProperty) {
+ List<Property> constraintParameters = new ArrayList<Property>();
+ Type type = constraintProperty.getType();
+ if (type instanceof Class && UMLUtil.getStereotypeApplication(type, ConstraintBlock.class) != null) { // instanceof ensure type is not null
+ Class constraintBlock = (Class)type;
+ EList<Property> ownedAttributes = constraintBlock.getOwnedAttributes();
+ for (Property property : ownedAttributes) {
+ if (property.getAppliedStereotypes().isEmpty()) {
+ constraintParameters.add(property);
+ }
+ }
+ }
+ return constraintParameters;
+ }
+
+ private Constraint getConstraint(Property constraintProperty) {
+ Type type = constraintProperty.getType();
+ if (type instanceof Class && UMLUtil.getStereotypeApplication(type, ConstraintBlock.class) != null) { // instanceof ensure type is not null
+ Class constraintBlock = (Class)type;
+ EList<Constraint> ownedRules = constraintBlock.getOwnedRules();
+ for (Constraint constraint : ownedRules) {
+ return constraint;
+ }
+ }
+ return null;
+ }
+
+ // Start of user code preferences
+ // End of user code
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/figure/ConstraintBlockPropertyCompositeFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/figure/ConstraintBlockPropertyCompositeFigure.java
new file mode 100644
index 00000000000..8d4475ccc55
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/figure/ConstraintBlockPropertyCompositeFigure.java
@@ -0,0 +1,49 @@
+package org.eclipse.papyrus.sysml.diagram.common.figure;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.text.FlowPage;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusRoundedNodeFigure;
+
+public class ConstraintBlockPropertyCompositeFigure extends PapyrusRoundedNodeFigure {
+
+ protected WrappingLabel constraintLabel;
+
+ /** main flow page */
+ protected FlowPage page;
+
+ public ConstraintBlockPropertyCompositeFigure() {
+ super();
+ corner = 50;
+
+ nameLabel = new WrappingLabel();
+ nameLabel.setOpaque(false);
+ nameLabel.setAlignment(PositionConstants.MIDDLE);
+ add(nameLabel);
+
+
+ constraintLabel = new WrappingLabel();
+ constraintLabel.setAlignment(PositionConstants.RIGHT);
+ add(constraintLabel);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#getNameLabel()
+ *
+ * @return
+ */
+ public WrappingLabel getNameLabel() {
+ return nameLabel;
+ }
+
+ /**
+ *
+ * @return the textflow of the constraint that contain the string of the
+ * specification
+ */
+ public WrappingLabel getConstraintLabel() {
+ return constraintLabel;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/figure/SysMLDiagramFrameFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/figure/SysMLDiagramFrameFigure.java
new file mode 100644
index 00000000000..f9f739f4675
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/figure/SysMLDiagramFrameFigure.java
@@ -0,0 +1,151 @@
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.figure;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.OrderedLayout;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.draw2d.InteractionFigure;
+import org.eclipse.papyrus.uml.diagram.common.draw2d.LeftToolbarLayout;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AutomaticCompartmentLayoutManager;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
+
+public class SysMLDiagramFrameFigure extends NodeNamedElementFigure {
+
+ private WrappingLabel frameLabel;
+
+ private RectangleFigure frameLabelContainerFigure;
+
+ private RectangleFigure structureCompartmentFigure;
+
+
+ public SysMLDiagramFrameFigure() {
+ super();
+ createContents();
+ }
+
+ protected void createContents() {
+ add(createInteractionFigureHeader());
+ add(createStructureCompartmentFigures());
+ setLayoutManager(new SysMLLayoutLayoutManager());
+ }
+
+ protected RectangleFigure createInteractionFigureHeader() {
+ if (this.frameLabel == null) {
+ this.frameLabel = new WrappingLabel() {
+
+ @Override
+ public Dimension getPreferredSize(final int wHint, final int hHint) {
+ final Dimension preferredSize = super.getPreferredSize(wHint, hHint);
+ if(preferredSize.width == 0) {
+ return preferredSize;
+ }
+ return new Dimension(preferredSize.width + 2, preferredSize.height + 2);
+ }
+ };
+ }
+
+ final InteractionFigure interactionFigure = new InteractionFigure();
+ interactionFigure.setBorder(new MarginBorder(3, 3, 3, 3));
+ interactionFigure.setLayoutManager(new LeftToolbarLayout());
+ interactionFigure.add(frameLabel);
+
+ frameLabelContainerFigure = new RectangleFigure();
+ frameLabelContainerFigure.setOutline(false);
+ frameLabelContainerFigure.setFill(false);
+ frameLabelContainerFigure.setLayoutManager(new ToolbarLayout(false));
+ frameLabelContainerFigure.setLineStyle(Graphics.LINE_DASHDOTDOT);
+ frameLabelContainerFigure.add(interactionFigure, OrderedLayout.ALIGN_CENTER);
+ return frameLabelContainerFigure;
+ }
+
+ @Override
+ public WrappingLabel getNameLabel() {
+ if (frameLabel == null) {
+ createInteractionFigureHeader();
+ }
+ return frameLabel;
+ }
+
+ public RectangleFigure getLabelContainer() {
+ return frameLabelContainerFigure;
+ }
+
+ public IFigure getStructureCompartmentFigure() {
+ if (structureCompartmentFigure == null) {
+ createStructureCompartmentFigures();
+ }
+ return structureCompartmentFigure;
+ }
+
+ public IFigure createStructureCompartmentFigures() {
+ structureCompartmentFigure = new RectangleFigure();
+ structureCompartmentFigure.setFill(false);
+
+ return structureCompartmentFigure;
+ }
+
+ /**
+ * this is the layout manager in charge to place element in the enumeration
+ *
+ */
+ private class SysMLLayoutLayoutManager extends AutomaticCompartmentLayoutManager {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void layout(final IFigure container) {
+ List<IFigure> figuresToRemove = new ArrayList<IFigure>();
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ IFigure currentCompartment = (IFigure)container.getChildren().get(i);
+ // this is a visible compartment
+ if(currentCompartment == structureCompartmentFigure) {
+ Rectangle bound = new Rectangle(currentCompartment.getBounds());
+ currentCompartment.invalidate();
+ Dimension pref = currentCompartment.getPreferredSize();
+ currentCompartment.invalidate();
+ Dimension prefConstraint = currentCompartment.getPreferredSize(container.getBounds().width - 40, -1);
+ if(pref.width < prefConstraint.width) {
+ bound.setSize(pref);
+ } else {
+ bound.setSize(prefConstraint);
+ }
+ int offset = 24;
+ bound.x = container.getBounds().x;
+ bound.y = container.getBounds().y + offset;
+ bound.width = container.getBounds().width;
+ bound.height = container.getBounds().height - offset;
+ currentCompartment.setBounds(bound);
+ } else if (currentCompartment == frameLabelContainerFigure) {
+ Rectangle boundLabel = new Rectangle(frameLabelContainerFigure.getBounds());
+ boundLabel.setSize(frameLabelContainerFigure.getPreferredSize());
+ frameLabelContainerFigure.setBounds(boundLabel);
+ } else {
+ // remove other figure
+ figuresToRemove.add(currentCompartment);
+ }
+ }
+ for (IFigure iFigure : figuresToRemove) {
+ container.getChildren().remove(iFigure);
+ }
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLGraphicalTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLGraphicalTypes.java
index f43a4ddcc98..eaa7b094cc9 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLGraphicalTypes.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLGraphicalTypes.java
@@ -25,6 +25,8 @@ public class SysMLGraphicalTypes {
public static final String SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID = "shape_sysml_blockproperty_as_composite"; //$NON-NLS-1$
+ public static final String SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID = "shape_sysml_constraintblockproperty_as_composite"; //$NON-NLS-1$
+
public static final String SHAPE_SYSML_DIMENSION_AS_CLASSIFIER_ID = "shape_sysml_dimension_as_classifier"; //$NON-NLS-1$
public static final String SHAPE_SYSML_CONSTRAINTBLOCK_AS_CLASSIFIER_ID = "shape_sysml_constraintblock_as_classifier"; //$NON-NLS-1$
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java
index 1728af01197..78884083e9f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConnectorEditPart.java
@@ -17,8 +17,13 @@ import org.eclipse.draw2d.Connection;
import org.eclipse.gef.EditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.blocks.BindingConnector;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
import org.eclipse.papyrus.uml.diagram.common.figure.ConnectorEdgeFigure;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.Element;
public class ConnectorEditPart extends AbstractElementLinkEditPart {
@@ -91,33 +96,14 @@ public class ConnectorEditPart extends AbstractElementLinkEditPart {
return (ConnectorEdgeFigure)getFigure();
}
- /**
- * {@inheritDoc}
- */
- @Override
- protected void refreshLineType() {
- // Start of user code custom line type
- super.refreshLineType();
- // End of user code
- }
-
- /**
- * {@inheritDoc}
- */
@Override
- protected void refreshArrowSource() {
- // Start of user code custom source decoration
- super.refreshArrowSource();
- // End of user code
+ protected void refreshLineWidth() {
+ if (org.eclipse.uml2.uml.util.UMLUtil.getStereotypeApplication((Element)resolveSemanticElement(), BindingConnector.class) != null) {
+ setLineWidth(2);
+ }
+ else {
+ setLineWidth(1);
+ }
}
- /**
- * {@inheritDoc}
- */
- @Override
- protected void refreshArrowTarget() {
- // Start of user code custom target decoration
- super.refreshArrowTarget();
- // End of user code
- }
}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConstraintParameterAffixedNodeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConstraintParameterAffixedNodeEditPart.java
new file mode 100644
index 00000000000..a450a7d041e
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/edit/part/ConstraintParameterAffixedNodeEditPart.java
@@ -0,0 +1,201 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.edit.part;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LayoutListener;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.ExternalLabelPrimaryDragRoleEditPolicy;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeIconlDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AppliedStereotypeLabelDisplayEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AffixedNamedElementFigure;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
+import org.eclipse.papyrus.uml.diagram.common.locator.ExternalLabelPositionLocator;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+
+public class ConstraintParameterAffixedNodeEditPart extends AbstractElementBorderEditPart {
+
+ private LayoutListener.Stub layoutInitializationListener;
+
+ public ConstraintParameterAffixedNodeEditPart(View view) {
+ super(view);
+ }
+
+
+ @Override
+ protected EditPart createChild(Object model) {
+ return super.createChild(model);
+ }
+
+
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(AppliedStereotypeLabelDisplayEditPolicy.STEREOTYPE_LABEL_POLICY, new AppliedStereotypeIconlDisplayEditPolicy() {
+
+ /**
+ * <pre>
+ * {@inheritDoc}
+ *
+ * This modifies the edit policy in order to call refreshVisuals() whenever the stereotype image to show is null.
+ * (required to show the Port default image correctly).
+ * </pre>
+ */
+ @Override
+ protected void refreshStereotypeDisplay() {
+ if(getHost() instanceof IPapyrusEditPart) {
+ IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
+
+ if((figure instanceof IPapyrusUMLElementFigure) && (stereotypeIconToDisplay() != null)) {
+ ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(null, stereotypeIconToDisplay());
+ } else {
+ refreshVisuals();
+ }
+ }
+ }
+
+ });
+
+ installEditPolicy(ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE, new ShowHideLabelEditPolicy());
+ }
+
+ @Override
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if(child instanceof IBorderItemEditPart) { // External labels
+ return new ExternalLabelPrimaryDragRoleEditPolicy() {
+
+ @SuppressWarnings("rawtypes")
+ 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;
+ }
+
+ @Override
+ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
+ IBorderItemLocator locator = new ExternalLabelPositionLocator(getMainFigure());
+ borderItemContainer.add(borderItemEditPart.getFigure(), locator);
+ return;
+ }
+
+ @Override
+ public EditPart getPrimaryChildEditPart() {
+ return getChildBySemanticHint(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID);
+ }
+
+ /**
+ * <pre>
+ * Calls the figure refresh when a change event is detected on
+ * UMLPackage.eINSTANCE.getProperty_Aggregation().
+ *
+ * {@inheritDoc}
+ * </pre>
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+
+ // When the constraint parameter position changes, its position on parent side may change and requires a visual refresh.
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getSize_Width().equals(feature) || NotationPackage.eINSTANCE.getSize_Height().equals(feature) || NotationPackage.eINSTANCE.getLocation_X().equals(feature) || NotationPackage.eINSTANCE.getLocation_Y().equals(feature)) {
+ refreshVisuals();
+ }
+
+ super.handleNotificationEvent(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected IFigure createNodeShape() {
+ return primaryShape = new AffixedNamedElementFigure();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AffixedNamedElementFigure getPrimaryShape() {
+ return (AffixedNamedElementFigure)primaryShape;
+ }
+
+ /**
+ * <pre>
+ * A post layout listener is added during activate and remove the first time the layout occurs.
+ * This is required in order to be able to find the side of this border item on its parent when opening the model.
+ * Without this, the locator is unable to guess the parent side because the parent constraint is not set yet.
+ *
+ * Once the initialization is done, the listener become useless and can be removed.
+ *
+ * {@inheritDoc}
+ * </pre>
+ */
+ @Override
+ public void activate() {
+
+ layoutInitializationListener = new LayoutListener.Stub() {
+
+ @Override
+ public void postLayout(IFigure container) {
+ refreshVisuals();
+ //getBorderedFigure().getBorderItemContainer().removeLayoutListener(layoutInitializationListener);
+ layoutInitializationListener = null;
+ }
+ };
+ getBorderedFigure().getBorderItemContainer().addLayoutListener(layoutInitializationListener);
+
+ super.activate();
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/DeleteElementAction.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/factory/ConstraintPropertyAffixedNodeViewFactory.java
index 58f3349fcd1..7e61a306410 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/DeleteElementAction.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/factory/ConstraintPropertyAffixedNodeViewFactory.java
@@ -1,16 +1,19 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.factory;
+
+
+
+public class ConstraintPropertyAffixedNodeViewFactory extends PortAffixedNodeViewFactory {
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/utils/UMLGraphicalTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/utils/UMLGraphicalTypes.java
index 6cec91a75e4..068f7c04bd6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/utils/UMLGraphicalTypes.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-gen/org/eclipse/papyrus/uml/diagram/common/utils/UMLGraphicalTypes.java
@@ -33,6 +33,8 @@ public class UMLGraphicalTypes {
public static final String SHAPE_UML_PORT_AS_AFFIXED_ID = "shape_uml_port_as_affixed"; //$NON-NLS-1$
+ public static final String SHAPE_UML_PROPERTY_AS_AFFIXED_ID = "shape_uml_property_as_affixed"; //$NON-NLS-1$
+
/** Custom label nodes */
public static final String SHAPE_UML_CONSTRAINT_AS_LABEL_ID = "shape_uml_constraint_as_label"; //$NON-NLS-1$
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java
index ecb3127afa8..d5c54840e24 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/Activator.java
@@ -1,306 +1,306 @@
-package org.eclipse.papyrus.sysml.diagram.common;
-
-import java.util.ArrayList;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
-import org.eclipse.papyrus.sysml.portandflows.FlowPort;
-import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-import org.osgi.framework.BundleContext;
-//import org.eclipse.papyrus.sysml.activities.provider.ActivitiesItemProviderAdapterFactory;
-//import org.eclipse.papyrus.sysml.allocations.provider.AllocationsItemProviderAdapterFactory;
-//import org.eclipse.papyrus.sysml.blocks.provider.BlocksItemProviderAdapterFactory;
-//import org.eclipse.papyrus.sysml.constraints.provider.ConstraintsItemProviderAdapterFactory;
-//import org.eclipse.papyrus.sysml.modelelements.provider.ModelelementsItemProviderAdapterFactory;
-//import org.eclipse.papyrus.sysml.portandflows.provider.PortandflowsItemProviderAdapterFactory;
-//import org.eclipse.papyrus.sysml.requirements.provider.RequirementsItemProviderAdapterFactory;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- /** The Constant ID. */
- public static final String PLUGIN_ID = "org.eclipse.papyrus.sysml.diagram.common"; //$NON-NLS-1$
-
- /** Shared instance of the plug-in (singleton pattern) */
- private static Activator plugin;
-
- /** Logging helper */
- public static LogHelper log;
-
- /** The composed adapter factory */
- private ComposedAdapterFactory adapterFactory;
-
- /** generic label provider based on EMF facet */
- private UMLLabelProvider labelProvider;
-
- /** Default constructor */
- public Activator() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
-
- // register the login helper
- log = new LogHelper(plugin);
-
- // prepare the composed adapter factory
- adapterFactory = createAdapterFactory();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- adapterFactory.dispose();
- adapterFactory = null;
- if(labelProvider != null) {
- labelProvider.dispose();
- labelProvider = null;
- }
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getInstance() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given plug-in relative path.
- *
- * @generated
- * @param path
- * the path
- * @return the image descriptor
- */
- public static ImageDescriptor getBundledImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-
- /**
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore()
- *
- * @return Shared Preference Store.
- */
- @Override
- public IPreferenceStore getPreferenceStore() {
- IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
- return store;
- }
-
- /**
- * Get the item provider adapter factory.
- *
- * @return the adapter factory.
- */
- public AdapterFactory getItemProvidersAdapterFactory() {
- return adapterFactory;
- }
-
- /**
- * Get an image descriptor for current item.
- *
- * @param item
- * the item for which an image descriptor searched.
- * @return the image descriptor.
- */
- public ImageDescriptor getItemImageDescriptor(Object item) {
- IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(item, IItemLabelProvider.class);
- if(labelProvider != null) {
- return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
- }
- return null;
- }
-
- /**
- * Get an image for a ENamedElement in plug-in image registry.
- *
- * @param element
- * the element.
- * @return the image.
- */
- public Image getImage(ENamedElement element) {
-
- String imageKey = element.getName();
-
- Image image = getImageRegistry().get(imageKey);
- if(image == null) {
- ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(imageKey, imageDescriptor);
- image = getImageRegistry().get(imageKey);
- }
- return image;
- }
-
- /**
- * <pre>
- * Provide a FlowPort image for border edit part that take the border item position
- * into account.
- *
- * The image is not rotated, but predefined.
- *
- * The side of the image (relatively to the parent figure) can be:
- * <ul>
- * <li>{@linkplain PositionConstants#NORTH}</li>
- * <li> {@linkplain PositionConstants#SOUTH}</li>
- * <li> {@linkplain PositionConstants#EAST}</li>
- * <li> {@linkplain PositionConstants#WEST}</li>
- * <li> {@linkplain PositionConstants#NORTH_EAST}</li>
- * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_EAST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
- * </ul>
- *
- * </pre>
- */
- public Image getFlowPortImage(FlowPort flowport, int side) {
-
- // Prepare the image key
- String imageKey = "FlowPort_";
- if(flowport.isAtomic()) {
- if(flowport.getDirection() == FlowDirection.IN) {
- imageKey = imageKey + "IN_";
- } else if(flowport.getDirection() == FlowDirection.OUT) {
- imageKey = imageKey + "OUT_";
- } else if(flowport.getDirection() == FlowDirection.INOUT) {
- imageKey = imageKey + "INOUT_";
- }
-
- imageKey = imageKey + "A_";
- } else {
- imageKey = imageKey + "NA_";
- }
-
- if(side == PositionConstants.WEST) {
- imageKey = imageKey + "WEST";
- } else if(side == PositionConstants.NORTH) {
- imageKey = imageKey + "NORTH";
- } else if(side == PositionConstants.SOUTH) {
- imageKey = imageKey + "SOUTH";
- } else if(side == PositionConstants.EAST) {
- imageKey = imageKey + "EAST";
- } else if(side == PositionConstants.NORTH_WEST) {
- imageKey = imageKey + "NORTH_WEST";
- } else if(side == PositionConstants.NORTH_EAST) {
- imageKey = imageKey + "NORTH_EAST";
- } else if(side == PositionConstants.SOUTH_EAST) {
- imageKey = imageKey + "SOUTH_EAST";
- } else if(side == PositionConstants.SOUTH_WEST) {
- imageKey = imageKey + "SOUTH_WEST";
- }
-
- // Retrieve image from registry or add it in the registry
- Image image = getImageRegistry().get(imageKey);
- if(image == null) {
-
- ImageDescriptor imageDescriptor = imageDescriptorFromPlugin(PLUGIN_ID, "/icons/flowports/" + imageKey + ".gif");
-
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(imageKey, imageDescriptor);
- image = getImageRegistry().get(imageKey);
- }
-
- return image;
- }
-
- /**
- * Returns a label provider supported by EMF Facet
- *
- * @return a label provider supported by EMF Facet
- */
- public ILabelProvider getLabelProvider() {
- if(labelProvider == null) {
- // add a generic label provider for sysml elements
- labelProvider = new UMLLabelProvider();
- }
- return labelProvider;
- }
-
- /**
- * Create a new Composed adapter factory for this plug-in.
- */
- protected ComposedAdapterFactory createAdapterFactory() {
- ArrayList<AdapterFactory> factories = new ArrayList<AdapterFactory>();
-
- // Add SysML adapters
-// factories.add(new ActivitiesItemProviderAdapterFactory());
-// factories.add(new AllocationsItemProviderAdapterFactory());
-// factories.add(new BlocksItemProviderAdapterFactory());
-// factories.add(new ConstraintsItemProviderAdapterFactory());
-// factories.add(new ModelelementsItemProviderAdapterFactory());
-// factories.add(new PortandflowsItemProviderAdapterFactory());
-// factories.add(new RequirementsItemProviderAdapterFactory());
- // Add UML adapter
- factories.add(new UMLItemProviderAdapterFactory());
-
- // Other adapters
- factories.add(new EcoreItemProviderAdapterFactory());
- factories.add(new ResourceItemProviderAdapterFactory());
- factories.add(new ReflectiveItemProviderAdapterFactory());
- return new ComposedAdapterFactory(factories);
- }
-
- private ImageDescriptor getProvidedImageDescriptor(ENamedElement element) {
- if(element instanceof EStructuralFeature) {
- EStructuralFeature feature = ((EStructuralFeature)element);
- EClass eContainingClass = feature.getEContainingClass();
- EClassifier eType = feature.getEType();
- if(eContainingClass != null && !eContainingClass.isAbstract()) {
- element = eContainingClass;
- } else if(eType instanceof EClass && !((EClass)eType).isAbstract()) {
- element = eType;
- }
- }
- if(element instanceof EClass) {
- EClass eClass = (EClass)element;
- if(!eClass.isAbstract()) {
- return getItemImageDescriptor(eClass.getEPackage().getEFactoryInstance().create(eClass));
- }
- }
- // TODO : support structural features
- return null;
- }
-
-
-}
+package org.eclipse.papyrus.sysml.diagram.common;
+
+import java.util.ArrayList;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
+import org.eclipse.papyrus.sysml.portandflows.FlowPort;
+import org.eclipse.papyrus.uml.tools.providers.UMLLabelProvider;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
+import org.osgi.framework.BundleContext;
+//import org.eclipse.papyrus.sysml.activities.provider.ActivitiesItemProviderAdapterFactory;
+//import org.eclipse.papyrus.sysml.allocations.provider.AllocationsItemProviderAdapterFactory;
+//import org.eclipse.papyrus.sysml.blocks.provider.BlocksItemProviderAdapterFactory;
+//import org.eclipse.papyrus.sysml.constraints.provider.ConstraintsItemProviderAdapterFactory;
+//import org.eclipse.papyrus.sysml.modelelements.provider.ModelelementsItemProviderAdapterFactory;
+//import org.eclipse.papyrus.sysml.portandflows.provider.PortandflowsItemProviderAdapterFactory;
+//import org.eclipse.papyrus.sysml.requirements.provider.RequirementsItemProviderAdapterFactory;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ /** The Constant ID. */
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.sysml.diagram.common"; //$NON-NLS-1$
+
+ /** Shared instance of the plug-in (singleton pattern) */
+ private static Activator plugin;
+
+ /** Logging helper */
+ public static LogHelper log;
+
+ /** The composed adapter factory */
+ private ComposedAdapterFactory adapterFactory;
+
+ /** generic label provider based on EMF facet */
+ private UMLLabelProvider labelProvider;
+
+ /** Default constructor */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ // register the login helper
+ log = new LogHelper(plugin);
+
+ // prepare the composed adapter factory
+ adapterFactory = createAdapterFactory();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ adapterFactory.dispose();
+ adapterFactory = null;
+ if(labelProvider != null) {
+ labelProvider.dispose();
+ labelProvider = null;
+ }
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getInstance() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in relative path.
+ *
+ * @generated
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getBundledImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore()
+ *
+ * @return Shared Preference Store.
+ */
+ @Override
+ public IPreferenceStore getPreferenceStore() {
+ IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
+ return store;
+ }
+
+ /**
+ * Get the item provider adapter factory.
+ *
+ * @return the adapter factory.
+ */
+ public AdapterFactory getItemProvidersAdapterFactory() {
+ return adapterFactory;
+ }
+
+ /**
+ * Get an image descriptor for current item.
+ *
+ * @param item
+ * the item for which an image descriptor searched.
+ * @return the image descriptor.
+ */
+ public ImageDescriptor getItemImageDescriptor(Object item) {
+ IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(item, IItemLabelProvider.class);
+ if(labelProvider != null) {
+ return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
+ }
+ return null;
+ }
+
+ /**
+ * Get an image for a ENamedElement in plug-in image registry.
+ *
+ * @param element
+ * the element.
+ * @return the image.
+ */
+ public Image getImage(ENamedElement element) {
+
+ String imageKey = element.getName();
+
+ Image image = getImageRegistry().get(imageKey);
+ if(image == null) {
+ ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
+ if(imageDescriptor == null) {
+ imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+ }
+ getImageRegistry().put(imageKey, imageDescriptor);
+ image = getImageRegistry().get(imageKey);
+ }
+ return image;
+ }
+
+ /**
+ * <pre>
+ * Provide a FlowPort image for border edit part that take the border item position
+ * into account.
+ *
+ * The image is not rotated, but predefined.
+ *
+ * The side of the image (relatively to the parent figure) can be:
+ * <ul>
+ * <li>{@linkplain PositionConstants#NORTH}</li>
+ * <li> {@linkplain PositionConstants#SOUTH}</li>
+ * <li> {@linkplain PositionConstants#EAST}</li>
+ * <li> {@linkplain PositionConstants#WEST}</li>
+ * <li> {@linkplain PositionConstants#NORTH_EAST}</li>
+ * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
+ * <li> {@linkplain PositionConstants#SOUTH_EAST}</li>
+ * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
+ * </ul>
+ *
+ * </pre>
+ */
+ public Image getFlowPortImage(FlowPort flowport, int side) {
+
+ // Prepare the image key
+ String imageKey = "FlowPort_";
+ if(flowport.isAtomic()) {
+ if(flowport.getDirection() == FlowDirection.IN) {
+ imageKey = imageKey + "IN_";
+ } else if(flowport.getDirection() == FlowDirection.OUT) {
+ imageKey = imageKey + "OUT_";
+ } else if(flowport.getDirection() == FlowDirection.INOUT) {
+ imageKey = imageKey + "INOUT_";
+ }
+
+ imageKey = imageKey + "A_";
+ } else {
+ imageKey = imageKey + "NA_";
+ }
+
+ if(side == PositionConstants.WEST) {
+ imageKey = imageKey + "WEST";
+ } else if(side == PositionConstants.NORTH) {
+ imageKey = imageKey + "NORTH";
+ } else if(side == PositionConstants.SOUTH) {
+ imageKey = imageKey + "SOUTH";
+ } else if(side == PositionConstants.EAST) {
+ imageKey = imageKey + "EAST";
+ } else if(side == PositionConstants.NORTH_WEST) {
+ imageKey = imageKey + "NORTH_WEST";
+ } else if(side == PositionConstants.NORTH_EAST) {
+ imageKey = imageKey + "NORTH_EAST";
+ } else if(side == PositionConstants.SOUTH_EAST) {
+ imageKey = imageKey + "SOUTH_EAST";
+ } else if(side == PositionConstants.SOUTH_WEST) {
+ imageKey = imageKey + "SOUTH_WEST";
+ }
+
+ // Retrieve image from registry or add it in the registry
+ Image image = getImageRegistry().get(imageKey);
+ if(image == null) {
+
+ ImageDescriptor imageDescriptor = imageDescriptorFromPlugin(PLUGIN_ID, "/icons/flowports/" + imageKey + ".gif");
+
+ if(imageDescriptor == null) {
+ imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
+ }
+ getImageRegistry().put(imageKey, imageDescriptor);
+ image = getImageRegistry().get(imageKey);
+ }
+
+ return image;
+ }
+
+ /**
+ * Returns a label provider supported by EMF Facet
+ *
+ * @return a label provider supported by EMF Facet
+ */
+ public ILabelProvider getLabelProvider() {
+ if(labelProvider == null) {
+ // add a generic label provider for sysml elements
+ labelProvider = new UMLLabelProvider();
+ }
+ return labelProvider;
+ }
+
+ /**
+ * Create a new Composed adapter factory for this plug-in.
+ */
+ protected ComposedAdapterFactory createAdapterFactory() {
+ ArrayList<AdapterFactory> factories = new ArrayList<AdapterFactory>();
+
+ // Add SysML adapters
+// factories.add(new ActivitiesItemProviderAdapterFactory());
+// factories.add(new AllocationsItemProviderAdapterFactory());
+// factories.add(new BlocksItemProviderAdapterFactory());
+// factories.add(new ConstraintsItemProviderAdapterFactory());
+// factories.add(new ModelelementsItemProviderAdapterFactory());
+// factories.add(new PortandflowsItemProviderAdapterFactory());
+// factories.add(new RequirementsItemProviderAdapterFactory());
+ // Add UML adapter
+ factories.add(new UMLItemProviderAdapterFactory());
+
+ // Other adapters
+ factories.add(new EcoreItemProviderAdapterFactory());
+ factories.add(new ResourceItemProviderAdapterFactory());
+ factories.add(new ReflectiveItemProviderAdapterFactory());
+ return new ComposedAdapterFactory(factories);
+ }
+
+ private ImageDescriptor getProvidedImageDescriptor(ENamedElement element) {
+ if(element instanceof EStructuralFeature) {
+ EStructuralFeature feature = ((EStructuralFeature)element);
+ EClass eContainingClass = feature.getEContainingClass();
+ EClassifier eType = feature.getEType();
+ if(eContainingClass != null && !eContainingClass.isAbstract()) {
+ element = eContainingClass;
+ } else if(eType instanceof EClass && !((EClass)eType).isAbstract()) {
+ element = eType;
+ }
+ }
+ if(element instanceof EClass) {
+ EClass eClass = (EClass)element;
+ if(!eClass.isAbstract()) {
+ return getItemImageDescriptor(eClass.getEPackage().getEFactoryInstance().create(eClass));
+ }
+ }
+ // TODO : support structural features
+ return null;
+ }
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/commands/CreateSysMLModelCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/commands/CreateSysMLModelCommand.java
index c312cecf7e8..fa291b14c1a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/commands/CreateSysMLModelCommand.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/commands/CreateSysMLModelCommand.java
@@ -1,69 +1,69 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tatiana Fesenko (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.commands;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.sysml.util.SysmlResource;
-import org.eclipse.papyrus.uml.diagram.common.commands.ModelCreationCommandBase;
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.UMLFactory;
-
-
-/**
- * The Class CreateSysMLModelCommand.
- */
-public class CreateSysMLModelCommand extends ModelCreationCommandBase {
-
- public static final String COMMAND_ID = "sysml";
-
- /**
- * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#createRootElement()
- *
- * @return
- */
-
- @Override
- protected EObject createRootElement() {
- return UMLFactory.eINSTANCE.createModel();
- }
-
- /**
- * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#initializeModel(org.eclipse.emf.ecore.EObject)
- *
- * @param owner
- */
-
- @Override
- protected void initializeModel(EObject owner) {
- super.initializeModel(owner);
- ((org.eclipse.uml2.uml.Package)owner).setName(getModelName());
-
- // Retrieve SysML profile and apply with Sub-profile
- Profile sysml = (Profile)PackageUtil.loadPackage(URI.createURI(SysmlResource.SYSML_PROFILE_URI), owner.eResource().getResourceSet());
- if(sysml != null) {
- PackageUtil.applyProfile(((org.eclipse.uml2.uml.Package)owner), sysml, true);
- }
- }
-
- /**
- * Gets the model name.
- *
- * @return the model name
- */
- protected String getModelName() {
- return "SysMLmodel";
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tatiana Fesenko (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.commands;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.sysml.util.SysmlResource;
+import org.eclipse.papyrus.uml.diagram.common.commands.ModelCreationCommandBase;
+import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.UMLFactory;
+
+
+/**
+ * The Class CreateSysMLModelCommand.
+ */
+public class CreateSysMLModelCommand extends ModelCreationCommandBase {
+
+ public static final String COMMAND_ID = "sysml";
+
+ /**
+ * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#createRootElement()
+ *
+ * @return
+ */
+
+ @Override
+ protected EObject createRootElement() {
+ return UMLFactory.eINSTANCE.createModel();
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#initializeModel(org.eclipse.emf.ecore.EObject)
+ *
+ * @param owner
+ */
+
+ @Override
+ protected void initializeModel(EObject owner) {
+ super.initializeModel(owner);
+ ((org.eclipse.uml2.uml.Package)owner).setName(getModelName());
+
+ // Retrieve SysML profile and apply with Sub-profile
+ Profile sysml = (Profile)PackageUtil.loadPackage(URI.createURI(SysmlResource.SYSML_PROFILE_URI), owner.eResource().getResourceSet());
+ if(sysml != null) {
+ PackageUtil.applyProfile(((org.eclipse.uml2.uml.Package)owner), sysml, true);
+ }
+ }
+
+ /**
+ * Gets the model name.
+ *
+ * @return the model name
+ */
+ protected String getModelName() {
+ return "SysMLmodel";
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java
index 9f57ecb282b..bdf8a3f464c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/utils/SysMLSelectionTester.java
@@ -1,143 +1,143 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.common.utils;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.infra.core.resource.NotFoundException;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForSelection;
-import org.eclipse.papyrus.sysml.SysmlPackage;
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
-import org.eclipse.papyrus.sysml.diagram.common.Activator;
-import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/**
- * This class is a Property tester used to check is current model (meaning the model currently opened in Papyrus) is a SysML Model.
- * This class is used in order to create test for deciding whether a diagram creation command should be visible or not.
- * This property tester assumes that currently active editor is Papyrus, it should be used with care (simultaneously with a test to ensure Papyrus is
- * currently opened and active).
- *
- */
-public class SysMLSelectionTester extends PropertyTester {
-
- /** Tester ID for SysML Model nature. This is currently a test on: is this a blocks profiles package... */
- public final static String IS_SYSML_MODEL = "isSysMLModel";
-
- /** Tester ID for SysML Requirements Model nature */
- public final static String IS_SYSML_REQUIREMENTS_MODEL = "isSysMLRequirementsModel";
-
- /** Tester ID for SysML Blocks Model nature */
- public final static String IS_SYSML_BLOCKS_MODEL = "isSysMLBlocksModel";
-
- /** Default constructor */
- public SysMLSelectionTester() {
- }
-
- /** Test the receiver against the selected property */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
-
- // Ensure Papyrus is the active editor
- Object currentValue = null;
- if(IS_SYSML_MODEL.equals(property)) {
- currentValue = testSysMLModelNature(receiver);
- return (currentValue == expectedValue);
- } else if(IS_SYSML_BLOCKS_MODEL.equals(property)) {
- currentValue = testSysMLBlocksModelNature(receiver);
- return (currentValue == expectedValue);
- } else if(IS_SYSML_REQUIREMENTS_MODEL.equals(property)) {
- currentValue = testSysMLRequirementsModelNature(receiver);
- return (currentValue == expectedValue);
- }
-
- return false;
- }
-
- /** True is root object is a UML Model with SysML Profile (and sub profiles) applied */
- protected boolean testSysMLModelNature(Object receiver) {
- boolean isSysMLModel = false;
-
- EObject root = getRoot(receiver);
- if(root instanceof Package) {
- Profile sysml = UMLUtil.getProfile(SysmlPackage.eINSTANCE, root);
- if(((Package)root).isProfileApplied(sysml)) {
- isSysMLModel = true;
- }
- }
-
- return isSysMLModel;
- }
-
- /** True is root object is a UML Model with SysML Requirements Profile applied */
- protected boolean testSysMLRequirementsModelNature(Object receiver) {
- boolean isSysMLModel = false;
-
- EObject root = getRoot(receiver);
- if(root instanceof Package) {
- Profile sysml = UMLUtil.getProfile(RequirementsPackage.eINSTANCE, root);
- if(((Package)root).isProfileApplied(sysml)) {
- isSysMLModel = true;
- }
- }
-
- return isSysMLModel;
- }
-
- /** True is root object is a UML Model with SysML Blocks Profile applied */
- protected boolean testSysMLBlocksModelNature(Object receiver) {
- boolean isSysMLModel = false;
-
- EObject root = getRoot(receiver);
- if(root instanceof Package) {
- Profile sysml = UMLUtil.getProfile(BlocksPackage.eINSTANCE, root);
- if(((Package)root).isProfileApplied(sysml)) {
- isSysMLModel = true;
- }
- }
-
- return isSysMLModel;
- }
-
- /** Returns the root EObject of currently opened model */
- private EObject getRoot(Object receiver) {
- EObject root = null;
-
- if(receiver instanceof ISelection) {
- ISelection selection = (ISelection)receiver;
- if(selection.isEmpty()) {
- return null;
- }
-
- try {
- ServiceUtilsForSelection serviceUtils = ServiceUtilsForSelection.getInstance();
- UmlModel openedModel = (UmlModel)serviceUtils.getModelSet(selection).getModel(UmlModel.MODEL_ID);
- if(openedModel != null) {
- root = openedModel.lookupRoot();
- }
- } catch (ServiceException e) {
- //Ignored: The selection cannot be used to retrieve the ServicesRegistry
- } catch (NotFoundException e) {
- Activator.log.error(e);
- }
- }
-
- return root;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.utils;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.papyrus.infra.core.resource.NotFoundException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForSelection;
+import org.eclipse.papyrus.sysml.SysmlPackage;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.sysml.diagram.common.Activator;
+import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
+import org.eclipse.papyrus.uml.tools.model.UmlModel;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * This class is a Property tester used to check is current model (meaning the model currently opened in Papyrus) is a SysML Model.
+ * This class is used in order to create test for deciding whether a diagram creation command should be visible or not.
+ * This property tester assumes that currently active editor is Papyrus, it should be used with care (simultaneously with a test to ensure Papyrus is
+ * currently opened and active).
+ *
+ */
+public class SysMLSelectionTester extends PropertyTester {
+
+ /** Tester ID for SysML Model nature. This is currently a test on: is this a blocks profiles package... */
+ public final static String IS_SYSML_MODEL = "isSysMLModel";
+
+ /** Tester ID for SysML Requirements Model nature */
+ public final static String IS_SYSML_REQUIREMENTS_MODEL = "isSysMLRequirementsModel";
+
+ /** Tester ID for SysML Blocks Model nature */
+ public final static String IS_SYSML_BLOCKS_MODEL = "isSysMLBlocksModel";
+
+ /** Default constructor */
+ public SysMLSelectionTester() {
+ }
+
+ /** Test the receiver against the selected property */
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+
+ // Ensure Papyrus is the active editor
+ Object currentValue = null;
+ if(IS_SYSML_MODEL.equals(property)) {
+ currentValue = testSysMLModelNature(receiver);
+ return (currentValue == expectedValue);
+ } else if(IS_SYSML_BLOCKS_MODEL.equals(property)) {
+ currentValue = testSysMLBlocksModelNature(receiver);
+ return (currentValue == expectedValue);
+ } else if(IS_SYSML_REQUIREMENTS_MODEL.equals(property)) {
+ currentValue = testSysMLRequirementsModelNature(receiver);
+ return (currentValue == expectedValue);
+ }
+
+ return false;
+ }
+
+ /** True is root object is a UML Model with SysML Profile (and sub profiles) applied */
+ protected boolean testSysMLModelNature(Object receiver) {
+ boolean isSysMLModel = false;
+
+ EObject root = getRoot(receiver);
+ if(root instanceof Package) {
+ Profile sysml = UMLUtil.getProfile(SysmlPackage.eINSTANCE, root);
+ if(((Package)root).isProfileApplied(sysml)) {
+ isSysMLModel = true;
+ }
+ }
+
+ return isSysMLModel;
+ }
+
+ /** True is root object is a UML Model with SysML Requirements Profile applied */
+ protected boolean testSysMLRequirementsModelNature(Object receiver) {
+ boolean isSysMLModel = false;
+
+ EObject root = getRoot(receiver);
+ if(root instanceof Package) {
+ Profile sysml = UMLUtil.getProfile(RequirementsPackage.eINSTANCE, root);
+ if(((Package)root).isProfileApplied(sysml)) {
+ isSysMLModel = true;
+ }
+ }
+
+ return isSysMLModel;
+ }
+
+ /** True is root object is a UML Model with SysML Blocks Profile applied */
+ protected boolean testSysMLBlocksModelNature(Object receiver) {
+ boolean isSysMLModel = false;
+
+ EObject root = getRoot(receiver);
+ if(root instanceof Package) {
+ Profile sysml = UMLUtil.getProfile(BlocksPackage.eINSTANCE, root);
+ if(((Package)root).isProfileApplied(sysml)) {
+ isSysMLModel = true;
+ }
+ }
+
+ return isSysMLModel;
+ }
+
+ /** Returns the root EObject of currently opened model */
+ private EObject getRoot(Object receiver) {
+ EObject root = null;
+
+ if(receiver instanceof ISelection) {
+ ISelection selection = (ISelection)receiver;
+ if(selection.isEmpty()) {
+ return null;
+ }
+
+ try {
+ ServiceUtilsForSelection serviceUtils = ServiceUtilsForSelection.getInstance();
+ UmlModel openedModel = (UmlModel)serviceUtils.getModelSet(selection).getModel(UmlModel.MODEL_ID);
+ if(openedModel != null) {
+ root = openedModel.lookupRoot();
+ }
+ } catch (ServiceException e) {
+ //Ignored: The selection cannot be used to retrieve the ServicesRegistry
+ } catch (NotFoundException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ return root;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.classpath b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.classpath
index f6326c88c74..59cf3977c7e 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.classpath
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.classpath
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="custom-src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.options b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.options
deleted file mode 100644
index 429092f38cf..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.options
+++ /dev/null
@@ -1,7 +0,0 @@
-# Tracing options for the org.eclipse.papyrus.sysml.diagram.parametric plug-in
-
-# Common issues
-org.eclipse.papyrus.sysml.diagram.parametric/debug=false
-
-# Visual IDs
-org.eclipse.papyrus.sysml.diagram.parametric/debug/visualID=false
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.project b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.project
index b331235c1b0..00bd1cbfb8f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.project
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.sysml.diagram.parametric</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.diagram.parametric</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/Parametric.gmfgen.prefs b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/Parametric.gmfgen.prefs
deleted file mode 100644
index 1bf41606aa9..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/Parametric.gmfgen.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Fri Apr 22 15:21:30 CEST 2011
-dynamic_figure_templates=platform\:/resource/org.eclipse.papyrus.def/dynamic-templates3.5/codegen
-eclipse.preferences.version=1
-generate_rcp=false
-ignore_gmfgen_validation=true
-ignore_mapmodel_validation=true
-use_map_mode=true
-use_runtime_figures=true
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.core.prefs b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.core.prefs
index 86564f572aa..af0f20f97a5 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,7 @@
-#Tue Dec 01 16:58:52 CET 2009
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.svnignore b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.svnignore
deleted file mode 100644
index c5e82d74585..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/.svnignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF
index 418680d8468..a7a0d4d5a1c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/META-INF/MANIFEST.MF
@@ -1,69 +1,54 @@
-Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.sysml.diagram.parametric,
- org.eclipse.papyrus.sysml.diagram.parametric.edit.commands,
- org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers,
- org.eclipse.papyrus.sysml.diagram.parametric.edit.parts,
- org.eclipse.papyrus.sysml.diagram.parametric.edit.policies,
- org.eclipse.papyrus.sysml.diagram.parametric.navigator,
- org.eclipse.papyrus.sysml.diagram.parametric.parsers,
- org.eclipse.papyrus.sysml.diagram.parametric.part,
- org.eclipse.papyrus.sysml.diagram.parametric.preferences,
- org.eclipse.papyrus.sysml.diagram.parametric.providers,
- org.eclipse.papyrus.sysml.diagram.parametric.sheet
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.core.expressions,
- org.eclipse.jface,
- org.eclipse.ui.ide,
- org.eclipse.ui.views,
- org.eclipse.ui.navigator,
- org.eclipse.ui.navigator.resources,
- org.eclipse.emf.ecore,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.edit.ui,
- org.eclipse.gmf.runtime.emf.core,
- org.eclipse.gmf.runtime.emf.commands.core,
- org.eclipse.gmf.runtime.emf.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui,
- org.eclipse.gmf.runtime.diagram.ui.properties,
- org.eclipse.gmf.runtime.diagram.ui.providers,
- org.eclipse.gmf.runtime.diagram.ui.providers.ide,
- org.eclipse.gmf.runtime.diagram.ui.render,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor,
- org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,
- org.eclipse.draw2d;visibility:=reexport,
- org.eclipse.papyrus.sysml;bundle-version="0.10.1";visibility:=reexport,
- org.eclipse.papyrus.sysml.edit;bundle-version="0.10.1";visibility:=reexport,
- org.eclipse.emf.ecore;visibility:=reexport,
- org.eclipse.emf.ecore.edit;visibility:=reexport,
- org.eclipse.uml2.uml;visibility:=reexport,
- org.eclipse.uml2.uml.edit;visibility:=reexport,
- org.eclipse.papyrus.resource;bundle-version="0.10.1";visibility:=reexport,
- org.eclipse.papyrus.resource.edit;bundle-version="0.10.1";visibility:=reexport,
- org.eclipse.gef,
- org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="0.10.1",
- org.eclipse.papyrus.extensionpoints.editors;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.standard;bundle-version="0.10.1";visibility:=reexport,
- org.eclipse.papyrus.uml.standard.edit;bundle-version="0.10.1";visibility:=reexport,
- org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
- org.eclipse.papyrus.parsers;bundle-version="0.10.1",
- org.eclipse.ocl.ecore;visibility:=reexport,
- org.eclipse.emf.validation;visibility:=reexport,
- org.eclipse.papyrus.infra.emf.appearance;bundle-version="0.10.1"
-Bundle-Vendor: %providerName
-Eclipse-LazyStart: true
-Bundle-Version: 0.10.1.qualifier
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.sysml.diagram.parametric.part.Sy
- smlDiagramEditorPlugin
-Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.parametric;sing
- leton:=true
-
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.sysml;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.1",
+ org.eclipse.emf.common.ui;bundle-version="2.5.0",
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.diagram.composite;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="1.3.0",
+ org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="0.10.1",
+ org.eclipse.core.expressions,
+ org.eclipse.papyrus.sysml.service.types;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.service.types;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.diagram.core;bundle-version="1.4.1",
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.5.0",
+ org.eclipse.papyrus.uml.tools;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="0.10.1",
+ org.eclipse.ui.ide;bundle-version="3.8.0",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
+ org.eclipse.uml2.uml;bundle-version="4.0.0",
+ org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.2.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.1",
+ org.eclipse.gmf.tooling.runtime;bundle-version="3.1.0",
+ org.eclipse.papyrus.sysml.diagram.internalblock;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.1",
+ org.eclipse.papyrus.sysml.diagram.common;bundle-version="0.10.1"
+Bundle-ManifestVersion: 2
+Bundle-ActivationPolicy: lazy
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.parametric;singleton:=true
+Bundle-Version: 0.10.1.qualifier
+Bundle-Vendor: %providerName
+Bundle-Activator: org.eclipse.papyrus.sysml.diagram.parametric.Activator
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.papyrus.sysml.diagram.parametric,
+ org.eclipse.papyrus.sysml.diagram.parametric.commands,
+ org.eclipse.papyrus.sysml.diagram.parametric.edit.part,
+ org.eclipse.papyrus.sysml.diagram.parametric.edit.policy,
+ org.eclipse.papyrus.sysml.diagram.parametric.factory,
+ org.eclipse.papyrus.sysml.diagram.parametric.figures,
+ org.eclipse.papyrus.sysml.diagram.parametric.parser,
+ org.eclipse.papyrus.sysml.diagram.parametric.part,
+ org.eclipse.papyrus.sysml.diagram.parametric.policies,
+ org.eclipse.papyrus.sysml.diagram.parametric.preferences,
+ org.eclipse.papyrus.sysml.diagram.parametric.provider,
+ org.eclipse.papyrus.sysml.diagram.parametric.utils
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/about.html b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/about.html
index 50d9eae0154..d35d5aed64c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/about.html
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>December 15, 2009</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
-
-</body>
-</html> \ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/build.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/build.properties
index 5dc0d74d81c..4874aad550f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/build.properties
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/build.properties
@@ -1,15 +1,11 @@
-#
-#Mon Sep 12 09:30:14 CEST 2011
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- messages.properties,\
- icons/,\
- plugin.properties,\
- .options,\
- about.html
-output..=bin/
-jars.compile.order=.
-src.includes = about.html
-source..=src/,custom-src/
-bin..=bin/
+source.. = src/,\
+ src-gen/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ plugin.xml,\
+ palettes/,\
+ icons/,\
+ about.html
+src.includes = model/
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramCommand.java
deleted file mode 100644
index 545b68c8839..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramCommand.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-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.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.util.SysmlResource;
-import org.eclipse.papyrus.uml.tools.utils.PackageUtil;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Model;
-import org.eclipse.uml2.uml.Profile;
-
-public class CreateParametricDiagramCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler {
-
- /** the Block containing the diagram */
- private Class selectedElement = null;
-
- @Override
- protected String getDiagramNotationID() {
- return ParametricEditPart.MODEL_ID;
- }
-
- @Override
- protected PreferencesHint getPreferenceHint() {
- return SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
- @Override
- protected String getDefaultDiagramName() {
- return "ParametricDiagram";
- }
-
- // @Override
- // protected EObject createRootElement() {
- // return UMLFactory.eINSTANCE.createModel();
- // }
- //
- // @Override
- // protected void initializeModel(EObject owner) {
- // EObject eObject = getSelectedElement();
- // if(eObject == null) {
- // eObject = owner;
- // }
- //
- // if(eObject instanceof Class) {
- // this.selectedElement = (Class)eObject;
- // }
- // }
-
- @Override
- protected void initializeDiagram(EObject diagram) {
- if(diagram instanceof Diagram) {
- Diagram diag = (Diagram)diagram;
- // test if the selected class is a block
- if(selectedElement != null && selectedElement.getAppliedStereotype(SysmlResource.BLOCK_ID) != null) {
- // YT : Not sure to understand why the selected element is tested to be a Block instead of Block || BlockConstraint
- diag.setElement(selectedElement);
- createParametricGraph(selectedElement, diag);
- }
- }
- }
-
- @Override
- protected Diagram createDiagram(Resource diagramResource, EObject owner, String name) {
- Diagram diagram = null;
-
- // FIXME : Dead code below, owner cannot be a Model due to ParametricDiagramCondition
- // which restricts possible owner to Class only (Block or ConstraintBlock).
- if(owner instanceof Model) {
- Model model = (Model)owner;
-
- if((model.getAppliedProfile(SysmlResource.SYSML_ID, true) == null) || (model.getAppliedProfile(SysmlResource.BLOCKS_ID, true) == null)) {
- // Retrieve SysML profile and apply with sub-profiles
- Profile sysml = (Profile)PackageUtil.loadPackage(URI.createURI(SysmlResource.SYSML_PROFILE_URI), model.eResource().getResourceSet());
- PackageUtil.applyProfile(model, sysml, true);
- }
-
- Class ownedClass = model.createOwnedClass("Parametric", false);
- ownedClass.applyStereotype(ownedClass.getApplicableStereotype(SysmlResource.BLOCK_ID));
- diagram = super.createDiagram(diagramResource, ownedClass, name);
-
- } else if(owner instanceof Class) {
- diagram = super.createDiagram(diagramResource, owner, name);
- }
- return diagram;
- }
-
- /**
- * Complete a Parametric diagram with required graphical elements.
- *
- * @param element
- * the element to which the diagram is associated
- * @param diagram
- * the diagram to complete
- */
- private void createParametricGraph(Element element, Diagram diagram) {
- /*
- * This method implementation allow you to create graphical nodes if required. You may
- * delete it if not necessary.
- */
- TransactionalEditingDomain editingdomain = EditorUtils.getTransactionalEditingDomain();
- IAdaptable elementAdapter = new EObjectAdapter(element);
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, null, ViewUtil.APPEND, true, SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
-
- CreateCommand nodeCreationCommand = new CreateCommand(editingdomain, descriptor, diagram);
-
- editingdomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(nodeCreationCommand));
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java
deleted file mode 100644
index 9f55e97aad4..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric;
-
-import org.eclipse.papyrus.infra.gmfdiag.common.GmfEditorFactory;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-
-public class ParametricDiagramEditorFactory extends GmfEditorFactory {
-
- /**
- * Instantiates a new use case diagram editor factory.
- */
- public ParametricDiagramEditorFactory() {
- super(ParametricDiagramForMultiEditor.class, ParametricEditPart.MODEL_ID);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/actions/RestoreRelatedLinksAction.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/actions/RestoreRelatedLinksAction.java
deleted file mode 100644
index 153c2d30d09..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/actions/RestoreRelatedLinksAction.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * 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.sysml.diagram.parametric.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.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.command.RestoreRelatedLinksCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.uml.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 ParametricEditPart.MODEL_ID;
- }
-
- /**
- * @see org.eclipse.jface.action.Action#isEnabled()
- */
- @Override
- public boolean isEnabled() {
- Diagram currentDiagram = getCurrentDiagram();
- if(currentDiagram != null) {
- return (!getSelection().isEmpty() && getDiagramNotationID().equals(currentDiagram.getType()));
- }
- return false;
- }
-
- /**
- * @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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateConstraintPropertyCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateConstraintPropertyCommand.java
deleted file mode 100644
index c2d5a2f2112..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateConstraintPropertyCommand.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.eclipse.papyrus.sysml.diagram.parametric.command;
-
-import java.util.List;
-
-import org.eclipse.gmf.runtime.diagram.ui.commands.CreateOrSelectElementCommand;
-import org.eclipse.swt.widgets.Shell;
-
-
-public class CreateConstraintPropertyCommand extends CreateOrSelectElementCommand {
-
- public CreateConstraintPropertyCommand(Shell parentShell, List content) {
- super(parentShell, content);
- // TODO Auto-generated constructor stub
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java
deleted file mode 100644
index 6291c5014d1..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.command;
-
-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.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.Property2CreateCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-
-public class CreateParameterViewCommand extends Command {
-
- /** The compartment which graphically contains the Constraint to create */
- private ConstraintPropertyEditPart 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 type of local condition to create */
- private IHintedType type;
-
- public CreateParameterViewCommand() {
- super();
- }
-
- public CreateParameterViewCommand(String label) {
- super(label);
- }
-
- /**
- * 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 CreateParameterViewCommand(IHintedType conditionType, ConstraintPropertyEditPart graphicalParent, EObject containerAction, EditPart actionPart) {
- elementCreationCommand = getElementCreationCommand(containerAction, conditionType);
- compartment = graphicalParent;
- 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(SysmlElementTypes.Property_3002.equals(conditionType)) {
- Property2CreateCommand cmd = new Property2CreateCommand(createElementReq);
- return new ICommandProxy(cmd);
- } 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() {
- super.execute();
- // Object property = null;
- // if (elementCreationCommand != null) {
- // elementCreationCommand.execute();
- // property = elementCreationCommand.getICommand().getCommandResult().getReturnValue();
- // }
- }
-
- /**
- * 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/RestoreRelatedLinksCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/RestoreRelatedLinksCommand.java
deleted file mode 100644
index c06ca614951..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/RestoreRelatedLinksCommand.java
+++ /dev/null
@@ -1,335 +0,0 @@
-/*******************************************************************************
- * 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.sysml.diagram.parametric.command;
-
-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.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramUpdater;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlLinkDescriptor;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.uml.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<SysmlLinkDescriptor> result, View view, List<?> descriptors) {
- for(Object object : descriptors) {
- if(false == object instanceof SysmlLinkDescriptor) {
- continue;
- }
- SysmlLinkDescriptor descriptor = (SysmlLinkDescriptor)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 sysmlLinkDescriptor
- * the descriptor to search
- * @return true if already exist
- */
- private boolean cleanContains(Collection<? extends SysmlLinkDescriptor> collection, SysmlLinkDescriptor sysmlLinkDescriptor) {
- for(Object object : collection) {
- if(object instanceof SysmlLinkDescriptor) {
- SysmlLinkDescriptor descriptor = (SysmlLinkDescriptor)object;
- if(descriptor.getModelElement() == sysmlLinkDescriptor.getModelElement() && descriptor.getSource() == sysmlLinkDescriptor.getSource() && descriptor.getDestination() == sysmlLinkDescriptor.getDestination() && descriptor.getVisualID() == sysmlLinkDescriptor.getVisualID()) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Collects all related links for view
- *
- * @param view
- * @param domain2NotationMap
- *
- * @return linkdescriptors
- */
- protected Collection<? extends SysmlLinkDescriptor> collectPartRelatedLinks(View view, Map<EObject, View> domain2NotationMap) {
- Collection<SysmlLinkDescriptor> result = new LinkedList<SysmlLinkDescriptor>();
- if(!domain2NotationMap.containsKey(view.getElement())) {
- // We must prevent duplicate descriptors
- List<?> outgoingDescriptors = SysmlDiagramUpdater.getOutgoingLinks(view);
- cleanAdd(result, view, outgoingDescriptors);
-
- List<?> incomingDescriptors = SysmlDiagramUpdater.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 SysmlLinkDescriptor> linkDescriptors, Map<EObject, View> domain2NotationMap) {
- // map diagram
- mapModel(diagram, domain2NotationMap);
-
- for(SysmlLinkDescriptor 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 SysmlLinkDescriptor> getLinkDescriptorToProcess(View notationView, Map<EObject, View> domain2NotationMap) {
- // Collect all related link from semantic model
- Collection<? extends SysmlLinkDescriptor> 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 = SysmlVisualIDRegistry.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 SysmlLinkDescriptor> LinkDescriptorsIterator = linkDescriptors.iterator(); LinkDescriptorsIterator.hasNext();) {
- SysmlLinkDescriptor 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, SysmlLinkDescriptor 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(!ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(view))) {
- return;
- }
-
- // register the view if its type allows incoming or outgoing links
- if(!SysmlDiagramUpdater.getOutgoingLinks(view).isEmpty() || !SysmlDiagramUpdater.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 SysmlLinkDescriptor> 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java
deleted file mode 100644
index 37d33140b36..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-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.commands.UnexecutableCommand;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-
-/**
- * Custom CreateParameterEditPolicy.
- */
-public class CreateParameterEditPolicy extends AbstractEditPolicy {
-
- public CreateParameterEditPolicy() {
- super();
- }
-
- @Override
- public Command getCommand(Request request) {
- if(RequestConstants.REQ_CREATE.equals(request.getType()) && request instanceof CreateUnspecifiedTypeRequest) {
- CreateUnspecifiedTypeRequest creationRequest = (CreateUnspecifiedTypeRequest)request;
- EditPart parentEditPart = getHost();
- if(parentEditPart instanceof ConstraintPropertyEditPart) {
- //ConstraintPropertyEditPart compartementPart = (ConstraintPropertyEditPart) parentEditPart;
- //EObject action = ViewUtil.resolveSemanticElement((View) getHost().getModel());
- for(Object obj : creationRequest.getElementTypes()) {
- if(SysmlElementTypes.Property_3002.equals(obj)) {
- // do nothing or display WarningAndLinkDialog
- return UnexecutableCommand.INSTANCE;
- // return new CreateParameterViewCommand((IHintedType) SysmlElementTypes.Property_3002,
- // compartementPart, action, getHost());
- }
- }
- }
- }
- return super.getCommand(request);
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CustomDiagramDragDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CustomDiagramDragDropEditPolicy.java
deleted file mode 100644
index 1dc70ffbf77..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CustomDiagramDragDropEditPolicy.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.helper.ConnectorLinkMappingHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.sysml.diagram.parametric.utils.PropertyLinkedToClassifier;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.OldCommonDiagramDragDropEditPolicy;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * This class is used to execute the drag and drop from the outline. It can manage the drop of nodes
- * and binary links. To manage specific drop the method
- * CommonDiagramDragDropEditPolicy.getSpecificDropCommand has to be implemented
- */
-public class CustomDiagramDragDropEditPolicy extends OldCommonDiagramDragDropEditPolicy {
-
- /** The container view where the drop is done */
- private View containerView;
-
- /**
- * Instantiates a new custom diagram drag drop edit policy with the right link mapping helper.
- */
- public CustomDiagramDragDropEditPolicy() {
- super(ConnectorLinkMappingHelper.getInstance());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Set<Integer> getDroppableElementVisualId() {
- Set<Integer> droppableElementsVisualId = new HashSet<Integer>();
- droppableElementsVisualId.add(ConnectorEditPart.VISUAL_ID);
- droppableElementsVisualId.add(ConstraintPropertyEditPart.VISUAL_ID);
- droppableElementsVisualId.add(PropertyEditPart.VISUAL_ID);
- return droppableElementsVisualId;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IElementType getUMLElementType(int elementID) {
- return SysmlElementTypes.getElementType(elementID);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getNodeVisualID(View containerView, EObject domainElement) {
- this.containerView = containerView;
- if(domainElement instanceof Element) {
- EObject e = getApplication(domainElement);
- if(e != null) {
- if(e instanceof ConstraintProperty) {
- return ConstraintPropertyEditPart.VISUAL_ID;
- }
- // others cases for stereotyped elements
- }
- }
- return SysmlVisualIDRegistry.getNodeVisualID(containerView, domainElement);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getLinkWithClassVisualID(EObject domainElement) {
- return SysmlVisualIDRegistry.getLinkWithClassVisualID(domainElement);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticLink, int nodeVISUALID, int linkVISUALID) {
- if(nodeVISUALID != -1) {
- switch(nodeVISUALID) {
- case ConstraintPropertyEditPart.VISUAL_ID:
- return dropConstraintProperty(dropRequest, semanticLink, nodeVISUALID);
- case PropertyEditPart.VISUAL_ID:
- return dropProperty(dropRequest, semanticLink, nodeVISUALID);
- default:
- return super.getSpecificDropCommand(dropRequest, semanticLink, nodeVISUALID, linkVISUALID);
- }
- } else if(linkVISUALID != -1) {
- switch(linkVISUALID) {
- case ConnectorEditPart.VISUAL_ID:
- return dropConnector(dropRequest, semanticLink, linkVISUALID);
- default:
- return super.getSpecificDropCommand(dropRequest, semanticLink, nodeVISUALID, linkVISUALID);
- }
- } else {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
- /**
- * Specific drop action for connector.
- *
- * @param dropRequest
- * the drop request
- * @param semanticLink
- * the semantic link
- * @param linkVISUALID
- * the link visual Sid
- *
- * @return the command for connector
- */
- protected Command dropConnector(DropObjectsRequest dropRequest, Element semanticLink, int linkVISUALID) {
- Collection<?> sources = ConnectorLinkMappingHelper.getInstance().getSource(semanticLink);
- Collection<?> targets = ConnectorLinkMappingHelper.getInstance().getTarget(semanticLink);
- if(sources.size() == 1 && targets.size() == 1) {
- ConnectorEnd sourceConnector = (ConnectorEnd)sources.toArray()[0];
- ConnectorEnd targetConnector = (ConnectorEnd)targets.toArray()[0];
- ConnectableElement source = sourceConnector.getRole();
- ConnectableElement target = targetConnector.getRole();
- return new ICommandProxy(dropBinaryLink(new CompositeCommand("drop Connector"), source, target, linkVISUALID, dropRequest.getLocation(), semanticLink));
- } else {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
- /**
- * Specific drop for constraint property.
- *
- * @param dropRequest
- * the drop request
- * @param semanticElement
- * the semantic link
- * @param nodeVISUALID
- * the node visual id
- *
- * @return the default drop node command for Constraint Property object
- */
- private Command dropConstraintProperty(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID) {
- CompositeCommand cc = new CompositeCommand("Drop");
- EObject droppedObject = getApplication(semanticElement);
- if(droppedObject != null) {
- cc = getDefaultDropNodeCommand(nodeVISUALID, dropRequest.getLocation(), droppedObject);
- return new ICommandProxy(cc);
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Specific drop for property. Check if the property is linked to the classifier we want to
- * drag&drop on
- *
- * @param dropRequest
- * the drop request
- * @param semanticElement
- * the semantic element
- * @param nodeVISUALID
- * the node visual id
- *
- * @return the command
- */
- private Command dropProperty(DropObjectsRequest dropRequest, Element semanticElement, int nodeVISUALID) {
- EObject eObject = containerView.getElement();
- if(eObject instanceof Classifier) {
- PropertyLinkedToClassifier propertyLinkedToClassifier = new PropertyLinkedToClassifier((Classifier)eObject, (Property)semanticElement);
- if(propertyLinkedToClassifier.isLinkedToClassifier()) {
- CompositeCommand cc = new CompositeCommand("Drop");
- cc = getDefaultDropNodeCommand(nodeVISUALID, dropRequest.getLocation(), semanticElement);
- return new ICommandProxy(cc);
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean isEditPartTypeSuitableForEClass(Class<? extends GraphicalEditPart> editPartClass, EClass eClass) {
- // avoid selecting a label instead of the activity node
- return !LabelEditPart.class.isAssignableFrom(editPartClass);
- }
-
- /**
- * Gets stereotype application element for a specified domain element.
- *
- * @param domainElement
- * the domain element
- *
- * @return the stereotype application object
- */
- private EObject getApplication(EObject domainElement) {
- if(getStereotypeAvailable(domainElement) != null && domainElement instanceof Element) {
- Element element = (Element)domainElement;
- List<EObject> applications = element.getStereotypeApplications();
- for(EObject eObject : applications) {
- if(getStereotypeAvailable(domainElement).equals(eObject.eClass())) {
- return eObject;
- }
- }
- }
- return null;
- }
-
- /**
- * Gets the available stereotype EClass for a specified EObject
- *
- * @param eObject
- * the e object
- *
- * @return the stereotype available
- */
- private EClass getStereotypeAvailable(EObject eObject) {
- if(eObject instanceof Property) {
- return ConstraintsPackage.Literals.CONSTRAINT_PROPERTY;
- }
- return null;
- }
-
-
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/NoDeleteFromDiagramEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/NoDeleteFromDiagramEditPolicy.java
deleted file mode 100644
index 603177f4747..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/NoDeleteFromDiagramEditPolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * 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.sysml.diagram.parametric.edit.policies;
-
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-
-/**
- * This edit policy disables the graphical deletion of a diagram element.
- */
-public class NoDeleteFromDiagramEditPolicy extends AbstractEditPolicy {
-
- /**
- * Returns true when the request is a graphical delete
- *
- * @see org.eclipse.gef.EditPolicy#understandsRequest(Request)
- */
- @Override
- public boolean understandsRequest(Request req) {
- return RequestConstants.REQ_DELETE.equals(req.getType());
- }
-
- /**
- * Returns an unexecutable command for graphical delete.
- *
- * @see org.eclipse.gef.EditPolicy#getCommand(Request)
- */
- @Override
- public Command getCommand(Request request) {
- if(RequestConstants.REQ_DELETE.equals(request.getType())) {
- return UnexecutableCommand.INSTANCE;
- } else if(EditPolicy.DIRECT_EDIT_ROLE.equals(request.getType())) {
- return UnexecutableCommand.INSTANCE;
- }
- return super.getCommand(request);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/NoDeleteFromModelEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/NoDeleteFromModelEditPolicy.java
deleted file mode 100644
index 5f348e1f301..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/NoDeleteFromModelEditPolicy.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * 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.sysml.diagram.parametric.edit.policies;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-/**
- * This edit policy disables the graphical deletion of a diagram element.
- */
-public class NoDeleteFromModelEditPolicy extends AbstractEditPolicy {
-
- /**
- * Returns true when the request is a graphical delete
- *
- * @see org.eclipse.gef.EditPolicy#understandsRequest(Request)
- */
- @Override
- public boolean understandsRequest(Request req) {
- if(RequestConstants.REQ_SEMANTIC_WRAPPER.equals(req.getType()) && req instanceof EditCommandRequestWrapper) {
- IEditCommandRequest wrappedRequest = ((EditCommandRequestWrapper)req).getEditCommandRequest();
- if(wrappedRequest instanceof DestroyElementRequest) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns an unexecutable command for graphical delete.
- *
- * @see org.eclipse.gef.EditPolicy#getCommand(Request)
- */
- @Override
- public Command getCommand(Request request) {
- if(RequestConstants.REQ_SEMANTIC_WRAPPER.equals(request.getType()) && request instanceof EditCommandRequestWrapper) {
- IEditCommandRequest wrappedRequest = ((EditCommandRequestWrapper)request).getEditCommandRequest();
- if(wrappedRequest instanceof DestroyElementRequest) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- return super.getCommand(request);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CenteredWrappedLabel.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CenteredWrappedLabel.java
deleted file mode 100644
index 8c3527909da..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CenteredWrappedLabel.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*****************************************************************************
- * 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.sysml.diagram.parametric.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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/ConnectorLinkMappingHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/ConnectorLinkMappingHelper.java
deleted file mode 100644
index 2db374f7d99..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/ConnectorLinkMappingHelper.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.helper;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.papyrus.uml.diagram.common.helper.ILinkMappingHelper;
-import org.eclipse.papyrus.uml.diagram.common.helper.LinkMappingHelper;
-import org.eclipse.papyrus.uml.diagram.common.helper.LinkMappingHelper.CommonSourceUMLSwitch;
-import org.eclipse.papyrus.uml.diagram.common.helper.LinkMappingHelper.CommonTargetUMLSwitch;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * Specialization of the link mapping helper for the Connector
- *
- * @author eperico
- */
-public class ConnectorLinkMappingHelper implements ILinkMappingHelper {
-
- /**
- * SingletonHolder is loaded at the first execution of getInstance() method
- */
- private static class SingletonHolder {
-
- private final static ConnectorLinkMappingHelper instance = new ConnectorLinkMappingHelper();
- }
-
- /**
- * Gets the single instance of ConnectorLinkMappingHelper.
- *
- * @return single instance of ConnectorLinkMappingHelper
- */
- public static ConnectorLinkMappingHelper getInstance() {
- return SingletonHolder.instance;
- }
-
- /**
- * private constructor
- */
- private ConnectorLinkMappingHelper() {
- // do nothing
- }
-
- /**
- * {@inheritDoc}
- */
- public Collection<?> getSource(Element link) {
- return LinkMappingHelper.getSource(link, new CommonSourceUMLSwitch() {
-
- public java.util.Collection<?> caseConnector(org.eclipse.uml2.uml.Connector object) {
- EList<ConnectorEnd> ends = object.getEnds();
- if(ends != null && !ends.isEmpty()) {
- return Collections.singleton(object.getEnds().get(0));
- }
- return Collections.emptyList();
- };
- });
- }
-
- /**
- * {@inheritDoc}
- */
- public Collection<?> getTarget(Element link) {
- return LinkMappingHelper.getTarget(link, new CommonTargetUMLSwitch() {
-
- public java.util.Collection<?> caseConnector(org.eclipse.uml2.uml.Connector object) {
- EList<ConnectorEnd> ends = object.getEnds();
- if(ends != null && !ends.isEmpty() && ends.size() > 0) {
- return Collections.singleton(object.getEnds().get(1));
- }
- return Collections.emptyList();
- };
- });
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/ModelValidationHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/ModelValidationHelper.java
deleted file mode 100644
index 500961026fc..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/ModelValidationHelper.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.helper;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.validation.EMFEventType;
-import org.eclipse.emf.validation.IValidationContext;
-import org.eclipse.papyrus.resource.Resource;
-import org.eclipse.papyrus.resource.util.ResourceUtil;
-import org.eclipse.papyrus.sysml.blocks.BlocksFactory;
-import org.eclipse.papyrus.sysml.blocks.NestedConnectorEnd;
-import org.eclipse.papyrus.sysml.diagram.parametric.utils.PropertyLinkedToClassifier;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * The Class ModelValidationHelper
- */
-public class ModelValidationHelper {
-
- private static final String NESTED_CONNECTOR_END_STEREOTYPE = "SysML::Blocks::NestedConnectorEnd";
-
- /**
- * Validate connector end.
- *
- * @param connector
- * @param ctx
- * @return the status
- */
- public static IStatus validateConnector(Connector connector, IValidationContext ctx) {
- if((EMFEventType.ADD.equals(ctx.getEventType()) || EMFEventType.ADD_MANY.equals(ctx.getEventType())) && UMLPackage.eINSTANCE.getConnector_End().equals(ctx.getFeature())) {
- // do nothing
- }
- return ctx.createSuccessStatus();
- }
-
- /**
- * Validate property.
- *
- * @param property
- * @param ctx
- * @return the status
- */
- public static IStatus validateProperty(Property property, IValidationContext ctx) {
- // TODO this validator will manage connectorEnd update when source/target property is moved into and IBD
- if((EMFEventType.MOVE.equals(ctx.getEventType())) || (EMFEventType.SET.equals(ctx.getEventType()))) {
- // only update if property is linked to connector end
- for(ConnectorEnd end : property.getEnds()) {
- if(end.getOwner() != null && end.getOwner() instanceof Connector) {
- Element owner = ((Connector)end.getOwner()).getOwner();
- if(owner instanceof Classifier) {
- PropertyLinkedToClassifier link = new PropertyLinkedToClassifier((Classifier)owner, property);
- if(link.isLinkedWithMultiLevelPath()) {
- createNestedConnectorEnd(end);
- } else {
- Stereotype appliedStereotype = end.getAppliedStereotype(NESTED_CONNECTOR_END_STEREOTYPE);
- if(appliedStereotype != null) {
- end.unapplyStereotype(appliedStereotype);
- }
- }
- }
- }
- }
- }
- return ctx.createSuccessStatus();
- }
-
- /**
- * Validate connector end.
- *
- * @param connectorEnd
- * @param ctx
- * @return the status
- */
- public static IStatus validateConnectorEnd(ConnectorEnd connectorEnd, IValidationContext ctx) {
- if((EMFEventType.SET.equals(ctx.getEventType())) && UMLPackage.eINSTANCE.getConnectorEnd_Role().equals(ctx.getFeature())) {
- ConnectableElement connectableElement = connectorEnd.getRole();
- Element connector = connectorEnd.getOwner();
- if(connector != null && connector.getOwner() instanceof Classifier) {
- Classifier owner = (Classifier)connector.getOwner();
- PropertyLinkedToClassifier link = new PropertyLinkedToClassifier((Classifier)owner, (Property)connectableElement);
- if(link.isLinkedWithMultiLevelPath()) {
- // create a nested connector end
- NestedConnectorEnd end = createNestedConnectorEnd(connectorEnd);
- if(!link.getAvailableRoutes().isEmpty()) {
- end.getPropertyPath().addAll(link.getAvailableRoutes().get(0).getProperties());
- }
- } else {
- Stereotype appliedStereotype = connectorEnd.getAppliedStereotype(NESTED_CONNECTOR_END_STEREOTYPE);
- if(appliedStereotype != null) {
- connectorEnd.unapplyStereotype(appliedStereotype);
- }
- }
- }
- }
- return ctx.createSuccessStatus();
- }
-
- /**
- * Validate nested connector end.
- *
- * @param connectorEnd
- * @param ctx
- * @return the status
- */
- public static IStatus validateNestedConnectorEnd(NestedConnectorEnd connectorEnd, IValidationContext ctx) {
- // TODO setBase_ConnectorEnd should be set to null when connector is deleted, fix problem
- // with delete from model command
- // there are dangling references after this command
- // if (EMFEventType.SET.equals(ctx.getEventType())) {
- // ResourceUtil.getResource(connectorEnd).getEobjects().remove(connectorEnd);
- // }
- return ctx.createSuccessStatus();
- }
-
- /**
- * Creates the nested connector end for a connector end
- *
- * @param connectorEnd
- * the connector end
- * @return the nested connector end
- */
- private static NestedConnectorEnd createNestedConnectorEnd(ConnectorEnd connectorEnd) {
- NestedConnectorEnd nested = BlocksFactory.eINSTANCE.createNestedConnectorEnd();
- Resource res = ResourceUtil.getResource(connectorEnd);
- if(res != null) {
- res.getEobjects().add(nested);
- nested.setBase_ConnectorEnd(connectorEnd);
- }
- return nested;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/SelfCompartmentNotificationHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/SelfCompartmentNotificationHelper.java
deleted file mode 100644
index 0b14d5d7605..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/SelfCompartmentNotificationHelper.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*****************************************************************************
- * 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.sysml.diagram.parametric.helper;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-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.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.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.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.common.helper.NotificationHelper;
-import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * SelfCompartmentNotificationHelper is a particular NotificationHelper which manages the editparts
- * drawn in a particular compartment for a particular feature. It automatically add or remove
- * appropriate parts when model is modified, so that all contained elements are represented once.
- */
-public class SelfCompartmentNotificationHelper extends NotificationHelper {
-
- /** The UI adapter that listens model update */
- private UIAdapter adapter = new UIAdapter();
-
- /** The compartment part. */
- private final ConstraintPropertyEditPart compartmentPart;
-
- /** The child feature. */
- private final EStructuralFeature childFeature;
-
- /** The child type. */
- private final IHintedType childType;
-
- private static CompositeTransactionalCommand command;
-
- /**
- * Instantiates a new self compartment notification helper.
- *
- * @param compartmentPart
- * the compartment part
- * @param childFeature
- * the child feature
- * @param childType
- * the child type
- */
- public SelfCompartmentNotificationHelper(final ConstraintPropertyEditPart compartmentPart, final EStructuralFeature childFeature, final IHintedType childType) {
- this.compartmentPart = compartmentPart;
- this.childFeature = childFeature;
- this.childType = childType;
- this.setModelListener(adapter);
- }
-
- /**
- * private class UIAdapter.
- */
- private class UIAdapter extends UIAdapterImpl {
-
- @Override
- protected void safeNotifyChanged(Notification msg) {
- if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(msg.getFeature())) {
- // listen type once it's set
- listenObject((Notifier)msg.getNewValue());
- updatePropertiesParts(compartmentPart, childFeature, childType);
- } else if(UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute().equals(msg.getFeature())) {
- updatePropertiesParts(compartmentPart, childFeature, childType);
- }
- }
- }
-
- /**
- * Update children edit parts so that each child is represented once
- *
- * @param compartmentPart
- * the compartment part containing children
- * @param childFeature
- * the feature containing children
- * @param childType
- * the children's IHintedType represented as Node
- */
- // TODO refactor this method
- public static void updatePropertiesParts(ConstraintPropertyEditPart compartmentPart, EStructuralFeature childFeature, IHintedType childType) {
- if(compartmentPart == null || childFeature == null || childType == null) {
- return;
- }
- command = new CompositeTransactionalCommand(EditorUtils.getTransactionalEditingDomain(), "update children");
- command.setTransactionNestingEnabled(false);
- if(compartmentPart.getModel() instanceof View) {
- View compartmentView = (View)compartmentPart.getModel();
- EObject containerObject = compartmentView.getElement();
- if(containerObject instanceof ConstraintProperty) {
- Property baseProperty = ((ConstraintProperty)containerObject).getBase_Property();
- if(baseProperty != null && baseProperty.getType() != null) {
- Object untypedOwnedObjects = baseProperty.getType().eGet(childFeature);
- if(untypedOwnedObjects instanceof List<?>) {
- List<?> ownedEObjectChildren = (List<?>)untypedOwnedObjects;
- Set<EObject> drawnEObjectChildren = new HashSet<EObject>(ownedEObjectChildren.size());
-
- // list children already drawn and remove old children
- for(Iterator<?> iterator = compartmentView.getPersistedChildren().iterator(); iterator.hasNext();) {
- EObject childView = (EObject)iterator.next();
- if(childView instanceof View && ((View)childView).getElement() != null) {
- EObject child = ((View)childView).getElement();
- switch(SysmlVisualIDRegistry.getVisualID((View)childView)) {
-
- case Property2EditPart.VISUAL_ID:
- // property already drawn
- if(ownedEObjectChildren.contains(child)) {
- drawnEObjectChildren.add(child);
- } else {
- // delete old connectors
- deleteConnectorsViews(command, (View)childView);
- // remove remaining property if any
- iterator.remove();
- }
- break;
-
- case ConstraintPropertyEditPart.VISUAL_ID:
- // property doesn't exist in the model, remove the view
- iterator.remove();
- break;
-
- default:
- break;
- }
- }
- }
- // draw remaining children
- List<Object> childrenToDraw = new ArrayList<Object>(ownedEObjectChildren);
- childrenToDraw.removeAll(drawnEObjectChildren);
- for(Object child : childrenToDraw) {
- if(child instanceof EObject) {
- IAdaptable adapter = new EObjectAdapter((EObject)child);
- ViewDescriptor descriptor = new ViewDescriptor(adapter, Node.class, childType.getSemanticHint(), ViewUtil.APPEND, true, compartmentPart.getDiagramPreferencesHint());
- CreateCommand nodeCreationCommand = new CreateCommand(compartmentPart.getEditingDomain(), descriptor, compartmentView);
- command.add(nodeCreationCommand);
- }
- }
- }
- } else {
- // constraint property type is set to null, remove old children
- for(Iterator<?> iterator = compartmentView.getPersistedChildren().iterator(); iterator.hasNext();) {
- EObject childView = (EObject)iterator.next();
- if((childView instanceof View) && SysmlVisualIDRegistry.getVisualID((View)childView) == Property2EditPart.VISUAL_ID) {
- // delete old connectors
- deleteConnectorsViews(command, (View)childView);
- // delete parameter view
- iterator.remove();
- }
- }
- }
- // execute transactional command
- execute();
- }
- }
- }
-
- /**
- * Execute command.
- */
- private static void execute() {
- if(!command.isEmpty()) {
- command.getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- }
- }
-
- /**
- * Delete source and target connectors of the deleted parameter view
- *
- * @param cmd
- * the cmd
- * @param propertyView
- * the property view
- */
- private static void deleteConnectorsViews(ICompositeCommand cmd, View propertyView) {
- for(Iterator<?> it = propertyView.getTargetEdges().iterator(); it.hasNext();) {
- Edge incomingLink = (Edge)it.next();
- if(SysmlVisualIDRegistry.getVisualID(incomingLink) == ConnectorEditPart.VISUAL_ID) {
- cmd.add(new DeleteCommand(incomingLink));
- }
- }
- for(Iterator<?> it = propertyView.getSourceEdges().iterator(); it.hasNext();) {
- Edge outgoingLink = (Edge)it.next();
- if(SysmlVisualIDRegistry.getVisualID(outgoingLink) == ConnectorEditPart.VISUAL_ID) {
- cmd.add(new DeleteCommand(outgoingLink));
- }
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/locator/ParameterPositionLocator.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/locator/ParameterPositionLocator.java
deleted file mode 100644
index 8716abfaf2c..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/locator/ParameterPositionLocator.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.locator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.papyrus.uml.diagram.common.locator.AdvancedBorderItemLocator;
-
-/**
- * The Class ParameterPositionLocator that manages position of property on constraint property
- */
-public class ParameterPositionLocator extends AdvancedBorderItemLocator {
-
- /** Constructor **/
- public ParameterPositionLocator(IFigure parentFigure) {
- super(parentFigure);
- }
-
- /** Constructor **/
- public ParameterPositionLocator(IFigure borderItem, IFigure parentFigure, Rectangle constraint) {
- super(borderItem, parentFigure, constraint);
- }
-
- /** Constructor **/
- public ParameterPositionLocator(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.
- *
- * @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().getCopy();
- if(rectSuggested.getTopLeft().x == 0 && rectSuggested.getTopLeft().y == 0) {
- rectSuggested.setLocation(getPreferredLocation(borderItem));
- } else {
- // recovered constraint must be translated with the parent location to be absolute
- rectSuggested.setLocation(rectSuggested.getLocation().translate(getParentBorder().getTopLeft()));
- }
- rectSuggested.setSize(size);
- Rectangle validLocation = getValidLocation(rectSuggested, borderItem);
- // the constraint is not reset, but the item bounds are
- borderItem.setBounds(validLocation);
- // ensure the side property is correctly set
- setCurrentSideOfParent(findClosestSideOfParent(borderItem.getBounds(), getParentBorder()));
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConnectorLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConnectorLabelParser.java
deleted file mode 100644
index dbabe0c4218..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConnectorLabelParser.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.parsers;
-
-import java.text.FieldPosition;
-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.uml2.uml.Connector;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * A specific parser for displaying a connector. This parser refreshes the text
- * displayed for the connector.
- */
-public class ConnectorLabelParser extends MessageFormatParser implements ISemanticParser {
-
- /** The String format for displaying a parameter with its type */
- private static final String TYPED_PARAMETER_FORMAT = "%s: %s";
-
- /** The String format for displaying a parameter with no type */
- private static final String UNTYPED_PARAMETER_FORMAT = "%s";
-
- public ConnectorLabelParser(EAttribute[] features, EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- public ConnectorLabelParser(EAttribute[] features) {
- super(features);
- }
-
- public ConnectorLabelParser() {
- 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;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
- EStructuralFeature feature = getEStructuralFeature(event);
- return isValidFeature(feature);
-
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- Object obj = element.getAdapter(EObject.class);
- Connector connector = (Connector)obj;
- String name = connector.getName();
- if(name == null) {
- name = " ";
- }
- if(connector.getType() != null) {
- String type = connector.getType().getName();
- if(type == null) {
- type = "";
- }
- return String.format(TYPED_PARAMETER_FORMAT, name, type);
- } else {
- return String.format(UNTYPED_PARAMETER_FORMAT, name);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- EStructuralFeature feature = getEStructuralFeature(notification);
- return isValidFeature(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<?> getSemanticElementsBeingParsed(EObject element) {
- List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- Connector connector = (Connector)element;
- semanticElementsBeingParsed.add(connector);
- if(connector.getType() != null) {
- semanticElementsBeingParsed.add(connector.getType());
- }
- 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.getConnector_Type().equals(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintLabelParser.java
deleted file mode 100644
index 44833a123bd..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintLabelParser.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.parsers;
-
-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.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.uml.diagram.common.commands.SetValueSpecificationValueCommand;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * The Class ConstraintLabelParser that manages constraint label of a constraintProperty
- */
-public class ConstraintLabelParser extends MessageFormatParser implements ISemanticParser {
-
- /** The String format for displaying a ConstraintProperty with no type */
- private static final String CONSTRAINT_LABEL__FORMAT = "{%s}";
-
- public ConstraintLabelParser(EAttribute[] features, EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- public ConstraintLabelParser(EAttribute[] features) {
- super(features);
- }
-
- public ConstraintLabelParser() {
- super(new EAttribute[]{ UMLPackage.eINSTANCE.getNamedElement_Name() });
- }
-
- /**
- * Gets the e structural feature.
- *
- * @param notification
- * the notification
- * @return the e structural feature
- */
- 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;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
- EStructuralFeature feature = getEStructuralFeature(event);
- return isValidFeature(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- String result = "";
- Object obj = element.getAdapter(EObject.class);
- if(obj instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)obj).getBase_Property();
- if(property != null) {
- // manage constraint
- if(property.getDefaultValue() != null) {
- ValueSpecification valueSpecification = property.getDefaultValue();
- String specificationValue = ValueSpecificationUtil.getSpecificationValue(valueSpecification);
- if(specificationValue != null && specificationValue.length() > 0) {
- result = String.format(CONSTRAINT_LABEL__FORMAT, specificationValue);
- }
- }
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- EStructuralFeature feature = getEStructuralFeature(notification);
- return isValidFeature(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<?> getSemanticElementsBeingParsed(EObject element) {
- List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- if(element instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)element).getBase_Property();
- if(property != null) {
- semanticElementsBeingParsed.add(property);
- if(property.getDefaultValue() != null) {
- semanticElementsBeingParsed.add(property.getDefaultValue());
- }
- }
- }
- 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.getProperty_DefaultValue().equals(feature) || UMLPackage.eINSTANCE.getProperty_DefaultValue().equals(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getEditString(IAdaptable adapter, int flags) {
- String result = "";
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- if(element instanceof ConstraintProperty) {
- element = ((ConstraintProperty)element).getBase_Property();
- if(element instanceof Property) {
- ValueSpecification defaultValue = ((Property)element).getDefaultValue();
- result = ValueSpecificationUtil.getSpecificationValue(defaultValue);
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
- Object obj = adapter.getAdapter(EObject.class);
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(obj);
-
- if(editingDomain != null && obj instanceof ConstraintProperty) {
- obj = ((ConstraintProperty)obj).getBase_Property();
- if(obj instanceof Property) {
- ValueSpecification valueSpec = ((Property)obj).getDefaultValue();
- if(valueSpec != null) {
- CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values");
- command.compose(new CommandProxy(new SetValueSpecificationValueCommand(valueSpec, newString)));
- return command;
- }
- }
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyLabelParser.java
deleted file mode 100644
index 15bf7d80d3f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyLabelParser.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.parsers;
-
-import java.text.FieldPosition;
-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.common.util.EList;
-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.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.InstanceValue;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * A specific parser for displaying a ConstraintProperty label. This parser refreshes the text
- * displayed for the ConstraintProperty.
- */
-public class ConstraintPropertyLabelParser extends MessageFormatParser implements ISemanticParser {
-
- /** The String format for displaying a ConstraintProperty with no type */
- private static final String UNTYPED_PARAMETER_FORMAT = "%s";
-
- /** The String format for displaying a ConstraintProperty with its type */
- private static final String TYPED_PARAMETER_FORMAT = "%s: %s";
-
- /** The String format for displaying a ConstraintProperty with multiplicity */
- private static final String MULTIPLICITY_PARAMETER_FORMAT = "%s [%s..%s]";
-
- /** The String format for displaying a ConstraintProperty with default value */
- private static final String DEFAULT_VALUE_PARAMETER_FORMAT = "%s= %s";
-
- /** The String format for displaying a ConstraintProperty with attribute */
- private static final String MODIFIER_PARAMETER_FORMAT = "%s{%s}";
-
- public ConstraintPropertyLabelParser(EAttribute[] features, EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- public ConstraintPropertyLabelParser(EAttribute[] features) {
- super(features);
- }
-
- public ConstraintPropertyLabelParser() {
- 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;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
- EStructuralFeature feature = getEStructuralFeature(event);
- return isValidFeature(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- String result = "";
- Object obj = element.getAdapter(EObject.class);
- Property property = null;
- if(obj instanceof ConstraintProperty) {
- property = ((ConstraintProperty)obj).getBase_Property();
- }
- if(property != null) {
- String name = property.isDerived() ? "/ " + property.getName() : property.getName();
- result = String.format(UNTYPED_PARAMETER_FORMAT, name);
- // manage type
- if(property.getType() != null) {
- String type = property.getType().getName();
- result = String.format(TYPED_PARAMETER_FORMAT, name, type);
- }
- // manage multiplicity
- if(property.getLower() != 1 || property.getUpper() != 1) {
- result = String.format(MULTIPLICITY_PARAMETER_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(property.getLowerValue()), ValueSpecificationUtil.getSpecificationValue(property.getUpperValue()));
- }
- // manage initial values
- if(property.getDefaultValue() != null) {
- ValueSpecification valueSpecification = property.getDefaultValue();
- if(valueSpecification instanceof InstanceValue && property.getType().equals(valueSpecification.getType())) {
- result = String.format(DEFAULT_VALUE_PARAMETER_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
- }
- }
- // manage modifier
- StringBuffer sb = new StringBuffer();
- if(property.isReadOnly()) {
- sb.append(sb.length() == 0 ? "readOnly" : ", readOnly");
- }
- if(property.isOrdered()) {
- sb.append(sb.length() == 0 ? "ordered" : ", ordered");
- }
- if(property.isUnique()) {
- sb.append(sb.length() == 0 ? "unique" : ", unique");
- }
- if(property.isDerivedUnion()) {
- sb.append(sb.length() == 0 ? "union" : ", union");
- }
- EList<Property> redefinedProperties = property.getRedefinedProperties();
- if(redefinedProperties != null && !redefinedProperties.isEmpty()) {
- for(Property p : redefinedProperties) {
- sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
- }
- }
- if(sb.length() != 0) {
- result = String.format(MODIFIER_PARAMETER_FORMAT, result, sb.toString());
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- EStructuralFeature feature = getEStructuralFeature(notification);
- return isValidFeature(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<?> getSemanticElementsBeingParsed(EObject element) {
- List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- Property property = null;
- if(element instanceof ConstraintProperty) {
- property = ((ConstraintProperty)element).getBase_Property();
- }
- if(property != null) {
- semanticElementsBeingParsed.add(property);
- if(property.getType() != null) {
- semanticElementsBeingParsed.add(property.getType());
- }
- if(property.getLowerValue() != null) {
- semanticElementsBeingParsed.add(property.getLowerValue());
- }
- if(property.getUpperValue() != null) {
- semanticElementsBeingParsed.add(property.getUpperValue());
- }
- if(property.getDefaultValue() != null) {
- semanticElementsBeingParsed.add(property.getDefaultValue());
- }
- }
- 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.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getInstanceValue_Instance().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature) || UMLPackage.eINSTANCE.getStructuralFeature_IsReadOnly().equals(feature) || UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerived().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerivedUnion().equals(feature) || UMLPackage.eINSTANCE.getProperty_RedefinedProperty().equals(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- if(element instanceof ConstraintProperty) {
- element = ((ConstraintProperty)element).getBase_Property();
- }
- return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getParseCommand(IAdaptable adapter, Object[] values, int flags) {
- if(values == null || validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) {
- return UnexecutableCommand.INSTANCE;
- }
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- if(element instanceof ConstraintProperty) {
- element = ((ConstraintProperty)element).getBase_Property();
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null) {
- return UnexecutableCommand.INSTANCE;
- }
- CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
- for(int i = 0; i < values.length; i++) {
- command.compose(getModificationCommand(element, editableFeatures[i], values[i]));
- }
- return command;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/PropertyLabelParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/PropertyLabelParser.java
deleted file mode 100644
index e34218f3571..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/PropertyLabelParser.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.parsers;
-
-import java.text.FieldPosition;
-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.common.util.EList;
-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.gmf.runtime.notation.Node;
-import org.eclipse.papyrus.sysml.diagram.parametric.utils.PropertyLinkedToClassifierNode;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.tools.utils.ValueSpecificationUtil;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * A specific parser for displaying an property. This parser refreshes the text displayed for the
- * Property.
- */
-public class PropertyLabelParser extends MessageFormatParser implements ISemanticParser {
-
- /** The String format for displaying a ConstraintProperty with no type */
- private static final String UNTYPED_PARAMETER_FORMAT = "%s";
-
- /** The String format for displaying a ConstraintProperty with its type */
- private static final String TYPED_PARAMETER_FORMAT = "%s: %s";
-
- /** The String format for displaying a ConstraintProperty with multiplicity */
- private static final String MULTIPLICITY_PARAMETER_FORMAT = "%s [%s..%s]";
-
- /** The String format for displaying a ConstraintProperty with default value */
- private static final String DEFAULT_VALUE_PARAMETER_FORMAT = "%s= %s";
-
- /** The String format for displaying a ConstraintProperty with attribute */
- private static final String MODIFIER_PARAMETER_FORMAT = "%s{%s}";
-
- /** Class to compute property name depth */
- PropertyLinkedToClassifierNode propertyLinkedToClassifier;
-
- /** The classifier, container view of the property */
- private Classifier classifier;
-
- public PropertyLabelParser(EAttribute[] features, EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- public PropertyLabelParser(EAttribute[] features) {
- super(features);
- }
-
- public PropertyLabelParser() {
- 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;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
- EStructuralFeature feature = getEStructuralFeature(event);
- return isValidFeature(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- String result = "";
- Property property = null;
- Object adapter = element.getAdapter(EObject.class);
- if(adapter instanceof Property) {
- property = (Property)adapter;
- String name = property.isDerived() ? "/ " + property.getName() : property.getName();
- result = String.format(UNTYPED_PARAMETER_FORMAT, name);
- // Perform property depth to set the name
- for(Object obj : DiagramEditPartsUtil.getEObjectViews(property)) {
- if(obj instanceof Node && classifier != null) {
- propertyLinkedToClassifier = new PropertyLinkedToClassifierNode(classifier, property, (Node)obj);
- propertyLinkedToClassifier.refresh();
- name = propertyLinkedToClassifier.getName();
- result = String.format(UNTYPED_PARAMETER_FORMAT, name);
- }
- }
- // manage type
- if(property.getType() != null) {
- String type = property.getType().getName();
- result = String.format(TYPED_PARAMETER_FORMAT, name, type);
- }
- // manage multiplicity
- if(property.getLower() != 1 || property.getUpper() != 1) {
- result = String.format(MULTIPLICITY_PARAMETER_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(property.getLowerValue()), ValueSpecificationUtil.getSpecificationValue(property.getUpperValue()));
- }
- // manage initial values
- if(property.getDefaultValue() != null) {
- ValueSpecification valueSpecification = property.getDefaultValue();
- String specificationValue = ValueSpecificationUtil.getSpecificationValue(valueSpecification);
- if(specificationValue != null && specificationValue.length() > 0) {
- result = String.format(DEFAULT_VALUE_PARAMETER_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
- }
- }
- // manage modifier
- StringBuffer sb = new StringBuffer();
- if(property.isReadOnly()) {
- sb.append(sb.length() == 0 ? "readOnly" : ", readOnly");
- }
- if(property.isOrdered()) {
- sb.append(sb.length() == 0 ? "ordered" : ", ordered");
- }
- if(property.isUnique()) {
- sb.append(sb.length() == 0 ? "unique" : ", unique");
- }
- if(property.isDerivedUnion()) {
- sb.append(sb.length() == 0 ? "union" : ", union");
- }
- EList<Property> redefinedProperties = property.getRedefinedProperties();
- if(redefinedProperties != null && !redefinedProperties.isEmpty()) {
- for(Property p : redefinedProperties) {
- sb.append(sb.length() == 0 ? p.getName() : ", redefines " + p.getName());
- }
- }
- if(sb.length() != 0) {
- result = String.format(MODIFIER_PARAMETER_FORMAT, result, sb.toString());
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- EStructuralFeature feature = getEStructuralFeature(notification);
- return isValidFeature(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<?> getSemanticElementsBeingParsed(EObject element) {
- List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- Property property = null;
- if(element instanceof Property) {
- property = (Property)element;
- semanticElementsBeingParsed.add(property);
- if(property.getType() != null) {
- semanticElementsBeingParsed.add(property.getType());
- }
- if(property.getLowerValue() != null) {
- semanticElementsBeingParsed.add(property.getLowerValue());
- }
- if(property.getUpperValue() != null) {
- semanticElementsBeingParsed.add(property.getUpperValue());
- }
- if(property.getDefaultValue() != null) {
- semanticElementsBeingParsed.add(property.getDefaultValue());
- }
- }
- 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.getTypedElement_Type().equals(feature) || UMLPackage.eINSTANCE.getConnector_Type().equals(feature) || UMLPackage.eINSTANCE.getInstanceValue_Instance().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature) || UMLPackage.eINSTANCE.getStructuralFeature_IsReadOnly().equals(feature) || UMLPackage.eINSTANCE.getFeature_IsStatic().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerived().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerivedUnion().equals(feature) || UMLPackage.eINSTANCE.getProperty_RedefinedProperty().equals(feature);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * Sets the block that is linked to the current property
- *
- * @param element
- */
- public void setBlock(EObject element) {
- if(element instanceof Classifier) {
- this.classifier = (Classifier)element;
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/CustomEditPolicyProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/CustomEditPolicyProvider.java
deleted file mode 100644
index 51741170d2a..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/CustomEditPolicyProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.HyperLinkPopupBarEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.NavigationEditPolicy;
-
-/**
- * this is an editpolicy provider in charge to install navigation policies
- *
- * @author Patrick Tessier
- */
-public class CustomEditPolicyProvider implements IEditPolicyProvider {
-
- /**
- *
- * {@inheritDoc}
- */
- public void addProviderChangeListener(IProviderChangeListener listener) {
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void createEditPolicies(EditPart editPart) {
- editPart.installEditPolicy(NavigationEditPolicy.NAVIGATION_POLICY, new NavigationEditPolicy());
- if( editPart instanceof IPrimaryEditPart){
- editPart.installEditPolicy(EditPolicyRoles.POPUPBAR_ROLE, new HyperLinkPopupBarEditPolicy());
- }
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
- if(!(epOperation.getEditPart() instanceof GraphicalEditPart)) {
- return false;
- }
- GraphicalEditPart gep = (GraphicalEditPart)epOperation.getEditPart();
- String diagramType = gep.getNotationView().getDiagram().getType();
- if(ParametricEditPart.MODEL_ID.equals(diagramType)) {
- return true;
- }
-
-
- return false;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void removeProviderChangeListener(IProviderChangeListener listener) {
-
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ParametricDiagramContributionItemProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ParametricDiagramContributionItemProvider.java
deleted file mode 100644
index 08146a8e960..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ParametricDiagramContributionItemProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.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.sysml.diagram.parametric.actions.RestoreRelatedLinksAction;
-
-
-/**
- * The Class uses to contribute item for specific actions
- */
-public class ParametricDiagramContributionItemProvider 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ParametricDiagramContributionPolicyClass.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ParametricDiagramContributionPolicyClass.java
deleted file mode 100644
index 9cb16bc8659..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ParametricDiagramContributionPolicyClass.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.IPopupMenuContributionPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Reduce the scope of the Menu contribution of the Parametric Diagram.
- * implements {@link IPopupMenuContributionPolicy}
- *
- * @author arthur daussy
- */
-public class ParametricDiagramContributionPolicyClass implements IPopupMenuContributionPolicy {
-
- public boolean appliesTo(ISelection selection, IConfigurationElement configuration) {
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editorPart instanceof IMultiDiagramEditor) {
- editorPart = ((IMultiDiagramEditor)editorPart).getActiveEditor();
- if(editorPart instanceof DiagramEditor) {
- DiagramEditPart host = ((DiagramEditor)editorPart).getDiagramEditPart();
- return ParametricEditPart.MODEL_ID.equals(host.getDiagramView().getType());
- }
- }
- return false;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/texteditor/ConstraintPropertyConfiguration.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/texteditor/ConstraintPropertyConfiguration.java
deleted file mode 100644
index 34897634f7e..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/texteditor/ConstraintPropertyConfiguration.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.texteditor;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.DefaultDirectEditorConfiguration;
-import org.eclipse.papyrus.parsers.modelgenerator.PropertyGenerator;
-import org.eclipse.papyrus.parsers.texteditor.CompletionFilterSourceViewerConfiguration.ICompletionFilter;
-import org.eclipse.papyrus.parsers.texteditor.propertylabel.IContext;
-import org.eclipse.papyrus.parsers.texteditor.propertylabel.PropertyConfigurationForUML;
-import org.eclipse.papyrus.parsers.texteditor.propertylabel.PropertyLabelSourceViewerConfiguration;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Configuration Class for the direct edition of a SysML constraint property
- */
-public class ConstraintPropertyConfiguration extends DefaultDirectEditorConfiguration {
-
- /** configuration of the source viewer */
- final private PropertyLabelSourceViewerConfiguration configuration;
-
- /**
- * Creates a new PropertyConfiguration to filter values.
- */
- public ConstraintPropertyConfiguration() {
- configuration = new PropertyLabelSourceViewerConfiguration(new ICompletionFilter() {
-
- public boolean filter(int context, EObject e) {
- switch(context) {
- case IContext.AFTER_COLON:
- if(e instanceof Element) {
- if(((Element)e).getAppliedStereotype("SysML::Constraints::ConstraintBlock") != null) {
- return false;
- }
- }
-
- return true;
- default:
- return false;
- }
- }
- });
- }
-
- /**
- * {@inheritDoc}
- */
- public SourceViewerConfiguration getSourceViewerConfiguration() {
- return configuration;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getTextToEdit(Object editedObject) {
- if(editedObject instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)editedObject).getBase_Property();
- return PropertyUtil.getLabel(property);
- }
- return "not a Constraint Property";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Object preEditAction(Object objectToEdit) {
- if(objectToEdit instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)objectToEdit).getBase_Property();
- configuration.setProperty(property);
- }
- return super.preEditAction(objectToEdit);
- }
-
- /**
- * {@inheritDoc}
- */
- public Object postEditAction(Object editedObject, String text) {
- if(editedObject instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)editedObject).getBase_Property();
- PropertyGenerator generator = new PropertyGenerator(property);
- generator.parseAndModifyProperty(text);
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IInputValidator getInputValidator() {
- return new IInputValidator() {
-
- public String isValid(String newText) {
- if(getObjectToEdit() instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)getObjectToEdit()).getBase_Property();
- PropertyGenerator generator = new PropertyGenerator(property);
- return generator.parseAndValidateProperty(newText);
- }
- return null;
- }
- };
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Selection getTextSelection(String value, Object editedObject) {
- if(editedObject instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)editedObject).getBase_Property();
- return new PropertyConfigurationForUML().getTextSelection(value, property);
- }
- return super.getTextSelection(value, editedObject);
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/PropertyLinkedToClassifier.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/PropertyLinkedToClassifier.java
deleted file mode 100644
index 828f7799dc1..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/PropertyLinkedToClassifier.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*****************************************************************************
- * 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:
- * Thibault Landre (Atos Origin) thibault.landre@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.utils;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * PropertyLinkedToClassifier checks if a specified property is linked to a classifier
- */
-public class PropertyLinkedToClassifier {
-
- /** The classifier. */
- private final Classifier classifier;
-
- /** The property. */
- private final Property property;
-
- /** The list routes. */
- private List<Route> routes;
-
- /**
- * Instantiates a new property linked to classifier.
- *
- * @param classifier
- * @param property
- */
- public PropertyLinkedToClassifier(Classifier classifier, Property property) {
- this.classifier = classifier;
- this.property = property;
- this.routes = new LinkedList<Route>();
- refresh();
- }
-
- /**
- * Checks if the property is linked to classifier.
- *
- * @return true, if is linked to classifier
- */
- public boolean isLinkedToClassifier() {
- return !routes.isEmpty();
- }
-
- /**
- * Checks if the property is linked to classifier with a multi-level path of accessible property from the classifier
- *
- * @return true, if is linked to classifier with a multi-level path
- */
- public boolean isLinkedWithMultiLevelPath() {
- boolean result = false;
- if(!routes.isEmpty()) {
- for(Route r : routes) {
- result |= r.getRouteDepth() > 1;
- }
- }
- return result;
- }
-
- /**
- * Gets the available routes.
- *
- * @return the available routes
- */
- public List<Route> getAvailableRoutes() {
- return routes;
- }
-
- /**
- * Gets the property.
- *
- * @return the property
- */
- protected Property getProperty() {
- return property;
- }
-
- /**
- * Gets the number available route.
- *
- * @return the number available route
- */
- public int getNumberAvailableRoute() {
- return routes.size();
- }
-
- /**
- * Refresh link to classifier.
- *
- * @param classifierParent
- * @param propertyToFind
- * @param route
- */
- private void refreshLinkToClassifier(Classifier classifierParent, final Property propertyToFind, final Route route) {
- EList<Property> classifierParentAttributes = classifierParent.getAllAttributes();
- // If the property is contained by the classifier
- if(classifierParentAttributes.contains(propertyToFind)) {
- route.addSegment(propertyToFind);
- routes.add(route);
- } else {
- for(Property attribute : classifierParentAttributes) {
- if(!(attribute instanceof Port)) {
- Type attributeType = attribute.getType();
- // stop loop
- if(route.getProperties().contains(attribute)) {
- // Launch a warning ? an error ?
- break;
- }
- if(attributeType instanceof Classifier) {
- Route newRoute = new Route(new LinkedList<Property>(route.getProperties()));
- newRoute.addSegment(attribute);
- refreshLinkToClassifier((Classifier)attributeType, propertyToFind, newRoute);
- }
- }
- }
- }
- }
-
- /**
- * Checks for several routes.
- *
- * @return true, if successful
- */
- public boolean hasSeveralRoutes() {
- return routes.size() > 1;
- }
-
- /**
- * Refresh.
- */
- public void refresh() {
- routes.clear();
- refreshLinkToClassifier(classifier, property, new Route());
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/PropertyLinkedToClassifierNode.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/PropertyLinkedToClassifierNode.java
deleted file mode 100644
index e9186398bdc..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/PropertyLinkedToClassifierNode.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*****************************************************************************
- * 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:
- * Thibault Landre (Atos Origin) thibault.landre@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.utils;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CreateOrSelectElementCommand.LabelProvider;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Property;
-
-public class PropertyLinkedToClassifierNode extends PropertyLinkedToClassifier {
-
- public static final String PROPERTY_ROUTE_URL_SOURCE = "http://www.eclipse.org/papyrus/propertyRoute";
-
- public static final String SELECTED_ROUTE_KEY = "selectedRoute";
-
- private Node graphNode;
-
- public PropertyLinkedToClassifierNode(Classifier classifier, Property property, Node graphNode) {
- super(classifier, property);
- this.graphNode = graphNode;
- }
-
- /**
- *
- * @return
- */
- public String getName() {
- String lName = "";
- if(getAvailableRoutes().isEmpty()) {
- lName = getProperty().getName();
- } else if(!hasSeveralRoutes()) {
- lName = getAvailableRoutes().get(0).getName();
- } else {
- lName = getSelectedRoute();
- }
- return lName;
- }
-
- private String getSelectedRoute() {
- String result = "";
- if("".equals(getRootingProperty(graphNode))) {
- LinkedList<Route> filteredAvailableRoute = filterAvailableRoute(getAvailableRoutes());
- if(filteredAvailableRoute.size() == 1) {
- result = filteredAvailableRoute.getFirst().getName();
- } else if(!filteredAvailableRoute.isEmpty()) {
- // doesn't display dialog box, only get the first route
- //result = getUserSelectionRoute(filteredAvailableRoute);
- result = filteredAvailableRoute.getFirst().getName();
- }
- } else {
- String oldRouteSelectedValue = getRootingProperty(graphNode);
- Map<String, Route> routeNameAndRoute = getRouteNameAndRoute(getAvailableRoutes());
- if(routeNameAndRoute.containsKey(oldRouteSelectedValue)) {
- result = oldRouteSelectedValue;
- } else {
- result = calculateNewRoute(oldRouteSelectedValue);
- }
- }
- return result;
- }
-
- private String getUserSelectionRoute(LinkedList<Route> filteredAvailableRoute) {
- IWorkbench workBench = SysmlDiagramEditorPlugin.getInstance().getWorkbench();
- Shell shell = workBench.getActiveWorkbenchWindow().getShell();
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new LabelProvider() {
-
- @Override
- public String getText(Object element) {
- if(element instanceof Route) {
- return ((Route)element).getName();
- }
- return super.getText(element);
- }
- });
- dialog.setTitle("Routing selection");
- dialog.setMessage("Select the route of the property (* = any string, ? = any char):");
- dialog.setElements(filteredAvailableRoute.toArray());
- dialog.setHelpAvailable(false);
- dialog.setMultipleSelection(false);
- dialog.open();
-
- String result = "";
- if(dialog.getResult() != null) {
- result = ((Route)dialog.getFirstResult()).getName();
- } else {
- result = filteredAvailableRoute.getFirst().getName();
- }
- return result;
- }
-
- /**
- * Filter the available route for accessing a property. Remove from the list the property that
- * are already displayed in the diagram.
- *
- * @param availableRoutes
- * the availableRoutes for this property
- * @return the availableRoutes for this property that are not already displayed in the diagram
- */
- private LinkedList<Route> filterAvailableRoute(List<Route> availableRoutes) {
- Map<String, Route> routeNameAndRoute = getRouteNameAndRoute(availableRoutes);
- for(Object view : DiagramEditPartsUtil.getEObjectViews(getProperty())) {
- if(view instanceof Node) {
- String routeNamedSaved = getRootingProperty((Node)view);
- if(routeNameAndRoute.containsKey(routeNamedSaved)) {
- routeNameAndRoute.remove(routeNamedSaved);
- }
- }
- }
- return new LinkedList<Route>(routeNameAndRoute.values());
- }
-
- /**
- * Return a map containing the routes and their associated names from a list of routes
- *
- * @param routes
- * the list of routes
- * @return the map with key the route, and value the name of the route.
- */
- private Map<String, Route> getRouteNameAndRoute(List<Route> routes) {
- Map<String, Route> routeAndName = new HashMap<String, Route>();
- for(Route route : routes) {
- routeAndName.put(route.getName(), route);
- }
- return routeAndName;
- }
-
- private String calculateNewRoute(String oldRouteSelectedValue) {
- List<String> availableSpecificRoute = new LinkedList<String>();
- // If the length of the availableRoutes is bigger than the length of the old route, it means
- // that the property
- // is dragged/dropped to a parent container of its current container
- if(getAvailableRoutes().get(0).getName().length() > oldRouteSelectedValue.length()) {
- for(Route route : getAvailableRoutes()) {
-
- if(route.getName().indexOf(oldRouteSelectedValue) > 0) {
- availableSpecificRoute.add(route.getName());
- }
- }
- // If a unique route is present in the list, it means that there is only a route
- // possible
- if(availableSpecificRoute.size() == 1) {
- return availableSpecificRoute.get(0);
- } else {
- // Otherwise it means there is several routes possible. We need to check the name of
- // the
- // container
- }
- }
- // Otherwise the element is dragged/dropped to a child container of its current container
- else {
- for(Route route : getAvailableRoutes()) {
- if(oldRouteSelectedValue.indexOf(route.getName()) > 0) {
- availableSpecificRoute.add(route.getName());
- }
- }
- if(availableSpecificRoute.size() == 1) {
- return availableSpecificRoute.get(0);
- }
- }
- return "";
- }
-
- /**
- * Creates the rooting property into an eAnnotation
- *
- * @param node
- * @param name
- */
- public void createRootingProperty(Node node, String name) {
- if("".equals(getRootingProperty(node))) {
- EAnnotation annotation = EcoreFactory.eINSTANCE.createEAnnotation();
- annotation.setSource(PROPERTY_ROUTE_URL_SOURCE);
- node.getEAnnotations().add(annotation);
-
- annotation.getDetails().put(SELECTED_ROUTE_KEY, name);
- }
- }
-
- /**
- * Checks if the specified name is an existing route.
- *
- * @param name
- * @return true if it is an existing route
- */
- public boolean isExistingRoute(String name) {
- boolean result = false;
- for(Route r : getAvailableRoutes()) {
- result |= r.getName().equals(name);
- }
- return result;
- }
-
- /**
- * Gets the rooting property.
- *
- * @param node
- * the node
- * @param key
- * the key
- * @return the rooting property
- */
- private String getRootingProperty(Node node) {
- String value = "";
- EAnnotation eAnnotation = node.getEAnnotation(PROPERTY_ROUTE_URL_SOURCE);
- if(eAnnotation != null) {
- value = eAnnotation.getDetails().get(SELECTED_ROUTE_KEY);
- }
- return value;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/Route.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/Route.java
deleted file mode 100644
index 612b4358fcd..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/utils/Route.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*****************************************************************************
- * 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:
- * Thibault Landre (Atos Origin) thibault.landre@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.utils;
-
-import java.util.LinkedList;
-
-import org.eclipse.uml2.uml.Property;
-
-/**
- * A class to described a route to access a property from a classifier. This class contains an
- * ordered list of the property contained in the route and a string representing the name of the
- * route.
- */
-public class Route {
-
- /** The properties list. */
- private LinkedList<Property> propertyList;
-
- /** The name of the route */
- private String name;
-
- /**
- * Instantiates a new route.
- */
- public Route() {
- this(new LinkedList<Property>());
- }
-
- /**
- * Instantiates a new route.
- *
- * @param propertyList
- */
- public Route(LinkedList<Property> propertyList) {
- assert propertyList != null;
- this.propertyList = propertyList;
- this.name = "";
- }
-
- /**
- * Adds a property to the list
- *
- * @param property
- */
- protected void addSegment(Property property) {
- propertyList.add(property);
- }
-
- /**
- * Calculate the name of the route. The name is composed of the name of each property which
- * makes up the route separated by coma.
- */
- private void calculateName() {
- name = "";
- for(Property property : propertyList) {
- if(name.length() == 0) {
- name = property.getName();
- } else {
- name = name + "." + property.getName();
- }
- }
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- calculateName();
- return name;
- }
-
- /**
- * Gets the properties.
- *
- * @return the properties
- */
- public LinkedList<Property> getProperties() {
- return propertyList;
- }
-
- /**
- * Gets the route depth.
- *
- * @return the route depth
- */
- public int getRouteDepth() {
- return propertyList.size();
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/incomingLinksNavigatorGroup.gif b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/incomingLinksNavigatorGroup.gif
index fca9c53e629..57f02b6f37a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/incomingLinksNavigatorGroup.gif
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/incomingLinksNavigatorGroup.gif
Binary files differ
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkSourceNavigatorGroup.gif b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkSourceNavigatorGroup.gif
index fca9c53e629..57f02b6f37a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkSourceNavigatorGroup.gif
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkSourceNavigatorGroup.gif
Binary files differ
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkTargetNavigatorGroup.gif b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkTargetNavigatorGroup.gif
index fca9c53e629..57f02b6f37a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkTargetNavigatorGroup.gif
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linkTargetNavigatorGroup.gif
Binary files differ
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linksNavigatorGroup.gif b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linksNavigatorGroup.gif
index fca9c53e629..57f02b6f37a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linksNavigatorGroup.gif
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/linksNavigatorGroup.gif
Binary files differ
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.gif b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.gif
index 97e8dd3c896..04d0854757f 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.gif
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/Diagram_Parametric.gif
Binary files differ
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/ResourceDiagramFile.gif b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/ResourceDiagramFile.gif
index 135bfefa2e3..937bd1f5657 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/ResourceDiagramFile.gif
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/obj16/ResourceDiagramFile.gif
Binary files differ
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/outgoingLinksNavigatorGroup.gif b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/outgoingLinksNavigatorGroup.gif
index fca9c53e629..57f02b6f37a 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/outgoingLinksNavigatorGroup.gif
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/icons/outgoingLinksNavigatorGroup.gif
Binary files differ
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/messages.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/messages.properties
deleted file mode 100644
index d0e32569e99..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/messages.properties
+++ /dev/null
@@ -1,133 +0,0 @@
-#/*****************************************************************************
-# * 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:
-# * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
-# *
-# *****************************************************************************/
-# TODO: manually put keys and values
-SysMLCreationWizardTitle=New SysML Diagram
-SysMLCreationWizard_DiagramModelFilePageTitle=Create SysML Diagram
-SysMLCreationWizard_DiagramModelFilePageDescription=Select file that will contain diagram model.
-SysMLCreationWizard_DomainModelFilePageTitle=Create SysML Domain Model
-SysMLCreationWizard_DomainModelFilePageDescription=Select file that will contain domain model.
-SysMLCreationWizardOpenEditorError=Error opening diagram editor
-SysMLCreationWizardCreationError=Creation Problems
-SysMLCreationWizardPageExtensionError=File name should have {0} extension.
-SysMLDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
-SysMLDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
-SysMLDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
-SysMLDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
-SysMLDocumentProvider_isModifiable=Updating cache failed
-SysMLDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
-SysMLDocumentProvider_IncorrectInputError={1}
-SysMLDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
-SysMLDocumentProvider_DiagramLoadingError=Error loading diagram
-SysMLDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
-SysMLDocumentProvider_SaveDiagramTask=Saving diagram
-SysMLDocumentProvider_SaveNextResourceTask=Saving {0}
-SysMLDocumentProvider_SaveAsOperation=Saving {0} diagram as
-InitDiagramFile_ResourceErrorDialogTitle=Error
-InitDiagramFile_ResourceErrorDialogMessage=Model file loading failed
-InitDiagramFile_WizardTitle=Initialize new {0} diagram file
-InitDiagramFile_OpenModelFileDialogTitle=Select domain model
-SysMLNewDiagramFileWizard_CreationPageName=Initialize new diagram file
-SysMLNewDiagramFileWizard_CreationPageTitle=Diagram file
-SysMLNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
-SysMLNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
-SysMLNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
-SysMLNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
-SysMLNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
-SysMLNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
-SysMLNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
-SysMLNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
-SysMLNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
-SysMLDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
-SysMLDiagramEditor_SaveAsErrorTitle=Problem During Save As...
-SysMLDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
-SysMLDiagramEditor_SaveErrorTitle=Save Problems
-SysMLDiagramEditor_SaveErrorMessage=Could not save file.
-SysMLElementChooserDialog_SelectModelElementTitle=Select model element
-ModelElementSelectionPageMessage=Select model element:
-ValidateActionMessage=Validate
-Sysml1Group_title=sysml
-ConstraintBlock1CreationTool_title=ConstraintBlock
-ConstraintBlock1CreationTool_desc=Create new ConstraintBlock
-ConstraintProperty2CreationTool_title=ConstraintProperty
-ConstraintProperty2CreationTool_desc=Create new ConstraintProperty
-
-CommandName_OpenDiagram=Open Diagram
-NavigatorActionProvider_OpenDiagramActionName=Open Diagram
-SysMLModelingAssistantProviderTitle=Select domain model element
-SysMLModelingAssistantProviderMessage=Available domain model elements:
-SysmlCreationWizardTitle=New Parametric Diagram
-SysmlCreationWizard_DiagramModelFilePageTitle=Create Parametric Diagram
-SysmlCreationWizard_DiagramModelFilePageDescription=Select file that will contain diagram model.
-SysmlCreationWizard_DomainModelFilePageTitle=Create Parametric Domain Model
-SysmlCreationWizard_DomainModelFilePageDescription=Select file that will contain domain model.
-SysmlCreationWizardOpenEditorError=Error opening diagram editor
-SysmlCreationWizardCreationError=Creation Problems
-SysmlCreationWizardPageExtensionError=File name should have {0} extension.
-SysmlDiagramEditorUtil_OpenModelResourceErrorDialogTitle=Error
-SysmlDiagramEditorUtil_OpenModelResourceErrorDialogMessage=Failed to load model file {0}
-SysmlDiagramEditorUtil_CreateDiagramProgressTask=Creating diagram and model files
-SysmlDiagramEditorUtil_CreateDiagramCommandLabel=Creating diagram and model
-SysmlDocumentProvider_isModifiable=Updating cache failed
-SysmlDocumentProvider_handleElementContentChanged=Failed to refresh hierarchy for changed resource
-SysmlDocumentProvider_IncorrectInputError={1}
-SysmlDocumentProvider_NoDiagramInResourceError=Diagram is not present in resource
-SysmlDocumentProvider_DiagramLoadingError=Error loading diagram
-SysmlDocumentProvider_UnsynchronizedFileSaveError=The file has been changed on the file system
-SysmlDocumentProvider_SaveDiagramTask=Saving diagram
-SysmlDocumentProvider_SaveNextResourceTask=Saving {0}
-SysmlDocumentProvider_SaveAsOperation=Saving {0} diagram as
-SysmlNewDiagramFileWizard_CreationPageName=Initialize new diagram file
-SysmlNewDiagramFileWizard_CreationPageTitle=Diagram file
-SysmlNewDiagramFileWizard_CreationPageDescription=Create new diagram based on {0} model content
-SysmlNewDiagramFileWizard_RootSelectionPageName=Select diagram root element
-SysmlNewDiagramFileWizard_RootSelectionPageTitle=Diagram root element
-SysmlNewDiagramFileWizard_RootSelectionPageDescription=Select semantic model element to be depicted on diagram
-SysmlNewDiagramFileWizard_RootSelectionPageSelectionTitle=Select diagram root element:
-SysmlNewDiagramFileWizard_RootSelectionPageNoSelectionMessage=Diagram root element is not selected
-SysmlNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage=Invalid diagram root element is selected
-SysmlNewDiagramFileWizard_InitDiagramCommand=Initializing diagram contents
-SysmlNewDiagramFileWizard_IncorrectRootError=Incorrect model object stored as a root resource object
-SysmlDiagramEditor_SavingDeletedFile=The original file "{0}" has been deleted.
-SysmlDiagramEditor_SaveAsErrorTitle=Problem During Save As...
-SysmlDiagramEditor_SaveAsErrorMessage=Save could not be completed. Target file is already open in another editor.
-SysmlDiagramEditor_SaveErrorTitle=Save Problems
-SysmlDiagramEditor_SaveErrorMessage=Could not save file.
-SysmlElementChooserDialog_SelectModelElementTitle=Select model element
-SysmlModelingAssistantProviderTitle=Select domain model element
-SysmlModelingAssistantProviderMessage=Available domain model elements:
-ConstraintProperty1CreationTool_title=ConstraintProperty
-ConstraintProperty1CreationTool_desc=Create new ConstraintProperty
-Property2CreationTool_title=Property
-Property2CreationTool_desc=Create new Property
-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}
-Parametric1Group_title=Parametric
-Connector3CreationTool_title=Connector
-Connector3CreationTool_desc=Create new Connector
-NavigatorGroupName_Resource_1000_links=links
-NavigatorGroupName_Property_2005_incominglinks=incoming links
-NavigatorGroupName_Property_2005_outgoinglinks=outgoing links
-NavigatorGroupName_Property_3002_incominglinks=incoming links
-NavigatorGroupName_Property_3002_outgoinglinks=outgoing links
-NavigatorGroupName_Connector_4001_target=target
-NavigatorGroupName_Connector_4001_source=source
-createParametric1Group_title=Parametric
-createConstraintProperty1CreationTool_title=ConstraintProperty
-createConstraintProperty1CreationTool_desc=Create new ConstraintProperty
-createProperty2CreationTool_title=Property
-createProperty2CreationTool_desc=Create new Property
-createConnector3CreationTool_title=Connector
-createConnector3CreationTool_desc=Create new Connector
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen
deleted file mode 100644
index 274361ddef2..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen
+++ /dev/null
@@ -1,559 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel"
- xmlns:papyrusgmfgenextension="http://www.eclipse.org/papyrus/2009/papyrusgmfgenextension">
- <gmfgen:GenEditorGenerator
- packageNamePrefix="org.eclipse.papyrus.sysml.diagram.parametric"
- modelID="Parametric"
- dynamicTemplates="true"
- templateDirectory="/org.eclipse.papyrus.def/dynamic-templates3.5/codegen">
- <audits>
- <categories
- id="org.eclipse.uml2.uml.util.UMLValidator.validate"
- name="validateSysMLModel"
- description="Validate the SysML model"
- path="/0/@audits/@categories.0"/>
- <categories
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement"
- name="validateConnectorElement"
- description="validate a connector checking that its children are consistent"
- path="/0/@audits/@categories.0 /0/@audits/@categories.1"
- audits="/0/@audits/@rules.0 /0/@audits/@rules.1 /0/@audits/@rules.2 /0/@audits/@rules.3"/>
- <rules
- name="validateConnector"
- description="The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateConnector"
- rule="/0/@expressionProviders/@providers.0/@expressions.0"
- message="NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector."
- severity="WARNING"
- 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/Connector"/>
- </target>
- </rules>
- <rules
- name="validateProperty"
- description="When you move a property, check that its incoming or outgoings connector get consistent connectorEnd"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateProperty"
- rule="/0/@expressionProviders/@providers.0/@expressions.1"
- message="NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector."
- severity="WARNING"
- 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/Property"/>
- </target>
- </rules>
- <rules
- name="validateConnectorEnd"
- description="The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateConnectorEnd"
- rule="/0/@expressionProviders/@providers.0/@expressions.2"
- message="NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector."
- severity="WARNING"
- 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/ConnectorEnd"/>
- </target>
- </rules>
- <rules
- name="validateNestedConnectorEnd"
- description="The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateNestedConnectorEnd"
- rule="/0/@expressionProviders/@providers.0/@expressions.3"
- message="NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector."
- severity="WARNING"
- useInLiveMode="true"
- category="/0/@audits/@categories.1">
- <target
- xsi:type="gmfgen:GenDomainElementTarget"
- contextSelector="/0/@audits/@clientContexts.0">
- <element
- href="../../org.eclipse.papyrus.sysml/model/sysml.genmodel#//sysml/blocks/NestedConnectorEnd"/>
- </target>
- </rules>
- <clientContexts
- ruleTargets="/0/@audits/@rules.0/@target /0/@audits/@rules.1/@target /0/@audits/@rules.2/@target /0/@audits/@rules.3/@target"/>
- </audits>
- <diagram
- visualID="1000"
- editPartClassName="ParametricEditPart"
- itemSemanticEditPolicyClassName="ParametricItemSemanticEditPolicy"
- canonicalEditPolicyClassName="ParametricCanonicalEditPolicy"
- iconProviderPriority="Low"
- validationProviderPriority="Low">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ResourceEditHelper"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.draw2d.FreeformLayer"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="EditPolicyRoles.DRAG_DROP_ROLE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.CustomDiagramDragDropEditPolicy"/>
- <domainDiagramElement
- href="../../../plugin/org.eclipse.papyrus.infra.core.resource/model/resource.genmodel#//resource/Resource"/>
- <childNodes
- xsi:type="gmfgen:GenChildSideAffixedNode"
- visualID="3002"
- editPartClassName="Property2EditPart"
- itemSemanticEditPolicyClassName="Property2ItemSemanticEditPolicy"
- notationViewFactoryClassName="PropertyViewFactory"
- canonicalEditPolicyClassName="Property2CanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="Property2GraphicalNodeEditPolicy"
- createCommandClassName="Property2CreateCommand"
- containers="/0/@diagram/@topLevelNodes.0">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="PropertyEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="ParameterDescriptor"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ParameterDescriptor extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ParameterDescriptor() {&#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;}&#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"/>
- </viewmap>
- <behaviour
- xsi:type="gmfgen:OpenDiagramBehaviour"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="RequestConstants.REQ_DELETE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromDiagramEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="RequestConstants.REQ_SEMANTIC_WRAPPER"
- editPolicyQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromModelEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Property"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedAttribute"/>
- <childMetaFeature
- href="../../org.eclipse.papyrus.sysml/model/sysml.genmodel#//sysml/constraints/ConstraintProperty/base_Property"/>
- </modelFacet>
- <labels
- xsi:type="gmfgen:GenExternalNodeLabel"
- visualID="5003"
- editPartClassName="PropertyName2EditPart"
- itemSemanticEditPolicyClassName="PropertyName2ItemSemanticEditPolicy"
- notationViewFactoryClassName="PropertyNameViewFactory">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:FigureViewmap"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="RequestConstants.REQ_DELETE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromDiagramEditPolicy"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="RequestConstants.REQ_SEMANTIC_WRAPPER"
- editPolicyQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromModelEditPolicy"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.1">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </childNodes>
- <topLevelNodes
- visualID="2003"
- editPartClassName="ConstraintPropertyEditPart"
- itemSemanticEditPolicyClassName="ConstraintPropertyItemSemanticEditPolicy"
- notationViewFactoryClassName="ConstraintPropertyViewFactory"
- canonicalEditPolicyClassName="ConstraintPropertyCanonicalEditPolicy"
- childNodes="/0/@diagram/@childNodes.0"
- graphicalNodeEditPolicyClassName="ConstraintPropertyGraphicalNodeEditPolicy"
- createCommandClassName="ConstraintPropertyCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ConstraintPropertyEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="ConstraintPropertyFigureDescriptor"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ConstraintPropertyFigureDescriptor extends org.eclipse.draw2d.RoundedRectangle {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel fConstraintPropertyFigureLabel; &#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fConstraintLabel; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ConstraintPropertyFigureDescriptor() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.draw2d.GridLayout layoutThis = new org.eclipse.draw2d.GridLayout();&#xA;&#x9;layoutThis.numColumns = 1;&#xA;&#x9;layoutThis.makeColumnsEqualWidth = true;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(25)&#xA;, getMapMode().DPtoLP(25)&#xA;));&#xA;this.setLineWidth(1);&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(200)&#xA;, getMapMode().DPtoLP(120)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fConstraintPropertyFigureLabel = new org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel();&#xA;&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFConstraintPropertyFigureLabel = new org.eclipse.draw2d.GridData();&#xA;constraintFConstraintPropertyFigureLabel.verticalAlignment = org.eclipse.draw2d.GridData.END;&#xA;constraintFConstraintPropertyFigureLabel.horizontalAlignment = org.eclipse.draw2d.GridData.CENTER;&#xA;constraintFConstraintPropertyFigureLabel.horizontalIndent = 0;&#xA;constraintFConstraintPropertyFigureLabel.horizontalSpan = 1;&#xA;constraintFConstraintPropertyFigureLabel.verticalSpan = 1;&#xA;constraintFConstraintPropertyFigureLabel.grabExcessHorizontalSpace = true;&#xA;constraintFConstraintPropertyFigureLabel.grabExcessVerticalSpace = true;&#xA;this.add(fConstraintPropertyFigureLabel, constraintFConstraintPropertyFigureLabel);&#xA;&#xA;&#xA;&#xA;&#xA;fConstraintLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;&#xA;&#xA;&#xA;&#xA;org.eclipse.draw2d.GridData constraintFConstraintLabel = new org.eclipse.draw2d.GridData();&#xA;constraintFConstraintLabel.verticalAlignment = org.eclipse.draw2d.GridData.BEGINNING;&#xA;constraintFConstraintLabel.horizontalAlignment = org.eclipse.draw2d.GridData.END;&#xA;constraintFConstraintLabel.horizontalIndent = 0;&#xA;constraintFConstraintLabel.horizontalSpan = 1;&#xA;constraintFConstraintLabel.verticalSpan = 1;&#xA;constraintFConstraintLabel.grabExcessHorizontalSpace = true;&#xA;constraintFConstraintLabel.grabExcessVerticalSpace = true;&#xA;this.add(fConstraintLabel, constraintFConstraintLabel);&#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.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel getConstraintPropertyFigureLabel() {&#xA;&#x9;&#x9;return fConstraintPropertyFigureLabel;&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getConstraintLabel() {&#xA;&#x9;&#x9;return fConstraintLabel;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="RequestConstants.REQ_CREATE"
- editPolicyQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.CreateParameterEditPolicy"/>
- <modelFacet>
- <metaClass
- href="../../org.eclipse.papyrus.sysml/model/sysml.genmodel#//sysml/constraints/ConstraintProperty"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.papyrus.infra.core.resource/model/resource.genmodel#//resource/Resource/eobjects"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.papyrus.infra.core.resource/model/resource.genmodel#//resource/Resource/eobjects"/>
- </modelFacet>
- <labels
- visualID="5001"
- editPartClassName="ConstraintPropertyNameEditPart"
- itemSemanticEditPolicyClassName="ConstraintPropertyNameItemSemanticEditPolicy"
- notationViewFactoryClassName="ConstraintPropertyLabelViewFactory"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getConstraintPropertyFigureLabel"
- figureQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel"/>
- <modelFacet
- parser="/0/@labelParsers/@implementations.3"/>
- </labels>
- <labels
- visualID="5004"
- editPartClassName="ConstraintLabelEditPart"
- itemSemanticEditPolicyClassName="ConstraintLabelItemSemanticEditPolicy"
- notationViewFactoryClassName="ConstraintPropertyLabelViewFactory"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getConstraintLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
- <behaviour
- xsi:type="gmfgen:CustomBehaviour"
- key="RequestConstants.REQ_SEMANTIC_WRAPPER"
- editPolicyQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromModelEditPolicy"/>
- <modelFacet
- parser="/0/@labelParsers/@implementations.4"/>
- </labels>
- </topLevelNodes>
- <topLevelNodes
- visualID="2005"
- editPartClassName="PropertyEditPart"
- itemSemanticEditPolicyClassName="PropertyItemSemanticEditPolicy"
- notationViewFactoryClassName="PropertyViewFactory"
- canonicalEditPolicyClassName="PropertyCanonicalEditPolicy"
- graphicalNodeEditPolicyClassName="PropertyGraphicalNodeEditPolicy"
- createCommandClassName="PropertyCreateCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:SpecializationType"
- metamodelType="/0/@diagram/@childNodes.0/@elementType"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="PropertyFigure"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PropertyFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel fPropertyFigureLabel; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PropertyFigure() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.papyrus.uml.diagram.common.draw2d.CenterLayout layoutThis = new org.eclipse.papyrus.uml.diagram.common.draw2d.CenterLayout();&#xA;&#xA;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(100)&#xA;, getMapMode().DPtoLP(40)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fPropertyFigureLabel = new org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fPropertyFigureLabel);&#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.sysml.diagram.parametric.figures.CenteredWrappedLabel getPropertyFigureLabel() {&#xA;&#x9;&#x9;return fPropertyFigureLabel;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Property"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedAttribute"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedAttribute"/>
- </modelFacet>
- <labels
- visualID="5002"
- editPartClassName="PropertyNameEditPart"
- itemSemanticEditPolicyClassName="PropertyNameItemSemanticEditPolicy"
- notationViewFactoryClassName="PropertyNameViewFactory"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getPropertyFigureLabel"
- figureQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel"/>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.1">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </topLevelNodes>
- <links
- visualID="4001"
- editPartClassName="ConnectorEditPart"
- itemSemanticEditPolicyClassName="ConnectorItemSemanticEditPolicy"
- notationViewFactoryClassName="ConnectorViewFactory"
- createCommandClassName="ConnectorCreateCommand"
- reorientCommandClassName="ConnectorReorientCommand">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Edge"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- editHelperClassName="ConnectorEditHelper"/>
- <viewmap
- xsi:type="gmfgen:InnerClassViewmap"
- className="ConnectorFigure"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ConnectorFigure extends org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fConnectorLabel; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ConnectorFigure() {&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fConnectorLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fConnectorLabel.setText(&quot;&quot;);&#xA;&#xA;this.add(fConnectorLabel);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getConnectorLabel() {&#xA;&#x9;&#x9;return fConnectorLabel;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
- <modelFacet
- xsi:type="gmfgen:TypeLinkModelFacet">
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Connector"/>
- <containmentMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedConnector"/>
- <childMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredClassifier/ownedConnector"/>
- <sourceMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConnectorEnd/role"/>
- <targetMetaFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConnectorEnd/role"/>
- </modelFacet>
- <labels
- visualID="6001"
- editPartClassName="ConnectorNameEditPart"
- itemSemanticEditPolicyClassName="ConnectorNameItemSemanticEditPolicy"
- notationViewFactoryClassName="ConnectorNameViewFactory"
- elementIcon="true">
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <viewmap
- xsi:type="gmfgen:ParentAssignedViewmap"
- getterName="getConnectorLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <attributes
- xsi:type="gmfgen:LabelOffsetAttributes"
- y="40"/>
- </viewmap>
- <modelFacet
- xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.2">
- <metaFeatures
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
- </modelFacet>
- </labels>
- </links>
- <palette>
- <groups
- title="Parametric"
- 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="ConstraintProperty"
- description="Create new ConstraintProperty"
- largeIconPath="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/full/obj16/ConstraintProperty.gif"
- smallIconPath="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/full/obj16/ConstraintProperty.gif"
- genNodes="/0/@diagram/@topLevelNodes.0"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Property"
- description="Create new Property"
- largeIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
- smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
- genNodes="/0/@diagram/@childNodes.0 /0/@diagram/@topLevelNodes.1"/>
- <entries
- xsi:type="gmfgen:ToolEntry"
- title="Connector"
- description="Create new Connector"
- smallIconPath="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif"
- genLinks="/0/@diagram/@links.0"/>
- </groups>
- </palette>
- <preferencePages
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.papyrus.sysml.diagram.general"
- name="Sysml Diagram">
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.papyrus.sysml.diagram.appearance"
- name="Appearance"
- kind="Appearance"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.papyrus.sysml.diagram.connections"
- name="Connections"
- kind="Connections"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.papyrus.sysml.diagram.printing"
- name="Printing"
- kind="Printing"/>
- <children
- xsi:type="gmfgen:GenStandardPreferencePage"
- iD="org.eclipse.papyrus.sysml.diagram.rulersAndGrid"
- name="Rulers And Grid"
- kind="RulersAndGrid"/>
- </preferencePages>
- </diagram>
- <plugin
- iD="org.eclipse.papyrus.sysml.diagram.parametric"
- name="Sysml Parametric diagram Plugin"
- provider="Eclipse.org"
- version="0.9.0.qualifier">
- <requiredPlugins>org.eclipse.draw2d</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"
- child="/0/@diagram/@topLevelNodes.0"/>
- <childReferences
- parent="/0/@diagram"
- child="/0/@diagram/@topLevelNodes.1"/>
- <childReferences
- parent="/0/@diagram"
- child="/0/@diagram/@links.0"
- groupName="links"
- groupIcon="icons/linksNavigatorGroup.gif"/>
- <childReferences
- parent="/0/@diagram/@links.0"
- child="/0/@diagram/@topLevelNodes.1"
- referenceType="out_target"
- groupName="target"
- groupIcon="icons/linkTargetNavigatorGroup.gif"/>
- <childReferences
- parent="/0/@diagram/@topLevelNodes.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.0"
- referenceType="out_target"
- groupName="target"
- groupIcon="icons/linkTargetNavigatorGroup.gif"/>
- <childReferences
- parent="/0/@diagram/@childNodes.0"
- child="/0/@diagram/@links.0"
- referenceType="in_source"
- groupName="incoming links"
- groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
- <childReferences
- parent="/0/@diagram/@links.0"
- child="/0/@diagram/@topLevelNodes.1"
- referenceType="in_source"
- groupName="source"
- groupIcon="icons/linkSourceNavigatorGroup.gif"/>
- <childReferences
- parent="/0/@diagram/@topLevelNodes.1"
- 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.0"
- referenceType="in_source"
- groupName="source"
- groupIcon="icons/linkSourceNavigatorGroup.gif"/>
- <childReferences
- parent="/0/@diagram/@childNodes.0"
- child="/0/@diagram/@links.0"
- 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="../../org.eclipse.papyrus.sysml/model/sysml.genmodel#/"/>
- <expressionProviders>
- <providers
- xsi:type="gmfgen:GenJavaExpressionProvider"
- injectExpressionBody="true">
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="return ModelValidationHelper.validateConnector(context, ctx);"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="return ModelValidationHelper.validateProperty(context, ctx);"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="return ModelValidationHelper.validateConnectorEnd(context, ctx);"/>
- <expressions
- xsi:type="gmfgen:GenConstraint"
- body="return ModelValidationHelper.validateNestedConnectorEnd(context, ctx);"/>
- </providers>
- </expressionProviders>
- <labelParsers
- extensibleViaService="true">
- <implementations
- xsi:type="gmfgen:PredefinedParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@topLevelNodes.1/@labels.0/@modelFacet /0/@diagram/@childNodes.0/@labels.0/@modelFacet"
- qualifiedName="org.eclipse.papyrus.sysml.diagram.parametric.parsers.PropertyLabelParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@links.0/@labels.0/@modelFacet"
- qualifiedName="org.eclipse.papyrus.sysml.diagram.parametric.parsers.ConnectorLabelParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet"
- qualifiedName="org.eclipse.papyrus.sysml.diagram.parametric.parsers.ConstraintPropertyLabelParser"/>
- <implementations
- xsi:type="gmfgen:CustomParser"
- uses="/0/@diagram/@topLevelNodes.0/@labels.1/@modelFacet"
- qualifiedName="org.eclipse.papyrus.sysml.diagram.parametric.parsers.ConstraintLabelParser"/>
- </labelParsers>
- <contextMenus
- context="/0/@diagram">
- <items
- xsi:type="gmfgen:LoadResourceAction"/>
- </contextMenus>
- </gmfgen:GenEditorGenerator>
- <papyrusgmfgenextension:PapyrusExtensionRootNode>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:SpecificLocator"
- comment="Affixed Parameter locator"
- classpath="org.eclipse.papyrus.sysml.diagram.parametric.locator.ParameterPositionLocator"
- genChildSideAffixedNode="/0/@diagram/@childNodes.0"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:LabelVisibilityPreference"
- comment="HiddenName"
- role="Name"
- iconPathRole="platform:/plugin/org.eclipse.papyrus.uml.diagram.common/icons/label_role/name.png"
- linkLabels="/0/@diagram/@links.0/@labels.0"
- visibleByDefault="false"/>
- <extensionNodes
- xsi:type="papyrusgmfgenextension:ExtendedGenView"
- comment=""
- genView="/0/@diagram/@links.0"
- name="ExtendedUMLLinks"
- superOwnedEditPart="org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart"/>
- </papyrusgmfgenextension:PapyrusExtensionRootNode>
-</xmi:XMI>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph
deleted file mode 100644
index 40f04caf4eb..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="sysml">
- <figures
- name="Default">
- <descriptors
- name="ConstraintPropertyFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:RoundedRectangle"
- name="ConstraintPropertyFigure"
- cornerWidth="25"
- cornerHeight="25">
- <layout
- xsi:type="gmfgraph:GridLayout"/>
- <minimumSize
- dx="200"
- dy="120"/>
- <children
- xsi:type="gmfgraph:CustomFigure"
- name="ConstraintPropertyFigureLabel"
- qualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel">
- <layoutData
- xsi:type="gmfgraph:GridLayoutData"
- grabExcessHorizontalSpace="true"
- grabExcessVerticalSpace="true"
- verticalAlignment="END"/>
- </children>
- <children
- xsi:type="gmfgraph:CustomFigure"
- name="ConstraintLabel"
- qualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel">
- <layoutData
- xsi:type="gmfgraph:GridLayoutData"
- grabExcessHorizontalSpace="true"
- grabExcessVerticalSpace="true"
- verticalAlignment="BEGINNING"
- horizontalAlignment="END"/>
- </children>
- </actualFigure>
- <accessors
- accessor="getConstraintPropertyFigureLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- <accessors
- accessor="getConstraintLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
- </descriptors>
- <descriptors
- name="PropertyFigure">
- <actualFigure
- xsi:type="gmfgraph:Rectangle"
- name="PropertyFigure">
- <layout
- xsi:type="gmfgraph:CustomLayout"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.draw2d.CenterLayout"/>
- <minimumSize
- dx="100"
- dy="40"/>
- <children
- xsi:type="gmfgraph:CustomFigure"
- name="PropertyFigureLabel"
- qualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel"/>
- </actualFigure>
- <accessors
- accessor="getPropertyFigureLabel"
- figure="//@figures.0/@descriptors.1/@actualFigure/@children.0"/>
- </descriptors>
- <descriptors
- name="ParameterDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Rectangle"
- name="ParameterRectangle">
- <preferredSize
- dx="16"
- dy="16"/>
- </actualFigure>
- </descriptors>
- <descriptors
- name="ParameterLabelFigure">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="ParameterLabel"/>
- </descriptors>
- <descriptors
- name="ConnectorFigure">
- <actualFigure
- xsi:type="gmfgraph:PolylineConnection"
- name="ConnectorPolylineConnection">
- <children
- xsi:type="gmfgraph:Label"
- name="ConnectorLabel"/>
- </actualFigure>
- <accessors
- accessor="getConnectorLabel"
- figure="//@figures.0/@descriptors.4/@actualFigure/@children.0"/>
- </descriptors>
- </figures>
- <nodes
- name="NodeConstraintProperty"
- figure="ConstraintPropertyFigureDescriptor"/>
- <nodes
- name="NodeProperty"
- figure="PropertyFigure"/>
- <nodes
- name="ParameterNode"
- figure="ParameterDescriptor"
- affixedParentSide="NSEW"/>
- <connections
- name="ConnectorConnection"
- figure="ConnectorFigure"/>
- <labels
- name="Property"
- figure="PropertyFigure"
- accessor="//@figures.0/@descriptors.1/@accessors.0">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
- <labels
- name="ConstraintProperty"
- figure="ConstraintPropertyFigureDescriptor"
- accessor="//@figures.0/@descriptors.0/@accessors.0">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
- <labels
- name="ParameterLabel"
- figure="ParameterLabelFigure"
- elementIcon="false">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"/>
- </labels>
- <labels
- name="ConnectorDiagramLabel"
- figure="ConnectorFigure"
- accessor="//@figures.0/@descriptors.4/@accessors.0"/>
- <labels
- name="ConstraintLabel"
- figure="ConstraintPropertyFigureDescriptor"
- accessor="//@figures.0/@descriptors.0/@accessors.1">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="END"/>
- </labels>
-</gmfgraph:Canvas>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfmap b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfmap
deleted file mode 100644
index 0e3d1611f53..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfmap
+++ /dev/null
@@ -1,182 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfmap:Mapping xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:gmfmap="http://www.eclipse.org/gmf/2008/mappings"
- xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
- <nodes>
- <containmentFeature
- href="../../../plugin/org.eclipse.papyrus.infra.core.resource/model/resource.ecore#//Resource/eobjects"/>
- <ownedChild>
- <domainMetaElement
- href="../../org.eclipse.papyrus.sysml.converted/model/sysml.ecore#//constraints/ConstraintProperty"/>
- <labelMappings>
- <diagramLabel
- href="Parametric.gmfgraph#ConstraintProperty"/>
- </labelMappings>
- <labelMappings>
- <diagramLabel
- href="Parametric.gmfgraph#ConstraintLabel"/>
- </labelMappings>
- <tool
- xsi:type="gmftool:CreationTool"
- href="Parametric.gmftool#//@palette/@tools.0/@tools.0"/>
- <diagramNode
- href="Parametric.gmfgraph#NodeConstraintProperty"/>
- <children
- referencedChild="//@nodes.0/@ownedChild/@children.0/@ownedChild">
- <containmentFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//StructuredClassifier/ownedAttribute"/>
- <childrenFeature
- href="../../org.eclipse.papyrus.sysml.converted/model/sysml.ecore#//constraints/ConstraintProperty/base_Property"/>
- <ownedChild
- relatedDiagrams="//@diagram">
- <domainMetaElement
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Property"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="Parametric.gmfgraph#ParameterLabel"/>
- <features
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
- </labelMappings>
- <tool
- xsi:type="gmftool:CreationTool"
- href="Parametric.gmftool#//@palette/@tools.0/@tools.1"/>
- <diagramNode
- href="Parametric.gmfgraph#ParameterNode"/>
- </ownedChild>
- </children>
- </ownedChild>
- </nodes>
- <nodes>
- <containmentFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//StructuredClassifier/ownedAttribute"/>
- <ownedChild>
- <domainMetaElement
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Property"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="Parametric.gmfgraph#Property"/>
- <features
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
- </labelMappings>
- <tool
- xsi:type="gmftool:CreationTool"
- href="Parametric.gmftool#//@palette/@tools.0/@tools.1"/>
- <diagramNode
- href="Parametric.gmfgraph#NodeProperty"/>
- </ownedChild>
- </nodes>
- <links
- relatedDiagrams="//@diagram">
- <domainMetaElement
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Connector"/>
- <labelMappings
- xsi:type="gmfmap:FeatureLabelMapping">
- <diagramLabel
- href="Parametric.gmfgraph#ConnectorDiagramLabel"/>
- <features
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//NamedElement/name"/>
- </labelMappings>
- <containmentFeature
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//StructuredClassifier/ownedConnector"/>
- <tool
- xsi:type="gmftool:CreationTool"
- href="Parametric.gmftool#//@palette/@tools.0/@tools.2"/>
- <diagramLink
- href="Parametric.gmfgraph#ConnectorConnection"/>
- <sourceMetaFeature
- xsi:type="ecore:EReference"
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ConnectorEnd/role"/>
- <linkMetaFeature
- xsi:type="ecore:EReference"
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ConnectorEnd/role"/>
- </links>
- <diagram>
- <diagramCanvas
- href="Parametric.gmfgraph#sysml"/>
- <domainModel
- href="../../org.eclipse.papyrus.sysml.converted/model/sysml.ecore#//blocks"/>
- <domainMetaElement
- href="../../../plugin/org.eclipse.papyrus.infra.core.resource/model/resource.ecore#//Resource"/>
- <palette
- href="Parametric.gmftool#//@palette"/>
- </diagram>
- <audits
- id="org.eclipse.uml2.uml.util.UMLValidator.validate"
- name="validateSysMLModel"
- description="Validate the SysML model">
- <childContainers
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement"
- name="validateConnectorElement"
- description="validate a connector checking that its children are consistent">
- <audits
- name="validateConnector"
- description="The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateConnector"
- severity="WARNING"
- useInLiveMode="true"
- message="NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector.">
- <rule
- body="return ModelValidationHelper.validateConnector(context, ctx);"
- language="java"/>
- <target
- xsi:type="gmfmap:DomainElementTarget">
- <element
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Connector"/>
- </target>
- </audits>
- <audits
- name="validateProperty"
- description="When you move a property, check that its incoming or outgoings connector get consistent connectorEnd"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateProperty"
- severity="WARNING"
- useInLiveMode="true"
- message="NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector.">
- <rule
- body="return ModelValidationHelper.validateProperty(context, ctx);"
- language="java"/>
- <target
- xsi:type="gmfmap:DomainElementTarget">
- <element
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//Property"/>
- </target>
- </audits>
- <audits
- name="validateConnectorEnd"
- description="The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateConnectorEnd"
- severity="WARNING"
- useInLiveMode="true"
- message="NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector.">
- <rule
- body="return ModelValidationHelper.validateConnectorEnd(context, ctx);"
- language="java"/>
- <target
- xsi:type="gmfmap:DomainElementTarget">
- <element
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#//ConnectorEnd"/>
- </target>
- </audits>
- <audits
- name="validateNestedConnectorEnd"
- description="The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property"
- id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateNestedConnectorEnd"
- severity="WARNING"
- useInLiveMode="true"
- message="NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector.">
- <rule
- body="return ModelValidationHelper.validateNestedConnectorEnd(context, ctx);"
- language="java"/>
- <target
- xsi:type="gmfmap:DomainElementTarget">
- <element
- href="../../org.eclipse.papyrus.sysml.converted/model/sysml.ecore#//blocks/NestedConnectorEnd"/>
- </target>
- </audits>
- </childContainers>
- </audits>
-</gmfmap:Mapping>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmftool b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmftool
deleted file mode 100644
index f30d8a80cb9..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmftool
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmftool:ToolRegistry xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmftool="http://www.eclipse.org/gmf/2005/ToolDefinition">
- <palette
- title="sysmlPalette">
- <tools
- xsi:type="gmftool:ToolGroup"
- title="Parametric">
- <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="ConstraintProperty"
- description="Create new ConstraintProperty">
- <smallIcon
- xsi:type="gmftool:BundleImage"
- path="/icons/full/obj16/ConstraintProperty.gif"
- bundle="platform:/plugin/org.eclipse.papyrus.sysml.edit"/>
- <largeIcon
- xsi:type="gmftool:BundleImage"
- path="/icons/full/obj16/ConstraintProperty.gif"
- bundle="platform:/plugin/org.eclipse.papyrus.sysml.edit"/>
- </tools>
- <tools
- xsi:type="gmftool:CreationTool"
- title="Property"
- description="Create new Property">
- <smallIcon
- xsi:type="gmftool:BundleImage"
- path="/icons/full/obj16/Property.gif"
- bundle="platform:/plugin/org.eclipse.uml2.uml.edit"/>
- <largeIcon
- xsi:type="gmftool:BundleImage"
- path="/icons/full/obj16/Property.gif"
- bundle="platform:/plugin/org.eclipse.uml2.uml.edit"/>
- </tools>
- <tools
- xsi:type="gmftool:CreationTool"
- title="Connector"
- description="Create new Connector">
- <smallIcon
- xsi:type="gmftool:BundleImage"
- path="/icons/full/obj16/Connector.gif"
- bundle="platform:/plugin/org.eclipse.uml2.uml.edit"/>
- </tools>
- </tools>
- </palette>
-</gmftool:ToolRegistry>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.trace b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.trace
deleted file mode 100644
index 89f49f47e77..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.trace
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<trace:TraceModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:trace="http://www.eclipse.org/gmf/2006/Trace">
- <nodeTraces
- visualID="2003"
- queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/papyrus/0.7.0/SysML/Constraints' and _eClass_.name = 'ConstraintProperty') and (let _containmentMF_:ecore::EStructuralFeature = modelFacet.containmentMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _containmentMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/papyurs/0.7.0/Resource' and _eClass_.name = 'Resource') and _containmentMF_.name = 'eobjects')">
- <nodeLabelTraces
- visualID="5001"
- queryText="true"/>
- <nodeLabelTraces
- visualID="5004"
- queryText="true"/>
- </nodeTraces>
- <nodeTraces
- visualID="2005"
- queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Property') 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 = 'StructuredClassifier') and _containmentMF_.name = 'ownedAttribute')">
- <nodeLabelTraces
- visualID="5002"
- queryText="true"/>
- </nodeTraces>
- <childNodeTraces
- visualID="3002"
- queryText="(let _eClass_:ecore::EClass = modelFacet.metaClass.ecoreClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/uml2/3.0.0/UML' and _eClass_.name = 'Property') 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 = 'StructuredClassifier') and _containmentMF_.name = 'ownedAttribute') and ( let _childMF_:ecore::EStructuralFeature = modelFacet.childMetaFeature.ecoreFeature in (let _eClass_:ecore::EClass = _childMF_.eContainingClass in _eClass_.ePackage.nsURI = 'http://www.eclipse.org/papyrus/0.7.0/SysML/Constraints' and _eClass_.name = 'ConstraintProperty') and _childMF_.name = 'base_Property')">
- <nodeLabelTraces
- visualID="5003"
- queryText="true"/>
- </childNodeTraces>
- <linkTraces
- visualID="4001"
- 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 = 'Connector')">
- <linkLabelTraces
- visualID="6001"
- queryText="true"/>
- </linkTraces>
-</trace:TraceModel>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/SysML.Parametric.idgen b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/SysML.Parametric.idgen
new file mode 100644
index 00000000000..4db68156930
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/model/SysML.Parametric.idgen
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<idgen:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gmfgen="http://www.eclipse.org/gmf/2009/GenModel" xmlns:idgen="http://www.eclipse.org/papyrus/0.7.0/idgen" name="Parametric" type="Parametric" icon="icons/obj16/Diagram_Parametric.gif" label="SysML Parametric Diagram" language="sysml" javaPackagePrefix="org.eclipse.papyrus.sysml.diagram.parametric" javaClassPrefix="ParametricDiagram" createCommandLabel="Create a new Parametric Diagram">
+ <diagramEditPart name="Diagram edit part">
+ <behaviors javaClassQualifiedName="org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy" key="DuplicatePasteEditPolicy.PASTE_ROLE"/>
+ <behaviors javaClassQualifiedName="org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDragDropEditPolicy" key="EditPolicyRoles.DRAG_DROP_ROLE"/>
+ <behaviors javaClassQualifiedName="org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultXYLayoutEditPolicy" key="EditPolicy.LAYOUT_ROLE"/>
+ <behaviors name="" javaClassQualifiedName="org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultCreationEditPolicy" key="EditPolicyRoles.CREATION_ROLE"/>
+ <behaviors javaClassQualifiedName="org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultContainerNodeEditPolicy" key="EditPolicy.GRAPHICAL_NODE_ROLE"/>
+ </diagramEditPart>
+ <inheritedDiagrams name="CompositeDiagram" viewProviderClassQualifiedName="" editPartProviderClassQualifiedName="" dndEditPolicyClassQualifiedName="org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.CustomDiagramDragDropEditPolicy">
+ <genInheritedEditor href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#CompositeStructure"/>
+ <genNodes>
+ <genNode xsi:type="gmfgen:GenTopLevelNode" href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@topLevelNodes.48"/>
+ <semanticType href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#org.eclipse.papyrus.uml.Constraint"/>
+ </genNodes>
+ <genNodes generatePreferencePage="false" generateTool="false">
+ <genNode xsi:type="gmfgen:GenChildNode" href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@childNodes.27"/>
+ <semanticType href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#org.eclipse.papyrus.uml.Comment"/>
+ </genNodes>
+ <genNodes>
+ <genNode xsi:type="gmfgen:GenTopLevelNode" href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@topLevelNodes.43"/>
+ <semanticType href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#org.eclipse.papyrus.uml.Comment"/>
+ </genNodes>
+ <genNodes generatePreferencePage="false" generateTool="false">
+ <genNode xsi:type="gmfgen:GenChildNode" href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@childNodes.32"/>
+ <semanticType href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#org.eclipse.papyrus.uml.Constraint"/>
+ </genNodes>
+ <genLinks>
+ <genLink href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@links.1"/>
+ </genLinks>
+ <genLinks>
+ <genLink href="../../org.eclipse.papyrus.uml.diagram.composite/model/compositediagram.gmfgen#/0/@diagram/@links.2"/>
+ </genLinks>
+ </inheritedDiagrams>
+ <customJavaClasses name="" customEditPolicyProvider="org.eclipse.papyrus.sysml.diagram.internalblock.CustomEditPolicyProvider" customPreferenceInitializer="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CustomPreferenceInitializer"/>
+ <usedCustomNodes href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_block_as_composite"/>
+ <usedCustomNodes href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/>
+ <usedCustomNodes href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_flowport_as_affixed"/>
+ <usedCustomNodes href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
+ <usedCustomEdges href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#link_uml_connector"/>
+ <usedCustomEdges href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#link_uml_dependency"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#label_sysml_block_name"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#affixedlabel_sysml_flowport_label"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#affixedlabel_uml_appliedstereotype"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#affixedlabel_uml_port_label"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_structure"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_blockproperty_structure"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#label_uml_property_label"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_appliedstereotype"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_connector_label"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_connector_source_multiplicity"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_connector_target_multiplicity"/>
+ <usedCustomDecorations href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#linklabel_uml_namedelement_name"/>
+ <diagramConfig>
+ <contains xsi:type="idgen:GraphicalTypeDiagramRef">
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_block_as_composite"/>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_flowport_as_affixed"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_structure"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_flowport_as_affixed"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#shape_uml_port_as_affixed"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_blockproperty_structure"/>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/>
+ </contains>
+ </contains>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_constraintblockproperty_as_composite"/>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#shape_uml_property_as_label"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_blockproperty_structure"/>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_constraintblockproperty_as_composite"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#label_uml_property_label"/>
+ </contains>
+ </contains>
+ </contains>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#link_uml_dependency"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/UML.ReusableParts.idgen#link_uml_connector"/>
+ </contains>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_structure"/>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_constraintblockproperty_as_composite"/>
+ </contains>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#compartment_sysml_blockproperty_structure"/>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_blockproperty_as_composite"/>
+ </contains>
+ <contains>
+ <ref href="../../org.eclipse.papyrus.sysml.diagram.common/model/SysML.ReusableParts.idgen#shape_sysml_constraintblockproperty_as_composite"/>
+ </contains>
+ </contains>
+ </diagramConfig>
+</idgen:Diagram>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/parametric.palette.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/parametric.palette.xml
new file mode 100644
index 00000000000..75247fe2000
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/palettes/parametric.palette.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<paletteDefinition>
+ <content>
+ <drawer id="parametric.drawer.nodes" name="Nodes" iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <aspectTool description="Create a new ConstraintProperty" id="parametric.tool.constraintblockpropertycomposite"
+ name="ConstraintProperty" refToolId="parametric.tool.constraintblockpropertycomposite">
+ </aspectTool>
+ <aspectTool description="Create a new ConstraintParameter" id="parametric.tool.parameter"
+ name="ConstraintParameter" refToolId="parametric.tool.parameter">
+ </aspectTool>
+ <aspectTool description="Create a new Part" id="parametric.tool.blockpropertycomposite"
+ name="Part" refToolId="parametric.tool.blockpropertycomposite">
+ </aspectTool>
+ <aspectTool description="Create a new Reference" id="parametric.tool.reference"
+ name="Reference" refToolId="parametric.tool.reference">
+ </aspectTool>
+ <aspectTool description="Create a new Value" id="parametric.tool.value"
+ name="Value" refToolId="parametric.tool.value">
+ </aspectTool>
+ </drawer>
+ <drawer id="parametric.drawer.edges" name="Edges" iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <aspectTool description="Create a new BindingConnector" id="parametric.tool.connector"
+ name="BindingConnector" refToolId="parametric.tool.connector">
+ </aspectTool>
+ </drawer>
+ <drawer id="parametric.drawer.others" name="Others" iconpath="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
+ <aspectTool description="Create a new Dependency" id="parametric.tool.dependency"
+ name="Dependency" refToolId="parametric.tool.dependency">
+ </aspectTool>
+ <aspectTool description="Create a new Comment" id="parametric.tool.comment"
+ name="Comment" refToolId="parametric.tool.comment">
+ </aspectTool>
+ <aspectTool description="Create a new Constraint" id="parametric.tool.constraint"
+ name="Constraint" refToolId="parametric.tool.constraint">
+ </aspectTool>
+ <aspectTool description="Create a new CommentAnnotatedElement" id="parametric.tool.commentannotatedelement"
+ name="CommentAnnotatedElement" refToolId="parametric.tool.comment_constraint_link">
+ </aspectTool>
+ </drawer>
+ </content>
+</paletteDefinition>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.properties b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.properties
index 7d806bfb50e..1095de7c781 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.properties
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.properties
@@ -1,59 +1,12 @@
-#/*****************************************************************************
-#* 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:
-# * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
-# *
-# *****************************************************************************/
-pluginName=Papyrus Paramatric Diagram for SysML (Incubation)
+#################################################################################
+# Copyright (c) 2010 CEA LIST.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - initial API and implementation
+##################################################################################
+pluginName=SysML Parametric Diagram
providerName=Eclipse Modeling Project
-
-editorName=SysML Diagram Editing
-context.description=SysML Diagram Editing
-context.name=In SysML Diagram Editor
-newWizardName=SysML Diagram
-newWizardDesc=Creates SysML diagram.
-
-initDiagramActionLabel=Initialize sysml_diagram diagram file
-
-
-navigatorContentName=*.sysml_diagram diagram contents
-domainNavigatorContentName=*.sysml model contents
-update.diagram.name=Update SysML diagram
-update.diagram.description=Perform SysML diagram update
-
-
-# Property Sheet
-tab.appearance=Appearance
-tab.diagram=Rulers & Grid
-tab.domain=Core
-
-# Preferences
-prefpage.org.eclipse.papyrus.sysml.diagram.general=SysML Diagram
-prefpage.org.eclipse.papyrus.sysml.diagram.appearance=Appearance
-prefpage.org.eclipse.papyrus.sysml.diagram.connections=Connections
-prefpage.org.eclipse.papyrus.sysml.diagram.printing=Printing
-prefpage.org.eclipse.papyrus.sysml.diagram.rulersAndGrid=Rulers And Grid
-
-
-# Providers
-metatype.name.Resource_1000=Undefined
-metatype.name.ConstraintProperty_2001=ConstraintProperty
-metatype.name.ConstraintBlock_2002=ConstraintBlock
-
-# Commands and menu actions
-cmdcategory.name=SysML Editor Commands
-cmdcategory.desc=SysML Editor Commands
-
-metatype.name.ConstraintProperty_2003=ConstraintProperty
-metatype.name.ConstraintBlock_2004=ConstraintBlock
-metatype.name.Property_2004=Property
-metatype.name.Property_2005=Property
-metatype.name.Property_3002=Property
-metatype.name.Connector_4001=Connector
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.xml
index 451f5e3b0e0..9b4009cdcc1 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.xml
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/plugin.xml
@@ -1,838 +1,562 @@
-<?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.sysml.diagram.parametric.providers.ParametricDiagramContributionItemProvider">
- <Priority name="Low"/>
- <popupContribution class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider">
- <popupStructuredContributionCriteria objectClass="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart" policyClass="org.eclipse.papyrus.sysml.diagram.parametric.providers.ParametricDiagramContributionPolicyClass"/>
- <popupAction id="papyrus.restoreRelatedLinksAction" path="/navigateMenu/additions"/>
- </popupContribution>
- </contributionItemProvider>
- </extension>
-
-
-
- <extension point="org.eclipse.ui.contexts" id="ui-context">
- <?gmfgen generated="true"?>
- <context
- description="%context.description"
- id="org.eclipse.papyrus.sysml.diagram.parametric.ui.diagramContext"
- name="%context.name"
- parentId="org.eclipse.gmf.runtime.diagram.ui.diagramContext">
- </context>
- </extension>
-
-
- <extension point="org.eclipse.ui.popupMenus" id="init-diagram-action">
- <?gmfgen generated="false"?>
- <!-- FIX Bug 314257-->
- <!--objectContribution
- id="org.eclipse.papyrus.sysml.diagram.parametric.InitDiagram"
- nameFilter="*.sysml"
- objectClass="org.eclipse.core.resources.IFile">
- <action
- label="%initDiagramActionLabel"
- class="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlInitDiagramFileAction"
- menubarPath="additions"
- enablesFor="1"
- id="org.eclipse.papyrus.sysml.diagram.parametric.InitDiagramAction">
- </action>
- </objectContribution-->
- </extension>
-
-
- <extension
- id="Sysml Plugin.palettedefinition"
- name="Sysml Plugin Predefined Entries"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Lowest"/>
- <contribution
- factoryClass="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- <entry
- defineOnly="true"
- description="Create new Property"
- id="createProperty2CreationTool"
- kind="tool"
- label="Property"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new ConstraintProperty"
- id="createConstraintProperty1CreationTool"
- kind="tool"
- label="ConstraintProperty"
- large_icon="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/full/obj16/ConstraintProperty.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/full/obj16/ConstraintProperty.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Connector"
- id="createConnector3CreationTool"
- kind="tool"
- label="Connector"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif"
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif">
- </entry>
-
- </contribution>
- </paletteProvider>
-
- </extension>
-
- <extension
- id="Sysml Plugin.standard"
- name="Sysml Plugin Standard Palette"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Low"/>
- <contribution
- factoryClass="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- <entry
- description=""
- id="createSysml1Group"
- kind="drawer"
- label="Parametric Diagram"
- 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="createProperty2CreationTool"
- path="/createSysml1Group">
- </predefinedEntry>
- <predefinedEntry
- id="createConstraintProperty1CreationTool"
- path="/createSysml1Group">
- </predefinedEntry>
- <predefinedEntry
- id="createConnector3CreationTool"
- path="/createSysml1Group">
- </predefinedEntry>
-
-
- </contribution>
- <editor id="org.eclipse.papyrus.sysml.diagram.parametric"/>
- </paletteProvider>
-
- </extension>
-
- <extension point="org.eclipse.ui.preferencePages" id="prefpages">
- <?gmfgen generated="true"?>
- <page
- id="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.Parametric"
- name="Parametric Diagram"
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams"
- class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.DiagramGeneralPreferencePage">
- </page>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+<!-- Diagram declaration -->
+<extension point="org.eclipse.papyrus.infra.core.papyrusDiagram">
+ <creationCommand
+ creationCommandClass="org.eclipse.papyrus.sysml.diagram.parametric.ParametricDiagramCreateCommand"
+ icon="icons/obj16/Diagram_Parametric.png"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.CreateCommand"
+ language="sysml"
+ label="SysML Parametric Diagram"/>
+ <editorDiagram
+ actionBarContributorId="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor"
+ factoryClass="org.eclipse.papyrus.sysml.diagram.parametric.ParametricDiagramEditorFactory"
+ icon="icons/obj16/Diagram_Parametric.png" />
+</extension>
- <page
- id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.DiagramPrintingPreferencePage"
- name="%prefpage.org.eclipse.papyrus.sysml.diagram.printing"
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.Parametric"
- class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.DiagramPrintingPreferencePage">
- </page>
+<!-- Diagram creation command and handler -->
+<extension point="org.eclipse.ui.commands">
+ <command id="org.eclipse.papyrus.sysml.diagram.parametric.CreateCommand"
+ name="Create a new Parametric Diagram"
+ description="Create a new Parametric Diagram"
+ categoryId="org.eclipse.papyrus.editor.category"/>
+</extension>
- <page
- id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.DiagramRulersAndGridPreferencePage"
- name="%prefpage.org.eclipse.papyrus.sysml.diagram.rulersAndGrid"
- category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.Parametric"
- class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.DiagramRulersAndGridPreferencePage">
- </page>
+<extension point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramWithNavigationHandler"
+ commandId="org.eclipse.papyrus.sysml.diagram.parametric.CreateCommand">
+ <activeWhen>
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor" />
+ </with>
+ </activeWhen>
+ </handler>
+</extension>
- </extension>
+<!-- Diagram creation command registration in menu and toolbar -->
+<extension point="org.eclipse.ui.menus">
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
- <?gmfgen generated="true"?>
- <propertyContributor
- contributorId="org.eclipse.papyrus.sysml.diagram.parametric"
- labelProvider="org.eclipse.papyrus.sysml.diagram.parametric.sheet.SysmlSheetLabelProvider">
- <propertyCategory category="domain"/>
- <propertyCategory category="visual"/>
- <propertyCategory category="extra"/>
- </propertyContributor>
- </extension>
+ <menuContribution locationURI="menu:org.eclipse.papyrus.ui.menu">
+ <menu id="org.eclipse.papyrus.uml.diagram.ui.menu.diagrams" label="Diagrams">
+ <command commandId="org.eclipse.papyrus.sysml.diagram.parametric.CreateCommand"
+ icon="icons/obj16/Diagram_Parametric.png" label="Create a new Parametric Diagram"
+ style="push" tooltip="Create a new Parametric Diagram">
+ <visibleWhen>
+ <reference definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML"/>
+ </visibleWhen>
+
+ </command>
+ </menu>
+ </menuContribution>
+
+ <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
+ <toolbar id="org.eclipse.papyrus.uml.diagram.ui.toolbar">
+ <command commandId="org.eclipse.papyrus.sysml.diagram.parametric.CreateCommand"
+ icon="icons/obj16/Diagram_Parametric.png" label="Create a new Parametric Diagram"
+ style="push" tooltip="Create a new Parametric Diagram">
+ <visibleWhen>
+ <reference definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML"/>
+ </visibleWhen>
+
+ </command>
+ </toolbar>
+ </menuContribution>
+
+ <menuContribution locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram">
+ <command commandId="org.eclipse.papyrus.sysml.diagram.parametric.CreateCommand"
+ icon="icons/obj16/Diagram_Parametric.png"
+ label="Create a new Parametric Diagram"
+ style="push"
+ tooltip="Create a new Parametric Diagram">
+ <visibleWhen>
+ <reference definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML"/>
+ </visibleWhen>
+
+ </command>
+ </menuContribution>
+
+</extension>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
- <?gmfgen generated="true"?>
- <propertyTabs contributorId="org.eclipse.papyrus.sysml.diagram.parametric">
- <propertyTab
- category="visual"
- id="property.tab.AppearancePropertySection"
- label="%tab.appearance"/>
- <propertyTab
- category="visual"
- id="property.tab.DiagramPropertySection"
- label="%tab.diagram"/>
- <propertyTab
- category="domain"
- id="property.tab.domain"
- label="%tab.domain"/>
- </propertyTabs>
- </extension>
+<!-- Palette tool definition (defines tools possibly used by the palette(s)) -->
+<extension point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders"
+ name="SYSML_Parametric_Predefined_Entries"
+ id="org.eclipse.papyrus.sysml.diagram.blockdefinition.palettedefinition">
+
+ <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
+ <Priority name="Lowest"/> <!-- Lower priority than Palette tool declaration -->
+
+ <!-- SysML Parametric Diagram specific tool definition -->
+ <contribution
+ factoryClass="org.eclipse.papyrus.sysml.diagram.parametric.factory.DiagramPaletteFactory">
+
+ <!-- parametric.tool.constraintblockpropertycomposite -->
+ <entry
+ defineOnly="true"
+ description="Create a ConstraintBlockProperty"
+ id="parametric.tool.constraintblockpropertycomposite"
+ kind="tool"
+ label="ConstraintProperty"
+ large_icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif"
+ small_icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif">
+ </entry>
+
+ <!-- parametric.tool.parameter -->
+ <entry
+ defineOnly="true"
+ description="Create a Parameter"
+ id="parametric.tool.parameter"
+ kind="tool"
+ label="ConstraintParameter"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Port.gif"
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Port.gif">
+ </entry>
+
+ <!-- parametric.tool.blockpropertycomposite -->
+ <entry
+ defineOnly="true"
+ description="Create a Part"
+ id="parametric.tool.blockpropertycomposite"
+ kind="tool"
+ label="Part"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif">
+ </entry>
+
+ <!-- parametric.tool.reference -->
+ <entry
+ defineOnly="true"
+ description="Create a Reference"
+ id="parametric.tool.reference"
+ kind="tool"
+ label="Reference"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif">
+ </entry>
+
+ <!-- parametric.tool.value -->
+ <entry
+ defineOnly="true"
+ description="Create a Value"
+ id="parametric.tool.value"
+ kind="tool"
+ label="Value"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif">
+ </entry>
+
+ <!-- Start of user code Custom node button entry
+ -->
+
+ <!-- End of user code -->
+
+
+ <!-- parametric.tool.connector -->
+ <entry
+ defineOnly="true"
+ description="Create a Connector"
+ id="parametric.tool.connector"
+ kind="tool"
+ label="Connector"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif"
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif">
+ </entry>
+
+ <!-- parametric.tool.dependency -->
+ <entry
+ defineOnly="true"
+ description="Create a Dependency"
+ id="parametric.tool.dependency"
+ kind="tool"
+ label="Dependency"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif"
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Dependency.gif">
+ </entry>
+ <!-- Start of user code Custom edge button entry -->
+ <!-- parametric.tool.comment -->
+ <entry
+ defineOnly="true"
+ description="Create a Comment"
+ id="parametric.tool.comment"
+ kind="tool"
+ label="Comment"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif"
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Comment.gif">
+ </entry>
+
+ <!-- internalblock.tool.constraint -->
+ <entry defineOnly="true"
+ description="Create a Constraint"
+ id="parametric.tool.constraint"
+ kind="tool"
+ label="Constraint"
+ large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif"
+ small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Constraint.gif">
+ </entry>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
- <?gmfgen generated="true"?>
- <propertySections contributorId="org.eclipse.papyrus.sysml.diagram.parametric">
- <propertySection id="property.section.ConnectorAppearancePropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ConnectionEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ConnectionAppearancePropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.ShapeColorAndFontPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.ShapeEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.DiagramColorsAndFontsPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.DiagramColorsAndFontsPropertySection"
- tab="property.tab.AppearancePropertySection">
- </propertySection>
- <propertySection id="property.section.RulerGridPropertySection"
- filter="org.eclipse.gmf.runtime.diagram.ui.properties.filters.DiagramEditPartPropertySectionFilter"
- class="org.eclipse.gmf.runtime.diagram.ui.properties.sections.grid.RulerGridPropertySection"
- tab="property.tab.DiagramPropertySection">
- </propertySection>
- <propertySection
- id="property.section.domain"
- tab="property.tab.domain"
- class="org.eclipse.papyrus.sysml.diagram.parametric.sheet.SysmlPropertySection">
- <input type="org.eclipse.gmf.runtime.notation.View"/>
- <input type="org.eclipse.gef.EditPart"/>
- <input type="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlAbstractNavigatorItem"/>
- </propertySection>
- </propertySections>
- </extension>
+ <entry
+ defineOnly="true"
+ description="Create a Comment / Constraint link"
+ id="parametric.tool.comment_constraint_link"
+ kind="tool"
+ label="Comment / Constraint link"
+ large_icon="icons/obj16/Link.gif"
+ small_icon="icons/obj16/Link.gif">
+ </entry>
+
+ <!-- End of user code -->
+
+ </contribution>
+
+ <!-- Specify diagram this palette tools relate to -->
+ <editor id="org.eclipse.papyrus.sysml.diagram.parametric"/>
+
+ </paletteProvider>
+</extension>
-
-<?gmfgen generated="true"?>
-
- <extension point="org.eclipse.core.runtime.preferences">
- <?gmfgen generated="true"?>
- <initializer class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.DiagramPreferenceInitializer"/>
- </extension>
+<!-- Palette tool declaration (declares the real palette containment) -->
+<extension point="org.eclipse.papyrus.uml.diagram.common.paletteDefinition"
+ name="SYSML_Parametric">
+
+ <paletteDefinition ID="SYSML_Parametric"
+ class="org.eclipse.papyrus.uml.diagram.common.service.PluginPaletteProvider"
+ name="SYSML_Parametric" icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
+ path="palettes/parametric.palette.xml"
+ provider="CEA LIST">
+ <Priority name="Low"/>
+
+ <!-- Specify diagram this palette tools relate to -->
+ <editor id="org.eclipse.papyrus.sysml.diagram.parametric"/>
+ </paletteDefinition>
+</extension>
- <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
- <?gmfgen generated="true"?>
- <viewProvider class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlViewProvider">
- <Priority name="Lowest"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="Parametric"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2003,2005,3002"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4001"/>
- </viewProvider>
- </extension>
- <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
- <?gmfgen generated="true"?>
- <editpartProvider class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlEditPartProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
- <method name="getType()" value="Parametric"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
- <method name="getType()" value="2003,2005,3002"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
- <method name="getType()" value="4001"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
- <method name="getType()" value="5001,5004,5002,5003"/>
- </object>
- <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
- <method name="getType()" value=""/>
- </object>
- <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
- </editpartProvider>
- </extension>
+<!-- Diagram view providers declaration -->
+<extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders">
+ <!-- Diagram view provider -->
+ <viewProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.ParametricDiagramViewProvider">
+ <Priority name="Low"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="Parametric"/>
+ </viewProvider>
+
+ <!-- Custom graphical types view provider -->
+ <viewProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomViewProvider">
+ <Priority name="Medium"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="UML::Property, UML::Port, SysML::ReferenceProperty, SysML::FlowPort, SysML::FlowPort_Out, SysML::Block, SysML::FlowPort_In, SysML::FlowPort_InOut, SysML::PartProperty, SysML::ConstraintProperty"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="shape_sysml_flowport_as_affixed, shape_uml_port_as_affixed, shape_sysml_block_as_composite, shape_sysml_blockproperty_as_composite, shape_sysml_constraintblockproperty_as_composite"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="UML::Connector, UML::Dependency"/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="link_uml_dependency, link_uml_connector"/>
+
+ <!-- Additional descriptors provided in case the semantic hint is is not provided -->
+
+ <!-- "uml.Class" -->
+ <object id="uml.Class" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)">
+ <method name="getProxyClassID()" value="uml.Class"/>
+ </object>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="uml.Class"/>
+
+ <!-- "uml.Port" -->
+ <object id="uml.Port" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)">
+ <method name="getProxyClassID()" value="uml.Port"/>
+ </object>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="uml.Port"/>
+
+ <!-- "uml.Property" -->
+ <object id="uml.Property" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)">
+ <method name="getProxyClassID()" value="uml.Property"/>
+ </object>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="uml.Property"/>
+
+ <!-- "uml.Connector" -->
+ <object id="uml.Connector" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)">
+ <method name="getProxyClassID()" value="uml.Connector"/>
+ </object>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="uml.Connector"/>
+
+ <!-- "uml.Dependency" -->
+ <object id="uml.Dependency" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)">
+ <method name="getProxyClassID()" value="uml.Dependency"/>
+ </object>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="uml.Dependency"/>
+ <object id="elementtype.node"
+ class="org.eclipse.papyrus.gmf.diagram.common.commands.ISemanticHintAdapter(org.eclipse.papyrus.sysml.diagram.common)">
+
+ <method
+ name="getSemanticHint()"
+ value="UML::Property, SysML::ActorPartProperty, SysML::ValueProperty, SysML::ReferenceProperty, SysML::FlowPort_In, UML::Port, SysML::FlowPort_Out, SysML::PartProperty, SysML::FlowPort_InOut, SysML::FlowPort, SysML::Block, SysML::FlowPort_NA">
+ </method>
+ </object>
+ <context
+ elements="elementtype.node"
+ viewClass="org.eclipse.gmf.runtime.notation.Node">
+ </context>
+ <object id="elementtype.edge"
+ class="org.eclipse.papyrus.gmf.diagram.common.commands.ISemanticHintAdapter(org.eclipse.papyrus.sysml.diagram.common)">
+ <method
+ name="getSemanticHint()"
+ value="UML::Dependency, UML::Connector">
+ </method>
+ </object>
+ <context
+ elements="elementtype.edge"
+ viewClass="org.eclipse.gmf.runtime.notation.Edge">
+ </context>
+
+ </viewProvider>
- <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
- <?gmfgen generated="true"?>
- <modelingAssistantProvider class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlModelingAssistantProvider">
- <Priority name="Lowest"/>
- <object class="org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart" id="Resource_1000"/>
- <object class="org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart" id="ConstraintProperty_2003"/>
- <object class="org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart" id="Property_2005"/>
- <context elements="Resource_1000,ConstraintProperty_2003,Property_2005"/>
- </modelingAssistantProvider>
- </extension>
+ <!-- ViewProvider for inherited elements (from CompositeDiagram ViewProvider) -->
+ <viewProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.InheritedCompositeDiagramViewProvider">
+ <Priority name="Low"></Priority>
+
+ <!-- Load the ViewProvider on following SemanticHint related to IElementType(s) used in the palette (also used for legacy elements) -->
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="UML::Comment, UML::Constraint"></context>
+
+ <!--
+ "2109" = COMMENT
+ "3097" = COMMENT_CN
+ "2114" = CONSTRAINT
+ "3120" = CONSTRAINT_CN
+ -->
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2109, 3097, 2114, 3120"></context>
+
+ <!--
+ "4002" = COMMENT_ANNOTATED_ELEMENT
+ "4003" = CONSTRAINT_CONSTRAINED_ELEMENT
+ -->
+ <context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints="4002, 4003"></context>
+
+ <!-- Additional descriptors provided in case the semantic hint is is not provided -->
+
+ <!-- "uml.Comment" -->
+ <object id="uml.Comment" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)">
+ <method name="getProxyClassID()" value="uml.Comment"></method>
+ </object>
- <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
- <?gmfgen generated="true"?>
- <IconProvider class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlIconProvider">
- <Priority name="Low"/>
- </IconProvider>
- </extension>
+ <!-- "uml.Constraint" -->
+ <object id="uml.Constraint" class="org.eclipse.gmf.runtime.emf.core.util.IProxyEObject(org.eclipse.gmf.runtime.emf.core)">
+ <method name="getProxyClassID()" value="uml.Constraint"></method>
+ </object>
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
- <?gmfgen generated="true"?>
- <metamodel nsURI="http://www.eclipse.org/papyurs/0.7.0/Resource">
- <metamodelType
- id="org.eclipse.papyrus.sysml.diagram.parametric.Resource_1000"
- name="%metatype.name.Resource_1000"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Resource"
- edithelper="org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers.ResourceEditHelper">
- <param name="semanticHint" value="1000"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/papyrus/0.7.0/SysML/Constraints">
- <metamodelType
- id="org.eclipse.papyrus.sysml.diagram.parametric.ConstraintProperty_2003"
- name="%metatype.name.ConstraintProperty_2003"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="ConstraintProperty"
- edithelper="org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers.ConstraintPropertyEditHelper">
- <param name="semanticHint" value="2003"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <specializationType
- id="org.eclipse.papyrus.sysml.diagram.parametric.Property_2005"
- name="%metatype.name.Property_2005"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType">
- <specializes id="org.eclipse.papyrus.sysml.diagram.parametric.Property_3002"/>
- <param name="semanticHint" value="2005"/>
- </specializationType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.sysml.diagram.parametric.Property_3002"
- name="%metatype.name.Property_3002"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Property"
- edithelper="org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers.PropertyEditHelper">
- <param name="semanticHint" value="3002"/>
- </metamodelType>
- </metamodel>
- <metamodel nsURI="http://www.eclipse.org/uml2/3.0.0/UML">
- <metamodelType
- id="org.eclipse.papyrus.sysml.diagram.parametric.Connector_4001"
- name="%metatype.name.Connector_4001"
- kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
- eclass="Connector"
- edithelper="org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers.ConnectorEditHelper">
- <param name="semanticHint" value="4001"/>
- </metamodelType>
- </metamodel>
- </extension>
+ <!-- Additional activation contexts for nodes semantic objects -->
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" elements="uml.Comment, uml.Constraint"></context>
+
+ </viewProvider>
+</extension>
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
- <?gmfgen generated="true"?>
- <clientContext id="org.eclipse.papyrus.sysml.diagram.parametric.TypeContext">
- <enablement>
- <test
- property="org.eclipse.gmf.runtime.emf.core.editingDomain"
- value="org.eclipse.papyrus.sysml.diagram.parametric.EditingDomain"/>
- </enablement>
- </clientContext>
- <binding context="org.eclipse.papyrus.sysml.diagram.parametric.TypeContext">
- <elementType ref="org.eclipse.papyrus.sysml.diagram.parametric.Resource_1000"/>
- <elementType ref="org.eclipse.papyrus.sysml.diagram.parametric.ConstraintProperty_2003"/>
- <elementType ref="org.eclipse.papyrus.sysml.diagram.parametric.Property_2005"/>
- <elementType ref="org.eclipse.papyrus.sysml.diagram.parametric.Property_3002"/>
- <elementType ref="org.eclipse.papyrus.sysml.diagram.parametric.Connector_4001"/>
- <advice ref="org.eclipse.gmf.runtime.diagram.core.advice.notationDepdendents"/>
- </binding>
- </extension>
- <extension point="org.eclipse.core.expressions.propertyTesters" id="navigator-proptest.isURIEditorInput">
- <?gmfgen generated="true"?>
- <propertyTester
- id="org.eclipse.papyrus.sysml.diagram.parametric.URIEditorInputPropertyTester"
- type="org.eclipse.emf.common.ui.URIEditorInput"
- namespace="org.eclipse.papyrus.sysml.diagram.parametric"
- properties="isURIEditorInput"
- class="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlUriEditorInputTester">
- </propertyTester>
- </extension>
+<!-- Diagram edit part providers declaration -->
+<extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
+ <!-- Diagram edit part provider -->
+ <editpartProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.ParametricDiagramEditPartProvider">
+ <Priority name="Low"/>
+ <object
+ id="org.eclipse.papyrus.sysml.diagram.parametric.Diagram"
+ class="org.eclipse.gmf.runtime.notation.Diagram">
+ <method name="getType()" value="Parametric"/>
+ </object>
+ <context views="org.eclipse.papyrus.sysml.diagram.parametric.Diagram"/>
+ </editpartProvider>
+
+ <!-- Custom graphical types edit part provider -->
+ <editpartProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomEditPartProvider">
+ <Priority name="Medium"/>
+
+ <object
+ class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.CustomNodeGraphicalTypes">
+ <method name="getType()" value="shape_sysml_flowport_as_affixed, shape_uml_port_as_affixed, shape_sysml_block_as_composite, shape_sysml_blockproperty_as_composite, shape_sysml_constraintblockproperty_as_composite"/>
+ </object>
+
+ <object
+ class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.CustomGraphicalTypes_Decorations">
+ <method name="getType()" value="linklabel_uml_connector_source_multiplicity, compartment_sysml_blockproperty_structure, linklabel_uml_connector_target_multiplicity, affixedlabel_sysml_flowport_label, compartment_sysml_structure, affixedlabel_uml_port_label, label_sysml_block_name, linklabel_uml_appliedstereotype, linklabel_uml_namedelement_name, linklabel_uml_connector_label, label_uml_property_label, shape_uml_constraint_as_label, affixedlabel_uml_appliedstereotype"/>
+ </object>
+
+ <context views="org.eclipse.papyrus.sysml.diagram.parametric.CustomNodeGraphicalTypes"/>
+ <context views="org.eclipse.papyrus.sysml.diagram.parametric.CustomGraphicalTypes_Decorations"/>
+
+ <object
+ class="org.eclipse.gmf.runtime.notation.Edge(org.eclipse.gmf.runtime.notation)"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.CustomEdgeGraphicalTypes">
+ <method name="getType()" value="link_uml_dependency, link_uml_connector"/>
+ </object>
+
+ <context views="org.eclipse.papyrus.sysml.diagram.parametric.CustomEdgeGraphicalTypes"/>
+
+ </editpartProvider>
+
+ <!-- EditPartProvider for inherited elements (from CompositeDiagram) -->
+ <editpartProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.InheritedCompositeDiagramEditPartProvider">
+ <Priority name="Low"></Priority>
+
+ <!--
+ The semantic hints given here are used in case the provider is not already loaded.
+ As soon as the provider is loaded its provides method is used.
+ "2109" = COMMENT
+ "5192" = COMMENT_LABEL_BODY_HINT
+ "3097" = COMMENT_CN
+ "5150" = COMMENT_CN_LABEL_BODY_HINT
+ "2114" = CONSTRAINT
+ "5197" = CONSTRAINT_LABEL_NAME_HINT
+ "6039" = CONSTRAINT_LABEL_SPECIFICATION_HINT
+ "3120" = CONSTRAINT_CN
+ "6048" = CONSTRAINT_CN_LABEL_NAME_HINT
+ "6049" = CONSTRAINT_CN_LABEL_SPECIFICATION_HINT
+ -->
+ <object id="COMMENT" class="org.eclipse.gmf.runtime.notation.Node">
+ <method name="getType()" value="2109, 5192"></method>
+ </object>
+ <object id="COMMENT_CN" class="org.eclipse.gmf.runtime.notation.Node">
+ <method name="getType()" value="3097, 5150"></method>
+ </object>
+ <object id="CONSTRAINT" class="org.eclipse.gmf.runtime.notation.Node">
+ <method name="getType()" value="2114, 5197, 6039"></method>
+ </object>
+ <object id="CONSTRAINT_CN" class="org.eclipse.gmf.runtime.notation.Node">
+ <method name="getType()" value="3120, 6048, 6049"></method>
+ </object>
- <extension point="org.eclipse.ui.navigator.viewer" id="navigator-viewbinding">
- <?gmfgen generated="true"?>
- <viewerContentBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <contentExtension pattern="org.eclipse.papyrus.sysml.diagram.parametric.resourceContent"/>
- <contentExtension pattern="org.eclipse.papyrus.sysml.diagram.parametric.domainResourceContent"/>
- <contentExtension pattern="org.eclipse.papyrus.sysml.diagram.parametric.navigatorLinkHelper"/>
- </includes>
- </viewerContentBinding>
- <viewerActionBinding viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <actionExtension pattern="org.eclipse.papyrus.sysml.diagram.parametric.navigatorActionProvider"/>
- </includes>
- </viewerActionBinding>
- </extension>
+ <!--
+ "4002" = COMMENT_ANNOTATED_ELEMENT
+ "4003" = CONSTRAINT_CONSTRAINED_ELEMENT
+ -->
+ <object id="COMMENT_ANNOTATED_ELEMENT" class="org.eclipse.gmf.runtime.notation.Edge">
+ <method name="getType()" value="4002"></method>
+ </object>
+ <object id="CONSTRAINT_CONSTRAINED_ELEMENT" class="org.eclipse.gmf.runtime.notation.Edge">
+ <method name="getType()" value="4003"></method>
+ </object>
- <extension point="org.eclipse.ui.navigator.navigatorContent" id="navigator-content">
- <?gmfgen generated="true"?>
- <navigatorContent
- id="org.eclipse.papyrus.sysml.diagram.parametric.resourceContent"
- name="%navigatorContentName"
- priority="normal"
- contentProvider="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorContentProvider"
- labelProvider="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorLabelProvider"
- icon="icons/obj16/ResourceDiagramFile.gif"
- activeByDefault="true">
- <triggerPoints>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="sysml_diagram"/>
- </and>
- <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlAbstractNavigatorItem"/>
- </or>
- </triggerPoints>
- <possibleChildren>
- <or>
- <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlAbstractNavigatorItem"/>
- </or>
- </possibleChildren>
- <commonSorter
- id="org.eclipse.papyrus.sysml.diagram.parametric.navigatorSorter"
- class="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorSorter">
- <parentExpression>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="sysml_diagram"/>
- </and>
- <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlAbstractNavigatorItem"/>
- </or>
- </parentExpression>
- </commonSorter>
- </navigatorContent>
- <navigatorContent
- id="org.eclipse.papyrus.sysml.diagram.parametric.domainResourceContent"
- name="%domainNavigatorContentName"
- priority="normal"
- contentProvider="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorContentProvider"
- labelProvider="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorLabelProvider"
- icon="icons/obj16/ResourceDiagramFile.gif"
- activeByDefault="true">
- <triggerPoints>
- <or>
- <and>
- <instanceof value="org.eclipse.core.resources.IFile"/>
- <test property="org.eclipse.core.resources.extension" value="sysml"/>
- </and>
- <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorItem"/>
- </or>
- </triggerPoints>
- <possibleChildren>
- <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorItem"/>
- </possibleChildren>
- </navigatorContent>
- <actionProvider
- id="org.eclipse.papyrus.sysml.diagram.parametric.navigatorActionProvider"
- class="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorActionProvider">
- <enablement>
- <or>
- <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlAbstractNavigatorItem"/>
- </or>
- </enablement>
- </actionProvider>
- </extension>
-
- <extension point="org.eclipse.ui.navigator.linkHelper" id="navigator-linkhelper">
- <?gmfgen generated="true"?>
- <linkHelper
- id="org.eclipse.papyrus.sysml.diagram.parametric.navigatorLinkHelper"
- class="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorLinkHelper">
- <editorInputEnablement>
- <and>
- <instanceof value="org.eclipse.emf.common.ui.URIEditorInput"/>
- <test property="org.eclipse.papyrus.sysml.diagram.parametric.isURIEditorInput"/>
- </and>
- </editorInputEnablement>
- <selectionEnablement>
- <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlAbstractNavigatorItem"/>
- </selectionEnablement>
- </linkHelper>
- </extension>
- <extension point="org.eclipse.ui.commands" id="update-cmd">
- <?gmfgen generated="true"?>
- <command
- categoryId="org.eclipse.ui.category.edit"
- defaultHandler="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramUpdateCommand"
- description="%update.diagram.description"
- id="org.eclipse.papyrus.sysml.diagram.parametric.updateDiagram"
- name="%update.diagram.name"/>
- </extension>
-
- <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
- <?gmfgen generated="true"?>
- <key
- commandId="org.eclipse.papyrus.sysml.diagram.parametric.updateDiagram"
- contextId="org.eclipse.papyrus.sysml.diagram.parametric.ui.diagramContext"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="F5"/>
- </extension>
+ <context views="COMMENT, COMMENT_CN, CONSTRAINT, CONSTRAINT_CN"></context>
+ <context views="COMMENT_ANNOTATED_ELEMENT, CONSTRAINT_CONSTRAINED_ELEMENT"></context>
+
+ </editpartProvider>
+
+</extension>
- <extension point="org.eclipse.ui.menus" id="context-menus">
- <?gmfgen generated="true"?>
- <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
- </menuContribution>
- <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=">
- </menuContribution -->
- <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu">
- <command commandId="org.eclipse.papyrus.sysml.diagram.parametric.LoadResourceAction">
- <visibleWhen>
- <and>
- <with variable="activePartId"><equals value="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorID"/></with>
- <with variable="selection"><iterate ifEmpty="false">
- <instanceof value="org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart"/>
- </iterate></with>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
-
-
- <menuContribution locationURI="menu:org.eclipse.papyrus.ui.menu">
- <menu id="org.eclipse.papyrus.uml.diagram.ui.menu.diagrams"
- label="Diagrams">
- <command commandId="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramCommand"
- icon="icons/obj16/Diagram_Parametric.gif"
- label="Create a new Parametric Diagram"
- style="push"
- tooltip="Create a new Parametric Diagram">
- <visibleWhen>
- <reference definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML"/>
- </visibleWhen>
- </command>
- </menu>
- </menuContribution>
-
- <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar">
- <toolbar id="org.eclipse.papyrus.uml.diagram.ui.toolbar">
- <command commandId="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramCommand"
- icon="icons/obj16/Diagram_Parametric.gif"
- label="Create a new Parametric Diagram"
- style="push"
- tooltip="Create a new Parametric Diagram">
- <visibleWhen>
- <reference definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML"/>
- </visibleWhen>
- </command>
- </toolbar>
- </menuContribution>
-
- <menuContribution
- locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.creatediagram">
- <command commandId="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramCommand"
- icon="icons/obj16/Diagram_Parametric.gif"
- label="Create a new Parametric Diagram"
- style="push"
- tooltip="Create a new Parametric Diagram">
- <visibleWhen>
- <reference definitionId="org.eclipse.papyrus.sysml.diagram.common.IsPapyrusActiveWithSysML"/>
- </visibleWhen>
- </command>
- </menuContribution>
-
+<!-- Diagram edit policy provider -->
+<extension
+ point="org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders">
+ <editpolicyProvider
+ class="org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomEditPolicyProvider">
+ <Priority name="Low"/>
+ </editpolicyProvider>
</extension>
- <extension point="org.eclipse.ui.commands" id="menu-commands">
- <?gmfgen generated="true"?>
- <category id="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
- <command id="org.eclipse.papyrus.sysml.diagram.parametric.LoadResourceAction"
- name="Load Resource"
- categoryId="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorID"
- defaultHandler="org.eclipse.papyrus.sysml.diagram.parametric.part.LoadResourceAction"/>
- </extension>
-
- <extension point="org.eclipse.ui.commands">
- <command description="Create a new Parametric Diagram"
- categoryId="org.eclipse.papyrus.editor.category"
- id="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramCommand"
- name="Create Parametric Diagram">
- </command>
- </extension>
-
- <extension point="org.eclipse.ui.handlers">
- <handler class="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramWithNavigationHandler"
- commandId="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramCommand">
- <activeWhen>
- <with variable="activeEditorId">
- <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"></equals>
- </with>
- </activeWhen>
- </handler>
- </extension>
-
-
- <extension
- point="org.eclipse.papyrus.infra.core.papyrusDiagram">
- <editorDiagram
- factoryClass="org.eclipse.papyrus.sysml.diagram.parametric.ParametricDiagramEditorFactory"
- icon="icons/obj16/Diagram_Parametric.gif">
- </editorDiagram>
- <creationCommand
- creationCommandClass="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramCommand"
- creationCondition="org.eclipse.papyrus.sysml.diagram.parametric.ParametricDiagramCondition"
- icon="icons/obj16/Diagram_Parametric.gif"
- id="org.eclipse.papyrus.sysml.diagram.parametric.CreateParametricDiagramCommand"
- language="sysml"
- label="SysML Parametric Diagram">
- </creationCommand>
- </extension>
-<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
- <?gmfgen generated="true"?>
- <ParserProvider class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider">
- <Priority name="Lowest"/>
- </ParserProvider>
- </extension>
+<!-- Preference pages declaration -->
+<extension point="org.eclipse.ui.preferencePages" id="prefpages">
+
+ <!-- Diagram Preference pages declaration -->
+ <page
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ name="Parametric Diagram"
+ category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ParametricDiagramGeneralPreferencePage">
+ </page>
-<extension point="org.eclipse.ui.preferencePages">
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.Parametric"
- class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConstraintPropertyPreferencePage"
- id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConstraintPropertyPreferencePage"
- name="ConstraintProperty Node" />
+ <!-- Element Preference pages declaration -->
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConstraintPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConstraintPreferencePage"
+ name="Constraint">
+ </page>
+
+
+
+
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CommentPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CommentPreferencePage"
+ name="Comment">
+ </page>
+
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CommentAnnotatedElementPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CommentAnnotatedElementPreferencePage"
+ name="CommentAnnotatedElement">
+ </page>
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.Parametric"
- class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.PropertyPreferencePage"
- id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.PropertyPreferencePage"
- name="Property Node" />
-
-
-
-
- <?gmfgen generated="true"?>
- <page category="org.eclipse.papyrus.infra.gmfdiag.preferences.diagrams.Parametric"
- class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConnectorPreferencePage"
- id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConnectorPreferencePage"
- name="Connector Link" />
-
-
-</extension>
-<extension
- point="org.eclipse.papyrus.extensionpoints.editors.DirectEditor">
- <DirectEditor
- contributor="Eclipse.org"
- editorConfiguration="org.eclipse.papyrus.sysml.diagram.parametric.texteditor.ConstraintPropertyConfiguration"
- icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintProperty.gif"
- language="Papyrus SysML"
- objectToEdit="org.eclipse.papyrus.sysml.constraints.ConstraintProperty">
- <simpleeditor
- editorConfiguration="org.eclipse.papyrus.sysml.diagram.parametric.texteditor.ConstraintPropertyConfiguration">
- </simpleeditor>
- </DirectEditor>
-</extension>
-
-<extension point="org.eclipse.emf.validation.constraintProviders">
- <?gmfgen generated="true"?>
- <category id="org.eclipse.uml2.uml.util.UMLValidator.validate" mandatory="false" name="validateSysMLModel">
- <![CDATA[Validate the SysML model]]>
- </category>
- <category id="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement" mandatory="false" name="validateConnectorElement">
- <![CDATA[validate a connector checking that its children are consistent]]>
- </category>
- <constraintProvider cache="true">
- <package namespaceUri="http://www.eclipse.org/uml2/3.0.0/UML"/>
- <package namespaceUri="http://www.eclipse.org/papyrus/0.7.0/SysML/Blocks"/>
- <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate">
- </constraints>
- <constraints categories="org.eclipse.uml2.uml.util.UMLValidator.validate/org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement">
- <constraint id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateConnector"
- lang="Java" class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlValidationProvider$Adapter1"
- name="validateConnector"
- mode="Live"
- severity="WARNING" statusCode="200">
-
- <description><![CDATA[The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property]]></description>
- <message><![CDATA[NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector.]]></message>
- <target class="uml.Connector"/>
- </constraint>
- <constraint id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateProperty"
- lang="Java" class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlValidationProvider$Adapter2"
- name="validateProperty"
- mode="Live"
- severity="WARNING" statusCode="200">
-
- <description><![CDATA[When you move a property, check that its incoming or outgoings connector get consistent connectorEnd]]></description>
- <message><![CDATA[NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector.]]></message>
- <target class="uml.Property"/>
- </constraint>
- <constraint id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateConnectorEnd"
- lang="Java" class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlValidationProvider$Adapter3"
- name="validateConnectorEnd"
- mode="Live"
- severity="WARNING" statusCode="200">
-
- <description><![CDATA[The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property]]></description>
- <message><![CDATA[NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector.]]></message>
- <target class="uml.ConnectorEnd"/>
- </constraint>
- <constraint id="org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateNestedConnectorEnd"
- lang="Java" class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlValidationProvider$Adapter4"
- name="validateNestedConnectorEnd"
- mode="Live"
- severity="WARNING" statusCode="200">
-
- <description><![CDATA[The NestedConnectorEnd stereotype of UML ConnectorEnd extends a UML ConnectorEnd so that the connected property]]></description>
- <message><![CDATA[NestedConnectorEnd is used for connected property identified by a multi-level path of accessible properties from the block that owns the connector.]]></message>
- <target class="sysml.blocks.NestedConnectorEnd"/>
- </constraint>
- </constraints>
- </constraintProvider>
- </extension>
-<extension point="org.eclipse.emf.validation.constraintBindings">
- <?gmfgen generated="true"?>
- <clientContext default="false" id="org.eclipse.papyrus.sysml.diagram.parametricDefaultCtx">
- <selector class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlValidationProvider$DefaultCtx"/>
- </clientContext>
- <binding context="org.eclipse.papyrus.sysml.diagram.parametricDefaultCtx">
- <constraint ref="org.eclipse.papyrus.sysml.diagram.parametric.org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateConnector"/>
- <constraint ref="org.eclipse.papyrus.sysml.diagram.parametric.org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateProperty"/>
- <constraint ref="org.eclipse.papyrus.sysml.diagram.parametric.org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateConnectorEnd"/>
- <constraint ref="org.eclipse.papyrus.sysml.diagram.parametric.org.eclipse.uml2.uml.util.UMLValidator.validateConnectorElement_validateNestedConnectorEnd"/>
- </binding>
-
- </extension>
-<extension
- point="org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders">
- <editpolicyProvider
- class="org.eclipse.papyrus.sysml.diagram.parametric.providers.CustomEditPolicyProvider">
- <Priority
- name="Lowest">
- </Priority>
- </editpolicyProvider>
-</extension>
-<extension point="org.eclipse.gmf.runtime.common.ui.services.markerNavigationProviders" id="markers-navigation">
- <?gmfgen generated="true"?>
- <MarkerNavigationProvider class="org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlMarkerNavigationProvider">
- <MarkerType name="org.eclipse.papyrus.sysml.diagram.parametric.diagnostic"/>
- <Priority name="Lowest"/>
- </MarkerNavigationProvider>
- </extension>
-
-<extension id="diagnostic" name="Sysml Parametric diagram Plugin problems" point="org.eclipse.core.resources.markers">
- <?gmfgen generated="true"?>
- <super type="org.eclipse.core.resources.problemmarker"/>
- <super type="org.eclipse.gmf.runtime.common.ui.services.marker"/>
- <persistent value="true"/>
- </extension><extension
- id="Sysml Parametric diagram Plugin.palettedefinition"
- name="Sysml Parametric diagram Plugin Predefined Entries"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <?gmfgen generated="true"?>
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Lowest"/>
- <contribution
- factoryClass="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- <entry
- defineOnly="true"
- description="Create new ConstraintProperty"
- id="createConstraintProperty1CreationTool"
- kind="tool"
- label="ConstraintProperty"
- large_icon="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/full/obj16/ConstraintProperty.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.papyrus.sysml.edit/icons/full/obj16/ConstraintProperty.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Property"
- id="createProperty2CreationTool"
- kind="tool"
- label="Property"
- large_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif"
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif">
- </entry>
- <entry
- defineOnly="true"
- description="Create new Connector"
- id="createConnector3CreationTool"
- kind="tool"
- label="Connector"
- large_icon=""
- path=""
- small_icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Connector.gif">
- </entry>
-
- </contribution>
- </paletteProvider>
-
- </extension>
-
-<extension
- id="Sysml Parametric diagram Plugin.standard"
- name="Sysml Parametric diagram Plugin Standard Palette"
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
-
- <?gmfgen generated="true"?>
- <paletteProvider class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority name="Low"/>
- <contribution
- factoryClass="org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlPaletteFactory">
- <predefinedEntry id="standardGroup/noteStack/noteTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/textTool" remove="true"/>
- <predefinedEntry id="standardGroup/noteStack/noteattachmentTool" remove="true"/>
- <entry
- description=""
- id="createParametric1Group"
- kind="drawer"
- label="Parametric"
- large_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif"
- path="/"
- small_icon="platform:/plugin/org.eclipse.gmf.runtime.diagram.ui/icons/group.gif">
- <expand
- force="true">
- </expand>
- </entry>
-
- <predefinedEntry
- id="createConstraintProperty1CreationTool"
- path="/createParametric1Group">
- </predefinedEntry>
- <predefinedEntry
- id="createProperty2CreationTool"
- path="/createParametric1Group">
- </predefinedEntry>
- <predefinedEntry
- id="createConnector3CreationTool"
- path="/createParametric1Group">
- </predefinedEntry>
-
-
- </contribution>
- <editor id="org.eclipse.papyrus.sysml.diagram.parametric"/>
- </paletteProvider>
-
- </extension>
-
-<extension point="org.eclipse.ui.handlers" id="menu-handlers">
- <?gmfgen generated="true"?>
- </extension>
-
- <!-- optionally, specify keybindings -->
-</plugin>
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.BlockCompositePreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.BlockCompositePreferencePage"
+ name="BlockComposite">
+ </page>
+
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CustomBlockPropertyCompositePreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CustomBlockPropertyCompositePreferencePage"
+ name="BlockPropertyComposite">
+ </page>
+
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CustomConstraintPropertyCompositePreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.CustomConstraintPropertyCompositePreferencePage"
+ name="ConstraintPropertyComposite">
+ </page>
+
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.FlowPortPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.FlowPortPreferencePage"
+ name="FlowPort">
+ </page>
+
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.PortPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.PortPreferencePage"
+ name="Port">
+ </page>
+
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConnectorPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConnectorPreferencePage"
+ name="Connector">
+ </page>
+
+ <page category="org.eclipse.papyrus.sysml.diagram.parametric.preferences"
+ class="org.eclipse.papyrus.sysml.diagram.parametric.preferences.DependencyPreferencePage"
+ id="org.eclipse.papyrus.sysml.diagram.parametric.preferences.DependencyPreferencePage"
+ name="Dependency">
+ </page>
+
+
+</extension>
+
+<!-- // Start of user code custom extensions
+ -->
+<!-- Parser provider declaration -->
+<extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders">
+ <ParserProvider class="org.eclipse.papyrus.sysml.diagram.parametric.provider.ParserProvider">
+ <Priority name="Low"></Priority>
+ </ParserProvider>
+</extension>
+
+ <!-- Diagram specific advices -->
+<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
+ <metamodel nsURI="http://www.eclipse.org/uml2/4.0.0/UML">
+ <!-- specific advices (pop up on creation) -->
+ <adviceBinding id="org.eclipse.papyrus.sysml.service.types.helper.ConstraintParameterEditHelperAdvice"
+ class="org.eclipse.papyrus.sysml.service.types.helper.ConstraintParameterEditHelperAdvice"
+ inheritance="none"
+ typeId="org.eclipse.papyrus.uml.Property"/>
+ </metamodel>
+</extension>
+
+<!-- UML ElementType bindings to Papyrus shared IClientContext -->
+<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
+
+ <!-- Bindings declaration to shared IClientContext -->
+ <binding context="org.eclipse.papyrus.infra.services.edit.TypeContext">
+ <elementType ref="org.eclipse.papyrus.sysml.service.types.helper.ConstraintParameterEditHelperAdvice"/>
+ </binding>
+
+</extension>
+
+<!-- // End of user code
+ -->
+
+</plugin> \ No newline at end of file
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCreateCommand.java
new file mode 100644
index 00000000000..7966aa486a3
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCreateCommand.java
@@ -0,0 +1,168 @@
+package org.eclipse.papyrus.sysml.diagram.parametric;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.notation.Bounds;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.infra.services.edit.utils.GMFCommandUtils;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+import org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditorPlugin;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+// Start of user code custom imports
+// End of user code
+
+public class ParametricDiagramCreateCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getDefaultDiagramName() {
+ return "NewParametricDiagram"; //$NON-NLS-1$
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getDiagramNotationID() {
+ return ElementTypes.DIAGRAM_ID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected PreferencesHint getPreferenceHint() {
+ return Activator.DIAGRAM_PREFERENCES_HINT;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Diagram createDiagram(Resource diagramResource, EObject owner, String name) {
+ // Start of user code Custom diagram creation
+ Diagram diagram = null;
+
+ if(owner instanceof org.eclipse.uml2.uml.Class) {
+ org.eclipse.uml2.uml.Class cOwner = (org.eclipse.uml2.uml.Class)owner;
+ Block block = UMLUtil.getStereotypeApplication(cOwner, Block.class);
+
+ if(block != null) {
+ canvasDomainElement = (EObject)owner;
+ Package owningPackage = ((Element)owner).getNearestPackage();
+ diagram = super.createDiagram(diagramResource, owningPackage, name);
+ }
+
+ } else if(owner instanceof Package) {
+
+ try {
+ canvasDomainElement = null;
+
+ IEditCommandRequest request = new CreateElementRequest((Package)owner, SysMLElementTypes.BLOCK);
+ IElementEditService commandService = ElementEditServiceUtils.getCommandProvider(owner);
+ if(commandService == null) {
+ return null;
+ }
+
+ ICommand createElementCommand = commandService.getEditCommand(request);
+ if((createElementCommand != null) && (createElementCommand.canExecute())) {
+ createElementCommand.execute(new NullProgressMonitor(), null);
+ EObject block = GMFCommandUtils.getCommandEObjectResult(createElementCommand);
+ canvasDomainElement = block;
+ diagram = super.createDiagram(diagramResource, (Package)owner, name);
+ }
+
+ } catch (ExecutionException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ return diagram;
+ // End of user code
+ }
+
+ // Start of user code Custom creation command
+ /** Domain Element referenced by canvas if it differs from {@link Package} */
+ protected EObject canvasDomainElement = null;
+
+ /** Default margin for the display of Domain Element referenced by canvas */
+ protected static int DEFAULT_MARGIN = 20;
+
+ /** Default height for the display of Domain Element referenced by canvas */
+ protected static int DEFAULT_HEIGHT = 600;
+
+ /** Default width for the display of Domain Element referenced by canvas */
+ protected static int DEFAULT_WIDTH = 1000;
+
+ /**
+ * Initialize the diagram. The diagram is attached to the element selected on creation.
+ * Possible element types are: Block.
+ */
+ @Override
+ protected void initializeDiagram(EObject diagram) {
+ if(diagram instanceof Diagram) {
+ Diagram currentDiagram = (Diagram)diagram;
+ if(canvasDomainElement != null) {
+ currentDiagram.setElement(canvasDomainElement);
+ initializeDiagramContent(currentDiagram);
+ }
+ }
+ }
+
+ /**
+ * Initialize the diagram with the canvas domain element shown.
+ *
+ * @param diagram
+ * the diagram to initialize
+ */
+ protected void initializeDiagramContent(Diagram diagram) {
+
+ // Create a view for the canvasDomainElement in the new diagram
+ View view =
+ ViewService.getInstance().createNode(new SemanticAdapter(canvasDomainElement, null), diagram, SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID, ViewUtil.APPEND, true, UMLDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
+ view.setElement(diagram.getElement());
+
+ // Update the view position and size (should adapt to canvas current size)
+ Bounds viewBounds = (Bounds)((Node)view).getLayoutConstraint();
+ viewBounds.setX(DEFAULT_MARGIN);
+ viewBounds.setY(DEFAULT_MARGIN);
+ viewBounds.setHeight(DEFAULT_HEIGHT);
+ viewBounds.setWidth(DEFAULT_WIDTH);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @generated NOT
+ */
+ @Override
+ public boolean isParentReassignable() {
+ // Bug 374626: [Model Explorer] Moving an IBD from a block to another block shall be forbidden
+ return false;
+ }
+
+ // End of user code
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java
new file mode 100644
index 00000000000..2bb7a36cd11
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramEditorFactory.java
@@ -0,0 +1,12 @@
+package org.eclipse.papyrus.sysml.diagram.parametric;
+
+import org.eclipse.papyrus.infra.gmfdiag.common.GmfEditorFactory;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+
+public class ParametricDiagramEditorFactory extends GmfEditorFactory {
+
+ public ParametricDiagramEditorFactory() {
+ super(ParametricDiagramForMultiEditor.class, ElementTypes.DIAGRAM_ID);
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java
index 7477764384f..b622f68c7da 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramForMultiEditor.java
@@ -1,114 +1,103 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.infra.core.editor.BackboneException;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditor;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-
-public class ParametricDiagramForMultiEditor extends SysmlDiagramEditor {
-
- /**
- * The location of diagram icon in the plug-in
- */
- private static final String DIAG_IMG_PATH = "icons/obj16/Diagram_Parametric.gif";
-
- /**
- * The image descriptor of the diagram icon
- */
- private static final ImageDescriptor DIAG_IMG_DESC = SysmlDiagramEditorPlugin.getBundledImageDescriptor(ParametricDiagramForMultiEditor.DIAG_IMG_PATH);
-
- /** The editor splitter. */
- private Composite splitter;
-
- /**
- * Constructor for SashSystem v2. Context and required objects are retrieved
- * from the ServiceRegistry.
- *
- * @throws BackboneException
- * @throws ServiceException
- *
- */
- public ParametricDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
- super(servicesRegistry, diagram);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- super.init(site, input);
- setPartName(getDiagram().getName());
- setTitleImage(DIAG_IMG_DESC.createImage());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setInput(IEditorInput input) {
- try {
- // Provide an URI with fragment in order to reuse the same Resource
- // and set the diagram to the fragment.
- URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(getDiagram()));
- doSetInput(uriInput, true);
- } catch (CoreException x) {
- String title = "Problem opening";
- String msg = "Cannot open input element:";
- Shell shell = getSite().getShell();
- ErrorDialog.openError(shell, title, msg, x.getStatus());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createGraphicalViewer(Composite parent) {
- splitter = parent;
- super.createGraphicalViewer(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setFocus() {
- splitter.setFocus();
- super.setFocus();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getEditingDomainID() {
- return "org.eclipse.papyrus.sysml.diagram.parametric.EditingDomain";
- }
-
-}
+package org.eclipse.papyrus.sysml.diagram.parametric;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.infra.core.editor.BackboneException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.sysml.diagram.parametric.part.ParametricDiagramEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * An editor to be used in multitabs editor. This editor extends the original UML Diagram.
+ *
+ */
+public class ParametricDiagramForMultiEditor extends ParametricDiagramEditor {
+
+ /**
+ * The location of diagram icon in the plug-in
+ */
+ private static final String DIAG_IMG_PATH = "icons/obj16/Diagram_Parametric.png";
+
+ /**
+ * The image descriptor of the diagram icon
+ */
+ private static final ImageDescriptor DIAG_IMG_DESC = Activator.getBundledImageDescriptor(ParametricDiagramForMultiEditor.DIAG_IMG_PATH);
+
+ /** The editor splitter. */
+ private Composite splitter;
+
+ /**
+ * Constructor for SashSystem v2. Context and required objects are retrieved from the
+ * ServiceRegistry.
+ *
+ * @throws BackboneException
+ * @throws ServiceException
+ *
+ */
+ public ParametricDiagramForMultiEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws BackboneException, ServiceException {
+ super(servicesRegistry, diagram);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+ super.init(site, input);
+ setPartName(getDiagram().getName());
+ setTitleImage(DIAG_IMG_DESC.createImage());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setInput(IEditorInput input) {
+ try {
+ // Provide an URI with fragment in order to reuse the same Resource
+ // and set the diagram to the fragment.
+ URIEditorInput uriInput = new URIEditorInput(EcoreUtil.getURI(getDiagram()));
+ doSetInput(uriInput, true);
+ } catch (CoreException x) {
+ String title = "Problem opening";
+ String msg = "Cannot open input element:";
+ Shell shell = getSite().getShell();
+ ErrorDialog.openError(shell, title, msg, x.getStatus());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createGraphicalViewer(Composite parent) {
+ splitter = parent;
+ super.createGraphicalViewer(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setFocus() {
+ splitter.setFocus();
+ super.setFocus();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getEditingDomainID() {
+ return "org.eclipse.papyrus.sysml.diagram.parametric.EditingDomain";
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/ParametricDiagramEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/ParametricDiagramEditPart.java
new file mode 100644
index 00000000000..8f4125a80ce
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/ParametricDiagramEditPart.java
@@ -0,0 +1,31 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.part;
+
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultContainerNodeEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultCreationEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultXYLayoutEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDragDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.policy.DiagramSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
+
+public class ParametricDiagramEditPart extends DiagramEditPart {
+
+ public ParametricDiagramEditPart(View view) {
+ super(view);
+ }
+
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DiagramSemanticEditPolicy());
+ installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
+ installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDragDropEditPolicy());
+ installEditPolicy(EditPolicy.LAYOUT_ROLE, new DefaultXYLayoutEditPolicy());
+ installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
+ installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultContainerNodeEditPolicy());
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/DiagramSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/DiagramSemanticEditPolicy.java
new file mode 100644
index 00000000000..f4d1149e7be
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/DiagramSemanticEditPolicy.java
@@ -0,0 +1,43 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.policy;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.requests.ReconnectRequest;
+// Start of user code custom imports
+// End of user code
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomDefaultSemanticEditPolicy;
+
+public class DiagramSemanticEditPolicy extends CustomDefaultSemanticEditPolicy {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getReorientRelationshipSourceCommand(ReconnectRequest request) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getReorientRelationshipTargetCommand(ReconnectRequest request) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getReorientRefRelationshipSourceCommand(ReconnectRequest request) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getReorientRefRelationshipTargetCommand(ReconnectRequest request) {
+ return UnexecutableCommand.INSTANCE;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/ParametricDiagramDragDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/ParametricDiagramDragDropEditPolicy.java
new file mode 100644
index 00000000000..5aefccbb024
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/edit/policy/ParametricDiagramDragDropEditPolicy.java
@@ -0,0 +1,38 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.policy;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.GraphicalTypeRegistry;
+import org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies.CustomDiagramDragDropEditPolicy;
+
+/** Customization of the DND edit policy for the Parametric Diagram */
+public class ParametricDiagramDragDropEditPolicy extends CustomDiagramDragDropEditPolicy {
+
+ /** Local graphical type registry */
+ protected IGraphicalTypeRegistry registry = new GraphicalTypeRegistry();
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getNodeVisualID(View containerView, EObject domainElement) {
+ String domainType = registry.getNodeGraphicalType(domainElement, containerView.getType());
+ if (IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainType)) {
+ return -1; // undefined
+ }
+ return new Integer(domainType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public int getLinkWithClassVisualID(EObject domainElement) {
+ String domainType = registry.getEdgeGraphicalType(domainElement);
+ if (IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainType)) {
+ return -1; // undefined
+ }
+ return new Integer(domainType);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java
new file mode 100644
index 00000000000..2a7b5905238
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java
@@ -0,0 +1,62 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.factory;
+
+import java.util.Arrays;
+import java.util.HashMap;
+
+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.sysml.diagram.internalblock.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+
+@SuppressWarnings("serial")
+public class DiagramPaletteFactory extends PaletteFactory.Adapter {
+
+ private static HashMap<String, IElementType[]> nodesToolIdTypesMap = new HashMap<String, IElementType[]>() {
+
+ {
+ put("parametric.tool.blockcomposite", new IElementType[]{ SysMLElementTypes.BLOCK });
+ put("parametric.tool.blockpropertycomposite", new IElementType[]{ SysMLElementTypes.PART_PROPERTY });
+ put("parametric.tool.reference", new IElementType[]{ SysMLElementTypes.REFERENCE_PROPERTY });
+ put("parametric.tool.value", new IElementType[]{ SysMLElementTypes.VALUE_PROPERTY });
+ put("parametric.tool.constraintblockpropertycomposite", new IElementType[]{ SysMLElementTypes.CONSTRAINT_PROPERTY });
+ put("parametric.tool.flowport", new IElementType[]{ SysMLElementTypes.FLOW_PORT });
+ put("parametric.tool.port", new IElementType[]{ UMLElementTypes.PORT });
+ put("parametric.tool.parameter", new IElementType[]{ UMLElementTypes.PROPERTY });
+ //Start of user code Custom nodes
+ put("parametric.tool.constraint", new IElementType[]{ UMLElementTypes.CONSTRAINT });
+ put("parametric.tool.comment", new IElementType[]{ UMLElementTypes.COMMENT });
+ //End of user code
+ }
+ };
+
+ private static HashMap<String, IElementType[]> edgesToolIdTypesMap = new HashMap<String, IElementType[]>() {
+
+ {
+ put("parametric.tool.connector", new IElementType[]{ UMLElementTypes.CONNECTOR });
+ put("parametric.tool.dependency", new IElementType[]{ UMLElementTypes.DEPENDENCY });
+ //Start of user code Custom edges
+ put("parametric.tool.comment_constraint_link", new IElementType[]{ ElementTypes.COMMENT_ANNOTATED_ELEMENT, ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT });
+ //End of user code
+ }
+ };
+
+ public Tool createTool(String toolId) {
+
+ IElementType[] types;
+
+ types = nodesToolIdTypesMap.get(toolId);
+ if(types != null) {
+ return new AspectUnspecifiedTypeCreationTool(Arrays.asList(types));
+ }
+
+ types = edgesToolIdTypesMap.get(toolId);
+ if(types != null) {
+ return new AspectUnspecifiedTypeConnectionTool(Arrays.asList(types));
+ }
+ return null;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java.lost b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java.lost
new file mode 100644
index 00000000000..28a8ccfd100
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/DiagramPaletteFactory.java.lost
@@ -0,0 +1,18 @@
+
+Tue Jun 25 16:58:16 CEST 2013
+================================================================================
+Start of user code Custom nodes
+
+ //End of user code
+Start of user code Custom edges
+
+ //End of user code
+
+Tue Jun 25 17:00:48 CEST 2013
+================================================================================
+Start of user code Custom nodes
+
+ //End of user code
+Start of user code Custom edges
+
+ //End of user code
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/ParametricDiagramViewFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/ParametricDiagramViewFactory.java
new file mode 100644
index 00000000000..95bc3423246
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/factory/ParametricDiagramViewFactory.java
@@ -0,0 +1,18 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.factory;
+
+import org.eclipse.gmf.runtime.diagram.ui.view.factories.DiagramViewFactory;
+import org.eclipse.gmf.runtime.notation.MeasurementUnit;
+
+public class ParametricDiagramViewFactory extends DiagramViewFactory {
+
+ // Start of user code Custom view Factory field
+ // End of user code
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected MeasurementUnit getMeasurementUnit() {
+ return MeasurementUnit.PIXEL_LITERAL;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/part/ParametricDiagramEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/part/ParametricDiagramEditor.java
new file mode 100644
index 00000000000..75d1e14f700
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/part/ParametricDiagramEditor.java
@@ -0,0 +1,51 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.part;
+
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+
+/**
+ * @generated
+ */
+public class ParametricDiagramEditor extends org.eclipse.papyrus.uml.diagram.composite.part.UMLDiagramEditor {
+
+ /** context used when trying to find services */
+ public static final String ID = "org.eclipse.papyrus.sysml.diagram.parametric.part.ParametricDiagramEditorID"; //$NON-NLS-1$
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getContextID() {
+ return CONTEXT_ID;
+ }
+
+ /**
+ * @throws org.eclipse.papyrus.infra.core.services.ServiceException
+ * @generated
+ */
+ public ParametricDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException, org.eclipse.papyrus.infra.core.services.ServiceException {
+ super(servicesRegistry, diagram);
+ }
+
+ // Start of user code Custom Editor Methods
+ // End of user code
+
+ /**
+ * @generated
+ */
+ @Override
+ public String getContributorId() {
+ return Activator.PLUGIN_ID;
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected PreferencesHint getPreferencesHint() {
+ return Activator.DIAGRAM_PREFERENCES_HINT;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockCompositePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockCompositePreferencePage.java
new file mode 100644
index 00000000000..204f72703c8
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockCompositePreferencePage.java
@@ -0,0 +1,83 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+
+public class BlockCompositePreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID; //$NON-NLS-1$
+
+ /** The compartments default visibility for preferences */
+ public static final Map<String, Boolean> compartmentDefaultVisibilityMap;
+
+ /** The compartment titles default visibility for preferences */
+ public static final Map<String, Boolean> compartmentTitleDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ compartmentDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ compartmentDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$
+
+ compartmentTitleDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ compartmentTitleDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$
+
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(compartmentDefaultVisibilityMap);
+ Collections.unmodifiableMap(compartmentTitleDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public BlockCompositePreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ // End of user code
+
+ // Initialize default visibility for compartments in preference page.
+ for(String compartmentName : compartmentDefaultVisibilityMap.keySet()) {
+ String showCompartmentKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
+ store.setDefault(showCompartmentKey, compartmentDefaultVisibilityMap.get(compartmentName));
+ }
+
+ // Initialize default title visibility for compartments in preference page.
+ for(String compartmentName : compartmentTitleDefaultVisibilityMap.keySet()) {
+ String showCompartmentTitleKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferenceConstantHelper.COMPARTMENT_NAME_VISIBILITY);
+ store.setDefault(showCompartmentTitleKey, compartmentTitleDefaultVisibilityMap.get(compartmentName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeCompartmentNamesList() {
+ for(String name : compartmentDefaultVisibilityMap.keySet()) {
+ this.compartmentNamesList.add(name);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeCompartmentTitlesList() {
+ for(String name : compartmentTitleDefaultVisibilityMap.keySet()) {
+ this.compartmentTitlesList.add(name);
+ }
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentAnnotatedElementPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentAnnotatedElementPreferencePage.java
new file mode 100644
index 00000000000..56fb3a64404
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentAnnotatedElementPreferencePage.java
@@ -0,0 +1,30 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+
+public class CommentAnnotatedElementPreferencePage extends ParametricDiagramLinkPreferencePage {
+
+ /** Constant key to access preferences */
+ protected static String prefKey = ElementTypes.DIAGRAM_ID + "_CommentAnnotatedElement"; //$NON-NLS-1$
+
+
+ /** Default constructor */
+ public CommentAnnotatedElementPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_CommentAnnotatedElement"); //$NON-NLS-1$
+ }
+
+ /**
+ * Initialize defaults using a specified {@link IPreferenceStore}
+ *
+ * @param store
+ * the preference store.
+ */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ // End of user code
+
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentPreferencePage.java
new file mode 100644
index 00000000000..d81c51d3791
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CommentPreferencePage.java
@@ -0,0 +1,31 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+
+public class CommentPreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ protected static String prefKey = ElementTypes.DIAGRAM_ID + "_Comment"; //$NON-NLS-1$
+
+
+ /** Default constructor */
+ public CommentPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_Comment"); //$NON-NLS-1$
+ }
+
+ /**
+ * Initialize defaults using a specified {@link IPreferenceStore}
+ *
+ * @param store
+ * the preference store.
+ */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ // End of user code
+
+ }
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java
new file mode 100644
index 00000000000..21808a0f5b2
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java
@@ -0,0 +1,61 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+
+public class ConnectorPreferencePage extends ParametricDiagramLinkPreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID; //$NON-NLS-1$
+
+ /** The labels default visibility for preferences */
+ public static final Map<String, Boolean> labelDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ labelDefaultVisibilityMap.put("Stereotype", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("Name", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("SourceMultiplicity", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("TargetMultiplicity", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(labelDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public ConnectorPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ // End of user code
+
+ // Initialize default visibility for labels in preference page.
+ for(String labelName : labelDefaultVisibilityMap.keySet()) {
+ String showLabelKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
+ store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeLabelsList() {
+ for(String name : labelDefaultVisibilityMap.keySet()) {
+ this.labelsList.add(name);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintConstrainedElementPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintConstrainedElementPreferencePage.java
new file mode 100644
index 00000000000..42d66df2afe
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintConstrainedElementPreferencePage.java
@@ -0,0 +1,30 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+
+public class ConstraintConstrainedElementPreferencePage extends ParametricDiagramLinkPreferencePage {
+
+ /** Constant key to access preferences */
+ protected static String prefKey = ElementTypes.DIAGRAM_ID + "_ConstraintConstrainedElement"; //$NON-NLS-1$
+
+
+ /** Default constructor */
+ public ConstraintConstrainedElementPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_ConstraintConstrainedElement"); //$NON-NLS-1$
+ }
+
+ /**
+ * Initialize defaults using a specified {@link IPreferenceStore}
+ *
+ * @param store
+ * the preference store.
+ */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ // End of user code
+
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPreferencePage.java
new file mode 100644
index 00000000000..6a31b455ae9
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPreferencePage.java
@@ -0,0 +1,31 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+
+public class ConstraintPreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ protected static String prefKey = ElementTypes.DIAGRAM_ID + "_Constraint"; //$NON-NLS-1$
+
+
+ /** Default constructor */
+ public ConstraintPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_Constraint"); //$NON-NLS-1$
+ }
+
+ /**
+ * Initialize defaults using a specified {@link IPreferenceStore}
+ *
+ * @param store
+ * the preference store.
+ */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ // End of user code
+
+ }
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DependencyPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DependencyPreferencePage.java
new file mode 100644
index 00000000000..c321e7e2939
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DependencyPreferencePage.java
@@ -0,0 +1,59 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+
+public class DependencyPreferencePage extends ParametricDiagramLinkPreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID; //$NON-NLS-1$
+
+ /** The labels default visibility for preferences */
+ public static final Map<String, Boolean> labelDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ labelDefaultVisibilityMap.put("Stereotype", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("Name", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(labelDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public DependencyPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ // End of user code
+
+ // Initialize default visibility for labels in preference page.
+ for(String labelName : labelDefaultVisibilityMap.keySet()) {
+ String showLabelKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
+ store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeLabelsList() {
+ for(String name : labelDefaultVisibilityMap.keySet()) {
+ this.labelsList.add(name);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/FlowPortPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/FlowPortPreferencePage.java
new file mode 100644
index 00000000000..c5119a7db01
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/FlowPortPreferencePage.java
@@ -0,0 +1,60 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+
+public class FlowPortPreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_shape_sysml_flowport_as_affixed"; //$NON-NLS-1$
+
+ /** The labels default visibility for preferences */
+ public static final Map<String, Boolean> labelDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ labelDefaultVisibilityMap.put("FlowPortAffixedLabel", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("AppliedStereotypeAffixedLabel", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(labelDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public FlowPortPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_shape_sysml_flowport_as_affixed"); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.WIDTH), 20);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.HEIGHT), 20);
+ // End of user code
+
+ // Initialize default visibility for labels in preference page.
+ for(String labelName : labelDefaultVisibilityMap.keySet()) {
+ String showLabelKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
+ store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeLabelsList() {
+ for(String name : labelDefaultVisibilityMap.keySet()) {
+ this.labelsList.add(name);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramGeneralPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramGeneralPreferencePage.java
new file mode 100644
index 00000000000..9f0750bfb35
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramGeneralPreferencePage.java
@@ -0,0 +1,11 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.DiagramPreferencePage;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+
+public class ParametricDiagramGeneralPreferencePage extends DiagramPreferencePage {
+
+ public ParametricDiagramGeneralPreferencePage() {
+ setPreferenceStore(Activator.getInstance().getPreferenceStore());
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramLinkPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramLinkPreferencePage.java
new file mode 100644
index 00000000000..8f688d25a1e
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramLinkPreferencePage.java
@@ -0,0 +1,60 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.TreeMap;
+
+import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusLinkPreferencePage;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.OrderedLabelGroup;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+import org.eclipse.swt.widgets.Composite;
+
+public class ParametricDiagramLinkPreferencePage extends AbstractPapyrusLinkPreferencePage {
+
+ /** The list of label names for this link */
+ protected List<String> labelsList;
+
+ /** Constructor */
+ public ParametricDiagramLinkPreferencePage() {
+ labelsList = new ArrayList<String>();
+ initializeLabelsList();
+ Collections.unmodifiableList(labelsList);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createPageContents(Composite parent) {
+ super.createPageContents(parent);
+
+ // Add label visibility group
+ if(!labelsList.isEmpty()) {
+ OrderedLabelGroup compartmentGroup = new OrderedLabelGroup(parent, getPreferenceKey(), this, labelsList);
+ addAbstractGroup(compartmentGroup);
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getBundleId() {
+ return Activator.PLUGIN_ID;
+ }
+
+ /** Initialize the list containing names of labels. */
+ protected void initializeLabelsList() {
+ // Implemented by subclasses.
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected final TreeMap<String, String> getLabelRole() {
+ return new TreeMap<String, String>();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramNodePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramNodePreferencePage.java
new file mode 100644
index 00000000000..4d9e33bb8e6
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramNodePreferencePage.java
@@ -0,0 +1,106 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.TreeMap;
+
+import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusNodePreferencePage;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.OrderedCompartmentGroup;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.ui.OrderedLabelGroup;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+import org.eclipse.swt.widgets.Composite;
+
+public class ParametricDiagramNodePreferencePage extends AbstractPapyrusNodePreferencePage {
+
+ /** The list owning the names of compartments */
+ protected List<String> compartmentNamesList;
+
+ /** The list owning the names of compartment that have a title */
+ protected List<String> compartmentTitlesList;
+
+ /** The list of label names for this node */
+ protected List<String> labelsList;
+
+ /** Constructor */
+ public ParametricDiagramNodePreferencePage() {
+ this.labelsList = new ArrayList<String>();
+ this.compartmentNamesList = new ArrayList<String>();
+ this.compartmentTitlesList = new ArrayList<String>();
+
+ initializeLabelsList();
+ initializeCompartmentNamesList();
+ initializeCompartmentTitlesList();
+
+ Collections.unmodifiableList(labelsList);
+ Collections.unmodifiableList(compartmentNamesList);
+ Collections.unmodifiableList(compartmentTitlesList);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createPageContents(Composite parent) {
+ super.createPageContents(parent);
+
+ // Add compartments visibility group
+ if(!compartmentNamesList.isEmpty()) {
+ OrderedCompartmentGroup compartmentGroup = new OrderedCompartmentGroup(parent, getPreferenceKey(), this, compartmentNamesList, compartmentTitlesList, getPreferenceStore());
+ addAbstractGroup(compartmentGroup);
+ }
+
+ // Add label visibility group
+ if(!labelsList.isEmpty()) {
+ OrderedLabelGroup compartmentGroup = new OrderedLabelGroup(parent, getPreferenceKey(), this, labelsList);
+ addAbstractGroup(compartmentGroup);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getBundleId() {
+ return Activator.PLUGIN_ID;
+ }
+
+ /** Initialize the list containing names of labels. */
+ protected void initializeLabelsList() {
+ // Implemented by subclasses.
+ }
+
+ /** Initialize the list containing the names of compartments. */
+ protected void initializeCompartmentNamesList() {
+ // Implemented by subclasses.
+ }
+
+ /** Initialize the list containing the names of compartment that have titles. */
+ protected void initializeCompartmentTitlesList() {
+ // Implemented by subclasses.
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected final TreeMap<String, String> getLabelRole() {
+ return new TreeMap<String, String>();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected final TreeMap<String, Boolean> getCompartmentTitleVisibilityPreferences() {
+ return new TreeMap<String, Boolean>();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected final void initializeCompartmentsList() {
+ compartmentsList = Collections.emptyList();
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramPreferenceInitializer.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramPreferenceInitializer.java
new file mode 100644
index 00000000000..ae5bebb52d8
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ParametricDiagramPreferenceInitializer.java
@@ -0,0 +1,28 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+
+public class ParametricDiagramPreferenceInitializer extends AbstractPreferenceInitializer {
+
+ protected IPreferenceStore getPreferenceStore() {
+ return Activator.getInstance().getPreferenceStore();
+ }
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore store = getPreferenceStore();
+
+ org.eclipse.papyrus.sysml.diagram.parametric.preferences.ConstraintPreferencePage.initDefaults(store);
+ org.eclipse.papyrus.sysml.diagram.parametric.preferences.CommentPreferencePage.initDefaults(store);
+ org.eclipse.papyrus.sysml.diagram.parametric.preferences.CommentAnnotatedElementPreferencePage.initDefaults(store);
+ BlockCompositePreferencePage.initDefaults(store);
+ BlockPropertyCompositePreferencePage.initDefaults(store);
+ FlowPortPreferencePage.initDefaults(store);
+ PortPreferencePage.initDefaults(store);
+ ConnectorPreferencePage.initDefaults(store);
+ DependencyPreferencePage.initDefaults(store);
+
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PortPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PortPreferencePage.java
new file mode 100644
index 00000000000..7c3c7303ff0
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PortPreferencePage.java
@@ -0,0 +1,60 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+
+public class PortPreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_shape_uml_port_as_affixed"; //$NON-NLS-1$
+
+ /** The labels default visibility for preferences */
+ public static final Map<String, Boolean> labelDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ labelDefaultVisibilityMap.put("PortAffixedLabel", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("AppliedStereotypeAffixedLabel", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(labelDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public PortPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_shape_uml_port_as_affixed"); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.WIDTH), 20);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.HEIGHT), 20);
+ // End of user code
+
+ // Initialize default visibility for labels in preference page.
+ for(String labelName : labelDefaultVisibilityMap.keySet()) {
+ String showLabelKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
+ store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeLabelsList() {
+ for(String name : labelDefaultVisibilityMap.keySet()) {
+ this.labelsList.add(name);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPartProvider.java
new file mode 100644
index 00000000000..9efdac2be81
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPartProvider.java
@@ -0,0 +1,120 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.provider.CustomAbstractEditPartProvider;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyStructureCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedLabelNameEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedNodeEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.StructureCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockCompositeEditPartTN;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockLabelNameEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockPropertyCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintBlockPropertyCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomConstraintParameterAffixedNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeAffixedLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AppliedStereotypeLinkLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelSourceMultiplicityEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorLinkLabelTargetMultiplicityEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintNodeLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.DependencyEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.NamedElementLinkLabelNameEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedLabelNameEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PropertyNodeLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+
+public class CustomEditPartProvider extends CustomAbstractEditPartProvider {
+
+ /** Map containing node view types supported by this provider */
+ protected Map<String, Class<?>> nodeMap = new HashMap<String, Class<?>>();
+
+ /** Map containing edge view types supported by this provider */
+ protected Map<String, Class<?>> edgeMap = new HashMap<String, Class<?>>();
+
+ /** Default constructor */
+ public CustomEditPartProvider() {
+ super();
+
+ diagramType = ElementTypes.DIAGRAM_ID;
+
+ // Nodes
+ nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID, CustomConstraintBlockPropertyCompositeEditPart.class);
+ nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, CustomBlockPropertyCompositeEditPart.class);
+ nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID, CustomBlockCompositeEditPartTN.class);
+ nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, FlowPortAffixedNodeEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, PortAffixedNodeEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID, CustomConstraintParameterAffixedNodeEditPart.class);
+
+ // Decorations
+ nodeMap.put(SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID, FlowPortAffixedLabelNameEditPart.class);
+ nodeMap.put(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID, BlockPropertyStructureCompartmentEditPart.class);
+ nodeMap.put(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID, StructureCompartmentEditPart.class);
+ nodeMap.put(SysMLGraphicalTypes.LABEL_SYSML_BLOCK_NAME_ID, CustomBlockLabelNameEditPart.class); // TODO : change for multi FlowText
+ nodeMap.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID, AppliedStereotypeAffixedLabelEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID, PortAffixedLabelNameEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID, PropertyNodeLabelEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID, ConstraintNodeLabelEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID, AppliedStereotypeLinkLabelEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID, ConnectorLinkLabelEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID, ConnectorLinkLabelSourceMultiplicityEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID, ConnectorLinkLabelTargetMultiplicityEditPart.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID, NamedElementLinkLabelNameEditPart.class);
+
+
+ // Edges
+ edgeMap.put(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, ConnectorEditPart.class);
+ edgeMap.put(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID, DependencyEditPart.class);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean provides(IOperation operation) {
+ if(operation instanceof CreateGraphicEditPartOperation) {
+ View newView = ((IEditPartOperation)operation).getView();
+ if (newView == null) {
+ return false;
+ }
+
+ String graphicalType = newView.getType();
+
+ if((newView instanceof Node) && (!nodeMap.containsKey(graphicalType))) {
+ return false;
+ }
+
+ if((newView instanceof Edge) && (!edgeMap.containsKey(graphicalType))) {
+ return false;
+ }
+ }
+
+ return super.provides(operation);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Class<?> getNodeEditPartClass(View view) {
+ return nodeMap.get(view.getType());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Class<?> getEdgeEditPartClass(View view) {
+ return edgeMap.get(view.getType());
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypeRegistry.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypeRegistry.java
new file mode 100644
index 00000000000..5b838c32c5f
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypeRegistry.java
@@ -0,0 +1,224 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+
+public class CustomGraphicalTypeRegistry extends GraphicalTypeRegistry {
+
+ /** Default constructor */
+ public CustomGraphicalTypeRegistry() {
+
+ super();
+
+ // Nodes
+ knownNodes.add(SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID);
+ knownNodes.add(SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID);
+ knownNodes.add(SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID);
+ knownNodes.add(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID);
+ knownNodes.add(UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID);
+ knownNodes.add(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID);
+ // Decorations
+ knownNodes.add(SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID);
+ knownNodes.add(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID);
+ knownNodes.add(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID);
+ knownNodes.add(SysMLGraphicalTypes.LABEL_SYSML_BLOCK_NAME_ID);
+ knownNodes.add(UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID);
+ knownNodes.add(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID);
+ knownNodes.add(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID);
+ knownNodes.add(UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID);
+ knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID);
+ knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID);
+ knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID);
+ knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID);
+ knownNodes.add(UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID);
+
+ // Edges
+ knownEdges.add(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID);
+ knownEdges.add(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getNodeGraphicalType(EObject domainElement, String containerType) {
+ // Start of user code getNodeGraphicalType(EObject domainElement, String containerType)
+ // End of user code
+
+ if(((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(domainElement)) {
+ if (ElementTypes.DIAGRAM_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+ if(((ISpecializationType)SysMLElementTypes.CONSTRAINT_PROPERTY).getMatcher().matches(domainElement)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(domainElement)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+
+ if(((ISpecializationType)SysMLElementTypes.PART_PROPERTY).getMatcher().matches(domainElement)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+ if(((ISpecializationType)SysMLElementTypes.REFERENCE_PROPERTY).getMatcher().matches(domainElement)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+ if(((ISpecializationType)SysMLElementTypes.VALUE_PROPERTY).getMatcher().matches(domainElement)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+ // Order is important for Part/Reference/ConstraintProperty which are also Property
+ if(UMLElementTypes.PROPERTY.getEClass().isInstance(domainElement)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID.equals(containerType)) {
+ return UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID;
+ }
+ return UNDEFINED_TYPE;
+
+ }
+
+ return super.getNodeGraphicalType(domainElement, containerType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNodeGraphicalType(String proposedType, String containerType) {
+ // Start of user code getNodeGraphicalType(String proposedType, String containerType)
+ // End of user code
+
+ if(SysMLElementTypes.BLOCK.getSemanticHint().equals(proposedType)) {
+ if (ElementTypes.DIAGRAM_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+
+ if(UMLElementTypes.PROPERTY.getSemanticHint().equals(proposedType)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID.equals(containerType)) {
+ return UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+
+ if(SysMLElementTypes.CONSTRAINT_PROPERTY.getSemanticHint().equals(proposedType)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+
+ if(SysMLElementTypes.PART_PROPERTY.getSemanticHint().equals(proposedType)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+ if(SysMLElementTypes.REFERENCE_PROPERTY.getSemanticHint().equals(proposedType)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+ if(SysMLElementTypes.VALUE_PROPERTY.getSemanticHint().equals(proposedType)) {
+ if (SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ if (SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID;
+ }
+ return UNDEFINED_TYPE;
+ }
+ return super.getNodeGraphicalType(proposedType, containerType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getEdgeGraphicalType(EObject domainElement) {
+ // Start of user code getEdgeGraphicalType(EObject domainElement)
+ // End of user code
+
+ if(UMLElementTypes.CONNECTOR.getEClass().isInstance(domainElement)) {
+ return UMLGraphicalTypes.LINK_UML_CONNECTOR_ID;
+ }
+ if(UMLElementTypes.DEPENDENCY.getEClass().isInstance(domainElement)) {
+ return UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID;
+ }
+ return super.getEdgeGraphicalType(domainElement);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEdgeGraphicalType(String proposedType) {
+ // Start of user code getEdgeGraphicalType(String proposedType)
+ // End of user code
+
+ if(UMLElementTypes.CONNECTOR.getSemanticHint().equals(proposedType)) {
+ return UMLGraphicalTypes.LINK_UML_CONNECTOR_ID;
+ }
+ if(UMLElementTypes.DEPENDENCY.getSemanticHint().equals(proposedType)) {
+ return UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID;
+ }
+ return super.getEdgeGraphicalType(proposedType);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypes.java
new file mode 100644
index 00000000000..31f18f64c05
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomGraphicalTypes.java
@@ -0,0 +1,13 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+public class CustomGraphicalTypes {
+
+ /** ********************************************************* */
+ /** Diagram custom graphical types id *********************** */
+ /** ********************************************************* */
+
+
+
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomViewProvider.java
new file mode 100644
index 00000000000..20bfe02018c
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomViewProvider.java
@@ -0,0 +1,87 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.factory.AffixedLabelViewFactory;
+import org.eclipse.papyrus.gmf.diagram.common.factory.CompartmentShapeViewFactory;
+import org.eclipse.papyrus.gmf.diagram.common.factory.ConnectorLabelViewFactory;
+import org.eclipse.papyrus.gmf.diagram.common.factory.InnerLabelViewFactory;
+import org.eclipse.papyrus.gmf.diagram.common.provider.CustomAbstractViewProvider;
+import org.eclipse.papyrus.sysml.diagram.common.factory.BlockCompositeClassifierViewFactory;
+import org.eclipse.papyrus.sysml.diagram.common.factory.BlockPropertyCompositeClassifierViewFactory;
+import org.eclipse.papyrus.sysml.diagram.common.factory.ConstraintBlockPropertyCompositeClassifierViewFactory;
+import org.eclipse.papyrus.sysml.diagram.common.factory.FlowPortAffixedNodeViewFactory;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.diagram.common.factory.ConnectorLinkViewFactory;
+import org.eclipse.papyrus.uml.diagram.common.factory.ConstraintPropertyAffixedNodeViewFactory;
+import org.eclipse.papyrus.uml.diagram.common.factory.DependencyLinkViewFactory;
+import org.eclipse.papyrus.uml.diagram.common.factory.PortAffixedNodeViewFactory;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+
+public class CustomViewProvider extends CustomAbstractViewProvider {
+
+ /** Map containing node view types supported by this provider */
+ protected Map<String, Class<?>> nodeMap = new HashMap<String, Class<?>>();
+
+ /** Map containing edge view types supported by this provider */
+ protected Map<String, Class<?>> edgeMap = new HashMap<String, Class<?>>();
+
+ /** Default constructor */
+ public CustomViewProvider() {
+ super();
+ this.registry = new CustomGraphicalTypeRegistry();
+
+ diagramType = ElementTypes.DIAGRAM_ID;
+
+ // Custom classifier nodes
+ nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_COMPOSITE_ID, BlockCompositeClassifierViewFactory.class);
+ nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID, BlockPropertyCompositeClassifierViewFactory.class);
+ nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID, ConstraintBlockPropertyCompositeClassifierViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID, ConstraintPropertyAffixedNodeViewFactory.class);
+ // Custom affixed nodes
+ nodeMap.put(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, FlowPortAffixedNodeViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, PortAffixedNodeViewFactory.class);
+ // Custom child node labels
+ // Custom inner labels
+ nodeMap.put(SysMLGraphicalTypes.LABEL_SYSML_BLOCK_NAME_ID, InnerLabelViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID, InnerLabelViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID, InnerLabelViewFactory.class);
+ // Custom compartments
+ nodeMap.put(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID, CompartmentShapeViewFactory.class);
+ nodeMap.put(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID, CompartmentShapeViewFactory.class);
+ // Custom affixed labels
+ nodeMap.put(SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID, AffixedLabelViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID, AffixedLabelViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID, AffixedLabelViewFactory.class);
+
+ // Custom edges
+ edgeMap.put(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, ConnectorLinkViewFactory.class);
+ edgeMap.put(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID, DependencyLinkViewFactory.class);
+
+ // Custom edge labels
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID, ConnectorLabelViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID, ConnectorLabelViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID, ConnectorLabelViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID, ConnectorLabelViewFactory.class);
+ nodeMap.put(UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID, ConnectorLabelViewFactory.class);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Class<?> getNodeViewClass(IAdaptable semanticAdapter, View containerView, String graphicalType) {
+ return nodeMap.get(graphicalType);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Class<?> getEdgeViewClass(IAdaptable semanticAdapter, View containerView, String graphicalType) {
+ return edgeMap.get(graphicalType);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ElementTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ElementTypes.java
new file mode 100644
index 00000000000..21830b124f4
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ElementTypes.java
@@ -0,0 +1,52 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import org.eclipse.gmf.runtime.emf.type.core.AbstractElementTypeEnumerator;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+
+public class ElementTypes extends AbstractElementTypeEnumerator {
+
+ /** ********************************************************* */
+ /** SysML Parametric Diagram specific elements **************** */
+ /** ********************************************************* */
+
+ /** SysML Parametric Diagram :: Diagram */
+ public static final String DIAGRAM_ID = "Parametric"; //$NON-NLS-1$
+
+
+
+
+ /** ********************************************************* */
+ /** SysML Parametric Diagram - CompositeDiagram related elements */
+ /** ********************************************************* */
+
+ /** CompositeDiagram :: CONSTRAINT */
+ public static final IHintedType CONSTRAINT = (IHintedType)getElementType("org.eclipse.papyrus.uml.diagram.composite.Constraint_2114"); //$NON-NLS-1$
+
+ public static final String CONSTRAINT_LABEL_NAME_HINT = "5197"; //$NON-NLS-1$
+
+ public static final String CONSTRAINT_LABEL_SPECIFICATION_HINT = "6039"; //$NON-NLS-1$
+
+ /** CompositeDiagram :: COMMENT_CN */
+ public static final IHintedType COMMENT_CN = (IHintedType)getElementType("org.eclipse.papyrus.uml.diagram.composite.Comment_3097"); //$NON-NLS-1$
+
+ public static final String COMMENT_CN_LABEL_BODY_HINT = "5150"; //$NON-NLS-1$
+
+ /** CompositeDiagram :: COMMENT */
+ public static final IHintedType COMMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.diagram.composite.Comment_2109"); //$NON-NLS-1$
+
+ public static final String COMMENT_LABEL_BODY_HINT = "5192"; //$NON-NLS-1$
+
+ /** CompositeDiagram :: CONSTRAINT_CN */
+ public static final IHintedType CONSTRAINT_CN = (IHintedType)getElementType("org.eclipse.papyrus.uml.diagram.composite.Constraint_3120"); //$NON-NLS-1$
+
+ public static final String CONSTRAINT_CN_LABEL_NAME_HINT = "6048"; //$NON-NLS-1$
+
+ public static final String CONSTRAINT_CN_LABEL_SPECIFICATION_HINT = "6049"; //$NON-NLS-1$
+
+ /** CompositeDiagram :: COMMENT_ANNOTATED_ELEMENT */
+ public static final IHintedType COMMENT_ANNOTATED_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.diagram.composite.CommentAnnotatedElement_4002"); //$NON-NLS-1$
+
+ /** CompositeDiagram :: CONSTRAINT_CONSTRAINED_ELEMENT */
+ public static final IHintedType CONSTRAINT_CONSTRAINED_ELEMENT = (IHintedType)getElementType("org.eclipse.papyrus.uml.diagram.composite.ConstraintConstrainedElement_4003"); //$NON-NLS-1$
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/GraphicalTypeRegistry.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/GraphicalTypeRegistry.java
new file mode 100644
index 00000000000..95e3081cd89
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/GraphicalTypeRegistry.java
@@ -0,0 +1,195 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+
+/**
+ * <pre>
+ * This class provides graphical type id (used as View type) for
+ * domain element according to their actual or expected graphical
+ * container type.
+ * </pre>
+ */
+public class GraphicalTypeRegistry implements IGraphicalTypeRegistry {
+
+ /** A Set containing all known node graphical types */
+ protected Set<String> knownNodes = new HashSet<String>();
+
+ /** A Set containing all known edge graphical types */
+ protected Set<String> knownEdges = new HashSet<String>();
+
+ /** Default constructor */
+ public GraphicalTypeRegistry() {
+
+ // Fill known edges set
+ knownEdges.add(ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint());
+ knownEdges.add(ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT.getSemanticHint());
+
+ // Fill known nodes set (primary nodes)
+ knownNodes.add(UMLElementTypes.CONSTRAINT.getSemanticHint());
+ knownNodes.add(UMLElementTypes.COMMENT.getSemanticHint());
+
+ knownNodes.add(ElementTypes.CONSTRAINT.getSemanticHint());
+ knownNodes.add(ElementTypes.COMMENT_CN.getSemanticHint());
+ knownNodes.add(ElementTypes.COMMENT.getSemanticHint());
+ knownNodes.add(ElementTypes.CONSTRAINT_CN.getSemanticHint());
+
+ // Fill known nodes set (child label nodes)
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEdgeGraphicalType(EObject domainElement) {
+
+ String graphicalType = UNDEFINED_TYPE;
+ if(domainElement == null) {
+ return UNDEFINED_TYPE;
+ }
+ return graphicalType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEdgeGraphicalType(IElementType elementType) {
+ if(elementType instanceof IHintedType) {
+ String semanticHint = ((IHintedType)elementType).getSemanticHint();
+ return getEdgeGraphicalType(semanticHint);
+ }
+
+ return UNDEFINED_TYPE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEdgeGraphicalType(String proposedType) {
+ if(isKnownEdgeType(proposedType)) {
+ return proposedType;
+ }
+
+ return UNDEFINED_TYPE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNodeGraphicalType(EObject domainElement, String containerType) {
+
+ String graphicalType = UNDEFINED_TYPE;
+ if((containerType == null) || (domainElement == null)) {
+ return UNDEFINED_TYPE;
+ }
+
+ if(domainElement instanceof org.eclipse.uml2.uml.Constraint) {
+ if(ElementTypes.DIAGRAM_ID.equals(containerType)) { // Constraint TopNode
+ graphicalType = ElementTypes.CONSTRAINT.getSemanticHint();
+ }
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ graphicalType = ElementTypes.CONSTRAINT_CN.getSemanticHint();
+ }
+
+ }
+
+ if(domainElement instanceof org.eclipse.uml2.uml.Comment) {
+ if(ElementTypes.DIAGRAM_ID.equals(containerType)) { // Comment TopNode
+ graphicalType = ElementTypes.COMMENT.getSemanticHint();
+ }
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ graphicalType = ElementTypes.COMMENT_CN.getSemanticHint();
+ }
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ graphicalType = ElementTypes.COMMENT_CN.getSemanticHint();
+ }
+
+ }
+
+ return graphicalType;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNodeGraphicalType(IElementType elementType, String containerType) {
+ if(elementType instanceof IHintedType) {
+ String semanticHint = ((IHintedType)elementType).getSemanticHint();
+ return getNodeGraphicalType(semanticHint, containerType);
+ }
+
+ return UNDEFINED_TYPE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getNodeGraphicalType(String proposedType, String containerType) {
+ if((UMLElementTypes.COMMENT.getSemanticHint().equals(proposedType))) {
+
+ if(ElementTypes.DIAGRAM_ID.equals(containerType)) { // Constraint TopNode
+ return ElementTypes.COMMENT.getSemanticHint();
+ }
+
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return ElementTypes.COMMENT_CN.getSemanticHint();
+ }
+
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerType)) {
+ return ElementTypes.COMMENT_CN.getSemanticHint();
+ }
+
+ return UNDEFINED_TYPE;
+ }
+
+ if(UMLElementTypes.CONSTRAINT.getSemanticHint().equals(proposedType)) {
+
+ if(ElementTypes.DIAGRAM_ID.equals(containerType)) { // Constraint TopNode
+ return ElementTypes.CONSTRAINT.getSemanticHint();
+ }
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerType)) {
+ return ElementTypes.CONSTRAINT_CN.getSemanticHint();
+ }
+
+ return UNDEFINED_TYPE;
+ }
+ if(isKnownNodeType(proposedType)) {
+ return proposedType;
+ }
+
+ return UNDEFINED_TYPE;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isKnownEdgeType(String type) {
+ return knownEdges.contains(type);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isKnownNodeType(String type) {
+ return knownNodes.contains(type);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/IGraphicalTypeRegistry.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/IGraphicalTypeRegistry.java
new file mode 100644
index 00000000000..fff577cb88d
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/IGraphicalTypeRegistry.java
@@ -0,0 +1,97 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+
+/**
+ * This interface provides an API for accessing the local graphical type registry.
+ * This registry provides a graphical type for existing model elements.
+ */
+public interface IGraphicalTypeRegistry {
+
+ /** Constant for undefined graphical type */
+ public static final String UNDEFINED_TYPE = "undefined_type";
+
+ /**
+ * Get a valid edge graphical type for the domain element.
+ *
+ * @param domainElement
+ * the domain element.
+ * @return the domain element graphical type.
+ */
+ public String getEdgeGraphicalType(EObject domainElement);
+
+ /**
+ * Get a valid edge graphical type for the element type.
+ *
+ * @param elementType
+ * the element type.
+ * @param containerType
+ * the type of the graphical owner of the domain element.
+ * @return the domain element graphical type.
+ */
+ public String getEdgeGraphicalType(IElementType elementType);
+
+ /**
+ * Get a valid edge graphical type for the proposed type.
+ *
+ * @param proposedType
+ * the proposed type.
+ * @param containerType
+ * the type of the graphical owner of the domain element.
+ * @return the domain element graphical type.
+ */
+ public String getEdgeGraphicalType(String proposedType);
+
+ /**
+ * Get a valid node graphical type for the domain element.
+ *
+ * @param domainElement
+ * the domain element.
+ * @param containerType
+ * the type of the graphical owner of the domain element.
+ * @return the domain element graphical type.
+ */
+ public String getNodeGraphicalType(EObject domainElement, String containerType);
+
+ /**
+ * Get a valid node graphical type for the element type.
+ *
+ * @param elementType
+ * the element type.
+ * @param containerType
+ * the type of the graphical owner of the domain element.
+ * @return the domain element graphical type.
+ */
+ public String getNodeGraphicalType(IElementType elementType, String containerType);
+
+ /**
+ * Get a valid node graphical type for the proposed type.
+ *
+ * @param proposedType
+ * the proposed type.
+ * @param containerType
+ * the type of the graphical owner of the domain element.
+ * @return the domain element graphical type.
+ */
+ public String getNodeGraphicalType(String proposedType, String containerType);
+
+ /**
+ * Test if the type is a known edge graphical type in this diagram
+ *
+ * @param type
+ * the type to test
+ * @return true if the type is known
+ */
+ public boolean isKnownEdgeType(String type);
+
+ /**
+ * Test if the type is a known node graphical type in this diagram
+ *
+ * @param type
+ * the type to test
+ * @return true if the type is known
+ */
+ public boolean isKnownNodeType(String type);
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramEditPartProvider.java
new file mode 100644
index 00000000000..6ec36d6fd70
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramEditPartProvider.java
@@ -0,0 +1,54 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.composite.providers.UMLEditPartProvider;
+
+public class InheritedCompositeDiagramEditPartProvider extends UMLEditPartProvider {
+
+
+ @Override
+ public synchronized boolean provides(IOperation operation) {
+ if(operation instanceof CreateGraphicEditPartOperation) {
+ View view = ((IEditPartOperation)operation).getView();
+
+ // Ensure current diagram is a Parametric Diagram
+ if(!ElementTypes.DIAGRAM_ID.equals(view.getDiagram().getType())) {
+ return false;
+ }
+
+ // Test supported inherited types
+ EObject eobject = view.getElement();
+
+ /** Nodes (and ChildLabelNodes) *********** */
+ if(eobject instanceof org.eclipse.uml2.uml.Constraint) {
+ return true;
+ }
+ if(eobject instanceof org.eclipse.uml2.uml.Comment) {
+ return true;
+ }
+
+ // Additional test needed here to decide whether to support Feature type links.
+ // As feature type link are not related to a MetaClass from the domain model
+ // they are not already handled by previous tests.
+ // Also concerns NotationType.
+ String hint = view.getType();
+
+ /** Edges (Feature) : COMMENT_ANNOTATED_ELEMENT *********** */
+ if(ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint().equals(hint)) {
+ return true;
+ }
+ /** Edges (Feature) : CONSTRAINT_CONSTRAINED_ELEMENT *********** */
+ if(ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT.getSemanticHint().equals(hint)) {
+ return true;
+ }
+
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramViewProvider.java
new file mode 100644
index 00000000000..37ef4b7f617
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/InheritedCompositeDiagramViewProvider.java
@@ -0,0 +1,218 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcoreFactory;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+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.gmf.diagram.common.provider.IGraphicalTypeRegistry;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.GraphicalTypeRegistry;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+import org.eclipse.papyrus.uml.diagram.composite.providers.UMLViewProvider;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+
+public class InheritedCompositeDiagramViewProvider extends UMLViewProvider {
+
+ /** Local graphical type registry */
+ protected IGraphicalTypeRegistry registry = new GraphicalTypeRegistry();
+
+ @Override
+ public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
+ Edge createdEdge = null;
+
+ IElementType elementType = (IElementType)semanticAdapter.getAdapter(IElementType.class);
+ if(elementType != null) {
+ createdEdge = super.createEdge(semanticAdapter, containerView, semanticHint, index, persisted, preferencesHint);
+ } else {
+
+ EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class);
+
+ String domainElementGraphicalType = semanticHint;
+ if(domainElementGraphicalType == null) {
+ domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement);
+ }
+
+ if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) {
+ // Cannot use createEdge from super class as it never take the graphical type (semanticHint) into account.
+ // createdEdge = super.createEdge(semanticAdapter, containerView, domainElementGraphicalType, index, persisted, preferencesHint);
+
+ if(ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint().equals(domainElementGraphicalType)) {
+ createdEdge = createCommentAnnotatedElement_4002(containerView, index, persisted, preferencesHint);
+ }
+ if(ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT.getSemanticHint().equals(domainElementGraphicalType)) {
+ createdEdge = createConstraintConstrainedElement_4003(containerView, index, persisted, preferencesHint);
+ }
+ }
+ }
+
+ if(createdEdge == null) {
+ Activator.log.error(new Exception("Could not create Edge."));
+ }
+
+ return createdEdge;
+ }
+
+ @Override
+ protected boolean provides(CreateViewForKindOperation op) {
+ // Never use this method (often incorrectly implemented due to GMF Tooling choices).
+ String diagramType = op.getContainerView().getDiagram().getType();
+ if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) {
+ return false;
+ }
+
+ throw new UnsupportedOperationException("Should never be called by the " + diagramType + " diagram.");
+ }
+
+ @Override
+ protected boolean provides(CreateEdgeViewOperation op) {
+
+ // Must have a container
+ if(op.getContainerView() == null) {
+ return false;
+ }
+
+ // This provider is registered for InternalBlock Diagram only
+ String diagramType = op.getContainerView().getDiagram().getType();
+ if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) {
+ return false;
+ }
+
+ IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
+ if(elementType == ElementTypes.COMMENT_ANNOTATED_ELEMENT) {
+ return true;
+ }
+ if(elementType == ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT) {
+ return true;
+ }
+
+ // /////////////////////////////////////////////////////////////////////
+ // Test possibility to provide a view based on the semantic nature and its expected container.
+ // /////////////////////////////////////////////////////////////////////
+
+ // IElementType may be null (especially when drop from ModelExplorer).
+ // In such a case, test the semantic EObject instead.
+ if(elementType == null) {
+ EObject domainElement = (EObject)op.getSemanticAdapter().getAdapter(EObject.class);
+ String domainElementGraphicalType = op.getSemanticHint();
+ if(domainElementGraphicalType == null) {
+ domainElementGraphicalType = registry.getEdgeGraphicalType(domainElement);
+ }
+
+ if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownEdgeType(domainElementGraphicalType))) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ protected boolean provides(CreateNodeViewOperation op) {
+ // Must have a container
+ if(op.getContainerView() == null) {
+ return false;
+ }
+ // Get the type of the container
+ String containerGraphicalType = op.getContainerView().getType();
+
+ // This provider is registered for InternalBlock Diagram only
+ String diagramType = op.getContainerView().getDiagram().getType();
+ if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) {
+ return false;
+ }
+
+ // /////////////////////////////////////////////////////////////////////
+ // Test possibility to provide a view based on the ElementType and its expected container.
+ // /////////////////////////////////////////////////////////////////////
+
+ IElementType elementType = (IElementType)op.getSemanticAdapter().getAdapter(IElementType.class);
+ if(elementType == UMLElementTypes.CONSTRAINT) {
+ if(ElementTypes.DIAGRAM_ID.equals(containerGraphicalType)) {
+ return true;
+ }
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerGraphicalType)) {
+ return true;
+ }
+ }
+ if(elementType == UMLElementTypes.COMMENT) {
+ if(ElementTypes.DIAGRAM_ID.equals(containerGraphicalType)) {
+ return true;
+ }
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_STRUCTURE_ID.equals(containerGraphicalType)) {
+ return true;
+ }
+ if(SysMLGraphicalTypes.COMPARTMENT_SYSML_BLOCKPROPERTY_STRUCTURE_ID.equals(containerGraphicalType)) {
+ return true;
+ }
+ }
+
+ // /////////////////////////////////////////////////////////////////////
+ // Test possibility to provide a view based on the semantic nature and its expected container.
+ // /////////////////////////////////////////////////////////////////////
+
+ // IElementType may be null (especially when drop from ModelExplorer).
+ // In such a case, test the semantic EObject instead.
+ if(elementType == null) {
+ EObject domainElement = (EObject)op.getSemanticAdapter().getAdapter(EObject.class);
+ String domainElementGraphicalType = op.getSemanticHint();
+ if(domainElementGraphicalType == null) {
+ domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType);
+ } else {
+ domainElementGraphicalType = registry.getNodeGraphicalType(domainElementGraphicalType, containerGraphicalType);
+ }
+
+ if((!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) && (registry.isKnownNodeType(domainElementGraphicalType))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
+
+ // Use the GraphicalTypeRegistry to find the expected type for a domain element
+ // Get the type of the container
+ String containerGraphicalType = containerView.getType();
+
+ // Get the type of the domain element
+ EObject domainElement = (EObject)semanticAdapter.getAdapter(EObject.class);
+
+ if(semanticHint != null) {
+ // Look for a possible graphicalType replacement
+ String graphicalType = registry.getNodeGraphicalType(semanticHint, containerGraphicalType);
+ return super.createNode(new SemanticAdapter(domainElement, null), containerView, graphicalType, index, persisted, preferencesHint);
+ }
+
+ String domainElementGraphicalType = registry.getNodeGraphicalType(domainElement, containerGraphicalType);
+
+ // Create the expected node
+ if(!IGraphicalTypeRegistry.UNDEFINED_TYPE.equals(domainElementGraphicalType)) {
+ return super.createNode(semanticAdapter, containerView, domainElementGraphicalType, index, persisted, preferencesHint);
+ }
+
+ Activator.log.error(new Exception("Could not create Node."));
+ return null;
+ }
+
+ @Override
+ protected void stampShortcut(View containerView, Node target) {
+ if(!ElementTypes.DIAGRAM_ID.equals(containerView.getDiagram().getType())) {
+ EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
+ shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
+ shortcutAnnotation.getDetails().put("modelID", ElementTypes.DIAGRAM_ID); //$NON-NLS-1$
+ target.getEAnnotations().add(shortcutAnnotation);
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPartProvider.java
new file mode 100644
index 00000000000..4e53242ab38
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPartProvider.java
@@ -0,0 +1,37 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.ParametricDiagramEditPart;
+
+public class ParametricDiagramEditPartProvider extends AbstractEditPartProvider {
+
+ @Override
+ public boolean provides(IOperation operation) {
+ if(operation instanceof CreateGraphicEditPartOperation) {
+ View view = ((IEditPartOperation)operation).getView();
+
+ // Ensure current diagram is Parametric Diagram
+ if(ElementTypes.DIAGRAM_ID.equals(view.getType())) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ @Override
+ protected Class<?> getDiagramEditPartClass(View view) {
+ if(ElementTypes.DIAGRAM_ID.equals(view.getType())) {
+ return ParametricDiagramEditPart.class;
+ }
+
+ Activator.log.error(new Exception("Could not create EditPart."));
+ return null;
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPolicyProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPolicyProvider.java
new file mode 100644
index 00000000000..de9fd4010b9
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramEditPolicyProvider.java
@@ -0,0 +1,50 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDragDropEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart;
+
+public class ParametricDiagramEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider {
+
+ public boolean provides(IOperation operation) {
+
+ CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
+ if(!(epOperation.getEditPart() instanceof GraphicalEditPart)) {
+ return false;
+ }
+ GraphicalEditPart gep = (GraphicalEditPart)epOperation.getEditPart();
+ String diagramType = gep.getNotationView().getDiagram().getType();
+ if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) {
+ return false;
+ }
+
+ if(gep instanceof org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintEditPart) {
+ return true;
+ }
+ if(gep instanceof PortAffixedNodeEditPart) {
+ return true;
+ }
+ if(gep instanceof org.eclipse.papyrus.uml.diagram.composite.edit.parts.UseCaseEditPartCN) {
+ return true;
+ }
+ if(gep instanceof org.eclipse.papyrus.uml.diagram.composite.edit.parts.CommentEditPart) {
+ return true;
+ }
+ if(gep instanceof org.eclipse.papyrus.uml.diagram.composite.edit.parts.InteractionConstraintEditPartCN) {
+ return true;
+ }
+
+ return false;
+ }
+
+ public void createEditPolicies(EditPart editPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDragDropEditPolicy());
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramViewProvider.java
new file mode 100644
index 00000000000..44dc9c87ee9
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParametricDiagramViewProvider.java
@@ -0,0 +1,31 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.diagram.core.providers.AbstractViewProvider;
+import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+import org.eclipse.papyrus.sysml.diagram.parametric.factory.ParametricDiagramViewFactory;
+
+public class ParametricDiagramViewProvider extends AbstractViewProvider {
+
+ @Override
+ protected boolean provides(CreateDiagramViewOperation operation) {
+
+ if(ElementTypes.DIAGRAM_ID.equals(operation.getSemanticHint())) {
+ return true;
+ }
+
+ return false;
+ }
+
+ @Override
+ protected Class<?> getDiagramViewClass(IAdaptable semanticAdapter, String diagramKind) {
+ if(ElementTypes.DIAGRAM_ID.equals(diagramKind)) {
+ return ParametricDiagramViewFactory.class;
+ }
+
+ Activator.log.error(new Exception("Could not create View."));
+ return null;
+ }
+}
+
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/utils/ParametricDiagramGraphicalTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/utils/ParametricDiagramGraphicalTypes.java
new file mode 100644
index 00000000000..05a8de05c4e
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src-gen/org/eclipse/papyrus/sysml/diagram/parametric/utils/ParametricDiagramGraphicalTypes.java
@@ -0,0 +1,15 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.utils;
+
+public class ParametricDiagramGraphicalTypes {
+
+ /** ********************************************************* */
+ /** Diagram custom graphical types id *********************** */
+ /** ********************************************************* */
+
+
+
+
+
+
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/Activator.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/Activator.java
new file mode 100644
index 00000000000..df6e7ce7ccb
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/Activator.java
@@ -0,0 +1,105 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric;
+
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.papyrus.sysml.diagram.parametric.preferences.CustomPreferenceInitializer;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/** The activator class controls the plug-in life cycle */
+public class Activator extends AbstractUIPlugin {
+
+ /** The plug-in ID */
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.sysml.diagram.parametric";
+
+ /** The plug-in shared instance */
+ private static Activator plugin;
+
+ /** The logging helper */
+ public static LogHelper log;
+
+ /** The plug-in Preference store */
+ public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(PLUGIN_ID);
+
+ /** Default constructor */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ // register the login helper
+ log = new LogHelper(plugin);
+
+ // register the preference store
+ PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
+
+ // Preferences initialization
+ CustomPreferenceInitializer diagramPreferenceInitializer = new CustomPreferenceInitializer();
+ diagramPreferenceInitializer.initializeDefaultPreferences();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getInstance() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in relative path.
+ *
+ * @generated
+ * @param path
+ * the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getBundledImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore()
+ *
+ * @return Shared Preference Store.
+ */
+ @Override
+ public IPreferenceStore getPreferenceStore() {
+ IPreferenceStore store = org.eclipse.papyrus.infra.gmfdiag.preferences.Activator.getDefault().getPreferenceStore();
+ return store;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramWithNavigationHandler.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramWithNavigationHandler.java
index d316e42d529..23be1b6512c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramWithNavigationHandler.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/CreateParametricDiagramWithNavigationHandler.java
@@ -1,25 +1,25 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric;
-
-import org.eclipse.papyrus.infra.gmfdiag.navigation.CreateDiagramWithNavigationHandler;
-
-
-public class CreateParametricDiagramWithNavigationHandler extends CreateDiagramWithNavigationHandler {
-
- public CreateParametricDiagramWithNavigationHandler() {
- super(new CreateParametricDiagramCommand(), new ParametricDiagramCondition());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric;
+
+import org.eclipse.papyrus.infra.gmfdiag.navigation.CreateDiagramWithNavigationHandler;
+
+
+public class CreateParametricDiagramWithNavigationHandler extends CreateDiagramWithNavigationHandler {
+
+ public CreateParametricDiagramWithNavigationHandler() {
+ super(new ParametricDiagramCreateCommand(), new ParametricDiagramCondition());
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java
index 355e25ef85f..edf0b0a3123 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/ParametricDiagramCondition.java
@@ -1,40 +1,44 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.core.extension.commands.PerspectiveContextDependence;
-import org.eclipse.papyrus.sysml.util.SysmlResource;
-import org.eclipse.uml2.uml.Class;
-
-/**
- * ParametricDiagramCondition to set conditions for the diagram creation
- */
-public class ParametricDiagramCondition extends PerspectiveContextDependence {
-
- /**
- * {@inheritDoc}
- */
- public boolean create(EObject selectedElement) {
- if(super.create(selectedElement)) {
- if(selectedElement instanceof org.eclipse.uml2.uml.Class) {
- Class clazz = (org.eclipse.uml2.uml.Class)selectedElement;
- if(clazz.getAppliedStereotype(SysmlResource.BLOCK_ID) != null || clazz.getAppliedStereotype(SysmlResource.CONSTRAINT_BLOCK_ID) != null) {
- return true;
- }
- }
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.core.extension.commands.PerspectiveContextDependence;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * ParametricDiagramCondition to set conditions for the diagram creation
+ */
+public class ParametricDiagramCondition extends PerspectiveContextDependence {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean create(EObject selectedElement) {
+ if(super.create(selectedElement)) {
+ if(selectedElement instanceof org.eclipse.uml2.uml.Class) {
+ org.eclipse.uml2.uml.Class clazz = (org.eclipse.uml2.uml.Class)selectedElement;
+ if(UMLUtil.getStereotypeApplication(clazz, Block.class) != null) {
+ return true;
+ }
+ }
+ else if(selectedElement instanceof org.eclipse.uml2.uml.Package) {
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorCreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorCreateCommand.java
new file mode 100644
index 00000000000..e2656ec954c
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/commands/CustomBindingConnectorCreateCommand.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.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.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
+import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
+import org.eclipse.papyrus.uml.service.types.utils.ConnectorUtils;
+import org.eclipse.papyrus.uml.service.types.utils.RequestParameterUtils;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.StructuredClassifier;
+import org.eclipse.uml2.uml.util.UMLUtil;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/**
+ * Creates a Message between MessageOccurrenceSpecifications. Converts OccurrenceSpecifications to
+ * MessageOccurrenceSpecifications if needed
+ */
+public class CustomBindingConnectorCreateCommand extends EditElementCommand {
+
+ private final EObject source;
+ private final EObject target;
+
+ public CustomBindingConnectorCreateCommand(final CreateRelationshipRequest request) {
+ super(request.getLabel(), null, request);
+ this.source = request.getSource();
+ this.target = request.getTarget();
+
+ }
+
+ @Override
+ public boolean canExecute() {
+ if(this.source == null) {
+ return false;
+ }
+ if(this.target == null) {
+ return true;
+ }
+ if(this.source == this.target) {
+ return false;
+ }
+ if (this.source != null && this.target != null) {
+ return isConstraintParameter((Element)source, RequestParameterUtils.getSourceView(getRequest()))
+ || isConstraintParameter((Element)target, RequestParameterUtils.getTargetView(getRequest()));
+ }
+ return false;
+ }
+
+ private boolean isConstraintParameter(Element element, View view) {
+ if (element instanceof Property) {
+ Property property = (Property) element;
+ Element ownerConstraintBlock = property.getOwner();
+ if (ownerConstraintBlock instanceof org.eclipse.uml2.uml.Class && UMLUtil.getStereotypeApplication(ownerConstraintBlock, ConstraintBlock.class) != null) {
+ // check for graphics : owned by a constraintProperty
+ View containerView = ViewUtil.getContainerView(view);
+ Element containerElement = (Element)containerView.getElement();
+ return containerElement instanceof Property
+ && UMLUtil.getStereotypeApplication(containerElement, ConstraintProperty.class) != null
+ && ((Property)containerElement).getType() == ownerConstraintBlock;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException {
+
+ if(!canExecute()) {
+ throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
+ }
+
+ // Create the Connector and its ConnectorEnd. Correct container are set and paths are set in case of <<NestedConnectorEnd>>.
+ StructuredClassifier deducedContainer = new ConnectorUtils().deduceContainer(RequestParameterUtils.getSourceView(getRequest()), RequestParameterUtils.getTargetView(getRequest()));
+ ((CreateRelationshipRequest)getRequest()).setContainer(deducedContainer);
+ IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(deducedContainer);
+ ICommand editCommand = commandProvider.getEditCommand(getRequest());
+
+ if (editCommand.canExecute()) {
+ editCommand.execute(monitor, info);
+ Object newObject = editCommand.getCommandResult().getReturnValue();
+
+ if (newObject instanceof Connector) {
+ Connector connector = (Connector)newObject;
+ // Apply the <<BindingConnector>> stereotype
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(connector, BlocksPackage.eINSTANCE.getBindingConnector());
+ }
+
+ return CommandResult.newOKCommandResult(newObject);
+ }
+ return CommandResult.newErrorCommandResult("Invalid arguments in create link command");
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConnectorCreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConnectorCreateCommand.java
deleted file mode 100644
index 9bbf7728d96..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConnectorCreateCommand.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.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.gmf.runtime.notation.Node;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ConnectorCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- protected final EObject source;
-
- /**
- * @generated
- */
- protected final EObject target;
-
- /**
- * @generated
- */
- protected StructuredClassifier container;
-
- /**
- * @generated
- */
- public ConnectorCreateCommand(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 ConnectableElement) {
- return false;
- }
- if(target != null && false == target instanceof ConnectableElement) {
- 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 SysmlBaseItemSemanticEditPolicy.getLinkConstraints().canCreateConnector_4001(getContainer(), getSource(), getTarget());
- }
-
- /**
- * @generated NOT
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$
- }
- Connector newElement = UMLFactory.eINSTANCE.createConnector();
- if(getContainer() != null) {
- getContainer().getOwnedConnectors().add(newElement);
- }
- // create the connector ends
- ConnectorEnd source = newElement.createEnd();
- ConnectorEnd target = newElement.createEnd();
- source.setRole(getSource());
- target.setRole(getTarget());
-
- doConfigure(newElement, monitor, info);
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(Connector 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 ConnectableElement getSource() {
- return (ConnectableElement)source;
- }
-
- /**
- * @generated
- */
- protected ConnectableElement getTarget() {
- return (ConnectableElement)target;
- }
-
- /**
- * @generated
- */
- public StructuredClassifier getContainer() {
- return container;
- }
-
- /**
- * Default approach is to traverse ancestors of the source to find instance of container. Modify
- * with appropriate logic.
- *
- * @generated NOT
- */
- private static StructuredClassifier deduceContainer(EObject source, EObject target) {
- // get the structured classifier, graphical container of the
- for(Object obj : DiagramEditPartsUtil.getEObjectViews(source)) {
- if(obj instanceof Node && ((Node)obj).getDiagram() != null) {
- EObject element = ((Node)obj).getDiagram().getElement();
- if(element instanceof StructuredClassifier) {
- return (StructuredClassifier)element;
- }
- }
- }
- return null;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConnectorReorientCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConnectorReorientCommand.java
deleted file mode 100644
index 022b8786103..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConnectorReorientCommand.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.commands;
-
-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.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.sysml.diagram.parametric.edit.policies.SysmlBaseItemSemanticEditPolicy;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.StructuredClassifier;
-
-/**
- * @generated
- */
-public class ConnectorReorientCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private final int reorientDirection;
-
- /**
- * @generated
- */
- private final EObject oldEnd;
-
- /**
- * @generated
- */
- private final EObject newEnd;
-
- /**
- * @generated
- */
- public ConnectorReorientCommand(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 Connector) {
- return false;
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) {
- return canReorientSource();
- }
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_TARGET) {
- return canReorientTarget();
- }
- return false;
- }
-
- /**
- * @generated NOT
- */
- protected boolean canReorientSource() {
- if(!(oldEnd instanceof ConnectableElement && newEnd instanceof ConnectableElement)) {
- return false;
- }
- ConnectableElement target = null;
- EList<ConnectorEnd> ends = getLink().getEnds();
- if(ends != null && !ends.isEmpty()) {
- target = ends.get(1).getRole();
- }
- if(!(getLink().eContainer() instanceof StructuredClassifier)) {
- return false;
- }
- StructuredClassifier container = (StructuredClassifier)getLink().eContainer();
- return SysmlBaseItemSemanticEditPolicy.LinkConstraints.canExistConnector_4001(container, getNewSource(), target);
- }
-
- /**
- * @generated NOT
- */
- protected boolean canReorientTarget() {
- if(!(oldEnd instanceof ConnectableElement && newEnd instanceof ConnectableElement)) {
- return false;
- }
- ConnectableElement source = null;
- EList<ConnectorEnd> ends = getLink().getEnds();
- if(ends != null && !ends.isEmpty()) {
- source = ends.get(0).getRole();
- }
- if(!(getLink().eContainer() instanceof StructuredClassifier)) {
- return false;
- }
- StructuredClassifier container = (StructuredClassifier)getLink().eContainer();
- return SysmlBaseItemSemanticEditPolicy.LinkConstraints.canExistConnector_4001(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 NOT
- */
- protected CommandResult reorientSource() throws ExecutionException {
- EList<ConnectorEnd> ends = getLink().getEnds();
- if(ends != null && !ends.isEmpty()) {
- ends.get(0).setRole(getNewSource());
- return CommandResult.newOKCommandResult(getLink());
- } else {
- return CommandResult.newCancelledCommandResult();
- }
- }
-
- /**
- * @generated NOT
- */
- protected CommandResult reorientTarget() throws ExecutionException {
- EList<ConnectorEnd> ends = getLink().getEnds();
- if(ends != null && !ends.isEmpty()) {
- ends.get(1).setRole(getNewTarget());
- return CommandResult.newOKCommandResult(getLink());
- } else {
- return CommandResult.newCancelledCommandResult();
- }
- }
-
- /**
- * @generated
- */
- protected Connector getLink() {
- return (Connector)getElementToEdit();
- }
-
- /**
- * @generated
- */
- protected ConnectableElement getOldSource() {
- return (ConnectableElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected ConnectableElement getNewSource() {
- return (ConnectableElement)newEnd;
- }
-
- /**
- * @generated
- */
- protected ConnectableElement getOldTarget() {
- return (ConnectableElement)oldEnd;
- }
-
- /**
- * @generated
- */
- protected ConnectableElement getNewTarget() {
- return (ConnectableElement)newEnd;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConstraintPropertyCreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConstraintPropertyCreateCommand.java
deleted file mode 100644
index 46dfcfd145f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/ConstraintPropertyCreateCommand.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.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.resource.Resource;
-import org.eclipse.papyrus.resource.util.ResourceUtil;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.constraints.ConstraintsFactory;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class ConstraintPropertyCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public ConstraintPropertyCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static ConstraintPropertyCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new ConstraintPropertyCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public ConstraintPropertyCreateCommand(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
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- ConstraintProperty newElement = ConstraintsFactory.eINSTANCE.createConstraintProperty();
-
- EObject elementToEdit = getElementToEdit();
-
- if(elementToEdit instanceof Class) {
- Class aClass = (Class)elementToEdit;
- Property property = UMLFactory.eINSTANCE.createProperty();
- aClass.getOwnedAttributes().add(property);
- newElement.setBase_Property(property);
- }
-
- Resource owner = ResourceUtil.getResource(elementToEdit);
- owner.getEobjects().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(ConstraintProperty 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java
deleted file mode 100644
index 1bf23c7f9e6..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.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.sysml.constraints.ConstraintProperty;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class Property2CreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public Property2CreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static Property2CreateCommand create(CreateElementRequest req, EObject eObject) {
- return new Property2CreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public Property2CreateCommand(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
- */
- public boolean canExecute() {
- ConstraintProperty container = (ConstraintProperty)getElementToEdit();
- Property baseProperty = container.getBase_Property();
- if(baseProperty != null && baseProperty.getType() != null) {
- // TODO constraint is too restrictive
- // && StereotypeUtils.isStereotypeApplied("SysML::Constraints::ConstraintBlock",
- // baseProperty.getType())) {
- return true;
- }
- return false;
-
- }
-
- /**
- * @generated NOT
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- Property newElement = UMLFactory.eINSTANCE.createProperty();
- ConstraintProperty owner = (ConstraintProperty)getElementToEdit();
- Type type = owner.getBase_Property().getType();
-
- if(type != null && type instanceof StructuredClassifier) {
- StructuredClassifier classifier = (StructuredClassifier)type;
- classifier.getOwnedAttributes().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- } else {
- return CommandResult.newCancelledCommandResult();
- }
- }
-
- /**
- * @generated
- */
- protected void doConfigure(Property 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/PropertyCreateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/PropertyCreateCommand.java
deleted file mode 100644
index f3ab3a73680..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/PropertyCreateCommand.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.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.uml2.uml.Property;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * @generated
- */
-public class PropertyCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private EClass eClass = null;
-
- /**
- * @generated
- */
- private EObject eObject = null;
-
- /**
- * @generated
- */
- public PropertyCreateCommand(CreateElementRequest req, EObject eObject) {
- super(req.getLabel(), null, req);
- this.eObject = eObject;
- this.eClass = eObject != null ? eObject.eClass() : null;
- }
-
- /**
- * @generated
- */
- public static PropertyCreateCommand create(CreateElementRequest req, EObject eObject) {
- return new PropertyCreateCommand(req, eObject);
- }
-
- /**
- * @generated
- */
- public PropertyCreateCommand(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 {
-
- Property newElement = UMLFactory.eINSTANCE.createProperty();
-
- StructuredClassifier owner = (StructuredClassifier)getElementToEdit();
- owner.getOwnedAttributes().add(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest)getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(Property 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/SysmlReorientConnectionViewCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/SysmlReorientConnectionViewCommand.java
deleted file mode 100644
index d6e9b75d520..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/SysmlReorientConnectionViewCommand.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.commands;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class SysmlReorientConnectionViewCommand extends AbstractTransactionalCommand {
-
- /**
- * @generated
- */
- private IAdaptable edgeAdaptor;
-
- /**
- * @generated
- */
- public SysmlReorientConnectionViewCommand(TransactionalEditingDomain editingDomain, String label) {
- super(editingDomain, label, null);
- }
-
- /**
- * @generated
- */
- public List getAffectedFiles() {
- View view = (View)edgeAdaptor.getAdapter(View.class);
- if(view != null) {
- return getWorkspaceFiles(view);
- }
- return super.getAffectedFiles();
- }
-
- /**
- * @generated
- */
- public IAdaptable getEdgeAdaptor() {
- return edgeAdaptor;
- }
-
- /**
- * @generated
- */
- public void setEdgeAdaptor(IAdaptable edgeAdaptor) {
- this.edgeAdaptor = edgeAdaptor;
- }
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) {
- assert null != edgeAdaptor : "Null child in SysmlReorientConnectionViewCommand"; //$NON-NLS-1$
- Edge edge = (Edge)getEdgeAdaptor().getAdapter(Edge.class);
- assert null != edge : "Null edge in SysmlReorientConnectionViewCommand"; //$NON-NLS-1$
- View tempView = edge.getSource();
- edge.setSource(edge.getTarget());
- edge.setTarget(tempView);
- return CommandResult.newOKCommandResult();
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ConnectorEditHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ConnectorEditHelper.java
deleted file mode 100644
index e55d99d4b4a..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ConnectorEditHelper.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers;
-
-/**
- * @generated
- */
-public class ConnectorEditHelper extends SysmlBaseEditHelper {
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ConstraintPropertyEditHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ConstraintPropertyEditHelper.java
deleted file mode 100644
index cb092f6ea84..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ConstraintPropertyEditHelper.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers;
-
-/**
- * @generated
- */
-public class ConstraintPropertyEditHelper extends SysmlBaseEditHelper {
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ResourceEditHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ResourceEditHelper.java
deleted file mode 100644
index b2491486a80..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/ResourceEditHelper.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers;
-
-/**
- * @generated
- */
-public class ResourceEditHelper extends SysmlBaseEditHelper {
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/SysmlBaseEditHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/SysmlBaseEditHelper.java
deleted file mode 100644
index 5f679efcf9f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/SysmlBaseEditHelper.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers;
-
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-
-/**
- * @generated
- */
-public class SysmlBaseEditHelper extends AbstractEditHelper {
-
- /**
- * @generated
- */
- public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ELEMENT_TYPE = "context element type"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- protected IEditHelperAdvice[] getEditHelperAdvice(IEditCommandRequest req) {
- if(req.getParameter(CONTEXT_ELEMENT_TYPE) instanceof IElementType) {
- return ElementTypeRegistry.getInstance().getEditHelperAdvice((IElementType)req.getParameter(CONTEXT_ELEMENT_TYPE));
- }
- return super.getEditHelperAdvice(req);
- }
-
- /**
- * @generated
- */
- protected ICommand getInsteadCommand(IEditCommandRequest req) {
- ICommand epCommand = (ICommand)req.getParameter(EDIT_POLICY_COMMAND);
- req.setParameter(EDIT_POLICY_COMMAND, null);
- ICommand ehCommand = super.getInsteadCommand(req);
- if(epCommand == null) {
- return ehCommand;
- }
- if(ehCommand == null) {
- return epCommand;
- }
- CompositeCommand command = new CompositeCommand(null);
- command.add(epCommand);
- command.add(ehCommand);
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateCommand(CreateElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockCompositeEditPartTN.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockCompositeEditPartTN.java
new file mode 100644
index 00000000000..45d0799010d
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockCompositeEditPartTN.java
@@ -0,0 +1,69 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.part;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockLabelNameEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.StructureCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.figure.SysMLDiagramFrameFigure;
+import org.eclipse.papyrus.sysml.diagram.parametric.figures.ParametricDiagramFrameFigure;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
+
+
+public class CustomBlockCompositeEditPartTN extends AbstractElementEditPart {
+
+ public CustomBlockCompositeEditPartTN(View view) {
+ super(view);
+ }
+
+ @Override
+ protected IFigure createNodeShape() {
+ return this.primaryShape = new ParametricDiagramFrameFigure();
+ }
+
+ @Override
+ public NodeNamedElementFigure getPrimaryShape() {
+ return (NodeNamedElementFigure)primaryShape;
+ }
+
+ @Override
+ protected boolean addFixedChild(EditPart childEditPart) {
+ if(childEditPart instanceof BlockLabelNameEditPart) {
+ ((BlockLabelNameEditPart)childEditPart).setLabel(getPrimaryShape().getNameLabel());
+ return true;
+ }
+ if(childEditPart instanceof StructureCompartmentEditPart) {
+ IFigure pane = ((SysMLDiagramFrameFigure)getPrimaryShape()).getStructureCompartmentFigure();
+ setupContentPane(pane);
+ pane.add(((StructureCompartmentEditPart)childEditPart).getFigure());
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ protected boolean removeFixedChild(EditPart childEditPart) {
+ return false;
+ }
+
+ @Override
+ protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
+ if(editPart instanceof StructureCompartmentEditPart) {
+ return ((SysMLDiagramFrameFigure)getPrimaryShape()).getStructureCompartmentFigure();
+ }
+ return getContentPane();
+ }
+
+ @Override
+ public EditPart getPrimaryChildEditPart() {
+ return null;
+ }
+
+ @Override
+ protected LayoutEditPolicy createLayoutEditPolicy() {
+ return null;
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java
new file mode 100644
index 00000000000..fa63868d0ff
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockLabelNameEditPart.java
@@ -0,0 +1,17 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.part;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockLabelNameEditPart;
+
+public class CustomBlockLabelNameEditPart extends BlockLabelNameEditPart {
+
+ public CustomBlockLabelNameEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected String getLabelText() {
+ String diagramName = getDiagramView().getName();
+ return super.getLabelText() + " [" + diagramName + "]";
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockPropertyCompositeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockPropertyCompositeEditPart.java
new file mode 100644
index 00000000000..10f16e46603
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomBlockPropertyCompositeEditPart.java
@@ -0,0 +1,20 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.part;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy;
+
+public class CustomBlockPropertyCompositeEditPart extends
+ BlockPropertyCompositeEditPart {
+
+ public CustomBlockPropertyCompositeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintBlockPropertyCompositeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintBlockPropertyCompositeEditPart.java
new file mode 100644
index 00000000000..b488262393d
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintBlockPropertyCompositeEditPart.java
@@ -0,0 +1,21 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.part;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintBlockPropertyCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy;
+
+public class CustomConstraintBlockPropertyCompositeEditPart extends
+ ConstraintBlockPropertyCompositeEditPart {
+
+ public CustomConstraintBlockPropertyCompositeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintParameterAffixedNodeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintParameterAffixedNodeEditPart.java
new file mode 100644
index 00000000000..41cc9983fb7
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomConstraintParameterAffixedNodeEditPart.java
@@ -0,0 +1,19 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.part;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintParameterAffixedNodeEditPart;
+
+public class CustomConstraintParameterAffixedNodeEditPart extends ConstraintParameterAffixedNodeEditPart {
+
+ public CustomConstraintParameterAffixedNodeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomPortAffixedNodeEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomPortAffixedNodeEditPart.java
new file mode 100644
index 00000000000..c89c9070057
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/part/CustomPortAffixedNodeEditPart.java
@@ -0,0 +1,20 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.edit.part;
+
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart;
+
+public class CustomPortAffixedNodeEditPart extends PortAffixedNodeEditPart {
+
+ public CustomPortAffixedNodeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConnectorEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConnectorEditPart.java
deleted file mode 100644
index 58ecd9c5f64..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConnectorEditPart.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import org.eclipse.draw2d.Connection;
-import org.eclipse.gef.EditPart;
-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.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.ConnectorItemSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.edge.UMLEdgeFigure;
-
-/**
- * @generated
- */
-public class ConnectorEditPart extends UMLConnectionNodeEditPart
-
-implements ITreeBranchEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 4001;
-
- /**
- * @generated
- */
- public ConnectorEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConnectorItemSemanticEditPolicy());
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConnectorNameEditPart) {
- ((ConnectorNameEditPart)childEditPart).setLabel(getPrimaryShape().getConnectorLabel());
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConnectorNameEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model so you may safely remove
- * <i>generated</i> tag and modify it.
- *
- * @generated
- */
-
- protected Connection createConnectionFigure() {
- return new ConnectorFigure();
- }
-
- /**
- * @generated
- */
- public ConnectorFigure getPrimaryShape() {
- return (ConnectorFigure)getFigure();
- }
-
- /**
- * @generated NOT extends UMLEdgeFigure
- */
- public class ConnectorFigure extends UMLEdgeFigure {
-
- /**
- * @generated
- */
- private WrappingLabel fConnectorLabel;
-
- /**
- * @generated
- */
- public ConnectorFigure() {
- this.setLineWidth(1);
-
- createContents();
- }
-
- /**
- * @generated NOT protected
- */
- protected void createContents() {
-
- fConnectorLabel = new WrappingLabel();
- fConnectorLabel.setText("");
-
- this.add(fConnectorLabel);
-
- }
-
- /**
- * @generated
- */
- public WrappingLabel getConnectorLabel() {
- return fConnectorLabel;
- }
-
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConnectorNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConnectorNameEditPart.java
deleted file mode 100644
index 105a4f92926..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConnectorNameEditPart.java
+++ /dev/null
@@ -1,756 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.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.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlTextSelectionEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConnectorNameEditPart extends LabelEditPart implements ITextAwareEditPart, ILabelRoleProvider {
-
- /**
- * @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(SysmlVisualIDRegistry.getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorNameEditPart.VISUAL_ID), new Point(0, 40));
- }
-
- /**
- * @generated
- */
- public ConnectorNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SysmlTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ParametricEditPart.LinkLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- public int getKeyPoint() {
- return ConnectionLocator.MIDDLE;
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated NOT
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return SysmlElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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 = SysmlParserProvider.getParser(SysmlElementTypes.Connector_4001, getParserElement(), SysmlVisualIDRegistry.getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), SysmlEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- *
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- */
- 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();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- refreshLabel();
- }
-
- super.handleNotificationEvent(event);
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- // Parent should assign one using setLabel() method
- return null;
- }
-
- /**
- * @generated
- */
- public String getLabelRole() {
- return "Name";//$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public String getIconPathRole() {
- return "platform:/plugin/org.eclipse.papyrus.uml.diagram.common/icons/label_role/name.png";//$NON-NLS-1$
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintLabelEditPart.java
deleted file mode 100644
index 14409979b2f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintLabelEditPart.java
+++ /dev/null
@@ -1,767 +0,0 @@
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromModelEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlTextSelectionEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConstraintLabelEditPart 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 ConstraintLabelEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SysmlTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ParametricEditPart.NodeLabelDragPolicy());
- installEditPolicy(RequestConstants.REQ_SEMANTIC_WRAPPER, new NoDeleteFromModelEditPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(WrappingLabel figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated NOT
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return SysmlElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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 = SysmlParserProvider.getParser(SysmlElementTypes.ConstraintProperty_2003, getParserElement(), SysmlVisualIDRegistry.getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintLabelEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), SysmlEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- *
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- */
- 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();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java
deleted file mode 100644
index 44b7e14bc92..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java
+++ /dev/null
@@ -1,496 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import org.eclipse.draw2d.GridData;
-import org.eclipse.draw2d.GridLayout;
-import org.eclipse.draw2d.IFigure;
-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.EObject;
-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.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-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.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.ConstraintPropertyItemSemanticEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.CreateParameterEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel;
-import org.eclipse.papyrus.sysml.diagram.parametric.helper.SelfCompartmentNotificationHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.locator.ParameterPositionLocator;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.BorderItemResizableEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ConstraintPropertyEditPart extends
-
-AbstractBorderedShapeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2003;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * Notifier for listening and stop listening model element.
- */
- private SelfCompartmentNotificationHelper notifier = new SelfCompartmentNotificationHelper(this, UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute(), (IHintedType)SysmlElementTypes.Property_3002);
-
- /**
- * @generated
- */
- public ConstraintPropertyEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- installEditPolicy(EditPolicyRoles.CREATION_ROLE, new CreationEditPolicy());
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ConstraintPropertyItemSemanticEditPolicy());
- 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.sysml.diagram.parametric.edit.policies.ConstraintPropertyCanonicalEditPolicy());
-
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(RequestConstants.REQ_CREATE, new CreateParameterEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(SysmlVisualIDRegistry.getVisualID(childView)) {
- case Property2EditPart.VISUAL_ID:
-
- return new BorderItemResizableEditPolicy();
-
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ConstraintPropertyFigureDescriptor();
- }
-
- /**
- * @generated
- */
- public ConstraintPropertyFigureDescriptor getPrimaryShape() {
- return (ConstraintPropertyFigureDescriptor)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintPropertyNameEditPart) {
- ((ConstraintPropertyNameEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintPropertyFigureLabel());
- return true;
- }
- if(childEditPart instanceof ConstraintLabelEditPart) {
- ((ConstraintLabelEditPart)childEditPart).setLabel(getPrimaryShape().getConstraintLabel());
- return true;
- }
-
- //Papyrus Gencode :Affixed Parameter locator
- if(childEditPart instanceof Property2EditPart) {
- IBorderItemLocator locator = new ParameterPositionLocator(getMainFigure(), PositionConstants.NONE);
- getBorderedFigure().getBorderItemContainer().add(((Property2EditPart)childEditPart).getFigure(), locator);
- return true;
- }
-
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof ConstraintPropertyNameEditPart) {
- return true;
- }
- if(childEditPart instanceof ConstraintLabelEditPart) {
- return true;
- }
- if(childEditPart instanceof Property2EditPart) {
- getBorderedFigure().getBorderItemContainer().remove(((Property2EditPart)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() {
- String prefElementId = "ConstraintProperty";
- IPreferenceStore store = SysmlDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model so you may safely remove
- * <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane. Respects layout one may have set
- * for generated figure.
- *
- * @param nodeShape
- * instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(SysmlVisualIDRegistry.getType(ConstraintPropertyNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public class ConstraintPropertyFigureDescriptor extends RoundedRectangle {
-
- /**
- * @generated
- */
- private CenteredWrappedLabel fConstraintPropertyFigureLabel;
-
- /**
- * @generated
- */
- private WrappingLabel fConstraintLabel;
-
- /**
- * @generated
- */
- public ConstraintPropertyFigureDescriptor() {
-
- GridLayout layoutThis = new GridLayout();
- layoutThis.numColumns = 1;
- layoutThis.makeColumnsEqualWidth = true;
- this.setLayoutManager(layoutThis);
-
- this.setCornerDimensions(new Dimension(getMapMode().DPtoLP(25), getMapMode().DPtoLP(25)));
- this.setLineWidth(1);
- this.setMinimumSize(new Dimension(getMapMode().DPtoLP(200), getMapMode().DPtoLP(120)));
- createContents();
- }
-
- /**
- * @generated
- */
- private void createContents() {
-
- fConstraintPropertyFigureLabel = new CenteredWrappedLabel();
-
- GridData constraintFConstraintPropertyFigureLabel = new GridData();
- constraintFConstraintPropertyFigureLabel.verticalAlignment = GridData.END;
- constraintFConstraintPropertyFigureLabel.horizontalAlignment = GridData.CENTER;
- constraintFConstraintPropertyFigureLabel.horizontalIndent = 0;
- constraintFConstraintPropertyFigureLabel.horizontalSpan = 1;
- constraintFConstraintPropertyFigureLabel.verticalSpan = 1;
- constraintFConstraintPropertyFigureLabel.grabExcessHorizontalSpace = true;
- constraintFConstraintPropertyFigureLabel.grabExcessVerticalSpace = true;
- this.add(fConstraintPropertyFigureLabel, constraintFConstraintPropertyFigureLabel);
-
- fConstraintLabel = new WrappingLabel();
-
- GridData constraintFConstraintLabel = new GridData();
- constraintFConstraintLabel.verticalAlignment = GridData.BEGINNING;
- constraintFConstraintLabel.horizontalAlignment = GridData.END;
- constraintFConstraintLabel.horizontalIndent = 0;
- constraintFConstraintLabel.horizontalSpan = 1;
- constraintFConstraintLabel.verticalSpan = 1;
- constraintFConstraintLabel.grabExcessHorizontalSpace = true;
- constraintFConstraintLabel.grabExcessVerticalSpace = true;
- this.add(fConstraintLabel, constraintFConstraintLabel);
-
- }
-
- /**
- * @generated
- */
- private boolean myUseLocalCoordinates = false;
-
- /**
- * @generated
- */
- protected boolean useLocalCoordinates() {
- return myUseLocalCoordinates;
- }
-
- /**
- * @generated
- */
- protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
- myUseLocalCoordinates = useLocalCoordinates;
- }
-
- /**
- * @generated
- */
- public CenteredWrappedLabel getConstraintPropertyFigureLabel() {
- return fConstraintPropertyFigureLabel;
- }
-
- /**
- * @generated
- */
- public WrappingLabel getConstraintLabel() {
- return fConstraintLabel;
- }
-
- }
-
- /**
- * @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("ConstraintProperty", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("ConstraintProperty", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("ConstraintProperty", 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("ConstraintProperty", 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;
- }
-
- /**
- * Activate a listener for to Handle notification for new owned property
- */
- @Override
- public void activate() {
- super.activate();
- EObject parent = resolveSemanticElement();
- // listen constraint property and self base property
- notifier.listenObject(parent);
- if(parent instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)parent).getBase_Property();
- notifier.listenObject(property);
- if(property.getType() != null) {
- notifier.listenObject(property.getType());
- }
- }
- // ensure children parts are correctly initialized.
- SelfCompartmentNotificationHelper.updatePropertiesParts(this, UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute(), (IHintedType)SysmlElementTypes.Property_3002);
- }
-
- /**
- * Deactivate listeners to handle notification in the message occurence specification
- */
- @Override
- public void deactivate() {
- notifier.unlistenAll();
- super.deactivate();
- }
-
- /**
- * Remove listeners to handle notification in the message occurence specification
- */
- @Override
- public void removeNotify() {
- notifier.unlistenAll();
- super.removeNotify();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyNameEditPart.java
deleted file mode 100644
index 7b44fc3d663..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyNameEditPart.java
+++ /dev/null
@@ -1,792 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlTextSelectionEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class ConstraintPropertyNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5001;
-
- /**
- * @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 ConstraintPropertyNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SysmlTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ParametricEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(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 NOT
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return SysmlElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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 = SysmlParserProvider.getParser(SysmlElementTypes.ConstraintProperty_2003, getParserElement(), SysmlVisualIDRegistry.getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), SysmlEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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.uml.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 NOT
- */
- protected boolean checkExtendedEditor() {
- EObject semanticElement = resolveSemanticElement();
- if(semanticElement != null && semanticElement instanceof ConstraintProperty) {
- boolean hasSpecificEditorConfiguration = DirectEditorsUtil.hasSpecificEditorConfiguration(((ConstraintProperty)semanticElement).getBase_Property().eClass().getInstanceClassName());
-
- return hasSpecificEditorConfiguration;
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- *
- * @generated NOT
- */
- 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.SYSML_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();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- 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);
-
- }
-
- // @Override
- // public EObject resolveSemanticElement() {
- // EObject semanticElement = super.resolveSemanticElement();
- // if (semanticElement instanceof ConstraintProperty) {
- // semanticElement = ((ConstraintProperty) semanticElement).getBase_Property();
- // }
- // return semanticElement;
- // }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ParametricEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ParametricEditPart.java
deleted file mode 100644
index cceaf0dda80..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ParametricEditPart.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.CustomDiagramDragDropEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.ParametricItemSemanticEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.providers.ViewInfo;
-import org.eclipse.papyrus.uml.diagram.common.util.MDTUtil;
-
-/**
- * @generated
- */
-public class ParametricEditPart extends DiagramEditPart {
-
- /**
- * @generated
- */
- public final static String MODEL_ID = "Parametric"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 1000;
-
- /**
- * @generated
- */
- public ParametricEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new DuplicatePasteEditPolicy());
-
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ParametricItemSemanticEditPolicy());
-
- //in Papyrus diagrams are not strongly synchronised
- //installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.ParametricCanonicalEditPolicy());
-
- installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDragDropEditPolicy());
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE);
- }
-
- /**
- * @generated
- */
- /* package-local */static class NodeLabelDragPolicy extends NonResizableEditPolicy {
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle h = new MoveHandle((GraphicalEditPart)getHost());
- h.setBorder(null);
- return Collections.singletonList(h);
- }
-
- /**
- * @generated
- */
- public Command getCommand(Request request) {
- return null;
- }
-
- /**
- * @generated
- */
- public boolean understandsRequest(Request request) {
- return false;
- }
- }
-
- /**
- * @generated
- */
- /* package-local */static class LinkLabelDragPolicy extends NonResizableLabelEditPolicy {
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- }
-
- /**
- * @generated
- */
- protected void handleNotificationEvent(Notification event) {
-
- super.handleNotificationEvent(event);
- if(event.getNotifier() instanceof EAnnotation) {
- EAnnotation eAnnotation = (EAnnotation)event.getNotifier();
- if(eAnnotation.getSource() != null && eAnnotation.getSource().equals(MDTUtil.FilterViewAndLabelsSource)) {
- //modification form MOSKitt approach, canonical policies are not called
- MDTUtil.filterDiagramViews(this.getDiagramView());
- }
- }
- }
-
- /**
- * @generated
- */
- public Object getAdapter(Class adapter) {
-
- if(adapter != null && adapter.equals(ViewInfo.class)) {
- return SysmlVisualIDRegistry.getDiagramViewInfo();
- }
- return super.getAdapter(adapter);
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/Property2EditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/Property2EditPart.java
deleted file mode 100644
index cdd49de3c3b..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/Property2EditPart.java
+++ /dev/null
@@ -1,383 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.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.diagram.ui.requests.RequestConstants;
-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.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromDiagramEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromModelEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.OpenDiagramEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.Property2ItemSemanticEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class Property2EditPart extends
-
-BorderedBorderItemEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 3002;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public Property2EditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new Property2ItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- installEditPolicy(EditPolicyRoles.OPEN_ROLE, new OpenDiagramEditPolicy());
- installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy());
- installEditPolicy(RequestConstants.REQ_SEMANTIC_WRAPPER, new NoDeleteFromModelEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View)child.getModel();
- switch(SysmlVisualIDRegistry.getVisualID(childView)) {
- case PropertyName2EditPart.VISUAL_ID:
- return new BorderItemSelectionEditPolicy() {
-
- protected List createSelectionHandles() {
- MoveHandle mh = new MoveHandle((GraphicalEditPart)getHost());
- mh.setBorder(null);
- return Collections.singletonList(mh);
- }
- };
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new ParameterDescriptor();
- }
-
- /**
- * @generated
- */
- public ParameterDescriptor getPrimaryShape() {
- return (ParameterDescriptor)primaryShape;
- }
-
- /**
- * @generated
- */
- protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) {
- if(borderItemEditPart instanceof PropertyName2EditPart) {
- 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() {
- String prefElementId = "Property";
- IPreferenceStore store = SysmlDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- //FIXME: workaround for #154536
- result.getBounds().setSize(result.getPreferredSize());
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model so you may safely remove
- * <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createMainFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane. Respects layout one may have set
- * for generated figure.
- *
- * @param nodeShape
- * instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(SysmlVisualIDRegistry.getType(PropertyName2EditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(SysmlElementTypes.Connector_4001);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof PropertyEditPart) {
- types.add(SysmlElementTypes.Connector_4001);
- }
- if(targetEditPart instanceof org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart) {
- types.add(SysmlElementTypes.Connector_4001);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == SysmlElementTypes.Connector_4001) {
- types.add(SysmlElementTypes.Property_2005);
- types.add(SysmlElementTypes.Property_3002);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(SysmlElementTypes.Connector_4001);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == SysmlElementTypes.Connector_4001) {
- types.add(SysmlElementTypes.Property_2005);
- types.add(SysmlElementTypes.Property_3002);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public class ParameterDescriptor extends RectangleFigure {
-
- /**
- * @generated
- */
- public ParameterDescriptor() {
- this.setLineWidth(1);
- this.setPreferredSize(new Dimension(getMapMode().DPtoLP(16), getMapMode().DPtoLP(16)));
- }
-
- /**
- * @generated
- */
- private boolean myUseLocalCoordinates = false;
-
- /**
- * @generated
- */
- protected boolean useLocalCoordinates() {
- return myUseLocalCoordinates;
- }
-
- /**
- * @generated
- */
- protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
- myUseLocalCoordinates = useLocalCoordinates;
- }
-
- }
-
- /**
- * @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("Property", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Property", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Property", 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("Property", 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java
deleted file mode 100644
index 4d954ccc14c..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-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.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.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.PropertyItemSemanticEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.draw2d.CenterLayout;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * @generated
- */
-public class PropertyEditPart extends
-
-ShapeNodeEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 2005;
-
- /**
- * @generated
- */
- protected IFigure contentPane;
-
- /**
- * @generated
- */
- protected IFigure primaryShape;
-
- /**
- * @generated
- */
- public PropertyEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new PropertyItemSemanticEditPolicy());
- installEditPolicy(EditPolicy.LAYOUT_ROLE, createLayoutEditPolicy());
- // XXX need an SCR to runtime to have another abstract superclass that would let children add reasonable editpolicies
- // removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CONNECTION_HANDLES_ROLE);
- }
-
- /**
- * @generated
- */
- protected LayoutEditPolicy createLayoutEditPolicy() {
- org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy lep = new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LayoutEditPolicy() {
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
- };
- return lep;
- }
-
- /**
- * @generated
- */
- protected IFigure createNodeShape() {
- return primaryShape = new PropertyFigure();
- }
-
- /**
- * @generated
- */
- public PropertyFigure getPrimaryShape() {
- return (PropertyFigure)primaryShape;
- }
-
- /**
- * @generated
- */
- protected boolean addFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PropertyNameEditPart) {
- ((PropertyNameEditPart)childEditPart).setLabel(getPrimaryShape().getPropertyFigureLabel());
- return true;
- }
-
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean removeFixedChild(EditPart childEditPart) {
- if(childEditPart instanceof PropertyNameEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected void addChildVisual(EditPart childEditPart, int index) {
- if(addFixedChild(childEditPart)) {
- return;
- }
- super.addChildVisual(childEditPart, -1);
- }
-
- /**
- * @generated
- */
- protected void removeChildVisual(EditPart childEditPart) {
- if(removeFixedChild(childEditPart)) {
- return;
- }
- super.removeChildVisual(childEditPart);
- }
-
- /**
- * @generated
- */
- protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
- return getContentPane();
- }
-
- /**
- * @generated
- */
- protected NodeFigure createNodePlate() {
- String prefElementId = "Property";
- IPreferenceStore store = SysmlDiagramEditorPlugin.getInstance().getPreferenceStore();
- String preferenceConstantWitdh = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.WIDTH);
- String preferenceConstantHeight = PreferenceInitializerForElementHelper.getpreferenceKey(getNotationView(), prefElementId, PreferenceConstantHelper.HEIGHT);
- DefaultSizeNodeFigure result = new DefaultSizeNodeFigure(store.getInt(preferenceConstantWitdh), store.getInt(preferenceConstantHeight));
-
- return result;
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model so you may safely remove
- * <i>generated</i> tag and modify it.
- *
- * @generated
- */
- protected NodeFigure createNodeFigure() {
- NodeFigure figure = createNodePlate();
- figure.setLayoutManager(new StackLayout());
- IFigure shape = createNodeShape();
- figure.add(shape);
- contentPane = setupContentPane(shape);
- return figure;
- }
-
- /**
- * Default implementation treats passed figure as content pane. Respects layout one may have set
- * for generated figure.
- *
- * @param nodeShape
- * instance of generated figure class
- * @generated
- */
- protected IFigure setupContentPane(IFigure nodeShape) {
- if(nodeShape.getLayoutManager() == null) {
- ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout();
- layout.setSpacing(5);
- nodeShape.setLayoutManager(layout);
- }
- return nodeShape; // use nodeShape itself as contentPane
- }
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- if(contentPane != null) {
- return contentPane;
- }
- return super.getContentPane();
- }
-
- /**
- * @generated
- */
- protected void setForegroundColor(Color color) {
- if(primaryShape != null) {
- primaryShape.setForegroundColor(color);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineWidth(int width) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineWidth(width);
- }
- }
-
- /**
- * @generated
- */
- protected void setLineType(int style) {
- if(primaryShape instanceof Shape) {
- ((Shape)primaryShape).setLineStyle(style);
- }
- }
-
- /**
- * @generated
- */
- public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(SysmlVisualIDRegistry.getType(PropertyNameEditPart.VISUAL_ID));
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSource() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(SysmlElementTypes.Connector_4001);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnSourceAndTarget(IGraphicalEditPart targetEditPart) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(targetEditPart instanceof org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart) {
- types.add(SysmlElementTypes.Connector_4001);
- }
- if(targetEditPart instanceof Property2EditPart) {
- types.add(SysmlElementTypes.Connector_4001);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForTarget(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == SysmlElementTypes.Connector_4001) {
- types.add(SysmlElementTypes.Property_2005);
- types.add(SysmlElementTypes.Property_3002);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMARelTypesOnTarget() {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(SysmlElementTypes.Connector_4001);
- return types;
- }
-
- /**
- * @generated
- */
- public List<IElementType> getMATypesForSource(IElementType relationshipType) {
- LinkedList<IElementType> types = new LinkedList<IElementType>();
- if(relationshipType == SysmlElementTypes.Connector_4001) {
- types.add(SysmlElementTypes.Property_2005);
- types.add(SysmlElementTypes.Property_3002);
- }
- return types;
- }
-
- /**
- * @generated
- */
- public class PropertyFigure extends RectangleFigure {
-
- /**
- * @generated
- */
- private CenteredWrappedLabel fPropertyFigureLabel;
-
- /**
- * @generated
- */
- public PropertyFigure() {
-
- CenterLayout layoutThis = new CenterLayout();
-
- this.setLayoutManager(layoutThis);
-
- this.setLineWidth(1);
- this.setMinimumSize(new Dimension(getMapMode().DPtoLP(100), getMapMode().DPtoLP(40)));
- createContents();
- }
-
- /**
- * @generated
- */
- private void createContents() {
-
- fPropertyFigureLabel = new CenteredWrappedLabel();
-
- this.add(fPropertyFigureLabel);
-
- }
-
- /**
- * @generated
- */
- private boolean myUseLocalCoordinates = false;
-
- /**
- * @generated
- */
- protected boolean useLocalCoordinates() {
- return myUseLocalCoordinates;
- }
-
- /**
- * @generated
- */
- protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
- myUseLocalCoordinates = useLocalCoordinates;
- }
-
- /**
- * @generated
- */
- public CenteredWrappedLabel getPropertyFigureLabel() {
- return fPropertyFigureLabel;
- }
-
- }
-
- /**
- * @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("Property", PreferenceConstantHelper.COLOR_LINE);
- } else if(feature == NotationPackage.eINSTANCE.getFontStyle_FontColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Property", PreferenceConstantHelper.COLOR_FONT);
- } else if(feature == NotationPackage.eINSTANCE.getFillStyle_FillColor()) {
- prefColor = PreferenceConstantHelper.getElementConstant("Property", 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("Property", 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyName2EditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyName2EditPart.java
deleted file mode 100644
index 6e7f3e2d703..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyName2EditPart.java
+++ /dev/null
@@ -1,754 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromDiagramEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.NoDeleteFromModelEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlTextSelectionEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class PropertyName2EditPart
-
-extends LabelEditPart
-
-implements ITextAwareEditPart, IBorderItemEditPart {
-
- /**
- * @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.) */
- // disable direct edition for property of a constraint property
- protected int directEditionMode = IDirectEdition.NO_DIRECT_EDITION;
-
- /** configuration from a registered edit dialog */
- protected IDirectEditorConfiguration configuration;
-
- /**
- * @generated
- */
- static {
- registerSnapBackPosition(SysmlVisualIDRegistry.getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart.VISUAL_ID), new Point(0, 0));
- }
-
- /**
- * @generated
- */
- public PropertyName2EditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SysmlTextSelectionEditPolicy());
- installEditPolicy(RequestConstants.REQ_DELETE, new NoDeleteFromDiagramEditPolicy());
- installEditPolicy(RequestConstants.REQ_SEMANTIC_WRAPPER, new NoDeleteFromModelEditPolicy());
- }
-
- /**
- * @generated
- */
- public IBorderItemLocator getBorderItemLocator() {
- IFigure parentFigure = getFigure().getParent();
- if(parentFigure != null && parentFigure.getLayoutManager() != null) {
- Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure());
- return (IBorderItemLocator)constraint;
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- int width = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Width())).intValue();
- int height = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_Height())).intValue();
- getBorderItemLocator().setConstraint(new Rectangle(x, y, width, height));
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(IFigure figure) {
- unregisterVisuals();
- setFigure(figure);
- defaultText = getLabelTextHelper(figure);
- registerVisuals();
- refreshVisuals();
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public IGraphicalEditPart getChildBySemanticHint(String semanticHint) {
- return null;
- }
-
- /**
- * @generated
- */
- protected EObject getParserElement() {
- return resolveSemanticElement();
- }
-
- /**
- * @generated
- */
- protected Image getLabelIcon() {
- return null;
- }
-
- /**
- * @generated
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null) {
- text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- }
- if(text == null || text.length() == 0) {
- text = defaultText;
- }
- return text;
- }
-
- /**
- * @generated
- */
- public void setLabelText(String text) {
- setLabelTextHelper(getFigure(), text);
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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 = SysmlParserProvider.getParser(SysmlElementTypes.Property_3002, getParserElement(), SysmlVisualIDRegistry.getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), SysmlEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- *
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- */
- 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 WrappingLabel();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java
deleted file mode 100644
index f8ed7985a92..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java
+++ /dev/null
@@ -1,800 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.AccessibleEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.viewers.ICellEditorValidator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IAdvancedEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.configuration.IPopupEditorConfiguration;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.ILabelEditorDialog;
-import org.eclipse.papyrus.extensionpoints.editors.ui.IPopupEditorHelper;
-import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
-import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlTextSelectionEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel;
-import org.eclipse.papyrus.sysml.diagram.parametric.parsers.PropertyLabelParser;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider;
-import org.eclipse.papyrus.uml.diagram.common.directedit.MultilineLabelDirectEditManager;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.IDirectEdition;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class PropertyNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
-
- /**
- * @generated
- */
- public static final int VISUAL_ID = 5002;
-
- /**
- * @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 PropertyNameEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new SysmlTextSelectionEditPolicy());
- installEditPolicy(EditPolicy.DIRECT_EDIT_ROLE, new LabelDirectEditPolicy());
- installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new ParametricEditPart.NodeLabelDragPolicy());
- }
-
- /**
- * @generated
- */
- protected String getLabelTextHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getText();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getText();
- } else {
- return ((Label)figure).getText();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelTextHelper(IFigure figure, String text) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setText(text);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setText(text);
- } else {
- ((Label)figure).setText(text);
- }
- }
-
- /**
- * @generated
- */
- protected Image getLabelIconHelper(IFigure figure) {
- if(figure instanceof WrappingLabel) {
- return ((WrappingLabel)figure).getIcon();
- } else if(figure instanceof ILabelFigure) {
- return ((ILabelFigure)figure).getIcon();
- } else {
- return ((Label)figure).getIcon();
- }
- }
-
- /**
- * @generated
- */
- protected void setLabelIconHelper(IFigure figure, Image icon) {
- if(figure instanceof WrappingLabel) {
- ((WrappingLabel)figure).setIcon(icon);
- } else if(figure instanceof ILabelFigure) {
- ((ILabelFigure)figure).setIcon(icon);
- } else {
- ((Label)figure).setIcon(icon);
- }
- }
-
- /**
- * @generated
- */
- public void setLabel(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 NOT
- */
- protected Image getLabelIcon() {
- EObject parserElement = getParserElement();
- if(parserElement == null) {
- return null;
- }
-
- List<View> views = DiagramEditPartsUtil.findViews(parserElement, getViewer());
- for(View view : views) {
- if(NameLabelIconHelper.showLabelIcon(view)) {
- return SysmlElementTypes.getImage(parserElement.eClass());
- }
- }
- return null;
-
- }
-
- // /**
- // * @generated
- // */
- // protected String getLabelText() {
- // String text = null;
- // EObject parserElement = getParserElement();
- // if (parserElement != null && getParser() != null) {
- // text = getParser().getPrintString(new EObjectAdapter(parserElement), getParserOptions().intValue());
- // }
- // if (text == null || text.length() == 0) {
- // text = defaultText;
- // }
- // return text;
- // }
-
- /**
- * @generated NOT
- */
- protected String getLabelText() {
- String text = null;
- EObject parserElement = getParserElement();
- if(parserElement != null && getParser() != null && getDiagramView() != null) {
- EObject element = getDiagramView().getElement();
- if(getParser() instanceof PropertyLabelParser) {
- // set the container to compute the property name depth
- ((PropertyLabelParser)getParser()).setBlock(element);
- }
- 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 SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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 = SysmlParserProvider.getParser(SysmlElementTypes.Property_2005, getParserElement(), SysmlVisualIDRegistry.getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart.VISUAL_ID));
- }
- return parser;
- }
-
- /**
- * @generated
- */
- protected DirectEditManager getManager() {
- if(manager == null) {
- setManager(new MultilineLabelDirectEditManager(this, MultilineLabelDirectEditManager.getTextCellEditorClass(this), SysmlEditPartFactory.getTextCellEditorLocator(this)));
- }
- return manager;
- }
-
- /**
- * @generated
- */
- protected void setManager(DirectEditManager manager) {
- this.manager = manager;
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit() {
- getManager().show();
- }
-
- /**
- * @generated
- */
- protected void performDirectEdit(Point eventLocation) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(eventLocation.getSWTPoint());
- }
- }
-
- /**
- * @generated
- */
- private void performDirectEdit(char initialCharacter) {
- if(getManager() instanceof TextDirectEditManager) {
- ((TextDirectEditManager)getManager()).show(initialCharacter);
- } else {
- performDirectEdit();
- }
- }
-
- /**
- * @generated
- */
- protected void performDirectEditRequest(Request request) {
-
- final Request theRequest = request;
-
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- updateExtendedEditorConfiguration();
- if(configuration == null || configuration.getLanguage() == null) {
- performDefaultDirectEditorEdit(theRequest);
- } else {
- configuration.preEditAction(resolveSemanticElement());
- Dialog dialog = null;
- if(configuration instanceof IPopupEditorConfiguration) {
- IPopupEditorHelper helper = ((IPopupEditorConfiguration)configuration).createPopupEditorHelper(this);
- helper.showEditor();
- return;
- } else if(configuration instanceof IAdvancedEditorConfiguration) {
- dialog = ((IAdvancedEditorConfiguration)configuration).createDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), configuration.getTextToEdit(resolveSemanticElement()));
- } else if(configuration instanceof IDirectEditorConfiguration) {
- dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), resolveSemanticElement(), ((IDirectEditorConfiguration)configuration).getTextToEdit(resolveSemanticElement()), (IDirectEditorConfiguration)configuration);
- } else {
- return;
- }
- final Dialog finalDialog = dialog;
-
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- RecordingCommand command = new RecordingCommand(domain, "Edit Label") {
-
- @Override
- protected void doExecute() {
- configuration.postEditAction(resolveSemanticElement(), ((ILabelEditorDialog)finalDialog).getValue());
-
- }
- };
- domain.getCommandStack().execute(command);
- }
- }
- break;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
-
- // initialize the direct edit manager
- try {
- getEditingDomain().runExclusive(new Runnable() {
-
- public void run() {
- if(isActive() && isEditable()) {
- if(theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR) instanceof Character) {
- Character initialChar = (Character)theRequest.getExtendedData().get(RequestConstants.REQ_DIRECTEDIT_EXTENDEDDATA_INITIAL_CHAR);
- performDirectEdit(initialChar.charValue());
- } else if((theRequest instanceof DirectEditRequest) && (getEditText().equals(getLabelText()))) {
- DirectEditRequest editRequest = (DirectEditRequest)theRequest;
- performDirectEdit(editRequest.getLocation());
- } else {
- performDirectEdit();
- }
- }
- }
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- break;
- default:
- break;
- }
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshUnderline();
- refreshStrikeThrough();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- EditPolicy maskLabelPolicy = getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(maskLabelPolicy == null) {
- setLabelTextHelper(getFigure(), getLabelText());
- setLabelIconHelper(getFigure(), getLabelIcon());
- }
- Object pdEditPolicy = getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(pdEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)pdEditPolicy).refreshFeedback();
- }
- Object sfEditPolicy = getEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE);
- if(sfEditPolicy instanceof SysmlTextSelectionEditPolicy) {
- ((SysmlTextSelectionEditPolicy)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.uml.diagram.common.editpolicies.IDirectEdition
- * @generated
- */
- public int getDirectEditionType() {
- if(checkExtendedEditor()) {
- initExtendedEditorConfiguration();
- return IDirectEdition.EXTENDED_DIRECT_EDITOR;
- }
- if(checkDefaultEdition()) {
- return IDirectEdition.DEFAULT_DIRECT_EDITOR;
- }
-
- // not a named element. no specific editor => do nothing
- return IDirectEdition.NO_DIRECT_EDITION;
- }
-
- /**
- * Checks if an extended editor is present.
- *
- * @return <code>true</code> if an extended editor is present.
- * @generated
- */
- protected boolean checkExtendedEditor() {
- if(resolveSemanticElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(resolveSemanticElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- * @generated
- */
- protected boolean checkDefaultEdition() {
- return (getParser() != null);
- }
-
- /**
- * Initializes the extended editor configuration
- *
- * @generated
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- final String languagePreferred = Activator.getDefault().getPreferenceStore().getString(IDirectEditorsIds.EDITOR_FOR_ELEMENT + resolveSemanticElement().eClass().getInstanceClassName());
- if(languagePreferred != null && !languagePreferred.equals("")) {
- configuration = DirectEditorsUtil.findEditorConfiguration(languagePreferred, resolveSemanticElement().eClass().getInstanceClassName());
- } else {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, resolveSemanticElement().eClass().getInstanceClassName());
- }
- }
- }
-
- /**
- * Updates the preference configuration
- */
- 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();
- }
- }
- }
-
- if(event.getNewValue() instanceof EAnnotation && VisualInformationPapyrusConstants.DISPLAY_NAMELABELICON.equals(((EAnnotation)event.getNewValue()).getSource())) {
- 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/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java
deleted file mode 100644
index 8159736287f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.parts;
-
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @generated
- */
-public class SysmlEditPartFactory implements EditPartFactory {
-
- /**
- * @generated
- */
- public EditPart createEditPart(EditPart context, Object model) {
- if(model instanceof View) {
- View view = (View)model;
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
-
- case ParametricEditPart.VISUAL_ID:
- return new ParametricEditPart(view);
-
- case ConstraintPropertyEditPart.VISUAL_ID:
- return new ConstraintPropertyEditPart(view);
-
- case ConstraintPropertyNameEditPart.VISUAL_ID:
- return new ConstraintPropertyNameEditPart(view);
-
- case ConstraintLabelEditPart.VISUAL_ID:
- return new ConstraintLabelEditPart(view);
-
- case PropertyEditPart.VISUAL_ID:
- return new PropertyEditPart(view);
-
- case PropertyNameEditPart.VISUAL_ID:
- return new PropertyNameEditPart(view);
-
- case Property2EditPart.VISUAL_ID:
- return new Property2EditPart(view);
-
- case PropertyName2EditPart.VISUAL_ID:
- return new PropertyName2EditPart(view);
-
- case ConnectorEditPart.VISUAL_ID:
- return new ConnectorEditPart(view);
-
- case ConnectorNameEditPart.VISUAL_ID:
- return new ConnectorNameEditPart(view);
-
- }
- }
- return createUnrecognizedEditPart(context, model);
- }
-
- /**
- * @generated
- */
- private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
- // Handle creation of unrecognized child node EditParts here
- return null;
- }
-
- /**
- * @generated
- */
- public static CellEditorLocator getTextCellEditorLocator(ITextAwareEditPart source) {
- if(source.getFigure() instanceof IMultilineEditableFigure)
- return new MultilineCellEditorLocator((IMultilineEditableFigure)source.getFigure());
- else if(source.getFigure() instanceof WrappingLabel)
- return new TextCellEditorLocator((WrappingLabel)source.getFigure());
- else {
- return new LabelCellEditorLocator((Label)source.getFigure());
- }
- }
-
- /**
- * @generated
- */
- static private class MultilineCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private IMultilineEditableFigure multilineEditableFigure;
-
- /**
- * @generated
- */
- public MultilineCellEditorLocator(IMultilineEditableFigure figure) {
- this.multilineEditableFigure = figure;
- }
-
- /**
- * @generated
- */
- public IMultilineEditableFigure getMultilineEditableFigure() {
- return multilineEditableFigure;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getMultilineEditableFigure().getBounds().getCopy();
- rect.x = getMultilineEditableFigure().getEditionLocation().x;
- rect.y = getMultilineEditableFigure().getEditionLocation().y;
- getMultilineEditableFigure().translateToAbsolute(rect);
- if(getMultilineEditableFigure().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
- /**
- * @generated
- */
- static private class TextCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private WrappingLabel wrapLabel;
-
- /**
- * @generated
- */
- public TextCellEditorLocator(WrappingLabel wrapLabel) {
- this.wrapLabel = wrapLabel;
- }
-
- /**
- * @generated
- */
- public WrappingLabel getWrapLabel() {
- return wrapLabel;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getWrapLabel().getTextBounds().getCopy();
- getWrapLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- } else {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
- /**
- * @generated
- */
- private static class LabelCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private Label label;
-
- /**
- * @generated
- */
- public LabelCellEditorLocator(Label label) {
- this.label = label;
- }
-
- /**
- * @generated
- */
- public Label getLabel() {
- return label;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getLabel().getTextBounds().getCopy();
- getLabel().translateToAbsolute(rect);
- if(!text.getFont().isDisposed()) {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConnectorItemSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConnectorItemSemanticEditPolicy.java
deleted file mode 100644
index cc64477098b..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConnectorItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.command.DeleteCommand;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-
-/**
- * @generated
- */
-public class ConnectorItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ConnectorItemSemanticEditPolicy() {
- super(SysmlElementTypes.Connector_4001);
- }
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new DeleteCommand(getEditingDomain(), todestroy)));
- return getGEFWrapper(cmd.reduce());
- //return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConstraintPropertyCanonicalEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConstraintPropertyCanonicalEditPolicy.java
deleted file mode 100644
index 99700601603..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConstraintPropertyCanonicalEditPolicy.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramUpdater;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlNodeDescriptor;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ConstraintPropertyCanonicalEditPolicy extends CanonicalEditPolicy {
-
- /**
- * @generated
- */
- protected void refreshOnActivate() {
- // Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
- List<?> c = getHost().getChildren();
- for(int i = 0; i < c.size(); i++) {
- ((EditPart)c.get(i)).activate();
- }
- super.refreshOnActivate();
- }
-
- /**
- * @generated
- */
- protected EStructuralFeature getFeatureToSynchronize() {
- return UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<SysmlNodeDescriptor> childDescriptors = SysmlDiagramUpdater.getConstraintProperty_2003SemanticChildren(viewObject);
- for(SysmlNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- return Property2EditPart.VISUAL_ID == SysmlVisualIDRegistry.getVisualID(view);
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<SysmlNodeDescriptor> childDescriptors = SysmlDiagramUpdater.getConstraintProperty_2003SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<SysmlNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- SysmlNodeDescriptor next = descriptorsIterator.next();
- String hint = SysmlVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(SysmlNodeDescriptor next : childDescriptors) {
- String hint = SysmlVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- makeViewsImmutable(createdViews);
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConstraintPropertyItemSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConstraintPropertyItemSemanticEditPolicy.java
deleted file mode 100644
index f78e4a0e01d..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ConstraintPropertyItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-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.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.Property2CreateCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * @generated
- */
-public class ConstraintPropertyItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ConstraintPropertyItemSemanticEditPolicy() {
- super(SysmlElementTypes.ConstraintProperty_2003);
- }
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(SysmlElementTypes.Property_3002 == req.getElementType()) {
- return getGEFWrapper(new Property2CreateCommand(req));
- }
- return super.getCreateCommand(req);
- }
-
- /**
- * @generated NOT delete property views if any
- */
- 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: true
- addDestroyChildNodesCommand(cmd);
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- cmd.add(new DestroyElementCommand(req));
- // destroy base property
- addDestroyBasePropertyCommand(cmd);
- } else {
- cmd.add(new DeleteCommand(getEditingDomain(), view));
- }
- return getGEFWrapper(cmd.reduce());
- }
-
- /**
- * Delete property views of the constraint property
- *
- * @generated NOT
- */
- private void addDestroyChildNodesCommand(ICompositeCommand cmd) {
- View view = (View)getHost().getModel();
- for(Iterator<?> nit = view.getChildren().iterator(); nit.hasNext();) {
- Node node = (Node)nit.next();
- switch(SysmlVisualIDRegistry.getVisualID(node)) {
- case Property2EditPart.VISUAL_ID:
- // only delete from diagram
- cmd.add(new DeleteCommand(getEditingDomain(), node));
- break;
- }
- }
- }
-
- /**
- * Delete the base property from the constraint property
- *
- * @generated NOT
- */
- private void addDestroyBasePropertyCommand(ICompositeCommand cmd) {
- View view = (View)getHost().getModel();
- EObject element = view.getElement();
- if(element instanceof ConstraintProperty) {
- Property property = ((ConstraintProperty)element).getBase_Property();
- if(property != null) {
- DestroyElementRequest request = new DestroyElementRequest(property, false);
- cmd.add(new DestroyElementCommand(request));
- }
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/OpenDiagramEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/OpenDiagramEditPolicy.java
deleted file mode 100644
index 4547027e26f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/OpenDiagramEditPolicy.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Iterator;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.OpenEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.HintedDiagramLinkStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.Style;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.Messages;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditor;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorUtil;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * @generated
- */
-public class OpenDiagramEditPolicy extends OpenEditPolicy {
-
- /**
- * @generated
- */
- protected Command getOpenCommand(Request request) {
- EditPart targetEditPart = getTargetEditPart(request);
- if(false == targetEditPart.getModel() instanceof View) {
- return null;
- }
- View view = (View)targetEditPart.getModel();
- Style link = view.getStyle(NotationPackage.eINSTANCE.getHintedDiagramLinkStyle());
- if(false == link instanceof HintedDiagramLinkStyle) {
- return null;
- }
- return new ICommandProxy(new OpenDiagramCommand((HintedDiagramLinkStyle)link));
- }
-
- /**
- * @generated
- */
- private static class OpenDiagramCommand extends AbstractTransactionalCommand {
-
- /**
- * @generated
- */
- private final HintedDiagramLinkStyle diagramFacet;
-
- /**
- * @generated
- */
- OpenDiagramCommand(HintedDiagramLinkStyle linkStyle) {
- // editing domain is taken for original diagram,
- // if we open diagram from another file, we should use another editing domain
- super(TransactionUtil.getEditingDomain(linkStyle), Messages.CommandName_OpenDiagram, null);
- diagramFacet = linkStyle;
- }
-
- // FIXME canExecute if !(readOnly && getDiagramToOpen == null), i.e. open works on ro
- // diagrams only when there's associated diagram already
-
- /**
- * @generated
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- try {
- Diagram diagram = getDiagramToOpen();
- if(diagram == null) {
- diagram = intializeNewDiagram();
- }
- URI uri = EcoreUtil.getURI(diagram);
- String editorName = uri.lastSegment() + '#' + diagram.eResource().getContents().indexOf(diagram);
- IEditorInput editorInput = new URIEditorInput(uri, editorName);
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- page.openEditor(editorInput, getEditorID());
- return CommandResult.newOKCommandResult();
- } catch (Exception ex) {
- throw new ExecutionException("Can't open diagram", ex);
- }
- }
-
- /**
- * @generated
- */
- protected Diagram getDiagramToOpen() {
- return diagramFacet.getDiagramLink();
- }
-
- /**
- * @generated
- */
- protected Diagram intializeNewDiagram() throws ExecutionException {
- Diagram d = ViewService.createDiagram(getDiagramDomainElement(), getDiagramKind(), getPreferencesHint());
- if(d == null) {
- throw new ExecutionException("Can't create diagram of '" + getDiagramKind() + "' kind");
- }
- diagramFacet.setDiagramLink(d);
- assert diagramFacet.eResource() != null;
- diagramFacet.eResource().getContents().add(d);
- EObject container = diagramFacet.eContainer();
- while(container instanceof View) {
- ((View)container).persist();
- container = container.eContainer();
- }
- try {
- new WorkspaceModifyOperation() {
-
- protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
- try {
- for(Iterator it = diagramFacet.eResource().getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- if(nextResource.isLoaded() && !getEditingDomain().isReadOnly(nextResource)) {
- nextResource.save(SysmlDiagramEditorUtil.getSaveOptions());
- }
- }
- } catch (IOException ex) {
- throw new InvocationTargetException(ex, "Save operation failed");
- }
- }
- }.run(null);
- } catch (InvocationTargetException e) {
- throw new ExecutionException("Can't create diagram of '" + getDiagramKind() + "' kind", e);
- } catch (InterruptedException e) {
- throw new ExecutionException("Can't create diagram of '" + getDiagramKind() + "' kind", e);
- }
- return d;
- }
-
- /**
- * @generated
- */
- protected EObject getDiagramDomainElement() {
- // use same element as associated with EP
- return ((View)diagramFacet.eContainer()).getElement();
- }
-
- /**
- * @generated
- */
- protected PreferencesHint getPreferencesHint() {
- // XXX prefhint from target diagram's editor?
- return SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
- /**
- * @generated
- */
- protected String getDiagramKind() {
- return ParametricEditPart.MODEL_ID;
- }
-
- /**
- * @generated
- */
- protected String getEditorID() {
- return SysmlDiagramEditor.ID;
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ParametricCanonicalEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ParametricCanonicalEditPolicy.java
deleted file mode 100644
index 2bd26ca228a..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ParametricCanonicalEditPolicy.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.resource.ResourcePackage;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramUpdater;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlLinkDescriptor;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlNodeDescriptor;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class ParametricCanonicalEditPolicy extends CanonicalEditPolicy {
-
- /**
- * @generated
- */
- private Set<EStructuralFeature> myFeaturesToSynchronize;
-
- /**
- * @generated
- */
- protected void refreshOnActivate() {
- // Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners
- List<?> c = getHost().getChildren();
- for(int i = 0; i < c.size(); i++) {
- ((EditPart)c.get(i)).activate();
- }
- super.refreshOnActivate();
- }
-
- /**
- * @generated
- */
- @SuppressWarnings("rawtypes")
- protected List getSemanticChildrenList() {
- View viewObject = (View)getHost().getModel();
- LinkedList<EObject> result = new LinkedList<EObject>();
- List<SysmlNodeDescriptor> childDescriptors = SysmlDiagramUpdater.getResource_1000SemanticChildren(viewObject);
- for(SysmlNodeDescriptor d : childDescriptors) {
- result.add(d.getModelElement());
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) {
- return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement());
- }
-
- /**
- * @generated
- */
- private boolean isMyDiagramElement(View view) {
- int visualID = SysmlVisualIDRegistry.getVisualID(view);
- return visualID == ConstraintPropertyEditPart.VISUAL_ID || visualID == PropertyEditPart.VISUAL_ID;
- }
-
- /**
- * @generated
- */
- protected Set getFeaturesToSynchronize() {
- if(myFeaturesToSynchronize == null) {
- myFeaturesToSynchronize = new HashSet<EStructuralFeature>();
- myFeaturesToSynchronize.add(ResourcePackage.eINSTANCE.getResource_Eobjects());
- myFeaturesToSynchronize.add(UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute());
- }
- return myFeaturesToSynchronize;
- }
-
- /**
- * @generated
- */
- protected void refreshSemantic() {
- if(resolveSemanticElement() == null) {
- return;
- }
- LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>();
- List<SysmlNodeDescriptor> childDescriptors = SysmlDiagramUpdater.getResource_1000SemanticChildren((View)getHost().getModel());
- LinkedList<View> orphaned = new LinkedList<View>();
- // we care to check only views we recognize as ours
- LinkedList<View> knownViewChildren = new LinkedList<View>();
- for(View v : getViewChildren()) {
- if(isMyDiagramElement(v)) {
- knownViewChildren.add(v);
- }
- }
- // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren)
- //
- // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
- // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
- // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
- for(Iterator<SysmlNodeDescriptor> descriptorsIterator = childDescriptors.iterator(); descriptorsIterator.hasNext();) {
- SysmlNodeDescriptor next = descriptorsIterator.next();
- String hint = SysmlVisualIDRegistry.getType(next.getVisualID());
- LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
- for(View childView : getViewChildren()) {
- EObject semanticElement = childView.getElement();
- if(next.getModelElement().equals(semanticElement)) {
- if(hint.equals(childView.getType())) {
- perfectMatch.add(childView);
- // actually, can stop iteration over view children here, but
- // may want to use not the first view but last one as a 'real' match (the way original CEP does
- // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
- }
- }
- }
- if(perfectMatch.size() > 0) {
- descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
- // use only one view (first or last?), keep rest as orphaned for further consideration
- knownViewChildren.remove(perfectMatch.getFirst());
- }
- }
- // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
- // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
- orphaned.addAll(knownViewChildren);
- //
- ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(childDescriptors.size());
- for(SysmlNodeDescriptor next : childDescriptors) {
- String hint = SysmlVisualIDRegistry.getType(next.getVisualID());
- IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint);
- CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint());
- viewDescriptors.add(descriptor);
- }
-
- boolean changed = deleteViews(orphaned.iterator());
- //
- CreateViewRequest request = getCreateViewRequest(viewDescriptors);
- Command cmd = getCreateViewCommand(request);
- if(cmd != null && cmd.canExecute()) {
- SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute();
- executeCommand(cmd);
- @SuppressWarnings("unchecked")
- List<IAdaptable> nl = (List<IAdaptable>)request.getNewObject();
- createdViews.addAll(nl);
- }
- if(changed || createdViews.size() > 0) {
- postProcessRefreshSemantic(createdViews);
- }
-
- Collection<IAdaptable> createdConnectionViews = refreshConnections();
-
- if(createdViews.size() > 1) {
- // perform a layout of the container
- DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host());
- executeCommand(new ICommandProxy(layoutCmd));
- }
-
- createdViews.addAll(createdConnectionViews);
-
- makeViewsImmutable(createdViews);
- }
-
- /**
- * @generated
- */
- private Diagram getDiagram() {
- return ((View)getHost().getModel()).getDiagram();
- }
-
- /**
- * @generated
- */
- private Collection<IAdaptable> refreshConnections() {
- Map<EObject, View> domain2NotationMap = new HashMap<EObject, View>();
- Collection<SysmlLinkDescriptor> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
- Collection existingLinks = new LinkedList(getDiagram().getEdges());
- for(Iterator linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {
- Edge nextDiagramLink = (Edge)linksIterator.next();
- int diagramLinkVisualID = SysmlVisualIDRegistry.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<SysmlLinkDescriptor> linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {
- SysmlLinkDescriptor nextLinkDescriptor = linkDescriptorsIterator.next();
- if(diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {
- linksIterator.remove();
- linkDescriptorsIterator.remove();
- break;
- }
- }
- }
- deleteViews(existingLinks.iterator());
- return createConnections(linkDescriptors, domain2NotationMap);
- }
-
- /**
- * @generated
- */
- private Collection<SysmlLinkDescriptor> collectAllLinks(View view, Map<EObject, View> domain2NotationMap) {
- if(!ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(view))) {
- return Collections.emptyList();
- }
- LinkedList<SysmlLinkDescriptor> result = new LinkedList<SysmlLinkDescriptor>();
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ParametricEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(SysmlDiagramUpdater.getResource_1000ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ConstraintPropertyEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(SysmlDiagramUpdater.getConstraintProperty_2003ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case PropertyEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(SysmlDiagramUpdater.getProperty_2005ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case Property2EditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(SysmlDiagramUpdater.getProperty_3002ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- case ConnectorEditPart.VISUAL_ID:
- {
- if(!domain2NotationMap.containsKey(view.getElement())) {
- result.addAll(SysmlDiagramUpdater.getConnector_4001ContainedLinks(view));
- }
- if(!domain2NotationMap.containsKey(view.getElement()) || view.getEAnnotation("Shortcut") == null) { //$NON-NLS-1$
- domain2NotationMap.put(view.getElement(), view);
- }
- break;
- }
- }
- for(Iterator children = view.getChildren().iterator(); children.hasNext();) {
- result.addAll(collectAllLinks((View)children.next(), domain2NotationMap));
- }
- for(Iterator edges = view.getSourceEdges().iterator(); edges.hasNext();) {
- result.addAll(collectAllLinks((View)edges.next(), domain2NotationMap));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection<IAdaptable> createConnections(Collection<SysmlLinkDescriptor> linkDescriptors, Map<EObject, View> domain2NotationMap) {
- LinkedList<IAdaptable> adapters = new LinkedList<IAdaptable>();
- for(SysmlLinkDescriptor nextLinkDescriptor : linkDescriptors) {
- EditPart sourceEditPart = getEditPart(nextLinkDescriptor.getSource(), domain2NotationMap);
- EditPart targetEditPart = getEditPart(nextLinkDescriptor.getDestination(), domain2NotationMap);
- if(sourceEditPart == null || targetEditPart == null) {
- continue;
- }
- CreateConnectionViewRequest.ConnectionViewDescriptor descriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(nextLinkDescriptor.getSemanticAdapter(), SysmlVisualIDRegistry.getType(nextLinkDescriptor.getVisualID()), ViewUtil.APPEND, false, ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint());
- CreateConnectionViewRequest ccr = new CreateConnectionViewRequest(descriptor);
- ccr.setType(RequestConstants.REQ_CONNECTION_START);
- ccr.setSourceEditPart(sourceEditPart);
- sourceEditPart.getCommand(ccr);
- ccr.setTargetEditPart(targetEditPart);
- ccr.setType(RequestConstants.REQ_CONNECTION_END);
- Command cmd = targetEditPart.getCommand(ccr);
- if(cmd != null && cmd.canExecute()) {
- executeCommand(cmd);
- IAdaptable viewAdapter = (IAdaptable)ccr.getNewObject();
- if(viewAdapter != null) {
- adapters.add(viewAdapter);
- }
- }
- }
- return adapters;
- }
-
- /**
- * @generated
- */
- private EditPart getEditPart(EObject domainModelElement, Map<EObject, View> domain2NotationMap) {
- View view = (View)domain2NotationMap.get(domainModelElement);
- if(view != null) {
- return (EditPart)getHost().getViewer().getEditPartRegistry().get(view);
- }
- return null;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ParametricItemSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ParametricItemSemanticEditPolicy.java
deleted file mode 100644
index 6527fe2543f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/ParametricItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.ConstraintPropertyCreateCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.PropertyCreateCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.commands.DuplicateNamedElementCommand;
-
-/**
- * @generated
- */
-public class ParametricItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public ParametricItemSemanticEditPolicy() {
- super(SysmlElementTypes.Resource_1000);
- }
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- if(SysmlElementTypes.ConstraintProperty_2003 == req.getElementType()) {
- return getGEFWrapper(new ConstraintPropertyCreateCommand(req));
- }
- if(SysmlElementTypes.Property_2005 == req.getElementType()) {
- return getGEFWrapper(new PropertyCreateCommand(req));
- }
- return super.getCreateCommand(req);
- }
-
- /**
- * @generated
- */
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- Diagram currentDiagram = null;
- if(getHost() instanceof IGraphicalEditPart) {
- currentDiagram = ((IGraphicalEditPart)getHost()).getNotationView().getDiagram();
- }
- return getGEFWrapper(new DuplicateAnythingCommand(editingDomain, req, currentDiagram));
- }
-
- /**
- * @generated
- */
- private static class DuplicateAnythingCommand extends DuplicateNamedElementCommand {
-
- private Diagram diagram;
-
- /**
- * @generated
- */
- public DuplicateAnythingCommand(TransactionalEditingDomain editingDomain, DuplicateElementsRequest req, Diagram currentDiagram) {
- super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap(), currentDiagram);
- this.diagram = currentDiagram;
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/Property2ItemSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/Property2ItemSemanticEditPolicy.java
deleted file mode 100644
index d20e4f32699..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/Property2ItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-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.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.View;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.ConnectorCreateCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.ConnectorReorientCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-
-/**
- * @generated
- */
-public class Property2ItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public Property2ItemSemanticEditPolicy() {
- super(SysmlElementTypes.Property_3002);
- }
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
-
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } 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(SysmlElementTypes.Connector_4001 == req.getElementType()) {
- return getGEFWrapper(new ConnectorCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(SysmlElementTypes.Connector_4001 == req.getElementType()) {
- return getGEFWrapper(new ConnectorCreateCommand(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 ConnectorEditPart.VISUAL_ID:
- return getGEFWrapper(new ConnectorReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/PropertyItemSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/PropertyItemSemanticEditPolicy.java
deleted file mode 100644
index 454d4191050..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/PropertyItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-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.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.View;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.ConnectorCreateCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.ConnectorReorientCommand;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-
-/**
- * @generated
- */
-public class PropertyItemSemanticEditPolicy extends SysmlBaseItemSemanticEditPolicy {
-
- /**
- * @generated
- */
- public PropertyItemSemanticEditPolicy() {
- super(SysmlElementTypes.Property_2005);
- }
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- View view = (View)getHost().getModel();
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(getEditingDomain(), null);
- cmd.setTransactionNestingEnabled(true);
-
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation == null) {
- // there are indirectly referenced children, need extra commands: false
- addDestroyShortcutsCommand(cmd, view);
- // delete host element
- List<EObject> todestroy = new ArrayList<EObject>();
- todestroy.add(req.getElementToDestroy());
- //cmd.add(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
- cmd.add(new EMFtoGMFCommandWrapper(new org.eclipse.emf.edit.command.DeleteCommand(getEditingDomain(), todestroy)));
- } 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(SysmlElementTypes.Connector_4001 == req.getElementType()) {
- return getGEFWrapper(new ConnectorCreateCommand(req, req.getSource(), req.getTarget()));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCompleteCreateRelationshipCommand(CreateRelationshipRequest req) {
- if(SysmlElementTypes.Connector_4001 == req.getElementType()) {
- return getGEFWrapper(new ConnectorCreateCommand(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 ConnectorEditPart.VISUAL_ID:
- return getGEFWrapper(new ConnectorReorientCommand(req));
- }
- return super.getReorientRelationshipCommand(req);
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java
deleted file mode 100644
index 0aa86973d06..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlBaseItemSemanticEditPolicy.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.ICompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.MoveElementsCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.extendedtypes.types.IExtendedHintedElementType;
-import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
-import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers.SysmlBaseEditHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * @generated
- */
-public class SysmlBaseItemSemanticEditPolicy extends SemanticEditPolicy {
-
- /**
- * Extended request data key to hold editpart visual id.
- *
- * @generated
- */
- public static final String VISUAL_ID_KEY = "visual_id"; //$NON-NLS-1$
-
- /**
- * Extended request data key to hold the edge view during a reconnect request.
- *
- * @generated
- */
- public static final String GRAPHICAL_RECONNECTED_EDGE = "graphical_edge"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final IElementType myElementType;
-
- /**
- * @generated
- */
- protected SysmlBaseItemSemanticEditPolicy(IElementType elementType) {
- myElementType = elementType;
- }
-
- /**
- * Extended request data key to hold editpart visual id. Add visual id of edited editpart to
- * extended data of the request so command switch can decide what kind of diagram element is
- * being edited. It is done in those cases when it's not possible to deduce diagram element kind
- * from domain element.
- *
- * @generated
- */
- @SuppressWarnings("unchecked")
- public Command getCommand(Request request) {
- if(request instanceof ReconnectRequest) {
- Object view = ((ReconnectRequest)request).getConnectionEditPart().getModel();
- if(view instanceof View) {
- Integer id = new Integer(SysmlVisualIDRegistry.getVisualID((View)view));
- request.getExtendedData().put(VISUAL_ID_KEY, id);
- request.getExtendedData().put(GRAPHICAL_RECONNECTED_EDGE, (View)view);
- }
- }
- return super.getCommand(request);
- }
-
- /**
- * Returns visual id from request parameters.
- *
- * @generated
- */
- protected int getVisualID(IEditCommandRequest request) {
- Object id = request.getParameter(VISUAL_ID_KEY);
- return id instanceof Integer ? ((Integer)id).intValue() : -1;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommand(IEditCommandRequest request) {
- IEditCommandRequest completedRequest = completeRequest(request);
- Command semanticCommand = getSemanticCommandSwitch(completedRequest);
- semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- if(completedRequest instanceof DestroyRequest) {
- DestroyRequest destroyRequest = (DestroyRequest)completedRequest;
- return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
- }
- return semanticCommand;
- }
-
- /**
- * @generated
- */
- protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
- Command deleteViewCommand = getGEFWrapper(new DeleteCommand(getEditingDomain(), (View)getHost().getModel()));
- return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
- }
-
- /**
- * @generated
- */
- private Command getEditHelperCommand(IEditCommandRequest request, Command editPolicyCommand) {
- if(editPolicyCommand != null) {
- ICommand command = editPolicyCommand instanceof ICommandProxy ? ((ICommandProxy)editPolicyCommand).getICommand() : new CommandProxy(editPolicyCommand);
- request.setParameter(SysmlBaseEditHelper.EDIT_POLICY_COMMAND, command);
- }
- IElementType requestContextElementType = getContextElementType(request);
- request.setParameter(SysmlBaseEditHelper.CONTEXT_ELEMENT_TYPE, requestContextElementType);
- ICommand command = requestContextElementType.getEditCommand(request);
- request.setParameter(SysmlBaseEditHelper.EDIT_POLICY_COMMAND, null);
- request.setParameter(SysmlBaseEditHelper.CONTEXT_ELEMENT_TYPE, null);
- if(command != null) {
- if(!(command instanceof CompositeTransactionalCommand)) {
- command = new CompositeTransactionalCommand(getEditingDomain(), command.getLabel()).compose(command);
- }
- return new ICommandProxy(command);
- }
- return editPolicyCommand;
- }
-
- /**
- * @generated
- */
- protected IElementType getContextElementType(IEditCommandRequest request) {
- IElementType requestContextElementType = SysmlElementTypes.getElementType(getVisualID(request));
- return requestContextElementType != null ? requestContextElementType : myElementType;
- }
-
- /**
- * @generated
- */
- protected Command getSemanticCommandSwitch(IEditCommandRequest req) {
- if(req instanceof CreateRelationshipRequest) {
- return getCreateRelationshipCommand((CreateRelationshipRequest)req);
- } else if(req instanceof CreateElementRequest) {
- return getCreateCommand((CreateElementRequest)req);
- } else if(req instanceof ConfigureRequest) {
- return getConfigureCommand((ConfigureRequest)req);
- } else if(req instanceof DestroyElementRequest) {
- return getDestroyElementCommand((DestroyElementRequest)req);
- } else if(req instanceof DestroyReferenceRequest) {
- return getDestroyReferenceCommand((DestroyReferenceRequest)req);
- } else if(req instanceof DuplicateElementsRequest) {
- return getDuplicateCommand((DuplicateElementsRequest)req);
- } else if(req instanceof GetEditContextRequest) {
- return getEditContextCommand((GetEditContextRequest)req);
- } else if(req instanceof MoveRequest) {
- return getMoveCommand((MoveRequest)req);
- } else if(req instanceof ReorientReferenceRelationshipRequest) {
- return getReorientReferenceRelationshipCommand((ReorientReferenceRelationshipRequest)req);
- } else if(req instanceof ReorientRelationshipRequest) {
- return getReorientRelationshipCommand((ReorientRelationshipRequest)req);
- } else if(req instanceof SetRequest) {
- return getSetCommand((SetRequest)req);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getConfigureCommand(ConfigureRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getCreateCommand(CreateElementRequest req) {
- // check if the type is an extended type, and then create directly the element...
- IElementType type = req.getElementType();
- if(type instanceof IExtendedHintedElementType) {
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(req.getContainer());
- if(provider == null) {
- return UnexecutableCommand.INSTANCE;
- }
-
- // Retrieve create command from the Element Edit service
- ICommand createGMFCommand = provider.getEditCommand(req);
-
- return getGEFWrapper(createGMFCommand);
- }
-
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getSetCommand(SetRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getEditContextCommand(GetEditContextRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyElementCommand(DestroyElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getDuplicateCommand(DuplicateElementsRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Command getMoveCommand(MoveRequest req) {
-
- return getGEFWrapper(new MoveElementsCommand(req));
-
- }
-
- /**
- * @generated
- */
- protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected Command getReorientRelationshipCommand(ReorientRelationshipRequest req) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * @generated
- */
- protected final Command getGEFWrapper(ICommand cmd) {
- return new ICommandProxy(cmd);
- }
-
- /**
- * Returns editing domain from the host edit part.
- *
- * @generated
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-
- /**
- * Clean all shortcuts to the host element from the same diagram
- *
- * @generated
- */
- protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
- assert view.getEAnnotation("Shortcut") == null; //$NON-NLS-1$
- for(Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext();) {
- View nextView = (View)it.next();
- if(nextView.getEAnnotation("Shortcut") == null || !nextView.isSetElement() || nextView.getElement() != view.getElement()) { //$NON-NLS-1$
- continue;
- }
- cmd.add(new DeleteCommand(getEditingDomain(), nextView));
- }
- }
-
- /**
- * @generated
- */
- public static LinkConstraints getLinkConstraints() {
- LinkConstraints cached = SysmlDiagramEditorPlugin.getInstance().getLinkConstraints();
- if(cached == null) {
- SysmlDiagramEditorPlugin.getInstance().setLinkConstraints(cached = new LinkConstraints());
- }
- return cached;
- }
-
- /**
- * @generated
- */
- public static class LinkConstraints {
-
- /**
- * @generated
- */
- public LinkConstraints() {
- // use static method #getLinkConstraints() to access instance
- }
-
- /**
- * @generated
- */
- public boolean canCreateConnector_4001(StructuredClassifier container, ConnectableElement source, ConnectableElement target) {
- return canExistConnector_4001(container, null, source, target);
- }
-
- /**
- * @generated
- */
- public boolean canExistConnector_4001(StructuredClassifier container, Connector linkInstance, ConnectableElement source, ConnectableElement target) {
- return true;
- }
-
- /**
- * Connector source and target must have the salme type
- *
- * @generated NOT
- */
- public static boolean canExistConnector_4001(StructuredClassifier container, ConnectableElement source, ConnectableElement target) {
- Type sourceType = (source == null) ? null : source.getType();
- Type targetType = (target == null) ? null : target.getType();
- if(sourceType != null && target == null) {
- return true;
- }
- return (sourceType != null && targetType != null && sourceType.equals(targetType));
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlTextNonResizableEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlTextNonResizableEditPolicy.java
deleted file mode 100644
index 8265437bfd2..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlTextNonResizableEditPolicy.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * @generated
- */
-public class SysmlTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
- /**
- * @generated
- */
- protected List createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
- moveHandle.setBorder(null);
- moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
- return Collections.singletonList(moveHandle);
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlTextSelectionEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlTextSelectionEditPolicy.java
deleted file mode 100644
index 3e5d81b4e4c..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/SysmlTextSelectionEditPolicy.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * @generated
- */
-public class SysmlTextSelectionEditPolicy extends SelectionEditPolicy {
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CustomBlockPropertyCompositeFigure.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CustomBlockPropertyCompositeFigure.java
new file mode 100644
index 00000000000..29fd7629c05
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CustomBlockPropertyCompositeFigure.java
@@ -0,0 +1,24 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.figures;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.papyrus.sysml.diagram.common.figure.BlockPropertyCompositeFigure;
+
+public class CustomBlockPropertyCompositeFigure extends
+ BlockPropertyCompositeFigure {
+
+ @Override
+ protected void initTagLabel(String value) {
+ // do nothing: we don't want a two lines element (tag + name)
+ }
+
+ @Override
+ public Label getTaggedLabel() {
+ // return a mock Label
+ return new Label();
+ }
+
+ @Override
+ public void setNameLabelIcon(boolean displayNameLabelIcon) {
+ getNameLabel().setIcon(null);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/PropertyEditHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/ParametricDiagramFrameFigure.java
index 1cbb9085b15..098c23ec740 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/helpers/PropertyEditHelper.java
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/figures/ParametricDiagramFrameFigure.java
@@ -1,20 +1,17 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.edit.helpers;
-
-/**
- * @generated
- */
-public class PropertyEditHelper extends SysmlBaseEditHelper {
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.figures;
+
+import org.eclipse.papyrus.sysml.diagram.common.figure.SysMLDiagramFrameFigure;
+
+public class ParametricDiagramFrameFigure extends SysMLDiagramFrameFigure {
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlAbstractNavigatorItem.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlAbstractNavigatorItem.java
deleted file mode 100644
index c8dacc0ac93..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlAbstractNavigatorItem.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-
-/**
- * @generated
- */
-public abstract class SysmlAbstractNavigatorItem extends PlatformObject {
-
- /**
- * @generated
- */
- static {
- final Class[] supportedTypes = new Class[]{ ITabbedPropertySheetPageContributor.class };
- final ITabbedPropertySheetPageContributor propertySheetPageContributor = new ITabbedPropertySheetPageContributor() {
-
- public String getContributorId() {
- return "org.eclipse.papyrus.sysml.diagram.parametric"; //$NON-NLS-1$
- }
- };
- Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlAbstractNavigatorItem && adapterType == ITabbedPropertySheetPageContributor.class) {
- return propertySheetPageContributor;
- }
- return null;
- }
-
- public Class[] getAdapterList() {
- return supportedTypes;
- }
- }, org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlAbstractNavigatorItem.class);
- }
-
- /**
- * @generated
- */
- private Object myParent;
-
- /**
- * @generated
- */
- protected SysmlAbstractNavigatorItem(Object parent) {
- myParent = parent;
- }
-
- /**
- * @generated
- */
- public Object getParent() {
- return myParent;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorContentProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorContentProvider.java
deleted file mode 100644
index 2125893f31e..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorContentProvider.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-
-/**
- * @generated
- */
-public class SysmlDomainNavigatorContentProvider implements ICommonContentProvider {
-
- /**
- * @generated
- */
- private AdapterFactoryContentProvider myAdapterFctoryContentProvier;
-
- /**
- * @generated
- */
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
- /**
- * @generated
- */
- private Viewer myViewer;
-
- /**
- * @generated
- */
- private AdapterFactoryEditingDomain myEditingDomain;
-
- /**
- * @generated
- */
- private WorkspaceSynchronizer myWorkspaceSynchronizer;
-
- /**
- * @generated
- */
- private Runnable myViewerRefreshRunnable;
-
- /**
- * @generated
- */
- public SysmlDomainNavigatorContentProvider() {
- myAdapterFctoryContentProvier = new AdapterFactoryContentProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- myEditingDomain = (AdapterFactoryEditingDomain)editingDomain;
- myEditingDomain.setResourceToReadOnlyMap(new HashMap() {
-
- public Object get(Object key) {
- if(!containsKey(key)) {
- put(key, Boolean.TRUE);
- }
- return super.get(key);
- }
- });
- myViewerRefreshRunnable = new Runnable() {
-
- public void run() {
- if(myViewer != null) {
- myViewer.refresh();
- }
- }
- };
- myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() {
-
- public void dispose() {
- }
-
- public boolean handleResourceChanged(final Resource resource) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- nextResource.unload();
- }
- if(myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
-
- public boolean handleResourceDeleted(Resource resource) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- nextResource.unload();
- }
- if(myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
-
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- nextResource.unload();
- }
- if(myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
- });
- }
-
- /**
- * @generated
- */
- public void dispose() {
- myWorkspaceSynchronizer.dispose();
- myWorkspaceSynchronizer = null;
- myViewerRefreshRunnable = null;
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource resource = (Resource)it.next();
- resource.unload();
- }
- ((TransactionalEditingDomain)myEditingDomain).dispose();
- myEditingDomain = null;
- }
-
- /**
- * @generated
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- myViewer = viewer;
- }
-
- /**
- * @generated
- */
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /**
- * @generated
- */
- public void restoreState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void saveState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /**
- * @generated
- */
- public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof IFile) {
- IFile file = (IFile)parentElement;
- URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
- return wrapEObjects(myAdapterFctoryContentProvier.getChildren(resource), parentElement);
- }
-
- if(parentElement instanceof SysmlDomainNavigatorItem) {
- return wrapEObjects(myAdapterFctoryContentProvier.getChildren(((SysmlDomainNavigatorItem)parentElement).getEObject()), parentElement);
- }
- return EMPTY_ARRAY;
- }
-
- /**
- * @generated
- */
- public Object[] wrapEObjects(Object[] objects, Object parentElement) {
- Collection result = new ArrayList();
- for(int i = 0; i < objects.length; i++) {
- if(objects[i] instanceof EObject) {
- result.add(new SysmlDomainNavigatorItem((EObject)objects[i], parentElement, myAdapterFctoryContentProvier));
- }
- }
- return result.toArray();
- }
-
- /**
- * @generated
- */
- public Object getParent(Object element) {
- if(element instanceof SysmlAbstractNavigatorItem) {
- SysmlAbstractNavigatorItem abstractNavigatorItem = (SysmlAbstractNavigatorItem)element;
- return abstractNavigatorItem.getParent();
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean hasChildren(Object element) {
- return element instanceof IFile || getChildren(element).length > 0;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorItem.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorItem.java
deleted file mode 100644
index 446065f92c8..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorItem.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.PlatformObject;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-/**
- * @generated
- */
-public class SysmlDomainNavigatorItem extends PlatformObject {
-
- /**
- * @generated
- */
- static {
- final Class[] supportedTypes = new Class[]{ EObject.class, IPropertySource.class };
- Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorItem) {
- org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorItem domainNavigatorItem = (org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorItem)adaptableObject;
- EObject eObject = domainNavigatorItem.getEObject();
- if(adapterType == EObject.class) {
- return eObject;
- }
- if(adapterType == IPropertySource.class) {
- return domainNavigatorItem.getPropertySourceProvider().getPropertySource(eObject);
- }
- }
-
- return null;
- }
-
- public Class[] getAdapterList() {
- return supportedTypes;
- }
- }, org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorItem.class);
- }
-
- /**
- * @generated
- */
- private Object myParent;
-
- /**
- * @generated
- */
- private EObject myEObject;
-
- /**
- * @generated
- */
- private IPropertySourceProvider myPropertySourceProvider;
-
- /**
- * @generated
- */
- public SysmlDomainNavigatorItem(EObject eObject, Object parent, IPropertySourceProvider propertySourceProvider) {
- myParent = parent;
- myEObject = eObject;
- myPropertySourceProvider = propertySourceProvider;
- }
-
- /**
- * @generated
- */
- public Object getParent() {
- return myParent;
- }
-
- /**
- * @generated
- */
- public EObject getEObject() {
- return myEObject;
- }
-
- /**
- * @generated
- */
- public IPropertySourceProvider getPropertySourceProvider() {
- return myPropertySourceProvider;
- }
-
- /**
- * @generated
- */
- public boolean equals(Object obj) {
- if(obj instanceof org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorItem) {
- return EcoreUtil.getURI(getEObject()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlDomainNavigatorItem)obj).getEObject()));
- }
- return super.equals(obj);
- }
-
- /**
- * @generated
- */
- public int hashCode() {
- return EcoreUtil.getURI(getEObject()).hashCode();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorLabelProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorLabelProvider.java
deleted file mode 100644
index 935c470715a..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlDomainNavigatorLabelProvider.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-/**
- * @generated
- */
-public class SysmlDomainNavigatorLabelProvider implements ICommonLabelProvider {
-
- /**
- * @generated
- */
- private AdapterFactoryLabelProvider myAdapterFactoryLabelProvider = new AdapterFactoryLabelProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
-
- /**
- * @generated
- */
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /**
- * @generated
- */
- public Image getImage(Object element) {
- if(element instanceof SysmlDomainNavigatorItem) {
- return myAdapterFactoryLabelProvider.getImage(((SysmlDomainNavigatorItem)element).getEObject());
- }
- return null;
- }
-
- /**
- * @generated
- */
- public String getText(Object element) {
- if(element instanceof SysmlDomainNavigatorItem) {
- return myAdapterFactoryLabelProvider.getText(((SysmlDomainNavigatorItem)element).getEObject());
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void addListener(ILabelProviderListener listener) {
- myAdapterFactoryLabelProvider.addListener(listener);
- }
-
- /**
- * @generated
- */
- public void dispose() {
- myAdapterFactoryLabelProvider.dispose();
- }
-
- /**
- * @generated
- */
- public boolean isLabelProperty(Object element, String property) {
- return myAdapterFactoryLabelProvider.isLabelProperty(element, property);
- }
-
- /**
- * @generated
- */
- public void removeListener(ILabelProviderListener listener) {
- myAdapterFactoryLabelProvider.removeListener(listener);
- }
-
- /**
- * @generated
- */
- public void restoreState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void saveState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public String getDescription(Object anElement) {
- return null;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorActionProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorActionProvider.java
deleted file mode 100644
index 5f39e88f3e8..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorActionProvider.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.Messages;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditor;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionConstants;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonViewerWorkbenchSite;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class SysmlNavigatorActionProvider extends CommonActionProvider {
-
- /**
- * @generated
- */
- private boolean myContribute;
-
- /**
- * @generated
- */
- private OpenDiagramAction myOpenDiagramAction;
-
- /**
- * @generated
- */
- public void init(ICommonActionExtensionSite aSite) {
- super.init(aSite);
- if(aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
- myContribute = true;
- makeActions((ICommonViewerWorkbenchSite)aSite.getViewSite());
- } else {
- myContribute = false;
- }
- }
-
- /**
- * @generated
- */
- private void makeActions(ICommonViewerWorkbenchSite viewerSite) {
- myOpenDiagramAction = new OpenDiagramAction(viewerSite);
- }
-
- /**
- * @generated
- */
- public void fillActionBars(IActionBars actionBars) {
- if(!myContribute) {
- return;
- }
- IStructuredSelection selection = (IStructuredSelection)getContext().getSelection();
- myOpenDiagramAction.selectionChanged(selection);
- if(myOpenDiagramAction.isEnabled()) {
- actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, myOpenDiagramAction);
- }
- }
-
- /**
- * @generated
- */
- public void fillContextMenu(IMenuManager menu) {
- }
-
- /**
- * @generated
- */
- private static class OpenDiagramAction extends Action {
-
- /**
- * @generated
- */
- private Diagram myDiagram;
-
- /**
- * @generated
- */
- private ICommonViewerWorkbenchSite myViewerSite;
-
- /**
- * @generated
- */
- public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) {
- super(Messages.NavigatorActionProvider_OpenDiagramActionName);
- myViewerSite = viewerSite;
- }
-
- /**
- * @generated
- */
- public final void selectionChanged(IStructuredSelection selection) {
- myDiagram = null;
- if(selection.size() == 1) {
- Object selectedElement = selection.getFirstElement();
- if(selectedElement instanceof SysmlNavigatorItem) {
- selectedElement = ((SysmlNavigatorItem)selectedElement).getView();
- } else if(selectedElement instanceof IAdaptable) {
- selectedElement = ((IAdaptable)selectedElement).getAdapter(View.class);
- }
- if(selectedElement instanceof Diagram) {
- Diagram diagram = (Diagram)selectedElement;
- if(ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(diagram))) {
- myDiagram = diagram;
- }
- }
- }
- setEnabled(myDiagram != null);
- }
-
- /**
- * @generated
- */
- public void run() {
- if(myDiagram == null || myDiagram.eResource() == null) {
- return;
- }
-
- IEditorInput editorInput = getEditorInput(myDiagram);
- IWorkbenchPage page = myViewerSite.getPage();
- try {
- page.openEditor(editorInput, SysmlDiagramEditor.ID);
- } catch (PartInitException e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Exception while openning diagram", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private static IEditorInput getEditorInput(Diagram diagram) {
- Resource diagramResource = diagram.eResource();
- for(EObject nextEObject : diagramResource.getContents()) {
- if(nextEObject == diagram) {
- return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource));
- }
- if(nextEObject instanceof Diagram) {
- break;
- }
- }
- URI uri = EcoreUtil.getURI(diagram);
- String editorName = uri.lastSegment() + '#' + diagram.eResource().getContents().indexOf(diagram);
- IEditorInput editorInput = new URIEditorInput(uri, editorName);
- return editorInput;
- }
-
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java
deleted file mode 100644
index aca9e5814e2..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorContentProvider.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-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.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.Messages;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonContentProvider;
-
-/**
- * @generated
- */
-public class SysmlNavigatorContentProvider implements ICommonContentProvider {
-
- /**
- * @generated
- */
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
- /**
- * @generated
- */
- private Viewer myViewer;
-
- /**
- * @generated
- */
- private AdapterFactoryEditingDomain myEditingDomain;
-
- /**
- * @generated
- */
- private WorkspaceSynchronizer myWorkspaceSynchronizer;
-
- /**
- * @generated
- */
- private Runnable myViewerRefreshRunnable;
-
- /**
- * @generated
- */
- @SuppressWarnings({ "unchecked", "serial", "rawtypes" })
- public SysmlNavigatorContentProvider() {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- myEditingDomain = (AdapterFactoryEditingDomain)editingDomain;
- myEditingDomain.setResourceToReadOnlyMap(new HashMap() {
-
- public Object get(Object key) {
- if(!containsKey(key)) {
- put(key, Boolean.TRUE);
- }
- return super.get(key);
- }
- });
- myViewerRefreshRunnable = new Runnable() {
-
- public void run() {
- if(myViewer != null) {
- myViewer.refresh();
- }
- }
- };
- myWorkspaceSynchronizer = new WorkspaceSynchronizer(editingDomain, new WorkspaceSynchronizer.Delegate() {
-
- public void dispose() {
- }
-
- public boolean handleResourceChanged(final Resource resource) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- nextResource.unload();
- }
- if(myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
-
- public boolean handleResourceDeleted(Resource resource) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- nextResource.unload();
- }
- if(myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
-
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- nextResource.unload();
- }
- if(myViewer != null) {
- myViewer.getControl().getDisplay().asyncExec(myViewerRefreshRunnable);
- }
- return true;
- }
- });
- }
-
- /**
- *
- * Papyrus Template this method is a modification of gmf code in order to avoid
- * getViewChidreen() method becoming greater than 64kb.
- *
- * @generated
- **/
- private Object[] getViewChildrenForParametricEditPart(View view, Object parentElement) {
- Collection result = new ArrayList();
- SysmlNavigatorGroup links = new SysmlNavigatorGroup(Messages.NavigatorGroupName_Resource_1000_links, "icons/linksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- Collection connectedViews = getChildrenByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(ConstraintPropertyEditPart.VISUAL_ID));
- result.addAll(createNavigatorItems(connectedViews, parentElement, false));
- connectedViews = getChildrenByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID));
- result.addAll(createNavigatorItems(connectedViews, parentElement, false));
- connectedViews = getDiagramLinksByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(ConnectorEditPart.VISUAL_ID));
- links.addChildren(createNavigatorItems(connectedViews, links, false));
- if(!links.isEmpty()) {
- result.add(links);
- }
- 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[] getViewChildrenForConstraintPropertyEditPart(View view, Object parentElement) {
- Collection result = new ArrayList();
- Collection connectedViews = getChildrenByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(Property2EditPart.VISUAL_ID));
- result.addAll(createNavigatorItems(connectedViews, parentElement, false));
- 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[] getViewChildrenForPropertyEditPart(View view, Object parentElement) {
- Collection result = new ArrayList();
- SysmlNavigatorGroup incominglinks = new SysmlNavigatorGroup(Messages.NavigatorGroupName_Property_2005_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- SysmlNavigatorGroup outgoinglinks = new SysmlNavigatorGroup(Messages.NavigatorGroupName_Property_2005_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(ConnectorEditPart.VISUAL_ID));
- incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- connectedViews = getOutgoingLinksByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(ConnectorEditPart.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[] getViewChildrenForProperty2EditPart(View view, Object parentElement) {
- Collection result = new ArrayList();
- SysmlNavigatorGroup incominglinks = new SysmlNavigatorGroup(Messages.NavigatorGroupName_Property_3002_incominglinks, "icons/incomingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- SysmlNavigatorGroup outgoinglinks = new SysmlNavigatorGroup(Messages.NavigatorGroupName_Property_3002_outgoinglinks, "icons/outgoingLinksNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- Collection connectedViews = getIncomingLinksByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(ConnectorEditPart.VISUAL_ID));
- incominglinks.addChildren(createNavigatorItems(connectedViews, incominglinks, true));
- connectedViews = getOutgoingLinksByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(ConnectorEditPart.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[] getViewChildrenForConnectorEditPart(View view, Object parentElement) {
- Collection result = new ArrayList();
- SysmlNavigatorGroup target = new SysmlNavigatorGroup(Messages.NavigatorGroupName_Connector_4001_target, "icons/linkTargetNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- SysmlNavigatorGroup source = new SysmlNavigatorGroup(Messages.NavigatorGroupName_Connector_4001_source, "icons/linkSourceNavigatorGroup.gif", parentElement); //$NON-NLS-1$
- Collection connectedViews = getLinksTargetByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID));
- target.addChildren(createNavigatorItems(connectedViews, target, true));
- connectedViews = getLinksTargetByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(Property2EditPart.VISUAL_ID));
- target.addChildren(createNavigatorItems(connectedViews, target, true));
- connectedViews = getLinksSourceByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID));
- source.addChildren(createNavigatorItems(connectedViews, source, true));
- connectedViews = getLinksSourceByType(Collections.singleton(view), SysmlVisualIDRegistry.getType(Property2EditPart.VISUAL_ID));
- source.addChildren(createNavigatorItems(connectedViews, source, true));
- if(!target.isEmpty()) {
- result.add(target);
- }
- if(!source.isEmpty()) {
- result.add(source);
- }
- return result.toArray();
- }
-
- /**
- * @generated
- */
- public void dispose() {
- myWorkspaceSynchronizer.dispose();
- myWorkspaceSynchronizer = null;
- myViewerRefreshRunnable = null;
- for(Iterator it = myEditingDomain.getResourceSet().getResources().iterator(); it.hasNext();) {
- Resource resource = (Resource)it.next();
- resource.unload();
- }
- ((TransactionalEditingDomain)myEditingDomain).dispose();
- myEditingDomain = null;
- }
-
- /**
- * @generated
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- myViewer = viewer;
- }
-
- /**
- * @generated
- */
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /**
- * @generated
- */
- public void restoreState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void saveState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /**
- * @generated
- */
- public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof IFile) {
- IFile file = (IFile)parentElement;
- URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- Resource resource = myEditingDomain.getResourceSet().getResource(fileURI, true);
- Collection result = new ArrayList();
- return result.toArray();
- }
-
- if(parentElement instanceof SysmlNavigatorGroup) {
- SysmlNavigatorGroup group = (SysmlNavigatorGroup)parentElement;
- return group.getChildren();
- }
-
- if(parentElement instanceof SysmlNavigatorItem) {
- SysmlNavigatorItem navigatorItem = (SysmlNavigatorItem)parentElement;
- if(navigatorItem.isLeaf() || !isOwnView(navigatorItem.getView())) {
- return EMPTY_ARRAY;
- }
- return getViewChildren(navigatorItem.getView(), parentElement);
- }
-
- return EMPTY_ARRAY;
- }
-
- /**
- * @generated
- */
- private Object[] getViewChildren(View view, Object parentElement) {
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
-
- case ParametricEditPart.VISUAL_ID:
- {
-
- //modification of the template to avoid mistake of 65kb.
- return getViewChildrenForParametricEditPart(view, parentElement);
-
- }
-
- case Property2EditPart.VISUAL_ID:
- {
-
- //modification of the template to avoid mistake of 65kb.
- return getViewChildrenForProperty2EditPart(view, parentElement);
-
- }
-
- case ConnectorEditPart.VISUAL_ID:
- {
-
- //modification of the template to avoid mistake of 65kb.
- return getViewChildrenForConnectorEditPart(view, parentElement);
-
- }
-
- case PropertyEditPart.VISUAL_ID:
- {
-
- //modification of the template to avoid mistake of 65kb.
- return getViewChildrenForPropertyEditPart(view, parentElement);
-
- }
-
- case ConstraintPropertyEditPart.VISUAL_ID:
- {
-
- //modification of the template to avoid mistake of 65kb.
- return getViewChildrenForConstraintPropertyEditPart(view, parentElement);
-
- }
-
- }
- return EMPTY_ARRAY;
- }
-
- /**
- * @generated
- */
- private Collection getLinksSourceByType(Collection edges, String type) {
- Collection result = new ArrayList();
- for(Iterator it = edges.iterator(); it.hasNext();) {
- Edge nextEdge = (Edge)it.next();
- View nextEdgeSource = nextEdge.getSource();
- if(type.equals(nextEdgeSource.getType()) && isOwnView(nextEdgeSource)) {
- result.add(nextEdgeSource);
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection getLinksTargetByType(Collection edges, String type) {
- Collection result = new ArrayList();
- for(Iterator it = edges.iterator(); it.hasNext();) {
- Edge nextEdge = (Edge)it.next();
- View nextEdgeTarget = nextEdge.getTarget();
- if(type.equals(nextEdgeTarget.getType()) && isOwnView(nextEdgeTarget)) {
- result.add(nextEdgeTarget);
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection getOutgoingLinksByType(Collection nodes, String type) {
- Collection result = new ArrayList();
- for(Iterator it = nodes.iterator(); it.hasNext();) {
- View nextNode = (View)it.next();
- result.addAll(selectViewsByType(nextNode.getSourceEdges(), type));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection getIncomingLinksByType(Collection nodes, String type) {
- Collection result = new ArrayList();
- for(Iterator it = nodes.iterator(); it.hasNext();) {
- View nextNode = (View)it.next();
- result.addAll(selectViewsByType(nextNode.getTargetEdges(), type));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection getChildrenByType(Collection nodes, String type) {
- Collection result = new ArrayList();
- for(Iterator it = nodes.iterator(); it.hasNext();) {
- View nextNode = (View)it.next();
- result.addAll(selectViewsByType(nextNode.getChildren(), type));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection getDiagramLinksByType(Collection diagrams, String type) {
- Collection result = new ArrayList();
- for(Iterator it = diagrams.iterator(); it.hasNext();) {
- Diagram nextDiagram = (Diagram)it.next();
- result.addAll(selectViewsByType(nextDiagram.getEdges(), type));
- }
- return result;
- }
-
- /**
- * @generated
- */
- private Collection selectViewsByType(Collection views, String type) {
- Collection result = new ArrayList();
- for(Iterator it = views.iterator(); it.hasNext();) {
- View nextView = (View)it.next();
- if(type.equals(nextView.getType()) && isOwnView(nextView)) {
- result.add(nextView);
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- private boolean isOwnView(View view) {
- return ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(view));
- }
-
- /**
- * @generated
- */
- private Collection createNavigatorItems(Collection views, Object parent, boolean isLeafs) {
- Collection result = new ArrayList();
- for(Iterator it = views.iterator(); it.hasNext();) {
- result.add(new SysmlNavigatorItem((View)it.next(), parent, isLeafs));
- }
- return result;
- }
-
- /**
- * @generated
- */
- public Object getParent(Object element) {
- if(element instanceof SysmlAbstractNavigatorItem) {
- SysmlAbstractNavigatorItem abstractNavigatorItem = (SysmlAbstractNavigatorItem)element;
- return abstractNavigatorItem.getParent();
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean hasChildren(Object element) {
- return element instanceof IFile || getChildren(element).length > 0;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorGroup.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorGroup.java
deleted file mode 100644
index aff7bf87cf6..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorGroup.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import java.util.Collection;
-import java.util.LinkedList;
-
-/**
- * @generated
- */
-public class SysmlNavigatorGroup extends SysmlAbstractNavigatorItem {
-
- /**
- * @generated
- */
- private String myGroupName;
-
- /**
- * @generated
- */
- private String myIcon;
-
- /**
- * @generated
- */
- private Collection myChildren = new LinkedList();
-
- /**
- * @generated
- */
- SysmlNavigatorGroup(String groupName, String icon, Object parent) {
- super(parent);
- myGroupName = groupName;
- myIcon = icon;
- }
-
- /**
- * @generated
- */
- public String getGroupName() {
- return myGroupName;
- }
-
- /**
- * @generated
- */
- public String getIcon() {
- return myIcon;
- }
-
- /**
- * @generated
- */
- public Object[] getChildren() {
- return myChildren.toArray();
- }
-
- /**
- * @generated
- */
- public void addChildren(Collection children) {
- myChildren.addAll(children);
- }
-
- /**
- * @generated
- */
- public void addChild(Object child) {
- myChildren.add(child);
- }
-
- /**
- * @generated
- */
- public boolean isEmpty() {
- return myChildren.size() == 0;
- }
-
- /**
- * @generated
- */
- public boolean equals(Object obj) {
- if(obj instanceof org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorGroup) {
- org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorGroup anotherGroup = (org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorGroup)obj;
- if(getGroupName().equals(anotherGroup.getGroupName())) {
- return getParent().equals(anotherGroup.getParent());
- }
- }
- return super.equals(obj);
- }
-
- /**
- * @generated
- */
- public int hashCode() {
- return getGroupName().hashCode();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorItem.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorItem.java
deleted file mode 100644
index 11e87b66b3e..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorItem.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @generated
- */
-public class SysmlNavigatorItem extends SysmlAbstractNavigatorItem {
-
- /**
- * @generated
- */
- static {
- final Class[] supportedTypes = new Class[]{ View.class, EObject.class };
- Platform.getAdapterManager().registerAdapters(new IAdapterFactory() {
-
- public Object getAdapter(Object adaptableObject, Class adapterType) {
- if(adaptableObject instanceof org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorItem && (adapterType == View.class || adapterType == EObject.class)) {
- return ((org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorItem)adaptableObject).getView();
- }
- return null;
- }
-
- public Class[] getAdapterList() {
- return supportedTypes;
- }
- }, org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorItem.class);
- }
-
- /**
- * @generated
- */
- private View myView;
-
- /**
- * @generated
- */
- private boolean myLeaf = false;
-
- /**
- * @generated
- */
- public SysmlNavigatorItem(View view, Object parent, boolean isLeaf) {
- super(parent);
- myView = view;
- myLeaf = isLeaf;
- }
-
- /**
- * @generated
- */
- public View getView() {
- return myView;
- }
-
- /**
- * @generated
- */
- public boolean isLeaf() {
- return myLeaf;
- }
-
- /**
- * @generated
- */
- public boolean equals(Object obj) {
- if(obj instanceof org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorItem) {
- return EcoreUtil.getURI(getView()).equals(EcoreUtil.getURI(((org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorItem)obj).getView()));
- }
- return super.equals(obj);
- }
-
- /**
- * @generated
- */
- public int hashCode() {
- return EcoreUtil.getURI(getView()).hashCode();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java
deleted file mode 100644
index dc5dc547777..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-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.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.navigator.ICommonContentExtensionSite;
-import org.eclipse.ui.navigator.ICommonLabelProvider;
-
-/**
- * @generated
- */
-public class SysmlNavigatorLabelProvider extends LabelProvider implements ICommonLabelProvider, ITreePathLabelProvider {
-
- /**
- * @generated
- */
- static {
- SysmlDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
- SysmlDiagramEditorPlugin.getInstance().getImageRegistry().put("Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public void updateLabel(ViewerLabel label, TreePath elementPath) {
- Object element = elementPath.getLastSegment();
- if(element instanceof SysmlNavigatorItem && !isOwnView(((SysmlNavigatorItem)element).getView())) {
- return;
- }
- label.setText(getText(element));
- label.setImage(getImage(element));
- }
-
- /**
- * @generated
- */
- public Image getImage(Object element) {
- if(element instanceof SysmlNavigatorGroup) {
- SysmlNavigatorGroup group = (SysmlNavigatorGroup)element;
- return SysmlDiagramEditorPlugin.getInstance().getBundledImage(group.getIcon());
- }
-
- if(element instanceof SysmlNavigatorItem) {
- SysmlNavigatorItem navigatorItem = (SysmlNavigatorItem)element;
- if(!isOwnView(navigatorItem.getView())) {
- return super.getImage(element);
- }
- return getImage(navigatorItem.getView());
- }
-
- return super.getImage(element);
- }
-
- /**
- * @generated
- */
- public Image getImage(View view) {
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ParametricEditPart.VISUAL_ID:
- return getImage("Navigator?Diagram?http://www.eclipse.org/papyurs/0.7.0/Resource?Resource", SysmlElementTypes.Resource_1000); //$NON-NLS-1$
- case Property2EditPart.VISUAL_ID:
- return getImage("Navigator?Node?http://www.eclipse.org/uml2/3.0.0/UML?Property", SysmlElementTypes.Property_3002); //$NON-NLS-1$
- case ConnectorEditPart.VISUAL_ID:
- return getImage("Navigator?Link?http://www.eclipse.org/uml2/3.0.0/UML?Connector", SysmlElementTypes.Connector_4001); //$NON-NLS-1$
- case PropertyEditPart.VISUAL_ID:
- return getImage("Navigator?TopLevelNode?http://www.eclipse.org/uml2/3.0.0/UML?Property", SysmlElementTypes.Property_2005); //$NON-NLS-1$
- case ConstraintPropertyEditPart.VISUAL_ID:
- return getImage("Navigator?TopLevelNode?http://www.eclipse.org/papyrus/0.7.0/SysML/Constraints?ConstraintProperty", SysmlElementTypes.ConstraintProperty_2003); //$NON-NLS-1$
- }
- return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- private Image getImage(String key, IElementType elementType) {
- ImageRegistry imageRegistry = SysmlDiagramEditorPlugin.getInstance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if(image == null && elementType != null && SysmlElementTypes.isKnownElementType(elementType)) {
- image = SysmlElementTypes.getImage(elementType);
- imageRegistry.put(key, image);
- }
-
- if(image == null) {
- image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
- imageRegistry.put(key, image);
- }
- return image;
- }
-
- /**
- * @generated
- */
- public String getText(Object element) {
- if(element instanceof SysmlNavigatorGroup) {
- SysmlNavigatorGroup group = (SysmlNavigatorGroup)element;
- return group.getGroupName();
- }
-
- if(element instanceof SysmlNavigatorItem) {
- SysmlNavigatorItem navigatorItem = (SysmlNavigatorItem)element;
- if(!isOwnView(navigatorItem.getView())) {
- return null;
- }
- return getText(navigatorItem.getView());
- }
-
- return super.getText(element);
- }
-
- /**
- * @generated
- */
- public String getText(View view) {
- if(view.getElement() != null && view.getElement().eIsProxy()) {
- return getUnresolvedDomainElementProxyText(view);
- }
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ParametricEditPart.VISUAL_ID:
- return getResource_1000Text(view);
- case Property2EditPart.VISUAL_ID:
- return getProperty_3002Text(view);
- case ConnectorEditPart.VISUAL_ID:
- return getConnector_4001Text(view);
- case PropertyEditPart.VISUAL_ID:
- return getProperty_2005Text(view);
- case ConstraintPropertyEditPart.VISUAL_ID:
- return getConstraintProperty_2003Text(view);
- }
- return getUnknownElementText(view);
- }
-
- /**
- * @generated
- */
- private String getResource_1000Text(View view) {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- private String getConstraintProperty_2003Text(View view) {
- IParser parser = SysmlParserProvider.getParser(SysmlElementTypes.ConstraintProperty_2003, view.getElement() != null ? view.getElement() : view, SysmlVisualIDRegistry.getType(ConstraintPropertyNameEditPart.VISUAL_ID));
- if(parser != null) {
- return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
- } else {
- SysmlDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5001); //$NON-NLS-1$
- return ""; //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private String getProperty_2005Text(View view) {
- IParser parser = SysmlParserProvider.getParser(SysmlElementTypes.Property_2005, view.getElement() != null ? view.getElement() : view, SysmlVisualIDRegistry.getType(PropertyNameEditPart.VISUAL_ID));
- if(parser != null) {
- return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
- } else {
- SysmlDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5002); //$NON-NLS-1$
- return ""; //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private String getProperty_3002Text(View view) {
- IParser parser = SysmlParserProvider.getParser(SysmlElementTypes.Property_3002, view.getElement() != null ? view.getElement() : view, SysmlVisualIDRegistry.getType(PropertyName2EditPart.VISUAL_ID));
- if(parser != null) {
- return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
- } else {
- SysmlDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 5003); //$NON-NLS-1$
- return ""; //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- private String getConnector_4001Text(View view) {
- IParser parser = SysmlParserProvider.getParser(SysmlElementTypes.Connector_4001, view.getElement() != null ? view.getElement() : view, SysmlVisualIDRegistry.getType(ConnectorNameEditPart.VISUAL_ID));
- if(parser != null) {
- return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view), ParserOptions.NONE.intValue());
- } else {
- SysmlDiagramEditorPlugin.getInstance().logError("Parser was not found for label " + 6001); //$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$
- }
-
- /**
- * @generated
- */
- private String getUnresolvedDomainElementProxyText(View view) {
- return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * @generated
- */
- public void init(ICommonContentExtensionSite aConfig) {
- }
-
- /**
- * @generated
- */
- public void restoreState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public void saveState(IMemento aMemento) {
- }
-
- /**
- * @generated
- */
- public String getDescription(Object anElement) {
- return null;
- }
-
- /**
- * @generated
- */
- private boolean isOwnView(View view) {
- return ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(view));
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLinkHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLinkHelper.java
deleted file mode 100644
index 66c239fa7cc..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLinkHelper.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.navigator.ILinkHelper;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class SysmlNavigatorLinkHelper implements ILinkHelper {
-
- /**
- * @generated
- */
- private static IEditorInput getEditorInput(Diagram diagram) {
- Resource diagramResource = diagram.eResource();
- for(EObject nextEObject : diagramResource.getContents()) {
- if(nextEObject == diagram) {
- return new FileEditorInput(WorkspaceSynchronizer.getFile(diagramResource));
- }
- if(nextEObject instanceof Diagram) {
- break;
- }
- }
- URI uri = EcoreUtil.getURI(diagram);
- String editorName = uri.lastSegment() + '#' + diagram.eResource().getContents().indexOf(diagram);
- IEditorInput editorInput = new URIEditorInput(uri, editorName);
- return editorInput;
- }
-
- /**
- * @generated
- */
- public IStructuredSelection findSelection(IEditorInput anInput) {
- IDiagramDocument document = SysmlDiagramEditorPlugin.getInstance().getDocumentProvider().getDiagramDocument(anInput);
- if(document == null) {
- return StructuredSelection.EMPTY;
- }
- Diagram diagram = document.getDiagram();
- if(diagram == null || diagram.eResource() == null) {
- return StructuredSelection.EMPTY;
- }
- IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
- if(file != null) {
- SysmlNavigatorItem item = new SysmlNavigatorItem(diagram, file, false);
- return new StructuredSelection(item);
- }
- return StructuredSelection.EMPTY;
- }
-
- /**
- * @generated
- */
- public void activateEditor(IWorkbenchPage aPage, IStructuredSelection aSelection) {
- if(aSelection == null || aSelection.isEmpty()) {
- return;
- }
- if(false == aSelection.getFirstElement() instanceof SysmlAbstractNavigatorItem) {
- return;
- }
-
- SysmlAbstractNavigatorItem abstractNavigatorItem = (SysmlAbstractNavigatorItem)aSelection.getFirstElement();
- View navigatorView = null;
- if(abstractNavigatorItem instanceof SysmlNavigatorItem) {
- navigatorView = ((SysmlNavigatorItem)abstractNavigatorItem).getView();
- } else if(abstractNavigatorItem instanceof SysmlNavigatorGroup) {
- SysmlNavigatorGroup navigatorGroup = (SysmlNavigatorGroup)abstractNavigatorItem;
- if(navigatorGroup.getParent() instanceof SysmlNavigatorItem) {
- navigatorView = ((SysmlNavigatorItem)navigatorGroup.getParent()).getView();
- }
- }
- if(navigatorView == null) {
- return;
- }
- IEditorInput editorInput = getEditorInput(navigatorView.getDiagram());
- IEditorPart editor = aPage.findEditor(editorInput);
- if(editor == null) {
- return;
- }
- aPage.bringToTop(editor);
- if(editor instanceof DiagramEditor) {
- DiagramEditor diagramEditor = (DiagramEditor)editor;
- ResourceSet diagramEditorResourceSet = diagramEditor.getEditingDomain().getResourceSet();
- EObject selectedView = diagramEditorResourceSet.getEObject(EcoreUtil.getURI(navigatorView), true);
- if(selectedView == null) {
- return;
- }
- GraphicalViewer graphicalViewer = (GraphicalViewer)diagramEditor.getAdapter(GraphicalViewer.class);
- EditPart selectedEditPart = (EditPart)graphicalViewer.getEditPartRegistry().get(selectedView);
- if(selectedEditPart != null) {
- graphicalViewer.select(selectedEditPart);
- }
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorSorter.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorSorter.java
deleted file mode 100644
index 99cb6dba5f0..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorSorter.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.navigator;
-
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-
-/**
- * @generated
- */
-public class SysmlNavigatorSorter extends ViewerSorter {
-
- /**
- * @generated
- */
- private static final int GROUP_CATEGORY = 4003;
-
- /**
- * @generated
- */
- public int category(Object element) {
- if(element instanceof SysmlNavigatorItem) {
- SysmlNavigatorItem item = (SysmlNavigatorItem)element;
- return SysmlVisualIDRegistry.getVisualID(item.getView());
- }
- return GROUP_CATEGORY;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parser/ParametricFrameParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parser/ParametricFrameParser.java
new file mode 100644
index 00000000000..d7ab2f04f94
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parser/ParametricFrameParser.java
@@ -0,0 +1,22 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.parser;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
+import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+public class ParametricFrameParser extends NamedElementLabelParser {
+
+ @Override
+ public String getPrintString(IAdaptable element, int flags) {
+ String elementType = null;
+ if (element instanceof EObjectAdapter) {
+ Object realObject = ((EObjectAdapter)element).getRealObject();
+ if (realObject instanceof org.eclipse.uml2.uml.Class) {
+ elementType = UMLUtil.getStereotypeApplication(((org.eclipse.uml2.uml.Class)realObject), ConstraintBlock.class) != null ? "ConstraintBlock" : "Block";
+ }
+ }
+ return "par [" + elementType + "] " + super.getPrintString(element, flags);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/AbstractParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/AbstractParser.java
deleted file mode 100644
index b7c8cb3c793..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/AbstractParser.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.parsers;
-
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.Messages;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public abstract class AbstractParser implements IParser {
-
- /**
- * @generated
- */
- protected final EAttribute[] features;
-
- /**
- * @generated
- */
- protected final EAttribute[] editableFeatures;
-
- /**
- * @generated
- */
- private String viewPattern;
-
- /**
- * @generated
- */
- private String editorPattern;
-
- /**
- * @generated
- */
- private String editPattern;
-
- /**
- * @generated
- */
- public AbstractParser(EAttribute[] features) {
- if(features == null || Arrays.asList(features).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.editableFeatures = this.features = features;
- }
-
- /**
- * @generated
- */
- public AbstractParser(EAttribute[] features, EAttribute[] editableFeatures) {
- if(features == null || Arrays.asList(features).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.features = features;
- if(editableFeatures == null || Arrays.asList(editableFeatures).contains(null)) {
- throw new IllegalArgumentException();
- }
- this.editableFeatures = editableFeatures;
- }
-
- /**
- * @generated
- */
- public String getViewPattern() {
- return viewPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- this.viewPattern = viewPattern;
- }
-
- /**
- * @generated
- */
- public String getEditorPattern() {
- return editorPattern;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- this.editorPattern = editorPattern;
- }
-
- /**
- * @generated
- */
- public String getEditPattern() {
- return editPattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- this.editPattern = editPattern;
- }
-
- /**
- * @generated
- */
- public boolean isAffectingEvent(Object event, int flags) {
- if(event instanceof Notification) {
- return isAffectingFeature(((Notification)event).getFeature());
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean isAffectingFeature(Object feature) {
- for(int i = 0; i < features.length; i++) {
- if(features[i] == feature) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @generated
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * @generated
- */
- protected Object[] getValues(EObject element) {
- Object[] values = new Object[features.length];
- for(int i = 0; i < features.length; i++) {
- values[i] = getValue(element, features[i]);
- }
- return values;
- }
-
- /**
- * @generated
- */
- protected Object[] getEditableValues(EObject element) {
- Object[] values = new Object[editableFeatures.length];
- for(int i = 0; i < editableFeatures.length; i++) {
- values[i] = getValue(element, editableFeatures[i]);
- }
- return values;
- }
-
- /**
- * @generated
- */
- protected Object getValue(EObject element, EAttribute feature) {
- Object value = element.eGet(feature);
- Class iClass = feature.getEAttributeType().getInstanceClass();
- if(String.class.equals(iClass)) {
- if(value == null) {
- value = ""; //$NON-NLS-1$
- }
- }
- return value;
- }
-
- /**
- * @generated
- */
- protected ICommand getParseCommand(IAdaptable adapter, Object[] values, int flags) {
- if(values == null || validateNewValues(values).getCode() != IParserEditStatus.EDITABLE) {
- return UnexecutableCommand.INSTANCE;
- }
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(element);
- if(editingDomain == null) {
- return UnexecutableCommand.INSTANCE;
- }
- CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$
- for(int i = 0; i < values.length; i++) {
- command.compose(getModificationCommand(element, editableFeatures[i], values[i]));
- }
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getModificationCommand(EObject element, EAttribute feature, Object value) {
- value = getValidNewValue(feature, value);
- if(value instanceof InvalidValue) {
- return UnexecutableCommand.INSTANCE;
- }
- SetRequest request = new SetRequest(element, feature, value);
- return new SetValueCommand(request);
- }
-
- /**
- * @generated
- */
- protected IParserEditStatus validateNewValues(Object[] values) {
- if(values.length != editableFeatures.length) {
- return ParserEditStatus.UNEDITABLE_STATUS;
- }
- for(int i = 0; i < values.length; i++) {
- Object value = getValidNewValue(editableFeatures[i], values[i]);
- if(value instanceof InvalidValue) {
- return new ParserEditStatus(SysmlDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, value.toString());
- }
- }
- return ParserEditStatus.EDITABLE_STATUS;
- }
-
- /**
- * @generated
- */
- protected Object getValidNewValue(EAttribute feature, Object value) {
- EClassifier type = feature.getEType();
- if(type instanceof EDataType) {
- Class iClass = type.getInstanceClass();
- if(Boolean.TYPE.equals(iClass)) {
- if(value instanceof Boolean) {
- // ok
- } else if(value instanceof String) {
- value = Boolean.valueOf((String)value);
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Character.TYPE.equals(iClass)) {
- if(value instanceof Character) {
- // ok
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- value = new Character(s.charAt(0));
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Byte.TYPE.equals(iClass)) {
- if(value instanceof Byte) {
- // ok
- } else if(value instanceof Number) {
- value = new Byte(((Number)value).byteValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Byte.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Short.TYPE.equals(iClass)) {
- if(value instanceof Short) {
- // ok
- } else if(value instanceof Number) {
- value = new Short(((Number)value).shortValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Short.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Integer.TYPE.equals(iClass)) {
- if(value instanceof Integer) {
- // ok
- } else if(value instanceof Number) {
- value = new Integer(((Number)value).intValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Integer.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Long.TYPE.equals(iClass)) {
- if(value instanceof Long) {
- // ok
- } else if(value instanceof Number) {
- value = new Long(((Number)value).longValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Long.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Float.TYPE.equals(iClass)) {
- if(value instanceof Float) {
- // ok
- } else if(value instanceof Number) {
- value = new Float(((Number)value).floatValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Float.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(Double.TYPE.equals(iClass)) {
- if(value instanceof Double) {
- // ok
- } else if(value instanceof Number) {
- value = new Double(((Number)value).doubleValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Double.valueOf(s);
- } catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
- }
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
- }
- } else if(type instanceof EEnum) {
- if(value instanceof String) {
- EEnumLiteral literal = ((EEnum)type).getEEnumLiteralByLiteral((String)value);
- if(literal == null) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnknownLiteral, value));
- } else {
- value = literal.getInstance();
- }
- } else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, String.class.getName()));
- }
- }
- }
- return value;
- }
-
- /**
- * @generated
- */
- protected class InvalidValue {
-
- /**
- * @generated
- */
- private String description;
-
- /**
- * @generated
- */
- public InvalidValue(String description) {
- this.description = description;
- }
-
- /**
- * @generated
- */
- public String toString() {
- return description;
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/MessageFormatParser.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/MessageFormatParser.java
deleted file mode 100644
index d3dc06d93a4..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/MessageFormatParser.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.parsers;
-
-import java.text.FieldPosition;
-import java.text.MessageFormat;
-import java.text.ParsePosition;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.Messages;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class MessageFormatParser extends AbstractParser {
-
- /**
- * @generated
- */
- private String defaultPattern;
-
- /**
- * @generated
- */
- private String defaultEditablePattern;
-
- /**
- * @generated
- */
- private MessageFormat viewProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editorProcessor;
-
- /**
- * @generated
- */
- private MessageFormat editProcessor;
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features) {
- super(features);
- }
-
- /**
- * @generated
- */
- public MessageFormatParser(EAttribute[] features, EAttribute[] editableFeatures) {
- super(features, editableFeatures);
- }
-
- /**
- * @generated
- */
- protected String getDefaultPattern() {
- if(defaultPattern == null) {
- StringBuffer sb = new StringBuffer();
- for(int i = 0; i < features.length; i++) {
- if(i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultPattern = sb.toString();
- }
- return defaultPattern;
- }
-
- /**
- * @generated
- */
- public void setViewPattern(String viewPattern) {
- super.setViewPattern(viewPattern);
- viewProcessor = null;
- }
-
- /**
- * @generated
- */
- public void setEditorPattern(String editorPattern) {
- super.setEditorPattern(editorPattern);
- editorProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getViewProcessor() {
- if(viewProcessor == null) {
- viewProcessor = new MessageFormat(getViewPattern() == null ? getDefaultPattern() : getViewPattern());
- }
- return viewProcessor;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditorProcessor() {
- if(editorProcessor == null) {
- editorProcessor = new MessageFormat(getEditorPattern() == null ? getDefaultEditablePattern() : getEditorPattern());
- }
- return editorProcessor;
- }
-
- /**
- * @generated
- */
- protected String getDefaultEditablePattern() {
- if(defaultEditablePattern == null) {
- StringBuffer sb = new StringBuffer();
- for(int i = 0; i < editableFeatures.length; i++) {
- if(i > 0) {
- sb.append(' ');
- }
- sb.append('{');
- sb.append(i);
- sb.append('}');
- }
- defaultEditablePattern = sb.toString();
- }
- return defaultEditablePattern;
- }
-
- /**
- * @generated
- */
- public void setEditPattern(String editPattern) {
- super.setEditPattern(editPattern);
- editProcessor = null;
- }
-
- /**
- * @generated
- */
- protected MessageFormat getEditProcessor() {
- if(editProcessor == null) {
- editProcessor = new MessageFormat(getEditPattern() == null ? getDefaultEditablePattern() : getEditPattern());
- }
- return editProcessor;
- }
-
- /**
- * @generated
- */
- public String getEditString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- return getEditorProcessor().format(getEditableValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
- /**
- * @generated
- */
- public IParserEditStatus isValidEditString(IAdaptable adapter, String editString) {
- ParsePosition pos = new ParsePosition(0);
- Object[] values = getEditProcessor().parse(editString, pos);
- if(values == null) {
- return new ParserEditStatus(SysmlDiagramEditorPlugin.ID, IParserEditStatus.UNEDITABLE, NLS.bind(Messages.MessageFormatParser_InvalidInputError, new Integer(pos.getErrorIndex())));
- }
- return validateNewValues(values);
- }
-
- /**
- * @generated
- */
- public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
- Object[] values = getEditProcessor().parse(newString, new ParsePosition(0));
- return getParseCommand(adapter, values, flags);
- }
-
- /**
- * @generated
- */
- public String getPrintString(IAdaptable adapter, int flags) {
- EObject element = (EObject)adapter.getAdapter(EObject.class);
- return getViewProcessor().format(getValues(element), new StringBuffer(), new FieldPosition(0)).toString();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/DiagramEditorContextMenuProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/DiagramEditorContextMenuProvider.java
deleted file mode 100644
index d6dcf4d73a5..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/DiagramEditorContextMenuProvider.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gmf.runtime.common.ui.services.action.contributionitem.ContributionItemService;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContextMenuProvider;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @generated
- */
-public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider {
-
- /**
- * @generated
- */
- private IWorkbenchPart part;
-
- /**
- * @generated
- */
- public DiagramEditorContextMenuProvider(IWorkbenchPart part, EditPartViewer viewer) {
- super(part, viewer);
- this.part = part;
-
- }
-
- /**
- * @generated
- */
- public void buildContextMenu(final IMenuManager menu) {
- getViewer().flush();
- try {
- TransactionUtil.getEditingDomain((EObject)getViewer().getContents().getModel()).runExclusive(new Runnable() {
-
- public void run() {
- ContributionItemService.getInstance().contributeToPopupMenu(DiagramEditorContextMenuProvider.this, part);
- menu.remove(ActionIds.ACTION_DELETE_FROM_MODEL);
-
- }
- });
- } catch (Exception e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Error building context menu", e);
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/LoadResourceAction.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/LoadResourceAction.java
deleted file mode 100644
index b213a7b412e..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/LoadResourceAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * @generated
- */
-public class LoadResourceAction extends AbstractHandler {
-
- /**
- * @generated
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event);
- Shell shell = diagramEditor.getEditorSite().getShell();
- assert diagramEditor instanceof DiagramEditor;
- TransactionalEditingDomain editingDomain = ((DiagramEditor)diagramEditor).getEditingDomain();
- org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog(shell, editingDomain);
- loadResourceDialog.open();
- return null;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/Messages.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/Messages.java
deleted file mode 100644
index 4ba5d7ed6fc..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/Messages.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * @generated
- */
-public class Messages extends NLS {
-
- /**
- * @generated
- */
- static {
- NLS.initializeMessages("messages", Messages.class); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- private Messages() {
- }
-
- /**
- * @generated
- */
- public static String SysmlCreationWizardTitle;
-
- /**
- * @generated
- */
- public static String SysmlCreationWizard_DiagramModelFilePageTitle;
-
- /**
- * @generated
- */
- public static String SysmlCreationWizard_DiagramModelFilePageDescription;
-
- /**
- * @generated
- */
- public static String SysmlCreationWizard_DomainModelFilePageTitle;
-
- /**
- * @generated
- */
- public static String SysmlCreationWizard_DomainModelFilePageDescription;
-
- /**
- * @generated
- */
- public static String SysmlCreationWizardOpenEditorError;
-
- /**
- * @generated
- */
- public static String SysmlCreationWizardCreationError;
-
- /**
- * @generated
- */
- public static String SysmlCreationWizardPageExtensionError;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditorUtil_OpenModelResourceErrorDialogTitle;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditorUtil_OpenModelResourceErrorDialogMessage;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditorUtil_CreateDiagramProgressTask;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditorUtil_CreateDiagramCommandLabel;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_isModifiable;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_handleElementContentChanged;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_IncorrectInputError;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_NoDiagramInResourceError;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_DiagramLoadingError;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_UnsynchronizedFileSaveError;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_SaveDiagramTask;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_SaveNextResourceTask;
-
- /**
- * @generated
- */
- public static String SysmlDocumentProvider_SaveAsOperation;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_ResourceErrorDialogTitle;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_ResourceErrorDialogMessage;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_WizardTitle;
-
- /**
- * @generated
- */
- public static String InitDiagramFile_OpenModelFileDialogTitle;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_CreationPageName;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_CreationPageTitle;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_CreationPageDescription;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_RootSelectionPageName;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_RootSelectionPageTitle;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_RootSelectionPageDescription;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_RootSelectionPageSelectionTitle;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_RootSelectionPageNoSelectionMessage;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_InitDiagramCommand;
-
- /**
- * @generated
- */
- public static String SysmlNewDiagramFileWizard_IncorrectRootError;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditor_SavingDeletedFile;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditor_SaveAsErrorTitle;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditor_SaveAsErrorMessage;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditor_SaveErrorTitle;
-
- /**
- * @generated
- */
- public static String SysmlDiagramEditor_SaveErrorMessage;
-
- /**
- * @generated
- */
- public static String SysmlElementChooserDialog_SelectModelElementTitle;
-
- /**
- * @generated
- */
- public static String ModelElementSelectionPageMessage;
-
- /**
- * @generated
- */
- public static String ValidateActionMessage;
-
- /**
- * @generated
- */
- public static String createParametric1Group_title;
-
- /**
- * @generated
- */
- public static String createConstraintProperty1CreationTool_title;
-
- /**
- * @generated
- */
- public static String createConstraintProperty1CreationTool_desc;
-
- /**
- * @generated
- */
- public static String createProperty2CreationTool_title;
-
- /**
- * @generated
- */
- public static String createProperty2CreationTool_desc;
-
- /**
- * @generated
- */
- public static String createConnector3CreationTool_title;
-
- /**
- * @generated
- */
- public static String createConnector3CreationTool_desc;
-
- /**
- * @generated
- */
- public static String CommandName_OpenDiagram;
-
- /**
- * @generated
- */
- public static String NavigatorGroupName_Resource_1000_links;
-
- /**
- * @generated
- */
- public static String NavigatorGroupName_Property_2005_incominglinks;
-
- /**
- * @generated
- */
- public static String NavigatorGroupName_Property_2005_outgoinglinks;
-
- /**
- * @generated
- */
- public static String NavigatorGroupName_Property_3002_incominglinks;
-
- /**
- * @generated
- */
- public static String NavigatorGroupName_Property_3002_outgoinglinks;
-
- /**
- * @generated
- */
- public static String NavigatorGroupName_Connector_4001_target;
-
- /**
- * @generated
- */
- public static String NavigatorGroupName_Connector_4001_source;
-
- /**
- * @generated
- */
- public static String NavigatorActionProvider_OpenDiagramActionName;
-
- /**
- * @generated
- */
- public static String AbstractParser_UnexpectedValueType;
-
- /**
- * @generated
- */
- public static String AbstractParser_WrongStringConversion;
-
- /**
- * @generated
- */
- public static String AbstractParser_UnknownLiteral;
-
- /**
- * @generated
- */
- public static String MessageFormatParser_InvalidInputError;
-
- /**
- * @generated
- */
- public static String SysmlModelingAssistantProviderTitle;
-
- /**
- * @generated
- */
- public static String SysmlModelingAssistantProviderMessage;
-
- // TODO: put accessor fields manually
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/ModelElementSelectionPage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/ModelElementSelectionPage.java
deleted file mode 100644
index 136fd3b48a1..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/ModelElementSelectionPage.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.edit.provider.IWrapperItemProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * Wizard page that allows to select element from model.
- *
- * @generated
- */
-public class ModelElementSelectionPage extends WizardPage {
-
- /**
- * @generated
- */
- protected EObject selectedModelElement;
-
- /**
- * @generated
- */
- private TreeViewer modelViewer;
-
- /**
- * @generated
- */
- public ModelElementSelectionPage(String pageName) {
- super(pageName);
- }
-
- /**
- * @generated
- */
- public EObject getModelElement() {
- return selectedModelElement;
- }
-
- /**
- * @generated
- */
- public void setModelElement(EObject modelElement) {
- selectedModelElement = modelElement;
- if(modelViewer != null) {
- if(selectedModelElement != null) {
- modelViewer.setInput(selectedModelElement.eResource());
- modelViewer.setSelection(new StructuredSelection(selectedModelElement));
- } else {
- modelViewer.setInput(null);
- }
- setPageComplete(validatePage());
- }
- }
-
- /**
- * @generated
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite plate = new Composite(parent, SWT.NONE);
- plate.setLayoutData(new GridData(GridData.FILL_BOTH));
- GridLayout layout = new GridLayout();
- layout.marginWidth = 0;
- plate.setLayout(layout);
- setControl(plate);
-
- Label label = new Label(plate, SWT.NONE);
- label.setText(getSelectionTitle());
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- modelViewer = new TreeViewer(plate, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- GridData layoutData = new GridData(GridData.FILL_BOTH);
- layoutData.heightHint = 300;
- layoutData.widthHint = 300;
- modelViewer.getTree().setLayoutData(layoutData);
- modelViewer.setContentProvider(new AdapterFactoryContentProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
- modelViewer.setLabelProvider(new AdapterFactoryLabelProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory()));
- if(selectedModelElement != null) {
- modelViewer.setInput(selectedModelElement.eResource());
- modelViewer.setSelection(new StructuredSelection(selectedModelElement));
- }
- modelViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ModelElementSelectionPage.this.updateSelection((IStructuredSelection)event.getSelection());
- }
- });
-
- setPageComplete(validatePage());
- }
-
- /**
- * Override to provide custom model element description.
- *
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.ModelElementSelectionPageMessage;
- }
-
- /**
- * @generated
- */
- protected void updateSelection(IStructuredSelection selection) {
- selectedModelElement = null;
- if(selection.size() == 1) {
- Object selectedElement = selection.getFirstElement();
- if(selectedElement instanceof IWrapperItemProvider) {
- selectedElement = ((IWrapperItemProvider)selectedElement).getValue();
- }
- if(selectedElement instanceof FeatureMap.Entry) {
- selectedElement = ((FeatureMap.Entry)selectedElement).getValue();
- }
- if(selectedElement instanceof EObject) {
- selectedModelElement = (EObject)selectedElement;
- }
- }
- setPageComplete(validatePage());
- }
-
- /**
- * Override to provide specific validation of the selected model element.
- *
- * @generated
- */
- protected boolean validatePage() {
- return true;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlCreationWizard.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlCreationWizard.java
deleted file mode 100644
index dd958c59002..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlCreationWizard.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-
-/**
- * @generated
- */
-public class SysmlCreationWizard extends Wizard implements INewWizard {
-
- /**
- * @generated
- */
- private IWorkbench workbench;
-
- /**
- * @generated
- */
- protected IStructuredSelection selection;
-
- /**
- * @generated
- */
- protected SysmlCreationWizardPage diagramModelFilePage;
-
- /**
- * @generated
- */
- protected SysmlCreationWizardPage domainModelFilePage;
-
- /**
- * @generated
- */
- protected Resource diagram;
-
- /**
- * @generated
- */
- private boolean openNewlyCreatedDiagramEditor = true;
-
- /**
- * @generated
- */
- public IWorkbench getWorkbench() {
- return workbench;
- }
-
- /**
- * @generated
- */
- public IStructuredSelection getSelection() {
- return selection;
- }
-
- /**
- * @generated
- */
- public final Resource getDiagram() {
- return diagram;
- }
-
- /**
- * @generated
- */
- public final boolean isOpenNewlyCreatedDiagramEditor() {
- return openNewlyCreatedDiagramEditor;
- }
-
- /**
- * @generated
- */
- public void setOpenNewlyCreatedDiagramEditor(boolean openNewlyCreatedDiagramEditor) {
- this.openNewlyCreatedDiagramEditor = openNewlyCreatedDiagramEditor;
- }
-
- /**
- * @generated
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(Messages.SysmlCreationWizardTitle);
- setDefaultPageImageDescriptor(SysmlDiagramEditorPlugin.getBundledImageDescriptor("icons/wizban/NewResourceWizard.gif")); //$NON-NLS-1$
- setNeedsProgressMonitor(true);
- }
-
- /**
- * @generated
- */
- public void addPages() {
- diagramModelFilePage = new SysmlCreationWizardPage("DiagramModelFile", getSelection(), "sysml_diagram"); //$NON-NLS-1$ //$NON-NLS-2$
- diagramModelFilePage.setTitle(Messages.SysmlCreationWizard_DiagramModelFilePageTitle);
- diagramModelFilePage.setDescription(Messages.SysmlCreationWizard_DiagramModelFilePageDescription);
- addPage(diagramModelFilePage);
-
- domainModelFilePage = new SysmlCreationWizardPage("DomainModelFile", getSelection(), "sysml") { //$NON-NLS-1$ //$NON-NLS-2$
-
- public void setVisible(boolean visible) {
- if(visible) {
- String fileName = diagramModelFilePage.getFileName();
- fileName = fileName.substring(0, fileName.length() - ".sysml_diagram".length()); //$NON-NLS-1$
- setFileName(SysmlDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), fileName, "sysml")); //$NON-NLS-1$
- }
- super.setVisible(visible);
- }
- };
- domainModelFilePage.setTitle(Messages.SysmlCreationWizard_DomainModelFilePageTitle);
- domainModelFilePage.setDescription(Messages.SysmlCreationWizard_DomainModelFilePageDescription);
- addPage(domainModelFilePage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- IRunnableWithProgress op = new WorkspaceModifyOperation(null) {
-
- protected void execute(IProgressMonitor monitor) throws CoreException, InterruptedException {
- diagram = SysmlDiagramEditorUtil.createDiagram(diagramModelFilePage.getURI(), domainModelFilePage.getURI(), monitor);
- if(isOpenNewlyCreatedDiagramEditor() && diagram != null) {
- try {
- SysmlDiagramEditorUtil.openDiagram(diagram);
- } catch (PartInitException e) {
- ErrorDialog.openError(getContainer().getShell(), Messages.SysmlCreationWizardOpenEditorError, null, e.getStatus());
- }
- }
- }
- };
- try {
- getContainer().run(false, true, op);
- } catch (InterruptedException e) {
- return false;
- } catch (InvocationTargetException e) {
- if(e.getTargetException() instanceof CoreException) {
- ErrorDialog.openError(getContainer().getShell(), Messages.SysmlCreationWizardCreationError, null, ((CoreException)e.getTargetException()).getStatus());
- } else {
- SysmlDiagramEditorPlugin.getInstance().logError("Error creating diagram", e.getTargetException()); //$NON-NLS-1$
- }
- return false;
- }
- return diagram != null;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlCreationWizardPage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlCreationWizardPage.java
deleted file mode 100644
index 6aba0fe89cb..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlCreationWizardPage.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- * @generated
- */
-public class SysmlCreationWizardPage extends WizardNewFileCreationPage {
-
- /**
- * @generated
- */
- private final String fileExtension;
-
- /**
- * @generated
- */
- public SysmlCreationWizardPage(String pageName, IStructuredSelection selection, String fileExtension) {
- super(pageName, selection);
- this.fileExtension = fileExtension;
- }
-
- /**
- * Override to create files with this extension.
- *
- * @generated
- */
- protected String getExtension() {
- return fileExtension;
- }
-
- /**
- * @generated
- */
- public URI getURI() {
- return URI.createPlatformResourceURI(getFilePath().toString(), false);
- }
-
- /**
- * @generated
- */
- protected IPath getFilePath() {
- IPath path = getContainerFullPath();
- if(path == null) {
- path = new Path(""); //$NON-NLS-1$
- }
- String fileName = getFileName();
- if(fileName != null) {
- path = path.append(fileName);
- }
- return path;
- }
-
- /**
- * @generated
- */
- public void createControl(Composite parent) {
- super.createControl(parent);
- setFileName(SysmlDiagramEditorUtil.getUniqueFileName(getContainerFullPath(), getFileName(), getExtension()));
- setPageComplete(validatePage());
- }
-
- /**
- * @generated
- */
- protected boolean validatePage() {
- if(!super.validatePage()) {
- return false;
- }
- String extension = getExtension();
- if(extension != null && !getFilePath().toString().endsWith("." + extension)) {
- setErrorMessage(NLS.bind(Messages.SysmlCreationWizardPageExtensionError, extension));
- return false;
- }
- return true;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramActionBarContributor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramActionBarContributor.java
deleted file mode 100644
index b9d2b4adc58..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramActionBarContributor.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * @generated
- */
-public class SysmlDiagramActionBarContributor extends DiagramActionBarContributor {
-
- /**
- * @generated
- */
- protected Class getEditorClass() {
- return SysmlDiagramEditor.class;
- }
-
- /**
- * @generated
- */
- protected String getEditorId() {
- return SysmlDiagramEditor.ID;
- }
-
- /**
- * @generated
- */
- public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars, page);
- // print preview
- IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
- assert fileMenu != null;
- fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
- IMenuManager editMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
- assert editMenu != null;
- if(editMenu.find("validationGroup") == null) { //$NON-NLS-1$
- editMenu.add(new GroupMarker("validationGroup")); //$NON-NLS-1$
- }
- IAction validateAction = new ValidateAction(page);
- editMenu.appendToGroup("validationGroup", validateAction); //$NON-NLS-1$
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditor.java
deleted file mode 100644
index 55d95caf27b..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditor.java
+++ /dev/null
@@ -1,569 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.util.EventObject;
-
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.GraphicalViewer;
-import org.eclipse.gef.KeyHandler;
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.commands.CommandStackListener;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.gef.ui.palette.PaletteViewerProvider;
-import org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener;
-import org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent;
-import org.eclipse.gmf.runtime.common.ui.services.marker.MarkerNavigationService;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.internal.parts.PaletteToolTransferDragSourceListener;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocumentProvider;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.util.LocalSelectionTransfer;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.infra.gmfdiag.common.GmfMultiDiagramDocumentProvider;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorItem;
-import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener;
-import org.eclipse.papyrus.uml.diagram.common.part.PapyrusPaletteContextMenuProvider;
-import org.eclipse.papyrus.uml.diagram.common.part.PapyrusPaletteViewer;
-import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
-import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.ide.IGotoMarker;
-import org.eclipse.ui.navigator.resources.ProjectExplorer;
-import org.eclipse.ui.part.IShowInTargetList;
-import org.eclipse.ui.part.ShowInContext;
-
-/**
- * @generated
- */
-public class SysmlDiagramEditor extends UmlGmfDiagramEditor implements IProviderChangeListener, IGotoMarker {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ID = "org.eclipse.papyrus.sysml.diagram.parametric.ui.diagramContext"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private KeyHandler paletteKeyHandler = null;
-
- /**
- * @generated
- */
- private MouseListener paletteMouseListener = null;
-
- /**
- * @generated
- */
- private IUndoableOperation savedOperation = null;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain editingDomain;
-
- /**
- * @generated
- */
- private IDocumentProvider documentProvider;
-
- /**
- * @generated
- */
- public SysmlDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
- super(servicesRegistry, diagram);
-
- // adds a listener to the palette service, which reacts to palette customizations
- PapyrusPaletteService.getInstance().addProviderChangeListener(this);
-
- // Share the same editing provider
- editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
- documentProvider = new GmfMultiDiagramDocumentProvider(editingDomain);
-
- // overrides editing domain created by super constructor
- setDocumentProvider(documentProvider);
-
- }
-
- /**
- * @generated
- */
- @Override
- protected String getContextID() {
- return CONTEXT_ID;
- }
-
- /**
- * @generated
- */
- @Override
- protected PaletteRoot createPaletteRoot(PaletteRoot existingPaletteRoot) {
- PaletteRoot paletteRoot;
- if(existingPaletteRoot == null) {
- paletteRoot = PapyrusPaletteService.getInstance().createPalette(this, getDefaultPaletteContent());
- } else {
- PapyrusPaletteService.getInstance().updatePalette(existingPaletteRoot, this, getDefaultPaletteContent());
- paletteRoot = existingPaletteRoot;
- }
- applyCustomizationsToPalette(paletteRoot);
- return paletteRoot;
- }
-
- /**
- * @generated
- */
- @Override
- protected PreferencesHint getPreferencesHint() {
- return SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT;
- }
-
- /**
- * @generated
- */
- @Override
- public String getContributorId() {
- return SysmlDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- @Override
- public Object getAdapter(Class type) {
- if(type == IShowInTargetList.class) {
- return new IShowInTargetList() {
-
- public String[] getShowInTargetIds() {
- return new String[]{ ProjectExplorer.VIEW_ID };
- }
- };
- }
- return super.getAdapter(type);
- }
-
- /**
- * @generated
- */
- @Override
- protected final IDocumentProvider getDocumentProvider(IEditorInput input) {
- return documentProvider;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#getKeyHandler()
- *
- * @return
- *
- * @generated NOT
- */
- @Override
- protected KeyHandler getKeyHandler() {
- //we remove all keybinding provided by GMF
- KeyHandler keyHandler = new KeyHandler();
- return keyHandler;
- }
-
- /**
- * @generated
- */
- @Override
- public TransactionalEditingDomain getEditingDomain() {
- return editingDomain;
- }
-
- /**
- * @generated
- */
- @Override
- protected final void setDocumentProvider(IEditorInput input) {
- // Already set in the constructor
- }
-
- /**
- * @generated
- */
- public void gotoMarker(IMarker marker) {
- MarkerNavigationService.getInstance().gotoMarker(this, marker);
- }
-
- /**
- * @generated
- */
- @Override
- public boolean isSaveAsAllowed() {
- return true;
- }
-
- /**
- * @generated
- */
- @Override
- public void doSaveAs() {
- performSaveAs(new NullProgressMonitor());
- }
-
- /**
- * @generated
- */
- @Override
- protected void performSaveAs(IProgressMonitor progressMonitor) {
- // Nothing
- }
-
- /**
- * @generated
- */
- @Override
- public ShowInContext getShowInContext() {
- return new ShowInContext(getEditorInput(), getNavigatorSelection());
- }
-
- /**
- * @generated
- */
- private ISelection getNavigatorSelection() {
- IDiagramDocument document = getDiagramDocument();
- if(document == null) {
- return StructuredSelection.EMPTY;
- }
- Diagram diagram = document.getDiagram();
- if(diagram == null || diagram.eResource() == null) {
- return StructuredSelection.EMPTY;
- }
- IFile file = WorkspaceSynchronizer.getFile(diagram.eResource());
- if(file != null) {
- SysmlNavigatorItem item = new SysmlNavigatorItem(diagram, file, false);
- return new StructuredSelection(item);
- }
- return StructuredSelection.EMPTY;
- }
-
- /**
- * @generated
- */
- @Override
- protected void configureGraphicalViewer() {
- super.configureGraphicalViewer();
- DiagramEditorContextMenuProvider provider = new DiagramEditorContextMenuProvider(this, getDiagramGraphicalViewer());
- getDiagramGraphicalViewer().setContextMenu(provider);
- getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer());
- }
-
- /**
- * @generated
- */
- @Override
- protected TransactionalEditingDomain createEditingDomain() {
- // Already configured
- return editingDomain;
- }
-
- /**
- * @generated
- */
- @Override
- protected void configureDiagramEditDomain() {
- super.configureDiagramEditDomain();
- getDiagramEditDomain().getDiagramCommandStack().addCommandStackListener(new CommandStackListener() {
-
- public void commandStackChanged(EventObject event) {
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
- });
- }
-
- /**
- * @generated
- */
- @Override
- public void doSave(IProgressMonitor progressMonitor) {
- // The saving of the resource is done by the CoreMultiDiagramEditor
- savedOperation = getOperationHistory().getUndoOperation(getUndoContext());
- }
-
- /**
- * @generated
- */
- @Override
- public boolean isDirty() {
- IUndoableOperation op = getOperationHistory().getUndoOperation(getUndoContext());
- return savedOperation != op;
- }
-
- /**
- * @generated
- */
- public void providerChanged(ProviderChangeEvent event) {
- // update the palette if the palette service has changed
- if(PapyrusPaletteService.getInstance().equals(event.getSource())) {
- PapyrusPaletteService.getInstance().updatePalette(getPaletteViewer().getPaletteRoot(), this, getDefaultPaletteContent());
- }
- }
-
- /**
- * @generated
- */
- @Override
- public void dispose() {
- // remove palette service listener
- // remove preference listener
- PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
-
- super.dispose();
- }
-
- /**
- * @generated
- */
- protected PaletteViewer getPaletteViewer() {
- return getEditDomain().getPaletteViewer();
- }
-
- /**
- * @generated
- */
- @Override
- protected PaletteViewer constructPaletteViewer() {
- return new PapyrusPaletteViewer();
- }
-
- /**
- * @generated
- */
- @Override
- protected PaletteViewerProvider createPaletteViewerProvider() {
- getEditDomain().setPaletteRoot(createPaletteRoot(null));
- return new PaletteViewerProvider(getEditDomain()) {
-
- /**
- * Override to provide the additional behavior for the tools. Will intialize with a
- * PaletteEditPartFactory that has a TrackDragger that understand how to handle the
- * mouseDoubleClick event for shape creation tools. Also will initialize the palette
- * with a defaultTool that is the SelectToolEx that undestands how to handle the enter
- * key which will result in the creation of the shape also.
- */
- protected void configurePaletteViewer(PaletteViewer viewer) {
- super.configurePaletteViewer(viewer);
-
- // customize menu...
- viewer.setContextMenu(new PapyrusPaletteContextMenuProvider(viewer));
-
- viewer.getKeyHandler().setParent(getPaletteKeyHandler());
- viewer.getControl().addMouseListener(getPaletteMouseListener());
-
- // Add a transfer drag target listener that is supported on
- // palette template entries whose template is a creation tool.
- // This will enable drag and drop of the palette shape creation
- // tools.
- viewer.addDragSourceListener(new PaletteToolTransferDragSourceListener(viewer));
- viewer.setCustomizer(createPaletteCustomizer());
- }
-
- public PaletteViewer createPaletteViewer(Composite parent) {
- PaletteViewer pViewer = constructPaletteViewer();
- pViewer.createControl(parent);
- configurePaletteViewer(pViewer);
- hookPaletteViewer(pViewer);
- return pViewer;
- }
-
- /**
- * @return Palette Key Handler for the palette
- */
- private KeyHandler getPaletteKeyHandler() {
-
- if(paletteKeyHandler == null) {
-
- paletteKeyHandler = new KeyHandler() {
-
- /**
- * Processes a <i>key released </i> event. This method is called by the Tool
- * whenever a key is released, and the Tool is in the proper state. Override
- * to support pressing the enter key to create a shape or connection
- * (between two selected shapes)
- *
- * @param event
- * the KeyEvent
- * @return <code>true</code> if KeyEvent was handled in some way
- */
- public boolean keyReleased(KeyEvent event) {
-
- if(event.keyCode == SWT.Selection) {
-
- Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if(toolSupportsAccessibility(tool)) {
-
- tool.keyUp(event, getDiagramGraphicalViewer());
-
- // deactivate current selection
- getPaletteViewer().setActiveTool(null);
-
- return true;
- }
-
- }
- return super.keyReleased(event);
- }
-
- };
-
- }
- return paletteKeyHandler;
- }
-
- /**
- * @return Palette Mouse listener for the palette
- */
- private MouseListener getPaletteMouseListener() {
-
- if(paletteMouseListener == null) {
-
- paletteMouseListener = new MouseListener() {
-
- /**
- * Flag to indicate that the current active tool should be cleared after a
- * mouse double-click event.
- */
- private boolean clearActiveTool = false;
-
- /**
- * Override to support double-clicking a palette tool entry to create a
- * shape or connection (between two selected shapes).
- *
- * @see MouseListener#mouseDoubleClick(MouseEvent)
- */
- public void mouseDoubleClick(MouseEvent e) {
- Tool tool = getPaletteViewer().getActiveTool().createTool();
-
- if(toolSupportsAccessibility(tool)) {
-
- tool.setViewer(getDiagramGraphicalViewer());
- tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain());
- tool.mouseDoubleClick(e, getDiagramGraphicalViewer());
-
- // Current active tool should be deactivated,
- // but if it is down here it will get
- // reactivated deep in GEF palette code after
- // receiving mouse up events.
- clearActiveTool = true;
- }
- }
-
- public void mouseDown(MouseEvent e) {
- // do nothing
- }
-
- public void mouseUp(MouseEvent e) {
- // Deactivate current active tool here if a
- // double-click was handled.
- if(clearActiveTool) {
- getPaletteViewer().setActiveTool(null);
- clearActiveTool = false;
- }
-
- }
- };
-
- }
- return paletteMouseListener;
- }
-
- };
- }
-
- /**
- * @generated
- */
- @Override
- public GraphicalViewer getGraphicalViewer() {
- return super.getGraphicalViewer();
- }
-
- /**
- * @generated
- */
- @Override
- protected void initializeGraphicalViewer() {
- super.initializeGraphicalViewer();
-
- // Enable Drop
- getDiagramGraphicalViewer().addDropTargetListener(new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) {
-
- @Override
- protected Object getJavaObject(TransferData data) {
- return LocalSelectionTransfer.getTransfer().nativeToJava(data);
- }
-
- @Override
- protected TransactionalEditingDomain getTransactionalEditingDomain() {
- return getEditingDomain();
- }
- });
-
- }
-
- /**
- * @generated
- */
- @Override
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if(getSite().getPage().getActiveEditor() instanceof IMultiDiagramEditor) {
- IMultiDiagramEditor editor = (IMultiDiagramEditor)getSite().getPage().getActiveEditor();
- // If not the active editor, ignore selection changed.
- if(this.equals(editor.getActiveEditor())) {
- updateActions(getSelectionActions());
- super.selectionChanged(part, selection);
- } else {
- super.selectionChanged(part, selection);
- }
- } else {
- super.selectionChanged(part, selection);
- }
- // from
- // org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.selectionChanged(IWorkbenchPart,
- // ISelection)
- if(part == this) {
- rebuildStatusLine();
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorPlugin.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorPlugin.java
deleted file mode 100644
index 5b4bbbc846f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorPlugin.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.Activator;
-import org.eclipse.papyrus.resource.provider.ResourceItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.activities.provider.ActivitiesItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.allocations.provider.AllocationsItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.blocks.provider.BlocksItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.constraints.provider.ConstraintsItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlBaseItemSemanticEditPolicy;
-import org.eclipse.papyrus.sysml.diagram.parametric.preferences.DiagramPreferenceInitializer;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.ElementInitializers;
-import org.eclipse.papyrus.sysml.modelelements.provider.ModelelementsItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.portandflows.provider.PortandflowsItemProviderAdapterFactory;
-import org.eclipse.papyrus.sysml.requirements.provider.RequirementsItemProviderAdapterFactory;
-import org.eclipse.papyrus.uml.standard.provider.StandardItemProviderAdapterFactory;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * @generated
- */
-public class SysmlDiagramEditorPlugin extends AbstractUIPlugin {
-
- /**
- * @generated
- */
- public static final String ID = "org.eclipse.papyrus.sysml.diagram.parametric"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
-
- /**
- * @generated
- */
- private static SysmlDiagramEditorPlugin instance;
-
- /**
- * @generated
- */
- private ComposedAdapterFactory adapterFactory;
-
- /**
- * @generated
- */
- private SysmlDocumentProvider documentProvider;
-
- /**
- * @generated
- */
- private SysmlBaseItemSemanticEditPolicy.LinkConstraints linkConstraints;
-
- /**
- * @generated
- */
- private ElementInitializers initializers;
-
- /**
- * @generated
- */
- public SysmlDiagramEditorPlugin() {
- }
-
- /**
- * @generated
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- instance = this;
- PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
- adapterFactory = createAdapterFactory();
- DiagramPreferenceInitializer diagramPreferenceInitializer = new DiagramPreferenceInitializer();
- diagramPreferenceInitializer.initializeDefaultPreferences();
- }
-
- /**
- * @generated
- */
- public void stop(BundleContext context) throws Exception {
- adapterFactory.dispose();
- adapterFactory = null;
- linkConstraints = null;
- initializers = null;
- instance = null;
- super.stop(context);
- }
-
- /**
- * @generated
- */
- public static SysmlDiagramEditorPlugin getInstance() {
- return instance;
- }
-
- /**
- * @generated
- */
- public IPreferenceStore getPreferenceStore() {
- IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- return store;
- }
-
- /**
- * @generated
- */
- protected ComposedAdapterFactory createAdapterFactory() {
- ArrayList<AdapterFactory> factories = new ArrayList<AdapterFactory>();
- fillItemProviderFactories(factories);
- return new ComposedAdapterFactory(factories);
- }
-
- /**
- * @generated NOT
- */
- protected void fillItemProviderFactories(List factories) {
- // factories.add(new SysmlItemProviderAdapterFactory());
- factories.add(new ModelelementsItemProviderAdapterFactory());
- factories.add(new BlocksItemProviderAdapterFactory());
- factories.add(new PortandflowsItemProviderAdapterFactory());
- factories.add(new ConstraintsItemProviderAdapterFactory());
- factories.add(new ActivitiesItemProviderAdapterFactory());
- factories.add(new AllocationsItemProviderAdapterFactory());
- factories.add(new RequirementsItemProviderAdapterFactory());
- // factories.add(new InteractionsItemProviderAdapterFactory());
- // factories.add(new StatemachinesItemProviderAdapterFactory());
- // factories.add(new UsecasesItemProviderAdapterFactory());
- factories.add(new EcoreItemProviderAdapterFactory());
- factories.add(new StandardItemProviderAdapterFactory());
- factories.add(new UMLItemProviderAdapterFactory());
- factories.add(new ResourceItemProviderAdapterFactory());
- factories.add(new org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory());
- factories.add(new ReflectiveItemProviderAdapterFactory());
- }
-
- /**
- * @generated
- */
- public AdapterFactory getItemProvidersAdapterFactory() {
- return adapterFactory;
- }
-
- /**
- * @generated
- */
- public ImageDescriptor getItemImageDescriptor(Object item) {
- IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(item, IItemLabelProvider.class);
- if(labelProvider != null) {
- return ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(item));
- }
- return null;
- }
-
- /**
- * Returns an image descriptor for the image file at the given plug-in relative path.
- *
- * @generated
- * @param path
- * the path
- * @return the image descriptor
- */
- public static ImageDescriptor getBundledImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
- }
-
- /**
- * Respects images residing in any plug-in. If path is relative, then this bundle is looked up
- * for the image, otherwise, for absolute path, first segment is taken as id of plug-in with
- * image
- *
- * @generated
- * @param path
- * the path to image, either absolute (with plug-in id as first segment), or relative
- * for bundled images
- * @return the image descriptor
- */
- public static ImageDescriptor findImageDescriptor(String path) {
- final IPath p = new Path(path);
- if(p.isAbsolute() && p.segmentCount() > 1) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p.removeFirstSegments(1).makeAbsolute().toString());
- } else {
- return getBundledImageDescriptor(p.makeAbsolute().toString());
- }
- }
-
- /**
- * Returns an image for the image file at the given plug-in relative path. Client do not need to
- * dispose this image. Images will be disposed automatically.
- *
- * @generated
- * @param path
- * the path
- * @return image instance
- */
- public Image getBundledImage(String path) {
- Image image = getImageRegistry().get(path);
- if(image == null) {
- getImageRegistry().put(path, getBundledImageDescriptor(path));
- image = getImageRegistry().get(path);
- }
- return image;
- }
-
- /**
- * Returns string from plug-in's resource bundle
- *
- * @generated
- */
- public static String getString(String key) {
- return Platform.getResourceString(getInstance().getBundle(), "%" + key); //$NON-NLS-1$
- }
-
- /**
- * @generated
- */
- public SysmlDocumentProvider getDocumentProvider() {
- if(documentProvider == null) {
- documentProvider = new SysmlDocumentProvider();
- }
- return documentProvider;
- }
-
- /**
- * @generated
- */
- public SysmlBaseItemSemanticEditPolicy.LinkConstraints getLinkConstraints() {
- return linkConstraints;
- }
-
- /**
- * @generated
- */
- public void setLinkConstraints(SysmlBaseItemSemanticEditPolicy.LinkConstraints lc) {
- this.linkConstraints = lc;
- }
-
- /**
- * @generated
- */
- public ElementInitializers getElementInitializers() {
- return initializers;
- }
-
- /**
- * @generated
- */
- public void setElementInitializers(ElementInitializers i) {
- this.initializers = i;
- }
-
- /**
- * @generated
- */
- public void logError(String error) {
- logError(error, null);
- }
-
- /**
- * @generated
- */
- public void logError(String error, Throwable throwable) {
- if(error == null && throwable != null) {
- error = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, IStatus.OK, error, throwable));
- debug(error, throwable);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message) {
- logInfo(message, null);
- }
-
- /**
- * @generated
- */
- public void logInfo(String message, Throwable throwable) {
- if(message == null && throwable != null) {
- message = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.INFO, SysmlDiagramEditorPlugin.ID, IStatus.OK, message, throwable));
- debug(message, throwable);
- }
-
- /**
- * @generated
- */
- private void debug(String message, Throwable throwable) {
- if(!isDebugging()) {
- return;
- }
- if(message != null) {
- System.err.println(message);
- }
- if(throwable != null) {
- throwable.printStackTrace();
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java
deleted file mode 100644
index 12598f3753b..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.papyrus.resource.ResourceFactory;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class SysmlDiagramEditorUtil {
-
- /**
- * @generated
- */
- public static Map<?, ?> getSaveOptions() {
- HashMap<String, Object> saveOptions = new HashMap<String, Object>();
- saveOptions.put(XMLResource.OPTION_ENCODING, "UTF-8"); //$NON-NLS-1$
- saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
- return saveOptions;
- }
-
- /**
- * @generated
- */
- public static boolean openDiagram(Resource diagram) throws PartInitException {
- String path = diagram.getURI().toPlatformString(true);
- IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
- if(workspaceResource instanceof IFile) {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- return null != page.openEditor(new FileEditorInput((IFile)workspaceResource), SysmlDiagramEditor.ID);
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static void setCharset(IFile file) {
- if(file == null) {
- return;
- }
- try {
- file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$
- } catch (CoreException e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static String getUniqueFileName(IPath containerFullPath, String fileName, String extension) {
- if(containerFullPath == null) {
- containerFullPath = new Path(""); //$NON-NLS-1$
- }
- if(fileName == null || fileName.trim().length() == 0) {
- fileName = "default"; //$NON-NLS-1$
- }
- IPath filePath = containerFullPath.append(fileName);
- if(extension != null && !extension.equals(filePath.getFileExtension())) {
- filePath = filePath.addFileExtension(extension);
- }
- extension = filePath.getFileExtension();
- fileName = filePath.removeFileExtension().lastSegment();
- int i = 1;
- while(ResourcesPlugin.getWorkspace().getRoot().exists(filePath)) {
- i++;
- filePath = containerFullPath.append(fileName + i);
- if(extension != null) {
- filePath = filePath.addFileExtension(extension);
- }
- }
- return filePath.lastSegment();
- }
-
- /**
- * Runs the wizard in a dialog.
- *
- * @generated
- */
- public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
- IDialogSettings pluginDialogSettings = SysmlDiagramEditorPlugin.getInstance().getDialogSettings();
- IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
- if(wizardDialogSettings == null) {
- wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
- }
- wizard.setDialogSettings(wizardDialogSettings);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
- dialog.open();
- }
-
- /**
- * This method should be called within a workspace modify operation since it creates resources.
- *
- * @generated
- */
- public static Resource createDiagram(URI diagramURI, URI modelURI, IProgressMonitor progressMonitor) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- progressMonitor.beginTask(Messages.SysmlDiagramEditorUtil_CreateDiagramProgressTask, 3);
- final Resource diagramResource = editingDomain.getResourceSet().createResource(diagramURI);
- final Resource modelResource = editingDomain.getResourceSet().createResource(modelURI);
- final String diagramName = diagramURI.lastSegment();
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, Messages.SysmlDiagramEditorUtil_CreateDiagramCommandLabel, Collections.EMPTY_LIST) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- org.eclipse.papyrus.resource.Resource model = createInitialModel();
- attachModelToResource(model, modelResource);
-
- Diagram diagram = ViewService.createDiagram(model, ParametricEditPart.MODEL_ID, SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- if(diagram != null) {
- diagramResource.getContents().add(diagram);
- diagram.setName(diagramName);
- diagram.setElement(model);
- }
-
- try {
- modelResource.save(org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorUtil.getSaveOptions());
- diagramResource.save(org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorUtil.getSaveOptions());
- } catch (IOException e) {
-
- SysmlDiagramEditorPlugin.getInstance().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$
- }
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new SubProgressMonitor(progressMonitor, 1), null);
- } catch (ExecutionException e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
- }
- setCharset(WorkspaceSynchronizer.getFile(modelResource));
- setCharset(WorkspaceSynchronizer.getFile(diagramResource));
- return diagramResource;
- }
-
- /**
- * Create a new instance of domain element associated with canvas.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @generated
- */
- private static org.eclipse.papyrus.resource.Resource createInitialModel() {
- return ResourceFactory.eINSTANCE.createResource();
- }
-
- /**
- * Store model element in the resource.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- private static void attachModelToResource(org.eclipse.papyrus.resource.Resource model, Resource resource) {
- resource.getContents().add(model);
- }
-
- /**
- * @generated
- */
- public static void selectElementsInDiagram(IDiagramWorkbenchPart diagramPart, List<EditPart> editParts) {
- diagramPart.getDiagramGraphicalViewer().deselectAll();
-
- EditPart firstPrimary = null;
- for(EditPart nextPart : editParts) {
- diagramPart.getDiagramGraphicalViewer().appendSelection(nextPart);
- if(firstPrimary == null && nextPart instanceof IPrimaryEditPart) {
- firstPrimary = nextPart;
- }
- }
-
- if(!editParts.isEmpty()) {
- diagramPart.getDiagramGraphicalViewer().reveal(firstPrimary != null ? firstPrimary : (EditPart)editParts.get(0));
- }
- }
-
- /**
- * @generated
- */
- private static int findElementsInDiagramByID(DiagramEditPart diagramPart, EObject element, List<EditPart> editPartCollector) {
- IDiagramGraphicalViewer viewer = (IDiagramGraphicalViewer)diagramPart.getViewer();
- final int intialNumOfEditParts = editPartCollector.size();
-
- if(element instanceof View) { // support notation element lookup
- EditPart editPart = (EditPart)viewer.getEditPartRegistry().get(element);
- if(editPart != null) {
- editPartCollector.add(editPart);
- return 1;
- }
- }
-
- String elementID = EMFCoreUtil.getProxyID(element);
- @SuppressWarnings("unchecked")
- List<EditPart> associatedParts = viewer.findEditPartsForElement(elementID, IGraphicalEditPart.class);
- // perform the possible hierarchy disjoint -> take the top-most parts only
- for(EditPart nextPart : associatedParts) {
- EditPart parentPart = nextPart.getParent();
- while(parentPart != null && !associatedParts.contains(parentPart)) {
- parentPart = parentPart.getParent();
- }
- if(parentPart == null) {
- editPartCollector.add(nextPart);
- }
- }
-
- if(intialNumOfEditParts == editPartCollector.size()) {
- if(!associatedParts.isEmpty()) {
- editPartCollector.add(associatedParts.get(0));
- } else {
- if(element.eContainer() != null) {
- return findElementsInDiagramByID(diagramPart, element.eContainer(), editPartCollector);
- }
- }
- }
- return editPartCollector.size() - intialNumOfEditParts;
- }
-
- /**
- * @generated
- */
- public static View findView(DiagramEditPart diagramEditPart, EObject targetElement, LazyElement2ViewMap lazyElement2ViewMap) {
- boolean hasStructuralURI = false;
- if(targetElement.eResource() instanceof XMLResource) {
- hasStructuralURI = ((XMLResource)targetElement.eResource()).getID(targetElement) == null;
- }
-
- View view = null;
- LinkedList<EditPart> editPartHolder = new LinkedList<EditPart>();
- if(hasStructuralURI && !lazyElement2ViewMap.getElement2ViewMap().isEmpty()) {
- view = lazyElement2ViewMap.getElement2ViewMap().get(targetElement);
- } else if(findElementsInDiagramByID(diagramEditPart, targetElement, editPartHolder) > 0) {
- EditPart editPart = editPartHolder.get(0);
- view = editPart.getModel() instanceof View ? (View)editPart.getModel() : null;
- }
-
- return (view == null) ? diagramEditPart.getDiagramView() : view;
- }
-
- /**
- * @generated
- */
- public static class LazyElement2ViewMap {
-
- /**
- * @generated
- */
- private Map<EObject, View> element2ViewMap;
-
- /**
- * @generated
- */
- private View scope;
-
- /**
- * @generated
- */
- private Set<? extends EObject> elementSet;
-
- /**
- * @generated
- */
- public LazyElement2ViewMap(View scope, Set<? extends EObject> elements) {
- this.scope = scope;
- this.elementSet = elements;
- }
-
- /**
- * @generated
- */
- public final Map<EObject, View> getElement2ViewMap() {
- if(element2ViewMap == null) {
- element2ViewMap = new HashMap<EObject, View>();
- // map possible notation elements to itself as these can't be found by view.getElement()
- for(EObject element : elementSet) {
- if(element instanceof View) {
- View view = (View)element;
- if(view.getDiagram() == scope.getDiagram()) {
- element2ViewMap.put(element, view); // take only those that part of our diagram
- }
- }
- }
-
- buildElement2ViewMap(scope, element2ViewMap, elementSet);
- }
- return element2ViewMap;
- }
-
- /**
- * @generated
- */
- private static boolean buildElement2ViewMap(View parentView, Map<EObject, View> element2ViewMap, Set<? extends EObject> elements) {
- if(elements.size() == element2ViewMap.size()) {
- return true;
- }
-
- if(parentView.isSetElement() && !element2ViewMap.containsKey(parentView.getElement()) && elements.contains(parentView.getElement())) {
- element2ViewMap.put(parentView.getElement(), parentView);
- if(elements.size() == element2ViewMap.size()) {
- return true;
- }
- }
- boolean complete = false;
- for(Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- for(Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- for(Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete;) {
- complete = buildElement2ViewMap((View)it.next(), element2ViewMap, elements);
- }
- return complete;
- }
- } // LazyElement2ViewMap
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdateCommand.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdateCommand.java
deleted file mode 100644
index 8e3daafffa6..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdateCommand.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.IHandlerListener;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @generated
- */
-public class SysmlDiagramUpdateCommand implements IHandler {
-
- /**
- * @generated
- */
- public void addHandlerListener(IHandlerListener handlerListener) {
- }
-
- /**
- * @generated
- */
- public void dispose() {
- }
-
- /**
- * @generated
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
- if(structuredSelection.size() != 1) {
- return null;
- }
- if(structuredSelection.getFirstElement() instanceof EditPart && ((EditPart)structuredSelection.getFirstElement()).getModel() instanceof View) {
- EObject modelElement = ((View)((EditPart)structuredSelection.getFirstElement()).getModel()).getElement();
- List editPolicies = CanonicalEditPolicy.getRegisteredEditPolicies(modelElement);
- for(Iterator it = editPolicies.iterator(); it.hasNext();) {
- CanonicalEditPolicy nextEditPolicy = (CanonicalEditPolicy)it.next();
- nextEditPolicy.refresh();
- }
-
- }
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean isEnabled() {
- return true;
- }
-
- /**
- * @generated
- */
- public boolean isHandled() {
- return true;
- }
-
- /**
- * @generated
- */
- public void removeHandlerListener(IHandlerListener handlerListener) {
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java
deleted file mode 100644
index 665a576ade9..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.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.common.util.EList;
-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.resource.util.ResourceUtil;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class SysmlDiagramUpdater {
-
- /**
- * @generated
- */
- public static List<SysmlNodeDescriptor> getSemanticChildren(View view) {
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ParametricEditPart.VISUAL_ID:
- return getResource_1000SemanticChildren(view);
- case ConstraintPropertyEditPart.VISUAL_ID:
- return getConstraintProperty_2003SemanticChildren(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated NOT
- */
- public static List getConstraintProperty_2003SemanticChildren(View view) {
- if(!view.isSetElement()) {
- return Collections.EMPTY_LIST;
- }
- ConstraintProperty modelElement = (ConstraintProperty)view.getElement();
- List result = new LinkedList();
- {
- Property childElement = modelElement.getBase_Property();
- int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
- if(visualID == Property2EditPart.VISUAL_ID) {
- result.add(new SysmlNodeDescriptor(childElement, visualID));
- }
- }
- return result;
- /*
- * if (!view.isSetElement()) { return Collections.EMPTY_LIST; } ConstraintProperty
- * modelElement = (ConstraintProperty) view.getElement(); List result = new LinkedList();
- *
- * Object oclRuleResult = OCLUtils.runOclRule("self.base_Property.type", modelElement); if
- * (oclRuleResult != null) { if (oclRuleResult instanceof StructuredClassifier) {
- * StructuredClassifier aClass = (StructuredClassifier) oclRuleResult; for (Iterator it =
- * aClass.getAttributes().iterator(); it.hasNext();) { Property childElement = (Property)
- * it.next(); int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement); if
- * (visualID == Property2EditPart.VISUAL_ID) { result.add(new
- * SysmlNodeDescriptor(childElement, visualID)); //continue; } } } else { throw new
- * UnsupportedOperationException("Can't access with ..."); } }
- */
- }
-
- /**
- * @generated NOT
- */
- public static List getResource_1000SemanticChildren(View view) {
- if(!view.isSetElement()) {
- return Collections.EMPTY_LIST;
- }
- List result = new LinkedList();
- EObject eObject = view.getElement();
- // element is a block
- if(eObject instanceof Class) {
- Class modelElement = (Class)eObject;
- // we get the papyrus resource from the model object
- EList<EObject> eobjects = ResourceUtil.getResource(modelElement).getEobjects();
- for(Iterator it = eobjects.iterator(); it.hasNext();) {
- EObject childElement = (EObject)it.next();
- int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, (EObject)childElement);
- if(visualID == ConstraintPropertyEditPart.VISUAL_ID) {
- result.add(new SysmlNodeDescriptor((EObject)childElement, visualID));
- continue;
- }
- }
- for(Iterator it = modelElement.getOwnedAttributes().iterator(); it.hasNext();) {
- EObject obj = (EObject)it.next();
- if(obj instanceof Property) {
- Property childElement = (Property)obj;
- int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
- if((visualID == PropertyEditPart.VISUAL_ID) && (childElement.getAppliedStereotype("SysML::Constraints::ConstraintProperty") == null)) {
- result.add(new SysmlNodeDescriptor(childElement, visualID));
- continue;
- }
- }
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getContainedLinks(View view) {
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ParametricEditPart.VISUAL_ID:
- return getResource_1000ContainedLinks(view);
- case ConstraintPropertyEditPart.VISUAL_ID:
- return getConstraintProperty_2003ContainedLinks(view);
- case PropertyEditPart.VISUAL_ID:
- return getProperty_2005ContainedLinks(view);
- case Property2EditPart.VISUAL_ID:
- return getProperty_3002ContainedLinks(view);
- case ConnectorEditPart.VISUAL_ID:
- return getConnector_4001ContainedLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getIncomingLinks(View view) {
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ConstraintPropertyEditPart.VISUAL_ID:
- return getConstraintProperty_2003IncomingLinks(view);
- case PropertyEditPart.VISUAL_ID:
- return getProperty_2005IncomingLinks(view);
- case Property2EditPart.VISUAL_ID:
- return getProperty_3002IncomingLinks(view);
- case ConnectorEditPart.VISUAL_ID:
- return getConnector_4001IncomingLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getOutgoingLinks(View view) {
- switch(SysmlVisualIDRegistry.getVisualID(view)) {
- case ConstraintPropertyEditPart.VISUAL_ID:
- return getConstraintProperty_2003OutgoingLinks(view);
- case PropertyEditPart.VISUAL_ID:
- return getProperty_2005OutgoingLinks(view);
- case Property2EditPart.VISUAL_ID:
- return getProperty_3002OutgoingLinks(view);
- case ConnectorEditPart.VISUAL_ID:
- return getConnector_4001OutgoingLinks(view);
- }
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getResource_1000ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getConstraintProperty_2003ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getProperty_2005ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getProperty_3002ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getConnector_4001ContainedLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getConstraintProperty_2003IncomingLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getProperty_2005IncomingLinks(View view) {
- Property modelElement = (Property)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<SysmlLinkDescriptor> result = new LinkedList<SysmlLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Connector_4001(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getProperty_3002IncomingLinks(View view) {
- Property modelElement = (Property)view.getElement();
- Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer.find(view.eResource().getResourceSet().getResources());
- LinkedList<SysmlLinkDescriptor> result = new LinkedList<SysmlLinkDescriptor>();
- result.addAll(getIncomingTypeModelFacetLinks_Connector_4001(modelElement, crossReferences));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getConnector_4001IncomingLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getConstraintProperty_2003OutgoingLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getProperty_2005OutgoingLinks(View view) {
- Property modelElement = (Property)view.getElement();
- LinkedList<SysmlLinkDescriptor> result = new LinkedList<SysmlLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Connector_4001(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getProperty_3002OutgoingLinks(View view) {
- Property modelElement = (Property)view.getElement();
- LinkedList<SysmlLinkDescriptor> result = new LinkedList<SysmlLinkDescriptor>();
- result.addAll(getOutgoingTypeModelFacetLinks_Connector_4001(modelElement));
- return result;
- }
-
- /**
- * @generated
- */
- public static List<SysmlLinkDescriptor> getConnector_4001OutgoingLinks(View view) {
- return Collections.emptyList();
- }
-
- /**
- * @generated NOT
- */
- private static Collection getIncomingTypeModelFacetLinks_Connector_4001(ConnectableElement 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.getConnectorEnd_Role() || false == setting.getEObject() instanceof ConnectorEnd) {
- continue;
- }
- ConnectorEnd connectorEnd = (ConnectorEnd)setting.getEObject();
- Connector link = (Connector)connectorEnd.getOwner();
- if(ConnectorEditPart.VISUAL_ID != SysmlVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
- ConnectableElement src = null;
- EList<ConnectorEnd> ends = link.getEnds();
- if(ends != null && !ends.isEmpty()) {
- src = ends.get(0).getRole();
- }
- result.add(new SysmlLinkDescriptor(src, target, link, SysmlElementTypes.Connector_4001, ConnectorEditPart.VISUAL_ID));
- }
- return result;
- }
-
- /**
- * @generated NOT
- */
- private static Collection getOutgoingTypeModelFacetLinks_Connector_4001(ConnectableElement source) {
- StructuredClassifier 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 StructuredClassifier) {
- container = (StructuredClassifier)element;
- }
- }
- if(container == null) {
- return Collections.EMPTY_LIST;
- }
- Collection result = new LinkedList();
- for(Iterator links = container.getOwnedConnectors().iterator(); links.hasNext();) {
- EObject linkObject = (EObject)links.next();
- if(false == linkObject instanceof Connector) {
- continue;
- }
- Connector link = (Connector)linkObject;
- if(ConnectorEditPart.VISUAL_ID != SysmlVisualIDRegistry.getLinkWithClassVisualID(link)) {
- continue;
- }
-
- ConnectableElement src = null;
- ConnectableElement dst = null;
- EList<ConnectorEnd> ends = link.getEnds();
- if(ends != null && !ends.isEmpty() && ends.size() > 1) {
- src = ends.get(0).getRole();
- dst = ends.get(1).getRole();
- }
-
- if(src != source) {
- continue;
- }
- result.add(new SysmlLinkDescriptor(src, dst, link, SysmlElementTypes.Connector_4001, ConnectorEditPart.VISUAL_ID));
-
- }
- return result;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDocumentProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDocumentProvider.java
deleted file mode 100644
index 3b0d09b93d1..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDocumentProvider.java
+++ /dev/null
@@ -1,988 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * @generated
- */
-public class SysmlDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider {
-
- /**
- * @generated
- */
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, NLS.bind(Messages.SysmlDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- IEditorInput editorInput = (IEditorInput)element;
- IDiagramDocument document = (IDiagramDocument)createDocument(editorInput);
-
- ResourceSetInfo info = new ResourceSetInfo(document, editorInput);
- info.setModificationStamp(computeModificationStamp(info));
- info.fStatus = null;
- return info;
- }
-
- /**
- * @generated
- */
- protected IDocument createDocument(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, NLS.bind(Messages.SysmlDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- IDocument document = createEmptyDocument();
- setDocumentContent(document, (IEditorInput)element);
- setupDocument(element, document);
- return document;
- }
-
- /**
- * Sets up the given document as it would be provided for the given element. The content of the
- * document is not changed. This default implementation is empty. Subclasses may reimplement.
- *
- * @param element
- * the blue-print element
- * @param document
- * the document to set up
- * @generated
- */
- protected void setupDocument(Object element, IDocument document) {
- // for subclasses
- }
-
- /**
- * @generated
- */
- private long computeModificationStamp(ResourceSetInfo info) {
- int result = 0;
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- if(file.getLocation() != null) {
- result += file.getLocation().toFile().lastModified();
- } else {
- result += file.getModificationStamp();
- }
- }
- }
- return result;
- }
-
- /**
- * @generated
- */
- protected IDocument createEmptyDocument() {
- DiagramDocument document = new DiagramDocument();
- document.setEditingDomain(createEditingDomain());
- return document;
- }
-
- /**
- * @generated
- */
- private TransactionalEditingDomain createEditingDomain() {
- TransactionalEditingDomain editingDomain = DiagramEditingDomainFactory.getInstance().createEditingDomain();
- editingDomain.setID("org.eclipse.papyrus.sysml.diagram.parametric.EditingDomain"); //$NON-NLS-1$
- final NotificationFilter diagramResourceModifiedFilter = NotificationFilter.createNotifierFilter(editingDomain.getResourceSet()).and(NotificationFilter.createEventTypeFilter(Notification.ADD)).and(NotificationFilter.createFeatureFilter(ResourceSet.class, ResourceSet.RESOURCE_SET__RESOURCES));
- editingDomain.getResourceSet().eAdapters().add(new Adapter() {
-
- private Notifier myTarger;
-
- public Notifier getTarget() {
- return myTarger;
- }
-
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
- public void notifyChanged(Notification notification) {
- if(diagramResourceModifiedFilter.matches(notification)) {
- Object value = notification.getNewValue();
- if(value instanceof Resource) {
- ((Resource)value).setTrackingModification(true);
- }
- }
- }
-
- public void setTarget(Notifier newTarget) {
- myTarger = newTarget;
- }
-
- });
-
- return editingDomain;
- }
-
- /**
- * @generated
- */
- protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
- TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
- if(element instanceof FileEditorInput) {
- IStorage storage = ((FileEditorInput)element).getStorage();
- Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor());
- document.setContent(diagram);
- } else if(element instanceof URIEditorInput) {
- URI uri = ((URIEditorInput)element).getURI();
- Resource resource = null;
- try {
- resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
- if(resource == null) {
- resource = domain.getResourceSet().createResource(uri.trimFragment());
- }
- if(!resource.isLoaded()) {
- try {
- Map options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
- // @see 171060
- // options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
- resource.load(options);
- } catch (IOException e) {
- resource.unload();
- throw e;
- }
- }
- if(uri.fragment() != null) {
- EObject rootElement = resource.getEObject(uri.fragment());
- if(rootElement instanceof Diagram) {
- document.setContent((Diagram)rootElement);
- return;
- }
- } else {
- for(Iterator it = resource.getContents().iterator(); it.hasNext();) {
- Object rootElement = it.next();
- if(rootElement instanceof Diagram) {
- document.setContent((Diagram)rootElement);
- return;
- }
- }
- }
- throw new RuntimeException(Messages.SysmlDocumentProvider_NoDiagramInResourceError);
- } catch (Exception e) {
- CoreException thrownExcp = null;
- if(e instanceof CoreException) {
- thrownExcp = (CoreException)e;
- } else {
- String msg = e.getLocalizedMessage();
- thrownExcp = new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, msg != null ? msg : Messages.SysmlDocumentProvider_DiagramLoadingError, e));
- }
- throw thrownExcp;
- }
- } else {
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, NLS.bind(Messages.SysmlDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- }
-
- /**
- * @generated
- */
- public long getModificationStamp(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- return computeModificationStamp(info);
- }
- return super.getModificationStamp(element);
- }
-
- /**
- * @generated
- */
- public boolean isDeleted(Object element) {
- IDiagramDocument document = getDiagramDocument(element);
- if(document != null) {
- Resource diagramResource = document.getDiagram().eResource();
- if(diagramResource != null) {
- IFile file = WorkspaceSynchronizer.getFile(diagramResource);
- return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
- }
- }
- return super.isDeleted(element);
- }
-
- /**
- * @generated
- */
- public ResourceSetInfo getResourceSetInfo(Object editorInput) {
- return (ResourceSetInfo)super.getElementInfo(editorInput);
- }
-
- /**
- * @generated
- */
- protected void disposeElementInfo(Object element, ElementInfo info) {
- if(info instanceof ResourceSetInfo) {
- ResourceSetInfo resourceSetInfo = (ResourceSetInfo)info;
- resourceSetInfo.dispose();
- }
- super.disposeElementInfo(element, info);
- }
-
- /**
- * @generated
- */
- protected void doValidateState(Object element, Object computationContext) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<IFile> files2Validate = new LinkedList<IFile>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
- files2Validate.add(file);
- }
- }
- ResourcesPlugin.getWorkspace().validateEdit((IFile[])files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
- }
-
- super.doValidateState(element, computationContext);
- }
-
- /**
- * @generated
- */
- public boolean isReadOnly(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- SysmlDiagramEditorPlugin.getInstance().logError(Messages.SysmlDocumentProvider_isModifiable, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
- }
- }
- return info.isReadOnly();
- }
- return super.isReadOnly(element);
- }
-
- /**
- * @generated
- */
- public boolean isModifiable(Object element) {
- if(!isStateValidated(element)) {
- if(element instanceof FileEditorInput || element instanceof URIEditorInput) {
- return true;
- }
- }
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- SysmlDiagramEditorPlugin.getInstance().logError(Messages.SysmlDocumentProvider_isModifiable, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.StorageDocumentProvider_isModifiable
- }
- }
- return info.isModifiable();
- }
- return super.isModifiable(element);
- }
-
- /**
- * @generated
- */
- protected void updateCache(Object element) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
- info.setReadOnly(true);
- info.setModifiable(false);
- return;
- }
- }
- info.setReadOnly(false);
- info.setModifiable(true);
- return;
- }
- }
-
- /**
- * @generated
- */
- protected void doUpdateStateCache(Object element) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- info.setUpdateCache(true);
- }
- super.doUpdateStateCache(element);
- }
-
- /**
- * @generated
- */
- public boolean isSynchronized(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- return info.isSynchronized();
- }
- return super.isSynchronized(element);
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getResetRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getSaveRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(computeSchedulingRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getSynchronizeRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> rules = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ISchedulingRule getValidateStateRule(Object element) {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- LinkedList<ISchedulingRule> files = new LinkedList<ISchedulingRule>();
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- files.add(file);
- }
- }
- return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule((IFile[])files.toArray(new IFile[files.size()]));
- }
- return null;
- }
-
- /**
- * @generated
- */
- private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if(toCreateOrModify.exists())
- return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
-
- IResource parent = toCreateOrModify;
- do {
- /*
- * XXX This is a workaround for
- * https://bugs.eclipse.org/bugs/show_bug.cgi?id=67601
- * IResourceRuleFactory.createRule should iterate the hierarchy
- * itself.
- */
- toCreateOrModify = parent;
- parent = toCreateOrModify.getParent();
- } while(parent != null && !parent.exists());
-
- return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
- }
-
- /**
- * @generated
- */
- protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- handleElementChanged(info, nextResource, monitor);
- }
- return;
- }
- super.doSynchronize(element, monitor);
- }
-
- /**
- * @generated
- */
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- ResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(!overwrite && !info.isSynchronized()) {
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, Messages.SysmlDocumentProvider_UnsynchronizedFileSaveError, null));
- }
- info.stopResourceListening();
- fireElementStateChanging(element);
- try {
- monitor.beginTask(Messages.SysmlDocumentProvider_SaveDiagramTask, info.getResourceSet().getResources().size() + 1); //"Saving diagram"
- for(Iterator<Resource> it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = it.next();
- monitor.setTaskName(NLS.bind(Messages.SysmlDocumentProvider_SaveNextResourceTask, nextResource.getURI()));
- if(nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
- try {
- nextResource.save(SysmlDiagramEditorUtil.getSaveOptions());
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, EditorStatusCodes.RESOURCE_FAILURE, e.getLocalizedMessage(), null));
- }
- }
- monitor.worked(1);
- }
- monitor.done();
- info.setModificationStamp(computeModificationStamp(info));
- } catch (RuntimeException x) {
- fireElementStateChangeFailed(element);
- throw x;
- } finally {
- info.startResourceListening();
- }
- } else {
- URI newResoruceURI;
- List<IFile> affectedFiles = null;
- if(element instanceof FileEditorInput) {
- IFile newFile = ((FileEditorInput)element).getFile();
- affectedFiles = Collections.singletonList(newFile);
- newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true);
- } else if(element instanceof URIEditorInput) {
- newResoruceURI = ((URIEditorInput)element).getURI();
- } else {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, NLS.bind(Messages.SysmlDocumentProvider_IncorrectInputError, new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- if(false == document instanceof IDiagramDocument) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
- final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
- final Diagram diagramCopy = (Diagram)EcoreUtil.copy(diagramDocument.getDiagram());
- try {
- new AbstractTransactionalCommand(diagramDocument.getEditingDomain(), NLS.bind(Messages.SysmlDocumentProvider_SaveAsOperation, diagramCopy.getName()), affectedFiles) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- newResource.getContents().add(diagramCopy);
- return CommandResult.newOKCommandResult();
- }
- }.execute(monitor, null);
- newResource.save(SysmlDiagramEditorUtil.getSaveOptions());
- } catch (ExecutionException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, SysmlDiagramEditorPlugin.ID, 0, e.getLocalizedMessage(), null));
- }
- newResource.unload();
- }
- }
-
- /**
- * @generated
- */
- protected void handleElementChanged(ResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
- IFile file = WorkspaceSynchronizer.getFile(changedResource);
- if(file != null) {
- try {
- file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- } catch (CoreException ex) {
- SysmlDiagramEditorPlugin.getInstance().logError(Messages.SysmlDocumentProvider_handleElementContentChanged, ex);
- // Error message to log was initially taken from org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.internal.l10n.EditorMessages.FileDocumentProvider_handleElementContentChanged
- }
- }
- changedResource.unload();
-
- fireElementContentAboutToBeReplaced(info.getEditorInput());
- removeUnchangedElementListeners(info.getEditorInput(), info);
- info.fStatus = null;
- try {
- setDocumentContent(info.fDocument, info.getEditorInput());
- } catch (CoreException e) {
- info.fStatus = e.getStatus();
- }
- if(!info.fCanBeSaved) {
- info.setModificationStamp(computeModificationStamp(info));
- }
- addUnchangedElementListeners(info.getEditorInput(), info);
- fireElementContentReplaced(info.getEditorInput());
- }
-
- /**
- * @generated
- */
- protected void handleElementMoved(IEditorInput input, URI uri) {
- if(input instanceof FileEditorInput) {
- IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1));
- fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile));
- return;
- }
- // TODO: append suffix to the URI! (use diagram as a parameter)
- fireElementMoved(input, new URIEditorInput(uri));
- }
-
- /**
- * @generated
- */
- public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
- return editorInput;
- }
-
- /**
- * @generated
- */
- public IDiagramDocument getDiagramDocument(Object element) {
- IDocument doc = getDocument(element);
- if(doc instanceof IDiagramDocument) {
- return (IDiagramDocument)doc;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- return null;
- }
-
- /**
- * @generated
- */
- protected class ResourceSetInfo extends ElementInfo {
-
- /**
- * @generated
- */
- private long myModificationStamp = IResource.NULL_STAMP;
-
- /**
- * @generated
- */
- private WorkspaceSynchronizer mySynchronizer;
-
- /**
- * @generated
- */
- private LinkedList<Resource> myUnSynchronizedResources = new LinkedList<Resource>();
-
- /**
- * @generated
- */
- private IDiagramDocument myDocument;
-
- /**
- * @generated
- */
- private IEditorInput myEditorInput;
-
- /**
- * @generated
- */
- private boolean myUpdateCache = true;
-
- /**
- * @generated
- */
- private boolean myModifiable = false;
-
- /**
- * @generated
- */
- private boolean myReadOnly = true;
-
- /**
- * @generated
- */
- private ResourceSetModificationListener myResourceSetListener;
-
- /**
- * @generated
- */
- public ResourceSetInfo(IDiagramDocument document, IEditorInput editorInput) {
- super(document);
- myDocument = document;
- myEditorInput = editorInput;
- startResourceListening();
- myResourceSetListener = new ResourceSetModificationListener(this);
- getResourceSet().eAdapters().add(myResourceSetListener);
- }
-
- /**
- * @generated
- */
- public long getModificationStamp() {
- return myModificationStamp;
- }
-
- /**
- * @generated
- */
- public void setModificationStamp(long modificationStamp) {
- myModificationStamp = modificationStamp;
- }
-
- /**
- * @generated
- */
- public TransactionalEditingDomain getEditingDomain() {
- return myDocument.getEditingDomain();
- }
-
- /**
- * @generated
- */
- public ResourceSet getResourceSet() {
- return getEditingDomain().getResourceSet();
- }
-
- /**
- * @generated
- */
- public Iterator<Resource> getLoadedResourcesIterator() {
- return new ArrayList<Resource>(getResourceSet().getResources()).iterator();
- }
-
- /**
- * @generated
- */
- public IEditorInput getEditorInput() {
- return myEditorInput;
- }
-
- /**
- * @generated
- */
- public void dispose() {
- stopResourceListening();
- getResourceSet().eAdapters().remove(myResourceSetListener);
- for(Iterator<Resource> it = getLoadedResourcesIterator(); it.hasNext();) {
- Resource resource = it.next();
- resource.unload();
- }
- getEditingDomain().dispose();
- }
-
- /**
- * @generated
- */
- public boolean isSynchronized() {
- return myUnSynchronizedResources.size() == 0;
- }
-
- /**
- * @generated
- */
- public void setUnSynchronized(Resource resource) {
- myUnSynchronizedResources.add(resource);
- }
-
- /**
- * @generated
- */
- public void setSynchronized(Resource resource) {
- myUnSynchronizedResources.remove(resource);
- }
-
- /**
- * @generated
- */
- public final void stopResourceListening() {
- mySynchronizer.dispose();
- mySynchronizer = null;
- }
-
- /**
- * @generated
- */
- public final void startResourceListening() {
- mySynchronizer = new WorkspaceSynchronizer(getEditingDomain(), new SynchronizerDelegate());
- }
-
- /**
- * @generated
- */
- public boolean isUpdateCache() {
- return myUpdateCache;
- }
-
- /**
- * @generated
- */
- public void setUpdateCache(boolean update) {
- myUpdateCache = update;
- }
-
- /**
- * @generated
- */
- public boolean isModifiable() {
- return myModifiable;
- }
-
- /**
- * @generated
- */
- public void setModifiable(boolean modifiable) {
- myModifiable = modifiable;
- }
-
- /**
- * @generated
- */
- public boolean isReadOnly() {
- return myReadOnly;
- }
-
- /**
- * @generated
- */
- public void setReadOnly(boolean readOnly) {
- myReadOnly = readOnly;
- }
-
- /**
- * @generated
- */
- private class SynchronizerDelegate implements WorkspaceSynchronizer.Delegate {
-
- /**
- * @generated
- */
- public void dispose() {
- }
-
- /**
- * @generated
- */
- public boolean handleResourceChanged(final Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- handleElementChanged(ResourceSetInfo.this, resource, null);
- }
- });
- return true;
- }
-
- /**
- * @generated
- */
- public boolean handleResourceDeleted(Resource resource) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- fireElementDeleted(ResourceSetInfo.this.getEditorInput());
- }
- });
- return true;
- }
-
- /**
- * @generated
- */
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- synchronized(ResourceSetInfo.this) {
- if(ResourceSetInfo.this.fCanBeSaved) {
- ResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- if(myDocument.getDiagram().eResource() == resource) {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- handleElementMoved(ResourceSetInfo.this.getEditorInput(), newURI);
- }
- });
- } else {
- handleResourceDeleted(resource);
- }
- return true;
- }
-
- }
-
- }
-
- /**
- * @generated
- */
- private class ResourceSetModificationListener extends EContentAdapter {
-
- /**
- * @generated
- */
- private NotificationFilter myModifiedFilter;
-
- /**
- * @generated
- */
- private ResourceSetInfo myInfo;
-
- /**
- * @generated
- */
- public ResourceSetModificationListener(ResourceSetInfo info) {
- myInfo = info;
- myModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)).and(NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED));
- }
-
- /**
- * @generated
- */
- public void notifyChanged(Notification notification) {
- if(notification.getNotifier() instanceof ResourceSet) {
- super.notifyChanged(notification);
- }
- if(!notification.isTouch() && myModifiedFilter.matches(notification)) {
- if(notification.getNotifier() instanceof Resource) {
- Resource resource = (Resource)notification.getNotifier();
- if(resource.isLoaded()) {
- boolean modified = false;
- for(Iterator/* <org.eclipse.emf.ecore.resource.Resource> */it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {
- Resource nextResource = (Resource)it.next();
- if(nextResource.isLoaded()) {
- modified = nextResource.isModified();
- }
- }
- boolean dirtyStateChanged = false;
- synchronized(myInfo) {
- if(modified != myInfo.fCanBeSaved) {
- myInfo.fCanBeSaved = modified;
- dirtyStateChanged = true;
- }
- if(!resource.isModified()) {
- myInfo.setSynchronized(resource);
- }
- }
- if(dirtyStateChanged) {
- fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
-
- if(!modified) {
- myInfo.setModificationStamp(computeModificationStamp(myInfo));
- }
- }
- }
- }
- }
- }
-
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlInitDiagramFileAction.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlInitDiagramFileAction.java
deleted file mode 100644
index d24c9252cfb..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlInitDiagramFileAction.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.WrappedException;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * @generated
- */
-public class SysmlInitDiagramFileAction implements IObjectActionDelegate {
-
- /**
- * @generated
- */
- private IWorkbenchPart targetPart;
-
- /**
- * @generated
- */
- private URI domainModelURI;
-
- /**
- * @generated
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- this.targetPart = targetPart;
- }
-
- /**
- * @generated
- */
- public void selectionChanged(IAction action, ISelection selection) {
- domainModelURI = null;
- action.setEnabled(false);
- if(selection instanceof IStructuredSelection == false || selection.isEmpty()) {
- return;
- }
- IFile file = (IFile)((IStructuredSelection)selection).getFirstElement();
- domainModelURI = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
- action.setEnabled(true);
- }
-
- /**
- * @generated
- */
- private Shell getShell() {
- return targetPart.getSite().getShell();
- }
-
- /**
- * @generated
- */
- public void run(IAction action) {
- TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain();
- ResourceSet resourceSet = editingDomain.getResourceSet();
- EObject diagramRoot = null;
- try {
- Resource resource = resourceSet.getResource(domainModelURI, true);
- diagramRoot = (EObject)resource.getContents().get(0);
- } catch (WrappedException ex) {
- SysmlDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$
- }
- if(diagramRoot == null) {
- MessageDialog.openError(getShell(), Messages.InitDiagramFile_ResourceErrorDialogTitle, Messages.InitDiagramFile_ResourceErrorDialogMessage);
- return;
- }
- Wizard wizard = new SysmlNewDiagramFileWizard(domainModelURI, diagramRoot, editingDomain);
- wizard.setWindowTitle(NLS.bind(Messages.InitDiagramFile_WizardTitle, ParametricEditPart.MODEL_ID));
- SysmlDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlLinkDescriptor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlLinkDescriptor.java
deleted file mode 100644
index 099c42c3ac1..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlLinkDescriptor.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-
-/**
- * @generated
- */
-public class SysmlLinkDescriptor extends SysmlNodeDescriptor {
-
- /**
- * @generated
- */
- private EObject mySource;
-
- /**
- * @generated
- */
- private EObject myDestination;
-
- /**
- * @generated
- */
- private IAdaptable mySemanticAdapter;
-
- /**
- * @generated
- */
- private SysmlLinkDescriptor(EObject source, EObject destination, EObject linkElement, int linkVID) {
- super(linkElement, linkVID);
- mySource = source;
- myDestination = destination;
- }
-
- /**
- * @generated
- */
- public SysmlLinkDescriptor(EObject source, EObject destination, IElementType elementType, int linkVID) {
- this(source, destination, (EObject)null, linkVID);
- final IElementType elementTypeCopy = elementType;
- mySemanticAdapter = new IAdaptable() {
-
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return null;
- }
- };
- }
-
- /**
- * @generated
- */
- public SysmlLinkDescriptor(EObject source, EObject destination, EObject linkElement, IElementType elementType, int linkVID) {
- this(source, destination, linkElement, linkVID);
- final IElementType elementTypeCopy = elementType;
- mySemanticAdapter = new EObjectAdapter(linkElement) {
-
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementTypeCopy;
- }
- return super.getAdapter(adapter);
- }
- };
- }
-
- /**
- * @generated
- */
- public EObject getSource() {
- return mySource;
- }
-
- /**
- * @generated
- */
- public EObject getDestination() {
- return myDestination;
- }
-
- /**
- * @generated
- */
- public IAdaptable getSemanticAdapter() {
- return mySemanticAdapter;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlMatchingStrategy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlMatchingStrategy.java
deleted file mode 100644
index 67bdb8b2dd2..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlMatchingStrategy.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorMatchingStrategy;
-import org.eclipse.ui.IEditorReference;
-import org.eclipse.ui.PartInitException;
-
-/**
- * @generated
- */
-public class SysmlMatchingStrategy implements IEditorMatchingStrategy {
-
- /**
- * @generated
- */
- public boolean matches(IEditorReference editorRef, IEditorInput input) {
- IEditorInput editorInput;
- try {
- editorInput = editorRef.getEditorInput();
- } catch (PartInitException e) {
- return false;
- }
-
- if(editorInput.equals(input)) {
- return true;
- }
- if(editorInput instanceof URIEditorInput && input instanceof URIEditorInput) {
- return ((URIEditorInput)editorInput).getURI().equals(((URIEditorInput)input).getURI());
- }
- return false;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlNewDiagramFileWizard.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlNewDiagramFileWizard.java
deleted file mode 100644
index 665d8cbe43f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlNewDiagramFileWizard.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.io.IOException;
-import java.util.LinkedList;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.OperationHistoryFactory;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-
-/**
- * @generated
- */
-public class SysmlNewDiagramFileWizard extends Wizard {
-
- /**
- * @generated
- */
- private WizardNewFileCreationPage myFileCreationPage;
-
- /**
- * @generated
- */
- private ModelElementSelectionPage diagramRootElementSelectionPage;
-
- /**
- * @generated
- */
- private TransactionalEditingDomain myEditingDomain;
-
- /**
- * @generated
- */
- public SysmlNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot, TransactionalEditingDomain editingDomain) {
- assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$
- assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$
- assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$
-
- myFileCreationPage = new WizardNewFileCreationPage(Messages.SysmlNewDiagramFileWizard_CreationPageName, StructuredSelection.EMPTY);
- myFileCreationPage.setTitle(Messages.SysmlNewDiagramFileWizard_CreationPageTitle);
- myFileCreationPage.setDescription(NLS.bind(Messages.SysmlNewDiagramFileWizard_CreationPageDescription, ParametricEditPart.MODEL_ID));
- IPath filePath;
- String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
- if(domainModelURI.isPlatformResource()) {
- filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
- } else if(domainModelURI.isFile()) {
- filePath = new Path(domainModelURI.trimSegments(1).toFileString());
- } else {
- // TODO : use some default path
- throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$
- }
- myFileCreationPage.setContainerFullPath(filePath);
- myFileCreationPage.setFileName(SysmlDiagramEditorUtil.getUniqueFileName(filePath, fileName, "sysml_diagram")); //$NON-NLS-1$
-
- diagramRootElementSelectionPage = new DiagramRootElementSelectionPage(Messages.SysmlNewDiagramFileWizard_RootSelectionPageName);
- diagramRootElementSelectionPage.setTitle(Messages.SysmlNewDiagramFileWizard_RootSelectionPageTitle);
- diagramRootElementSelectionPage.setDescription(Messages.SysmlNewDiagramFileWizard_RootSelectionPageDescription);
- diagramRootElementSelectionPage.setModelElement(diagramRoot);
-
- myEditingDomain = editingDomain;
- }
-
- /**
- * @generated
- */
- public void addPages() {
- addPage(myFileCreationPage);
- addPage(diagramRootElementSelectionPage);
- }
-
- /**
- * @generated
- */
- public boolean performFinish() {
- LinkedList<IFile> affectedFiles = new LinkedList<IFile>();
- IFile diagramFile = myFileCreationPage.createNewFile();
- SysmlDiagramEditorUtil.setCharset(diagramFile);
- affectedFiles.add(diagramFile);
- URI diagramModelURI = URI.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
- ResourceSet resourceSet = myEditingDomain.getResourceSet();
- final Resource diagramResource = resourceSet.createResource(diagramModelURI);
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, Messages.SysmlNewDiagramFileWizard_InitDiagramCommand, affectedFiles) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- int diagramVID = SysmlVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement());
- if(diagramVID != ParametricEditPart.VISUAL_ID) {
- return CommandResult.newErrorCommandResult(Messages.SysmlNewDiagramFileWizard_IncorrectRootError);
- }
- Diagram diagram = ViewService.createDiagram(diagramRootElementSelectionPage.getModelElement(), ParametricEditPart.MODEL_ID, SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
- diagramResource.getContents().add(diagram);
- return CommandResult.newOKCommandResult();
- }
- };
- try {
- OperationHistoryFactory.getOperationHistory().execute(command, new NullProgressMonitor(), null);
- diagramResource.save(SysmlDiagramEditorUtil.getSaveOptions());
- SysmlDiagramEditorUtil.openDiagram(diagramResource);
- } catch (ExecutionException e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Unable to create model and diagram", e); //$NON-NLS-1$
- } catch (IOException ex) {
- SysmlDiagramEditorPlugin.getInstance().logError("Save operation failed for: " + diagramModelURI, ex); //$NON-NLS-1$
- } catch (PartInitException ex) {
- SysmlDiagramEditorPlugin.getInstance().logError("Unable to open editor", ex); //$NON-NLS-1$
- }
- return true;
- }
-
- /**
- * @generated
- */
- private static class DiagramRootElementSelectionPage extends ModelElementSelectionPage {
-
- /**
- * @generated
- */
- protected DiagramRootElementSelectionPage(String pageName) {
- super(pageName);
- }
-
- /**
- * @generated
- */
- protected String getSelectionTitle() {
- return Messages.SysmlNewDiagramFileWizard_RootSelectionPageSelectionTitle;
- }
-
- /**
- * @generated
- */
- protected boolean validatePage() {
- if(selectedModelElement == null) {
- setErrorMessage(Messages.SysmlNewDiagramFileWizard_RootSelectionPageNoSelectionMessage);
- return false;
- }
- boolean result = ViewService.getInstance().provides(new CreateDiagramViewOperation(new EObjectAdapter(selectedModelElement), ParametricEditPart.MODEL_ID, SysmlDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT));
- setErrorMessage(result ? null : Messages.SysmlNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage);
- return result;
- }
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlNodeDescriptor.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlNodeDescriptor.java
deleted file mode 100644
index cd2274b0853..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlNodeDescriptor.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * @generated
- */
-public class SysmlNodeDescriptor {
-
- /**
- * @generated
- */
- private final EObject myModelElement;
-
- /**
- * @generated
- */
- private final int myVisualID;
-
- /**
- * @generated
- */
- public SysmlNodeDescriptor(EObject modelElement, int visualID) {
- myModelElement = modelElement;
- myVisualID = visualID;
- }
-
- /**
- * @generated
- */
- public EObject getModelElement() {
- return myModelElement;
- }
-
- /**
- * @generated
- */
- public int getVisualID() {
- return myVisualID;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlPaletteFactory.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlPaletteFactory.java
deleted file mode 100644
index aa83177f224..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlPaletteFactory.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.Tool;
-import org.eclipse.gmf.runtime.diagram.ui.services.palette.PaletteFactory;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
-import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
-
-/**
- * @generated
- */
-public class SysmlPaletteFactory extends PaletteFactory.Adapter {
-
- /**
- * @generated
- */
- private final static String CREATECONSTRAINTPROPERTY1CREATIONTOOL = "createConstraintProperty1CreationTool"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String CREATEPROPERTY2CREATIONTOOL = "createProperty2CreationTool"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- private final static String CREATECONNECTOR3CREATIONTOOL = "createConnector3CreationTool"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public SysmlPaletteFactory() {
-
- }
-
- /**
- * @generated
- */
- public Tool createTool(String toolId) {
- if(toolId.equals(CREATECONSTRAINTPROPERTY1CREATIONTOOL)) {
- return createConstraintProperty1CreationTool();
- }
- if(toolId.equals(CREATEPROPERTY2CREATIONTOOL)) {
- return createProperty2CreationTool();
- }
- if(toolId.equals(CREATECONNECTOR3CREATIONTOOL)) {
- return createConnector3CreationTool();
- }
-
- // default return: null
- return null;
- }
-
- public Object getTemplate(String templateId) {
-
- // default return: null
- return null;
- }
-
- /**
- * @generated
- */
- private Tool createConstraintProperty1CreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(SysmlElementTypes.ConstraintProperty_2003);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createProperty2CreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(2);
- types.add(SysmlElementTypes.Property_3002);
- types.add(SysmlElementTypes.Property_2005);
-
- Tool tool = new AspectUnspecifiedTypeCreationTool(types);
- return tool;
- }
-
- /**
- * @generated
- */
- private Tool createConnector3CreationTool() {
- List<IElementType> types = new ArrayList<IElementType>(1);
- types.add(SysmlElementTypes.Connector_4001);
-
- Tool tool = new AspectUnspecifiedTypeConnectionTool(types);
- return tool;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlUriEditorInputTester.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlUriEditorInputTester.java
deleted file mode 100644
index f2a612d3103..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlUriEditorInputTester.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.emf.common.ui.URIEditorInput;
-
-/**
- * @generated
- */
-public class SysmlUriEditorInputTester extends PropertyTester {
-
- /**
- * @generated
- */
- public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
- if(false == receiver instanceof URIEditorInput) {
- return false;
- }
- URIEditorInput editorInput = (URIEditorInput)receiver;
- return "sysml_diagram".equals(editorInput.getURI().fileExtension()); //$NON-NLS-1$
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java
deleted file mode 100644
index 26e18ffed28..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java
+++ /dev/null
@@ -1,283 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.resource.Resource;
-import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintLabelEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart;
-import org.eclipse.papyrus.uml.diagram.common.providers.BaseViewInfo;
-import org.eclipse.papyrus.uml.diagram.common.providers.ViewInfo;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This registry is used to determine which type of visual object should be created for the
- * corresponding Diagram, Node, ChildNode or Link represented by a domain model object.
- *
- * @generated
- */
-public class SysmlVisualIDRegistry {
-
- /**
- * @generated
- */
- private static final String DEBUG_KEY = "org.eclipse.papyrus.sysml.diagram.parametric/debug/visualID"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static int getVisualID(View view) {
- if(view instanceof Diagram) {
- if(ParametricEditPart.MODEL_ID.equals(view.getType())) {
- return ParametricEditPart.VISUAL_ID;
- } else {
- return -1;
- }
- }
- return org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry.getVisualID(view.getType());
- }
-
- /**
- * @generated
- */
- public static String getModelID(View view) {
- View diagram = view.getDiagram();
- while(view != diagram) {
- EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
- if(annotation != null) {
- return (String)annotation.getDetails().get("modelID"); //$NON-NLS-1$
- }
- view = (View)view.eContainer();
- }
- return diagram != null ? diagram.getType() : null;
- }
-
- /**
- * @generated
- */
- public static int getVisualID(String type) {
- try {
- return Integer.parseInt(type);
- } catch (NumberFormatException e) {
- if(Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) {
- SysmlDiagramEditorPlugin.getInstance().logError("Unable to parse view type as a visualID number: " + type);
- }
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static String getType(int visualID) {
- return Integer.toString(visualID);
- }
-
- /**
- * @generated NOT
- */
- public static int getDiagramVisualID(EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- // test if it is a class for the parametric diagram
- if(UMLPackage.eINSTANCE.getClass_().equals(domainElement.eClass())) {
- return ParametricEditPart.VISUAL_ID;
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static int getNodeVisualID(View containerView, EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- String containerModelID = org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry.getModelID(containerView);
- if(!ParametricEditPart.MODEL_ID.equals(containerModelID)) {
- return -1;
- }
- int containerVisualID;
- if(ParametricEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry.getVisualID(containerView);
- } else {
- if(containerView instanceof Diagram) {
- containerVisualID = ParametricEditPart.VISUAL_ID;
- } else {
- return -1;
- }
- }
- switch(containerVisualID) {
- case ParametricEditPart.VISUAL_ID:
- if(ConstraintsPackage.eINSTANCE.getConstraintProperty().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ConstraintPropertyEditPart.VISUAL_ID;
- }
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return PropertyEditPart.VISUAL_ID;
- }
- break;
- case ConstraintPropertyEditPart.VISUAL_ID:
- if(UMLPackage.eINSTANCE.getProperty().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return Property2EditPart.VISUAL_ID;
- }
- break;
- }
- return -1;
- }
-
- /**
- * @generated
- */
- public static boolean canCreateNode(View containerView, int nodeVisualID) {
- String containerModelID = org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry.getModelID(containerView);
- if(!ParametricEditPart.MODEL_ID.equals(containerModelID)) {
- return false;
- }
- int containerVisualID;
- if(ParametricEditPart.MODEL_ID.equals(containerModelID)) {
- containerVisualID = org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry.getVisualID(containerView);
- } else {
- if(containerView instanceof Diagram) {
- containerVisualID = ParametricEditPart.VISUAL_ID;
- } else {
- return false;
- }
- }
- switch(containerVisualID) {
- case ParametricEditPart.VISUAL_ID:
- if(ConstraintPropertyEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(PropertyEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ConstraintPropertyEditPart.VISUAL_ID:
- if(ConstraintPropertyNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(ConstraintLabelEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- if(Property2EditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case PropertyEditPart.VISUAL_ID:
- if(PropertyNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case Property2EditPart.VISUAL_ID:
- if(PropertyName2EditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- case ConnectorEditPart.VISUAL_ID:
- if(ConnectorNameEditPart.VISUAL_ID == nodeVisualID) {
- return true;
- }
- break;
- }
- return false;
- }
-
- /**
- * @generated
- */
- public static int getLinkWithClassVisualID(EObject domainElement) {
- if(domainElement == null) {
- return -1;
- }
- if(UMLPackage.eINSTANCE.getConnector().isSuperTypeOf(domainElement.eClass())
-
- ) {
- return ConnectorEditPart.VISUAL_ID;
- }
- return -1;
- }
-
- /**
- * User can change implementation of this method to handle some specific situations not covered
- * by default logic.
- *
- * @generated
- */
- private static boolean isDiagram(Resource element) {
- return true;
- }
-
- /**
- * @generated
- */
- private static ViewInfo diagramViewInfo = null;
-
- /**
- * @generated
- */
- public static ViewInfo getDiagramViewInfo() {
- if(diagramViewInfo == null) {
- diagramViewInfo = getResource_1000ViewInfo();
- }
- return diagramViewInfo;
- }
-
- /**
- * @generated
- */
- protected static ViewInfo getResource_1000ViewInfo() {
- ViewInfo root = new BaseViewInfo(1000, ViewInfo.Head, "", null, null);
- ViewInfo viewInfo = null;
- ViewInfo labelInfo = null;
-
- viewInfo = new BaseViewInfo(2003, ViewInfo.Node, "ConstraintProperty");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(2005, ViewInfo.Node, "Property");
- root.addNode(1000, viewInfo);
-
- viewInfo = new BaseViewInfo(4001, ViewInfo.Edge, "");
- root.addNode(1000, viewInfo);
-
- labelInfo = new BaseViewInfo(6001, ViewInfo.Label, "", null, viewInfo);
- viewInfo.getChildren().add(labelInfo);
-
- viewInfo = new BaseViewInfo(3002, ViewInfo.Node, "Property");
-
- root.addNode(2003, viewInfo);
-
- return root;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/ValidateAction.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/ValidateAction.java
deleted file mode 100644
index eeb491b040f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/ValidateAction.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.part;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.Diagnostician;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.emf.validation.model.EvaluationMode;
-import org.eclipse.emf.validation.model.IConstraintStatus;
-import org.eclipse.emf.validation.service.IBatchValidator;
-import org.eclipse.emf.validation.service.ModelValidationService;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlMarkerNavigationProvider;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlValidationProvider;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
-
-/**
- * @generated
- */
-public class ValidateAction extends Action {
-
- /**
- * @generated
- */
- private IWorkbenchPage page;
-
- /**
- * @generated
- */
- public ValidateAction(IWorkbenchPage page) {
- setText(Messages.ValidateActionMessage);
- this.page = page;
- }
-
- /**
- * @generated
- */
- public void run() {
- IWorkbenchPart workbenchPart = page.getActivePart();
- if(workbenchPart instanceof IDiagramWorkbenchPart) {
- final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart)workbenchPart;
- try {
- new WorkspaceModifyDelegatingOperation(new IRunnableWithProgress() {
-
- public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
- runValidation(part.getDiagramEditPart(), part.getDiagram());
- }
- }).run(new NullProgressMonitor());
- } catch (Exception e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Validation action failed", e); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * @generated
- */
- public static void runValidation(View view) {
- try {
- if(SysmlDiagramEditorUtil.openDiagram(view.eResource())) {
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editorPart instanceof IDiagramWorkbenchPart) {
- runValidation(((IDiagramWorkbenchPart)editorPart).getDiagramEditPart(), view);
- } else {
- runNonUIValidation(view);
- }
- }
- } catch (Exception e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Validation action failed", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static void runNonUIValidation(View view) {
- DiagramEditPart diagramEditPart = OffscreenEditPartFactory.getInstance().createDiagramEditPart(view.getDiagram());
- runValidation(diagramEditPart, view);
- }
-
- /**
- * @generated
- */
- public static void runValidation(DiagramEditPart diagramEditPart, View view) {
- final DiagramEditPart fpart = diagramEditPart;
- final View fview = view;
- TransactionalEditingDomain txDomain = TransactionUtil.getEditingDomain(view);
- SysmlValidationProvider.runWithConstraints(txDomain, new Runnable() {
-
- public void run() {
- validate(fpart, fview);
- }
- });
- }
-
- /**
- * @generated
- */
- private static Diagnostic runEMFValidator(View target) {
- if(target.isSetElement() && target.getElement() != null) {
- return new Diagnostician() {
-
- public String getObjectLabel(EObject eObject) {
- return EMFCoreUtil.getQualifiedName(eObject, true);
- }
- }.validate(target.getElement());
- }
- return Diagnostic.OK_INSTANCE;
- }
-
- /**
- * @generated
- */
- private static void validate(DiagramEditPart diagramEditPart, View view) {
- IFile target = view.eResource() != null ? WorkspaceSynchronizer.getFile(view.eResource()) : null;
- if(target != null) {
- SysmlMarkerNavigationProvider.deleteMarkers(target);
- }
- Diagnostic diagnostic = runEMFValidator(view);
- createMarkers(target, diagnostic, diagramEditPart);
- IBatchValidator validator = (IBatchValidator)ModelValidationService.getInstance().newValidator(EvaluationMode.BATCH);
- validator.setIncludeLiveConstraints(true);
- if(view.isSetElement() && view.getElement() != null) {
- IStatus status = validator.validate(view.getElement());
- createMarkers(target, status, diagramEditPart);
- }
- }
-
- /**
- * @generated
- */
- private static void createMarkers(IFile target, IStatus validationStatus, DiagramEditPart diagramEditPart) {
- if(validationStatus.isOK()) {
- return;
- }
- final IStatus rootStatus = validationStatus;
- List allStatuses = new ArrayList();
- SysmlDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new SysmlDiagramEditorUtil.LazyElement2ViewMap(diagramEditPart.getDiagramView(), collectTargetElements(rootStatus, new HashSet<EObject>(), allStatuses));
- for(Iterator it = allStatuses.iterator(); it.hasNext();) {
- IConstraintStatus nextStatus = (IConstraintStatus)it.next();
- View view = SysmlDiagramEditorUtil.findView(diagramEditPart, nextStatus.getTarget(), element2ViewMap);
- addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view), EMFCoreUtil.getQualifiedName(nextStatus.getTarget(), true), nextStatus.getMessage(), nextStatus.getSeverity());
- }
- }
-
- /**
- * @generated
- */
- private static void createMarkers(IFile target, Diagnostic emfValidationStatus, DiagramEditPart diagramEditPart) {
- if(emfValidationStatus.getSeverity() == Diagnostic.OK) {
- return;
- }
- final Diagnostic rootStatus = emfValidationStatus;
- List allDiagnostics = new ArrayList();
- SysmlDiagramEditorUtil.LazyElement2ViewMap element2ViewMap = new SysmlDiagramEditorUtil.LazyElement2ViewMap(diagramEditPart.getDiagramView(), collectTargetElements(rootStatus, new HashSet<EObject>(), allDiagnostics));
- for(Iterator it = emfValidationStatus.getChildren().iterator(); it.hasNext();) {
- Diagnostic nextDiagnostic = (Diagnostic)it.next();
- List data = nextDiagnostic.getData();
- if(data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
- EObject element = (EObject)data.get(0);
- View view = SysmlDiagramEditorUtil.findView(diagramEditPart, element, element2ViewMap);
- addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view), EMFCoreUtil.getQualifiedName(element, true), nextDiagnostic.getMessage(), diagnosticToStatusSeverity(nextDiagnostic.getSeverity()));
- }
- }
- }
-
- /**
- * @generated
- */
- private static void addMarker(EditPartViewer viewer, IFile target, String elementId, String location, String message, int statusSeverity) {
- if(target == null) {
- return;
- }
- SysmlMarkerNavigationProvider.addMarker(target, elementId, location, message, statusSeverity);
- }
-
- /**
- * @generated
- */
- private static int diagnosticToStatusSeverity(int diagnosticSeverity) {
- if(diagnosticSeverity == Diagnostic.OK) {
- return IStatus.OK;
- } else if(diagnosticSeverity == Diagnostic.INFO) {
- return IStatus.INFO;
- } else if(diagnosticSeverity == Diagnostic.WARNING) {
- return IStatus.WARNING;
- } else if(diagnosticSeverity == Diagnostic.ERROR || diagnosticSeverity == Diagnostic.CANCEL) {
- return IStatus.ERROR;
- }
- return IStatus.INFO;
- }
-
- /**
- * @generated
- */
- private static Set<EObject> collectTargetElements(IStatus status, Set<EObject> targetElementCollector, List allConstraintStatuses) {
- if(status instanceof IConstraintStatus) {
- targetElementCollector.add(((IConstraintStatus)status).getTarget());
- allConstraintStatuses.add(status);
- }
- if(status.isMultiStatus()) {
- IStatus[] children = status.getChildren();
- for(int i = 0; i < children.length; i++) {
- collectTargetElements(children[i], targetElementCollector, allConstraintStatuses);
- }
- }
- return targetElementCollector;
- }
-
- /**
- * @generated
- */
- private static Set<EObject> collectTargetElements(Diagnostic diagnostic, Set<EObject> targetElementCollector, List allDiagnostics) {
- List data = diagnostic.getData();
- EObject target = null;
- if(data != null && !data.isEmpty() && data.get(0) instanceof EObject) {
- target = (EObject)data.get(0);
- targetElementCollector.add(target);
- allDiagnostics.add(diagnostic);
- }
- if(diagnostic.getChildren() != null && !diagnostic.getChildren().isEmpty()) {
- for(Iterator it = diagnostic.getChildren().iterator(); it.hasNext();) {
- collectTargetElements((Diagnostic)it.next(), targetElementCollector, allDiagnostics);
- }
- }
- return targetElementCollector;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDefaultSemanticEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDefaultSemanticEditPolicy.java
new file mode 100644
index 00000000000..f2018499f68
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDefaultSemanticEditPolicy.java
@@ -0,0 +1,94 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.provider.IGraphicalTypeRegistry;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.CustomGraphicalTypeRegistry;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.GraphicalTypeRegistry;
+import org.eclipse.papyrus.uml.diagram.composite.edit.commands.CommentAnnotatedElementCreateCommand;
+import org.eclipse.papyrus.uml.diagram.composite.edit.commands.CommentAnnotatedElementReorientCommand;
+import org.eclipse.papyrus.uml.diagram.composite.edit.commands.ConstraintConstrainedElementCreateCommand;
+import org.eclipse.papyrus.uml.diagram.composite.edit.commands.ConstraintConstrainedElementReorientCommand;
+import org.eclipse.papyrus.infra.services.edit.utils.RequestParameterConstants;
+
+/**
+ * <pre>
+ * Custom semantic edit policy that replace DefaultSemanticEditPolicy
+ * in order to manage Class Diagram specific elements (reference
+ * relationships COMMENT_ANNOTATED_ELEMENT and CONSTRAINT_CONSTRAINED_ELEMENT).
+ * </pre>
+ */
+public class CustomDefaultSemanticEditPolicy extends DefaultSemanticEditPolicy {
+
+ /** Local graphical type registry for graphical elements */
+ private IGraphicalTypeRegistry registry = new CustomGraphicalTypeRegistry();
+
+ /** Local graphical type registry for inherited graphical elements */
+ private IGraphicalTypeRegistry inheritedRegistry = new GraphicalTypeRegistry();
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+
+ if(ElementTypes.COMMENT_ANNOTATED_ELEMENT == req.getElementType()) {
+ return getGEFWrapper(new CommentAnnotatedElementCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+
+ if(ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT == req.getElementType()) {
+ return getGEFWrapper(new ConstraintConstrainedElementCreateCommand(req, req.getSource(), req.getTarget()));
+ }
+
+ String newEdgeGraphicalType = registry.getEdgeGraphicalType(req.getElementType());
+
+ if(inheritedRegistry.isKnownEdgeType(newEdgeGraphicalType)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ if(!registry.isKnownEdgeType(newEdgeGraphicalType)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ return super.getCreateRelationshipCommand(req);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getReorientReferenceRelationshipCommand(ReorientReferenceRelationshipRequest req) {
+
+ View reconnectedView = (View)req.getParameter(RequestParameterConstants.GRAPHICAL_RECONNECTED_EDGE);
+ String reconnectedViewType = (reconnectedView != null) ? reconnectedView.getType() : IGraphicalTypeRegistry.UNDEFINED_TYPE;
+
+ if(ElementTypes.COMMENT_ANNOTATED_ELEMENT.getSemanticHint().equals(reconnectedViewType)) {
+ return getGEFWrapper(new CommentAnnotatedElementReorientCommand(req));
+ }
+
+ if(ElementTypes.CONSTRAINT_CONSTRAINED_ELEMENT.getSemanticHint().equals(reconnectedViewType)) {
+ return getGEFWrapper(new ConstraintConstrainedElementReorientCommand(req));
+ }
+
+ return super.getReorientReferenceRelationshipCommand(req);
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDragDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDragDropEditPolicy.java
new file mode 100644
index 00000000000..cec8a5f41da
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomDragDropEditPolicy.java
@@ -0,0 +1,277 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.policies;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.CommonDiagramDragDropEditPolicy;
+import org.eclipse.papyrus.sysml.blocks.NestedConnectorEnd;
+import org.eclipse.papyrus.sysml.diagram.internalblock.dnd.helper.CustomLinkMappingHelper;
+import org.eclipse.papyrus.sysml.diagram.internalblock.provider.CustomGraphicalTypeRegistry;
+import org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils;
+import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.ConnectorEnd;
+import org.eclipse.uml2.uml.EncapsulatedClassifier;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/** Customization of the DND edit policy for the Internal Block Diagram */
+public class CustomDragDropEditPolicy extends CommonDiagramDragDropEditPolicy {
+
+ private ConnectorUtils utils = new ConnectorUtils();
+
+ /** Default constructor. */
+ public CustomDragDropEditPolicy() {
+ super(new CustomLinkMappingHelper());
+ registry = new CustomGraphicalTypeRegistry();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Set<String> getSpecificDropBehaviorTypes() {
+ Set<String> specificDropBehaviorTypes = new HashSet<String>();
+
+ specificDropBehaviorTypes.add(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID);
+
+ return specificDropBehaviorTypes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getSpecificDropCommand(DropObjectsRequest dropRequest, EObject droppedEObject, String nodeType, String edgeType) {
+ if((UMLGraphicalTypes.LINK_UML_CONNECTOR_ID.equals(edgeType)) && (droppedEObject instanceof Connector)) {
+ return getConnectorDropCommand(dropRequest, (Connector)droppedEObject, edgeType);
+ }
+
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ protected ICommand getConnectorDropCommand(DropObjectsRequest dropRequest, Connector droppedEObject, String edgeType) {
+
+ // Only manage binary link during drop
+ if(droppedEObject.getEnds().size() != 2) {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ ConnectorEnd source = droppedEObject.getEnds().get(0);
+ ConnectorEnd target = droppedEObject.getEnds().get(1);
+
+ // Find views in current diagram representing source and target
+ Collection<View> sourceViews = getViewsForConnectorEnd(source);
+ Collection<View> targetViews = getViewsForConnectorEnd(target);
+
+ IAdaptable sourceViewAdapter = null;
+ IAdaptable targetViewAdapter = null;
+
+ // If either a source or target lacks create view for these elements, abort...
+ if(sourceViews.isEmpty() || targetViews.isEmpty()) {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ View selectedSourceView = null;
+ View selectedTargetView = null;
+ // until a correct one is found, check that source and target views selected are correct given the current path for the connector...
+ for(View sourceView : sourceViews) {
+ View targetView = getFirstValidTargetViewForSource(sourceView, targetViews, droppedEObject);
+ if(targetView !=null) {
+ selectedSourceView = sourceView;
+ selectedTargetView = targetView;
+ break;
+ }
+ }
+
+
+ // Create source adapter
+ if(selectedSourceView!=null) { // sourceViewAdapter should still be null in this case
+ sourceViewAdapter = new SemanticAdapter(null, selectedSourceView);
+ } else {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ // Create target adapter
+ if(selectedTargetView!=null) { // targetViewAdapter should still be null in this case
+ targetViewAdapter = new SemanticAdapter(null, selectedTargetView);
+ } else {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ // Create a view for the dropped link between the source and target view adapters
+ IAdaptable droppedObjectAdapter = new SemanticAdapter(droppedEObject, null);
+
+ CreateConnectionViewRequest.ConnectionViewDescriptor linkdescriptor = new CreateConnectionViewRequest.ConnectionViewDescriptor(droppedObjectAdapter, edgeType, getDiagramPreferencesHint());
+
+ CommonDeferredCreateConnectionViewCommand createConnectionViewCommand = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), edgeType, sourceViewAdapter, targetViewAdapter, getViewer(), getDiagramPreferencesHint(), linkdescriptor, null);
+ createConnectionViewCommand.setElement(droppedEObject);
+
+ return createConnectionViewCommand;
+ }
+
+ /**
+ * get the first valid target view for the given source. the couple source/target is valid if the path to them from the future container is valid
+ * @param sourceView
+ * @param targetViews
+ * @return
+ */
+ private View getFirstValidTargetViewForSource(View sourceView, Collection<View> targetViews, Connector droppedConnector) {
+ for(View targetView : targetViews) {
+ if(isValidTargetViewForSource(sourceView, targetView, droppedConnector)) {
+ return targetView;
+ }
+ }
+
+ return null;
+ }
+
+ private boolean isValidTargetViewForSource(View sourceView, View targetView, Connector droppedConnector) {
+ if(!(utils.isCrossingEncapsulation(sourceView, targetView))) {
+ // no encapsulation. Computes the end paths
+ List<Property> sourceNestedPaths = utils.getNestedPropertyPath(sourceView, targetView);
+ List<Property> targetNestedPaths = utils.getNestedPropertyPath(targetView, sourceView);
+
+ // check this is compatible with current connector
+ ConnectorEnd sourceConnectorEnd = utils.getSourceConnectorEnd(droppedConnector);
+ NestedConnectorEnd nestedSourceConnectorEnd = UMLUtil.getStereotypeApplication(sourceConnectorEnd, NestedConnectorEnd.class);
+ if(nestedSourceConnectorEnd!=null) {
+ List<Property> currentSourceConnectorPropertyPath = nestedSourceConnectorEnd.getPropertyPath();
+ // compare the 2 list
+ if(!sourceNestedPaths.equals(currentSourceConnectorPropertyPath)) {
+ return false;
+ }
+
+ } else { // no end for the current connector, so the sourceNestedPath should be empty
+ if(!sourceNestedPaths.isEmpty()) {
+ return false;
+ }
+ }
+
+
+ ConnectorEnd targetConnectorEnd = utils.getTargetConnectorEnd(droppedConnector);
+ NestedConnectorEnd nestedTargetConnectorEnd = UMLUtil.getStereotypeApplication(targetConnectorEnd, NestedConnectorEnd.class);
+ if(nestedTargetConnectorEnd!=null) {
+ List<Property> currentTargetConnectorPropertyPath = nestedTargetConnectorEnd.getPropertyPath();
+ // compare the 2 list
+ if(!targetNestedPaths.equals(currentTargetConnectorPropertyPath)) {
+ return false;
+ }
+
+ } else { // no end for the current connector, so the targetNestedPaths should be empty
+ if(!targetNestedPaths.isEmpty()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ * This methods looks for views representing a given {@link ConnectorEnd} in the host diagram.
+ *
+ * @param end
+ * the {@link ConnectorEnd} to look for.
+ * @return the list of {@link View} representing the eObject.
+ */
+ protected Set<View> getViewsForConnectorEnd(ConnectorEnd end) {
+ Set<View> views = new HashSet<View>();
+
+ // Retrieve host diagram
+ View hostView = ((IGraphicalEditPart)getHost()).getNotationView();
+ View hostDiagram = (hostView instanceof Diagram) ? hostView : hostView.getDiagram();
+
+ // Retrieve all views for the ConnectorEnd role
+ EReference[] refs = { NotationPackage.eINSTANCE.getView_Element() };
+ @SuppressWarnings("unchecked")
+ Collection<View> relatedViews = EMFCoreUtil.getReferencers(end.getRole(), refs);
+
+ // TODO: We should filter views not only for the current diagram,
+ // but also consider only views nested within the owner of the connector that are closest to the host view
+ // (in case there are several instances of a Part within which the connector could appear).
+ // Connector connector = (Connector)end.getOwner();
+ // StructuredClassifier connectorOwner = (StructuredClassifier)connector.getOwner();
+ // Parse and select views from host diagram only
+ Iterator<View> it = relatedViews.iterator();
+ while(it.hasNext()) {
+ View currentView = it.next();
+ if(currentView.getDiagram() == hostDiagram) { // FIXME: Cf TODO above.
+
+ boolean isInView = false;
+ View containerView = currentView;
+ while(containerView != null && !(containerView instanceof Diagram)) {
+ if(containerView == getReferenceViewForConnectorEnd()) {
+ isInView = true;
+ }
+ containerView = ViewUtil.getContainerView(containerView);
+ }
+
+ if(isInView) {
+
+ EObject containerElement = ViewUtil.getContainerView(currentView).getElement();
+
+ // If the ConnectorEnd partWithPort is not null, only select Views for which
+ // the graphical parent reference partWithPort.
+ if(end.getPartWithPort() != null) {
+ if(containerElement == end.getPartWithPort()) {
+ views.add(currentView);
+ }
+ } else {
+ // If the role is a Port, its graphical parent is a EncapsulatedClassifier
+ if(end.getRole() instanceof Port) {
+ if(containerElement instanceof EncapsulatedClassifier) {
+ views.add(currentView);
+ } else if(containerElement instanceof Property) {
+ Property property = (Property)containerElement;
+ if(property.getType() == end.getRole().getOwner()) {
+ views.add(currentView);
+ }
+ }
+ } else { // No further test needed
+ views.add(currentView);
+ }
+
+ }
+ }
+ }
+ }
+
+ return views;
+ }
+
+ protected View getReferenceViewForConnectorEnd() {
+ return ((IGraphicalEditPart)getHost()).getNotationView();
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomParametricSemanticPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomParametricSemanticPolicy.java
new file mode 100644
index 00000000000..fe7adbbccb2
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/CustomParametricSemanticPolicy.java
@@ -0,0 +1,38 @@
+package org.eclipse.papyrus.sysml.diagram.parametric.policies;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintBlockPropertyCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.commands.CustomBindingConnectorCreateCommand;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockCompositeEditPartTN;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.policy.DiagramSemanticEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintParameterAffixedNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart;
+import org.eclipse.uml2.uml.UMLPackage;
+
+public class CustomParametricSemanticPolicy extends DiagramSemanticEditPolicy {
+
+ @Override
+ protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ if (req.getElementType().getEClass() == UMLPackage.eINSTANCE.getConnector()) {
+ if (getHost() instanceof CustomBlockCompositeEditPartTN) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (getHost() instanceof ConstraintBlockPropertyCompositeEditPart) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if (getHost() instanceof ConstraintParameterAffixedNodeEditPart) {
+ return getGEFWrapper(new CustomBindingConnectorCreateCommand(req));
+ }
+ if (getHost() instanceof PortAffixedNodeEditPart) {
+ return getGEFWrapper(new CustomBindingConnectorCreateCommand(req));
+ }
+ if (getHost() instanceof BlockPropertyCompositeEditPart) {
+ return getGEFWrapper(new CustomBindingConnectorCreateCommand(req));
+ }
+ }
+ return super.getCreateRelationshipCommand(req);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/StructureClassifierDropEditPolicy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/StructureClassifierDropEditPolicy.java
new file mode 100644
index 00000000000..94dd1a8a147
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/policies/StructureClassifierDropEditPolicy.java
@@ -0,0 +1,139 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.policies;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.SelectAndExecuteCommand;
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomDragDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.utils.BlockDropHelper;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * <pre>
+ * Customization of the DND edit policy for the StructureClassifier compartments, that enables the direct
+ * creation of typed Part, Reference, Value, ActorPart or Property by dragging types in a Block structure compartment.
+ * </pre>
+ */
+public class StructureClassifierDropEditPolicy extends CustomDragDropEditPolicy {
+
+ /** Default constructor */
+ public StructureClassifierDropEditPolicy() {
+ super();
+ }
+
+ /**
+ * {@inheritedDoc}.
+ */
+ @Override
+ public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
+
+ BlockDropHelper helper = new BlockDropHelper(getEditingDomain());
+
+ // Single drop management possible drop action list can be proposed
+ if(dropRequest.getObjects().size() == 1) {
+
+ // List of available drop commands
+ final List<Command> commandChoice = new ArrayList<Command>();
+
+ // 1. Try to create a Part typed by the dropped object
+ Command dropAsTypedPart = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart)getHost(), SysMLElementTypes.PART_PROPERTY);
+ if((dropAsTypedPart != null) && (dropAsTypedPart.canExecute())) {
+ commandChoice.add(dropAsTypedPart);
+ }
+
+ // 2. Try to create a Reference typed by the dropped object
+ Command dropAsTypedReference = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart)getHost(), SysMLElementTypes.REFERENCE_PROPERTY);
+ if((dropAsTypedReference != null) && (dropAsTypedReference.canExecute())) {
+ commandChoice.add(dropAsTypedReference);
+ }
+
+ // 3. Try to create an ActorPart typed by the dropped object
+ Command dropAsTypedActorPart = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart)getHost(), SysMLElementTypes.ACTOR_PART_PROPERTY);
+ if((dropAsTypedActorPart != null) && (dropAsTypedActorPart.canExecute())) {
+ commandChoice.add(dropAsTypedActorPart);
+ }
+
+ // 4. Try to create a Value typed by the dropped object
+ Command dropAsTypedValue = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart)getHost(), SysMLElementTypes.VALUE_PROPERTY);
+ if((dropAsTypedValue != null) && (dropAsTypedValue.canExecute())) {
+ commandChoice.add(dropAsTypedValue);
+ }
+
+ // 5. Try to create a Property typed by the dropped object
+ Command dropAsTypedProperty = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart)getHost(), UMLElementTypes.PROPERTY);
+ if((dropAsTypedProperty != null) && (dropAsTypedProperty.canExecute())) {
+ commandChoice.add(dropAsTypedProperty);
+ }
+
+ // 6. Try to create a ConstraintProperty typed by the dropped object
+ Command dropAsTypedConstraintProperty = helper.getDropAsStructureItem(dropRequest, (GraphicalEditPart)getHost(), SysMLElementTypes.CONSTRAINT_PROPERTY);
+ if((dropAsTypedConstraintProperty != null) && (dropAsTypedConstraintProperty.canExecute())) {
+ commandChoice.add(dropAsTypedConstraintProperty);
+ }
+
+ // 7. Build default drop command (show view of the dropped object)
+ Command defaultDropCommand = super.getDropObjectsCommand(dropRequest);
+ defaultDropCommand.setLabel("Default drop (Show dropped object in diagram)");
+ if((defaultDropCommand != null) && (defaultDropCommand.canExecute())) {
+ commandChoice.add(defaultDropCommand);
+ }
+
+ // Prepare the selection command (if several command are available) or return the drop command
+ if(commandChoice.size() > 1) {
+ RunnableWithResult<ICommand> runnable;
+ Display.getDefault().syncExec(runnable = new RunnableWithResult.Impl<ICommand>() {
+
+ public void run() {
+ setResult(new SelectAndExecuteCommand("Select drop action for ", PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), commandChoice));
+ }
+ });
+
+ ICommand selectCommand = runnable.getResult();
+
+ return new ICommandProxy(selectCommand);
+
+ } else if(commandChoice.size() == 1) {
+ return commandChoice.get(0);
+ }
+
+ // else (command choice is empty)
+ return UnexecutableCommand.INSTANCE;
+
+ }
+
+ return super.getDropObjectsCommand(dropRequest);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected View getReferenceViewForConnectorEnd() {
+ return ViewUtil.getContainerView(super.getReferenceViewForConnectorEnd());
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockPropertyCompositePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockPropertyCompositePreferencePage.java
new file mode 100644
index 00000000000..a3686290b78
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/BlockPropertyCompositePreferencePage.java
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import org.eclipse.gmf.runtime.common.ui.preferences.AbstractPreferencePage;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.widgets.Composite;
+
+public class BlockPropertyCompositePreferencePage extends AbstractPreferencePage {
+
+ /** Constructor */
+ public BlockPropertyCompositePreferencePage() {
+ super();
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ CustomBlockPropertyCompositePreferencePage.initDefaults(store);
+ /*CustomNestedBlockPropertyCompositePreferencePage.initDefaults(store);*/
+ }
+
+ @Override
+ protected void addFields(Composite parent) {
+
+ }
+
+ @Override
+ protected void initHelp() {
+
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java
deleted file mode 100644
index 031e4ffa005..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConnectorPreferencePage.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusLinkPreferencePage;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.uml.diagram.common.util.StringComparator;
-
-/**
- * @generated
- */
-public class ConnectorPreferencePage extends AbstractPapyrusLinkPreferencePage {
-
- /**
- * @generated
- */
- public ConnectorPreferencePage() {
- super();
- setPreferenceKey(ParametricEditPart.MODEL_ID + "_Connector");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return SysmlDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ParametricEditPart.MODEL_ID + "_Connector";
- Map<String, Boolean> map = getStaticLabelVisibilityPreferences();
- for(String role : map.keySet()) {
- String preferenceName = PreferenceConstantHelper.getLabelElementConstant(key, role, PreferenceConstantHelper.LABEL_VISIBILITY);
- store.setDefault(preferenceName, map.get(role));
- }
-
- }
-
- /**
- * @generated
- */
- private static TreeMap<String, String> getStaticLabelRole() {
- TreeMap<String, String> map = new TreeMap<String, String>(new StringComparator());
- map.put("Name", "platform:/plugin/org.eclipse.papyrus.uml.diagram.common/icons/label_role/name.png");//$NON-NLS-1$ //$NON-NLS-2$
- return map;
- }
-
- /**
- * @generated
- */
- private static TreeMap<String, Boolean> getStaticLabelVisibilityPreferences() {
- TreeMap<String, Boolean> map = new TreeMap<String, Boolean>();
-
- map.put("Name", Boolean.FALSE);//$NON-NLS-1$
-
- return map;
- }
-
- /**
- * @generated
- */
- protected TreeMap<String, String> getLabelRole() {
- return getStaticLabelRole();
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintParameterAsBorderItemPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintParameterAsBorderItemPreferencePage.java
new file mode 100644
index 00000000000..3bba22ac76e
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintParameterAsBorderItemPreferencePage.java
@@ -0,0 +1,302 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULTVALUE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DERIVE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MODIFIERS;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_NAME;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_UNDEFINED_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_VISIBILITY;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+/**
+ * {@link Port} preference page.
+ */
+public class ConstraintParameterAsBorderItemPreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID; //$NON-NLS-1$
+
+ public static String prefLabelKey = prefKey + "-" + UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID; //$NON-NLS-1$
+
+ /** The labels default visibility for preferences */
+ public static final Map<String, Boolean> labelDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ labelDefaultVisibilityMap.put("Stereotype", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("Label", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(labelDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public ConstraintParameterAsBorderItemPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.SHAPE_UML_PROPERTY_AS_AFFIXED_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ store.setDefault(LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE), DISP_NAME | DISP_TYPE | DISP_MULTIPLICITY | DISP_UNDEFINED_TYPE);
+
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.WIDTH), 20);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.HEIGHT), 20);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.ELEMENTICON), 0);
+
+ // Initialize default visibility for labels in preference page.
+ for(String labelName : labelDefaultVisibilityMap.keySet()) {
+ String showLabelKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
+ store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeLabelsList() {
+ for(String name : labelDefaultVisibilityMap.keySet()) {
+ this.labelsList.add(name);
+ }
+ }
+
+ /** buttons to select the display mask of the label */
+ protected Button bttnVisibility, bttnDerive, bttnName, bttnType, bttnUndefined_Type, bttnMultiplicity, bttnDefault_Multiplicity, bttnDefaultValue, bttnModifiers;
+
+ private String labelDisplayPreferenceKey = LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE);
+
+ /** current property display style */
+ private int propertyValue = getPreferenceStore().getInt(labelDisplayPreferenceKey);
+
+ /**
+ * Creates a button with the {@link SWT#CHECK} style.
+ *
+ * @param parent
+ * the parent of the button
+ * @param label
+ * the label of the button
+ * @param mask
+ * the value controlled by the button
+ * @return the button created
+ */
+ protected Button createCheckButton(Composite parent, String label, int mask) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setText(label);
+ button.addSelectionListener(new AppearenceSelectionListener(mask));
+ return button;
+ }
+
+ /**
+ * Creates the group and check boxes to choose the kind of display
+ *
+ * @param parent
+ * the parent composite that holds the group
+ */
+ protected void createLabelPreferencesButtons(Composite parent) {
+ // create group that host the buttons
+ Group group = new Group(parent, SWT.SHADOW_NONE);
+ group.setText("Label Display");
+ group.setLayout(new FormLayout());
+
+ FormData data;
+
+ bttnVisibility = createCheckButton(group, "Visibility", DISP_VISIBILITY);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ bttnVisibility.setLayoutData(data);
+
+ bttnDerive = createCheckButton(group, "Derive", DISP_DERIVE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnDerive.setLayoutData(data);
+
+ bttnName = createCheckButton(group, "Name", DISP_NAME);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnName.setLayoutData(data);
+
+ bttnType = createCheckButton(group, "Type", DISP_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnType.setLayoutData(data);
+
+ bttnUndefined_Type = createCheckButton(group, "Undefined_Type", DISP_UNDEFINED_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnUndefined_Type.setLayoutData(data);
+
+ bttnMultiplicity = createCheckButton(group, "Multiplicity", DISP_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnMultiplicity.setLayoutData(data);
+
+ bttnDefault_Multiplicity = createCheckButton(group, "Default_Multiplicity", DISP_DEFAULT_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnDefault_Multiplicity.setLayoutData(data);
+
+ bttnDefaultValue = createCheckButton(group, "DefaultValue", DISP_DEFAULTVALUE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnDefaultValue.setLayoutData(data);
+
+ bttnModifiers = createCheckButton(group, "Modifiers", DISP_MODIFIERS);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnUndefined_Type, ITabbedPropertyConstants.HSPACE);
+ bttnModifiers.setLayoutData(data);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createPageContents(Composite parent) {
+ super.createPageContents(parent);
+
+ // adds the label preferences check boxes
+ createLabelPreferencesButtons(parent);
+
+ refreshButtons();
+ }
+
+ /**
+ * Load the default preferences of the fields contained in this page
+ */
+ protected void loadDefaultPreferences() {
+ propertyValue = getPreferenceStore().getDefaultInt(labelDisplayPreferenceKey);
+ refreshButtons();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void performDefaults() {
+ loadDefaultPreferences();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean performOk() {
+ storePreferences();
+ return super.performOk();
+ }
+
+ /**
+ * Refresh the buttons that manages the display.
+ */
+ protected void refreshButtons() {
+
+ bttnVisibility.setSelection((propertyValue & DISP_VISIBILITY) == DISP_VISIBILITY);
+ bttnDerive.setSelection((propertyValue & DISP_DERIVE) == DISP_DERIVE);
+ bttnName.setSelection((propertyValue & DISP_NAME) == DISP_NAME);
+ bttnType.setSelection((propertyValue & DISP_TYPE) == DISP_TYPE);
+ bttnUndefined_Type.setSelection((propertyValue & DISP_UNDEFINED_TYPE) == DISP_UNDEFINED_TYPE);
+ bttnMultiplicity.setSelection((propertyValue & DISP_MULTIPLICITY) == DISP_MULTIPLICITY);
+ bttnDefault_Multiplicity.setSelection((propertyValue & DISP_DEFAULT_MULTIPLICITY) == DISP_DEFAULT_MULTIPLICITY);
+ bttnDefaultValue.setSelection((propertyValue & DISP_DEFAULTVALUE) == DISP_DEFAULTVALUE);
+ bttnModifiers.setSelection((propertyValue & DISP_MODIFIERS) == DISP_MODIFIERS);
+
+ }
+
+ /**
+ * Stores the values of the fields contained in this page into the preference store.
+ */
+ protected void storePreferences() {
+ super.storePreferences();
+ IPreferenceStore store = getPreferenceStore();
+ // checks the stored value and the actual one, so does not refresh diagram if it is not
+ // needed
+ if(propertyValue != store.getInt(labelDisplayPreferenceKey)) {
+ store.setValue(labelDisplayPreferenceKey, propertyValue);
+ }
+ }
+
+ /**
+ * Listeners for the check buttons that select the display.
+ */
+ private class AppearenceSelectionListener implements SelectionListener {
+
+ /** The constant which refers the element to display or not. */
+ final private int style;
+
+ /**
+ * Default Constructor.
+ *
+ * @param style
+ */
+ public AppearenceSelectionListener(int style) {
+ this.style = style;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // add or remove the flag to the display property value (invert the current value)
+ propertyValue = propertyValue ^ style;
+ // refresh buttons to show current values
+ refreshButtons();
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPropertyPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPropertyPreferencePage.java
deleted file mode 100644
index 90fd061e82a..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/ConstraintPropertyPreferencePage.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class ConstraintPropertyPreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /**
- * @generated
- */
- public ConstraintPropertyPreferencePage() {
- super();
- setPreferenceKey(ParametricEditPart.MODEL_ID + "_ConstraintProperty");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return SysmlDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ParametricEditPart.MODEL_ID + "_ConstraintProperty";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 40);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 40);
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomBlockPropertyCompositePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomBlockPropertyCompositePreferencePage.java
new file mode 100644
index 00000000000..5d84d21d9f4
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomBlockPropertyCompositePreferencePage.java
@@ -0,0 +1,327 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULTVALUE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DERIVE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MODIFIERS;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_NAME;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_UNDEFINED_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_VISIBILITY;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+/**
+ * Preference page for Part and References.
+ */
+public class CustomBlockPropertyCompositePreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID; //$NON-NLS-1$
+
+ public static String prefLabelKey = prefKey + "-" + UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID; //$NON-NLS-1$
+
+ /** The compartments default visibility for preferences */
+ public static final Map<String, Boolean> compartmentDefaultVisibilityMap;
+
+ /** The compartment titles default visibility for preferences */
+ public static final Map<String, Boolean> compartmentTitleDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ compartmentDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ compartmentDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$
+
+ compartmentTitleDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ compartmentTitleDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ compartmentTitleDefaultVisibilityMap.remove("structure"); //$NON-NLS-1$
+ compartmentTitleDefaultVisibilityMap.put("structure", Boolean.FALSE); //$NON-NLS-1$
+ // End of user code
+
+ Collections.unmodifiableMap(compartmentDefaultVisibilityMap);
+ Collections.unmodifiableMap(compartmentTitleDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public CustomBlockPropertyCompositePreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.WIDTH), 200);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.HEIGHT), 100);
+ store.setDefault(LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE), DISP_NAME | DISP_TYPE | DISP_UNDEFINED_TYPE);
+ // End of user code
+
+ // Initialize default visibility for compartments in preference page.
+ for(String compartmentName : compartmentDefaultVisibilityMap.keySet()) {
+ String showCompartmentKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
+ store.setDefault(showCompartmentKey, compartmentDefaultVisibilityMap.get(compartmentName));
+ }
+
+ // Initialize default title visibility for compartments in preference page.
+ for(String compartmentName : compartmentTitleDefaultVisibilityMap.keySet()) {
+ String showCompartmentTitleKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferenceConstantHelper.COMPARTMENT_NAME_VISIBILITY);
+ store.setDefault(showCompartmentTitleKey, compartmentTitleDefaultVisibilityMap.get(compartmentName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeCompartmentNamesList() {
+ for(String name : compartmentDefaultVisibilityMap.keySet()) {
+ this.compartmentNamesList.add(name);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeCompartmentTitlesList() {
+ for(String name : compartmentTitleDefaultVisibilityMap.keySet()) {
+ this.compartmentTitlesList.add(name);
+ }
+ }
+
+ /** buttons to select the display mask of the label */
+ protected Button bttnVisibility, bttnDerive, bttnName, bttnType, bttnUndefined_Type, bttnMultiplicity, bttnDefault_Multiplicity, bttnDefaultValue, bttnModifiers;
+
+ private String labelDisplayPreferenceKey = LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE);
+
+ /** current property display style */
+ private int propertyValue = getPreferenceStore().getInt(labelDisplayPreferenceKey);
+
+ /**
+ * Creates a button with the {@link SWT#CHECK} style.
+ *
+ * @param parent
+ * the parent of the button
+ * @param label
+ * the label of the button
+ * @param mask
+ * the value controlled by the button
+ * @return the button created
+ */
+ protected Button createCheckButton(Composite parent, String label, int mask) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setText(label);
+ button.addSelectionListener(new AppearenceSelectionListener(mask));
+ return button;
+ }
+
+ /**
+ * Creates the group and check boxes to choose the kind of display
+ *
+ * @param parent
+ * the parent composite that holds the group
+ */
+ protected void createLabelPreferencesButtons(Composite parent) {
+ // create group that host the buttons
+ Group group = new Group(parent, SWT.SHADOW_NONE);
+ group.setText("Label Display");
+ group.setLayout(new FormLayout());
+
+ FormData data;
+
+ bttnVisibility = createCheckButton(group, "Visibility", DISP_VISIBILITY);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ bttnVisibility.setLayoutData(data);
+
+ bttnDerive = createCheckButton(group, "Derive", DISP_DERIVE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnDerive.setLayoutData(data);
+
+ bttnName = createCheckButton(group, "Name", DISP_NAME);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnName.setLayoutData(data);
+
+ bttnType = createCheckButton(group, "Type", DISP_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnType.setLayoutData(data);
+
+ bttnUndefined_Type = createCheckButton(group, "Undefined_Type", DISP_UNDEFINED_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnUndefined_Type.setLayoutData(data);
+
+ bttnMultiplicity = createCheckButton(group, "Multiplicity", DISP_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnMultiplicity.setLayoutData(data);
+
+ bttnDefault_Multiplicity = createCheckButton(group, "Default_Multiplicity", DISP_DEFAULT_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnDefault_Multiplicity.setLayoutData(data);
+
+ bttnDefaultValue = createCheckButton(group, "DefaultValue", DISP_DEFAULTVALUE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnDefaultValue.setLayoutData(data);
+
+ bttnModifiers = createCheckButton(group, "Modifiers", DISP_MODIFIERS);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnUndefined_Type, ITabbedPropertyConstants.HSPACE);
+ bttnModifiers.setLayoutData(data);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createPageContents(Composite parent) {
+ super.createPageContents(parent);
+
+ // adds the label preferences check boxes
+ createLabelPreferencesButtons(parent);
+
+ refreshButtons();
+ }
+
+ /**
+ * Load the default preferences of the fields contained in this page
+ */
+ protected void loadDefaultPreferences() {
+ propertyValue = getPreferenceStore().getDefaultInt(labelDisplayPreferenceKey);
+ refreshButtons();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void performDefaults() {
+ loadDefaultPreferences();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean performOk() {
+ storePreferences();
+ return super.performOk();
+ }
+
+ /**
+ * Refresh the buttons that manages the display.
+ */
+ protected void refreshButtons() {
+
+ bttnVisibility.setSelection((propertyValue & DISP_VISIBILITY) == DISP_VISIBILITY);
+ bttnDerive.setSelection((propertyValue & DISP_DERIVE) == DISP_DERIVE);
+ bttnName.setSelection((propertyValue & DISP_NAME) == DISP_NAME);
+ bttnType.setSelection((propertyValue & DISP_TYPE) == DISP_TYPE);
+ bttnUndefined_Type.setSelection((propertyValue & DISP_UNDEFINED_TYPE) == DISP_UNDEFINED_TYPE);
+ bttnMultiplicity.setSelection((propertyValue & DISP_MULTIPLICITY) == DISP_MULTIPLICITY);
+ bttnDefault_Multiplicity.setSelection((propertyValue & DISP_DEFAULT_MULTIPLICITY) == DISP_DEFAULT_MULTIPLICITY);
+ bttnDefaultValue.setSelection((propertyValue & DISP_DEFAULTVALUE) == DISP_DEFAULTVALUE);
+ bttnModifiers.setSelection((propertyValue & DISP_MODIFIERS) == DISP_MODIFIERS);
+
+ }
+
+ /**
+ * Stores the values of the fields contained in this page into the preference store.
+ */
+ protected void storePreferences() {
+ super.storePreferences();
+ IPreferenceStore store = getPreferenceStore();
+ // checks the stored value and the actual one, so does not refresh diagram if it is not
+ // needed
+ if(propertyValue != store.getInt(labelDisplayPreferenceKey)) {
+ store.setValue(labelDisplayPreferenceKey, propertyValue);
+ }
+ }
+
+ /**
+ * Listeners for the check buttons that select the display.
+ */
+ private class AppearenceSelectionListener implements SelectionListener {
+
+ /** The constant which refers the element to display or not. */
+ final private int style;
+
+ /**
+ * Default Constructor.
+ *
+ * @param style
+ */
+ public AppearenceSelectionListener(int style) {
+ this.style = style;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // add or remove the flag to the display property value (invert the current value)
+ propertyValue = propertyValue ^ style;
+ // refresh buttons to show current values
+ refreshButtons();
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConnectorPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConnectorPreferencePage.java
new file mode 100644
index 00000000000..8c200be32ca
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConnectorPreferencePage.java
@@ -0,0 +1,464 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_NAME;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_UNDEFINED_TYPE;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+
+/**
+ * {@link Connector} preference page.
+ */
+public class CustomConnectorPreferencePage extends ParametricDiagramLinkPreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID; //$NON-NLS-1$
+
+ /** The labels default visibility for preferences */
+ public static final Map<String, Boolean> labelDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ labelDefaultVisibilityMap.put("Stereotype", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("Label", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("SourceMultiplicity", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("TargetMultiplicity", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(labelDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public CustomConnectorPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+
+ // Label default masks initialization
+ store.setDefault(LabelPreferenceHelper.getPreferenceConstant(labelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE), DISP_NAME | DISP_TYPE);
+ store.setDefault(LabelPreferenceHelper.getPreferenceConstant(sourceMultLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE), DISP_MULTIPLICITY);
+ store.setDefault(LabelPreferenceHelper.getPreferenceConstant(targetMultLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE), DISP_MULTIPLICITY);
+
+ // End of user code
+
+ // Initialize default visibility for labels in preference page.
+ for(String labelName : labelDefaultVisibilityMap.keySet()) {
+ String showLabelKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
+ store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeLabelsList() {
+ for(String name : labelDefaultVisibilityMap.keySet()) {
+ this.labelsList.add(name);
+ }
+ }
+
+ // Label display mask management in preference page
+
+ /** buttons to select the display mask of the label */
+ protected Button bttnName, bttnType, bttnUndefined_Type;
+
+ /** buttons to select the display mask of the source labels */
+ protected Button bttnSourceMultMultiplicity, bttnSourceMultDefault_Multiplicity;
+
+ /** buttons to select the display mask of the target labels */
+ protected Button bttnTargetMultMultiplicity, bttnTargetMultDefault_Multiplicity;
+
+ /** Preference keys */
+ public static String labelKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID + "-" + UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID; //$NON-NLS-1$
+
+ public static String sourceMultLabelKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID + "-" + UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID; //$NON-NLS-1$
+
+ public static String targetMultLabelKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.LINK_UML_CONNECTOR_ID + "-" + UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID; //$NON-NLS-1$
+
+ private String labelDisplayPreferenceKey = LabelPreferenceHelper.getPreferenceConstant(labelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE);
+
+ private String sourceMultLabelDisplayPreferenceKey = LabelPreferenceHelper.getPreferenceConstant(sourceMultLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE);
+
+ private String targetMultLabelDisplayPreferenceKey = LabelPreferenceHelper.getPreferenceConstant(targetMultLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE);
+
+ /** Current property display styles for labels */
+ private int labelDisplayValue = getPreferenceStore().getInt(labelDisplayPreferenceKey);
+
+ private int sourceMultDisplayValue = getPreferenceStore().getInt(sourceMultLabelDisplayPreferenceKey);
+
+ private int targetMultDisplayValue = getPreferenceStore().getInt(targetMultLabelDisplayPreferenceKey);
+
+ /**
+ * Creates the group and check boxes to choose the kind of display
+ *
+ * @param parent
+ * the parent composite that holds the group
+ */
+ protected void createLabelPreferencesButtons(Composite parent) {
+ // create group that host the buttons
+ Group group = new Group(parent, SWT.SHADOW_NONE);
+ group.setText("Label Display");
+ group.setLayout(new FormLayout());
+
+ FormData data;
+
+ bttnName = createLabelCheckButton(group, "Name", DISP_NAME);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ bttnName.setLayoutData(data);
+
+ bttnType = createLabelCheckButton(group, "Type", DISP_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnType.setLayoutData(data);
+
+ bttnUndefined_Type = createLabelCheckButton(group, "Undefined_Type", DISP_UNDEFINED_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnType, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnUndefined_Type.setLayoutData(data);
+ }
+
+ /**
+ * Creates the group and check boxes to choose the kind of display
+ *
+ * @param parent
+ * the parent composite that holds the group
+ */
+ protected void createSourceMultLabelPreferencesButtons(Composite parent) {
+ // create group that host the buttons
+ Group group = new Group(parent, SWT.SHADOW_NONE);
+ group.setText("Source Multiplicity Label Display");
+ group.setLayout(new FormLayout());
+
+ FormData data;
+
+ bttnSourceMultMultiplicity = createSourceMultCheckButton(group, "Multiplicity", DISP_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ bttnSourceMultMultiplicity.setLayoutData(data);
+
+ bttnSourceMultDefault_Multiplicity = createSourceMultCheckButton(group, "Default_Multiplicity", DISP_DEFAULT_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnSourceMultMultiplicity, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnSourceMultDefault_Multiplicity.setLayoutData(data);
+ }
+
+ /**
+ * Creates the group and check boxes to choose the kind of display
+ *
+ * @param parent
+ * the parent composite that holds the group
+ */
+ protected void createTargetMultLabelPreferencesButtons(Composite parent) {
+ // create group that host the buttons
+ Group group = new Group(parent, SWT.SHADOW_NONE);
+ group.setText("Target Multiplicity Label Display");
+ group.setLayout(new FormLayout());
+
+ FormData data;
+
+ bttnTargetMultMultiplicity = createTargetMultCheckButton(group, "Multiplicity", DISP_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ bttnTargetMultMultiplicity.setLayoutData(data);
+
+ bttnTargetMultDefault_Multiplicity = createTargetMultCheckButton(group, "Default_Multiplicity", DISP_DEFAULT_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnTargetMultMultiplicity, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnTargetMultDefault_Multiplicity.setLayoutData(data);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createPageContents(Composite parent) {
+ super.createPageContents(parent);
+
+ // adds the label preferences check boxes
+ createLabelPreferencesButtons(parent);
+ createSourceMultLabelPreferencesButtons(parent);
+ createTargetMultLabelPreferencesButtons(parent);
+
+ refreshButtons();
+ }
+
+ /**
+ * Load the default preferences of the fields contained in this page
+ */
+ protected void loadDefaultPreferences() {
+ labelDisplayValue = getPreferenceStore().getDefaultInt(labelDisplayPreferenceKey);
+ sourceMultDisplayValue = getPreferenceStore().getDefaultInt(sourceMultLabelDisplayPreferenceKey);
+ targetMultDisplayValue = getPreferenceStore().getDefaultInt(targetMultLabelDisplayPreferenceKey);
+
+ refreshButtons();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void performDefaults() {
+ loadDefaultPreferences();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean performOk() {
+ storePreferences();
+ return super.performOk();
+ }
+
+ /**
+ * Refresh the buttons that manages the display.
+ */
+ protected void refreshButtons() {
+
+ // Label refresh buttons
+ bttnName.setSelection((labelDisplayValue & DISP_NAME) == DISP_NAME);
+ bttnType.setSelection((labelDisplayValue & DISP_TYPE) == DISP_TYPE);
+ bttnUndefined_Type.setSelection((labelDisplayValue & DISP_UNDEFINED_TYPE) == DISP_UNDEFINED_TYPE);
+
+ // Source Label Buttons
+ bttnSourceMultMultiplicity.setSelection((sourceMultDisplayValue & DISP_MULTIPLICITY) == DISP_MULTIPLICITY);
+ bttnSourceMultDefault_Multiplicity.setSelection((sourceMultDisplayValue & DISP_DEFAULT_MULTIPLICITY) == DISP_DEFAULT_MULTIPLICITY);
+
+ // Target Label Buttons
+ bttnTargetMultMultiplicity.setSelection((targetMultDisplayValue & DISP_MULTIPLICITY) == DISP_MULTIPLICITY);
+ bttnTargetMultDefault_Multiplicity.setSelection((targetMultDisplayValue & DISP_DEFAULT_MULTIPLICITY) == DISP_DEFAULT_MULTIPLICITY);
+
+ }
+
+ /**
+ * Stores the values of the fields contained in this page into the preference store.
+ */
+ protected void storePreferences() {
+ super.storePreferences();
+ IPreferenceStore store = getPreferenceStore();
+ // checks the stored value and the actual one, so does not refresh diagram if it is not
+ // needed
+ if(labelDisplayValue != store.getInt(labelDisplayPreferenceKey)) {
+ store.setValue(labelDisplayPreferenceKey, labelDisplayValue);
+ }
+ if(sourceMultDisplayValue != store.getInt(sourceMultLabelDisplayPreferenceKey)) {
+ store.setValue(sourceMultLabelDisplayPreferenceKey, sourceMultDisplayValue);
+ }
+ if(targetMultDisplayValue != store.getInt(targetMultLabelDisplayPreferenceKey)) {
+ store.setValue(targetMultLabelDisplayPreferenceKey, targetMultDisplayValue);
+ }
+ }
+
+ /**
+ * Creates a button with the {@link SWT#CHECK} style.
+ *
+ * @param parent
+ * the parent of the button
+ * @param label
+ * the label of the button
+ * @param mask
+ * the value controlled by the button
+ * @return the button created
+ */
+ protected Button createLabelCheckButton(Composite parent, String label, int mask) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setText(label);
+ button.addSelectionListener(new LabelAppearenceSelectionListener(mask));
+ return button;
+ }
+
+ /**
+ * Creates a button with the {@link SWT#CHECK} style.
+ *
+ * @param parent
+ * the parent of the button
+ * @param label
+ * the label of the button
+ * @param mask
+ * the value controlled by the button
+ * @return the button created
+ */
+ protected Button createSourceMultCheckButton(Composite parent, String label, int mask) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setText(label);
+ button.addSelectionListener(new SourceMultAppearenceSelectionListener(mask));
+ return button;
+ }
+
+ /**
+ * Creates a button with the {@link SWT#CHECK} style.
+ *
+ * @param parent
+ * the parent of the button
+ * @param label
+ * the label of the button
+ * @param mask
+ * the value controlled by the button
+ * @return the button created
+ */
+ protected Button createTargetMultCheckButton(Composite parent, String label, int mask) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setText(label);
+ button.addSelectionListener(new TargetMultAppearenceSelectionListener(mask));
+ return button;
+ }
+
+ /**
+ * Listeners for the check buttons that select the label display.
+ */
+ private class LabelAppearenceSelectionListener implements SelectionListener {
+
+ /** The constant which refers the element to display or not. */
+ final private int style;
+
+ /**
+ * Default Constructor.
+ *
+ * @param style
+ */
+ public LabelAppearenceSelectionListener(int style) {
+ this.style = style;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // add or remove the flag to the display property value (invert the current value)
+ labelDisplayValue = labelDisplayValue ^ style;
+
+ // refresh buttons to show current values
+ refreshButtons();
+ }
+ }
+
+ /**
+ * Listeners for the check buttons that select the source multiplicity display.
+ */
+ private class SourceMultAppearenceSelectionListener implements SelectionListener {
+
+ /** The constant which refers the element to display or not. */
+ final private int style;
+
+ /**
+ * Default Constructor.
+ *
+ * @param style
+ */
+ public SourceMultAppearenceSelectionListener(int style) {
+ this.style = style;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // add or remove the flag to the display property value (invert the current value)
+ sourceMultDisplayValue = sourceMultDisplayValue ^ style;
+
+ // refresh buttons to show current values
+ refreshButtons();
+ }
+ }
+
+ /**
+ * Listeners for the check buttons that select the target multiplicity display.
+ */
+ private class TargetMultAppearenceSelectionListener implements SelectionListener {
+
+ /** The constant which refers the element to display or not. */
+ final private int style;
+
+ /**
+ * Default Constructor.
+ *
+ * @param style
+ */
+ public TargetMultAppearenceSelectionListener(int style) {
+ this.style = style;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // add or remove the flag to the display property value (invert the current value)
+ targetMultDisplayValue = targetMultDisplayValue ^ style;
+
+ // refresh buttons to show current values
+ refreshButtons();
+ }
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConstraintPropertyCompositePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConstraintPropertyCompositePreferencePage.java
new file mode 100644
index 00000000000..78f3e67d396
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomConstraintPropertyCompositePreferencePage.java
@@ -0,0 +1,327 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULTVALUE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DERIVE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MODIFIERS;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_NAME;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_UNDEFINED_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_VISIBILITY;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+/**
+ * Preference page for Part and References.
+ */
+public class CustomConstraintPropertyCompositePreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCKPROPERTY_AS_COMPOSITE_ID; //$NON-NLS-1$
+
+ public static String prefLabelKey = prefKey + "-" + UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID; //$NON-NLS-1$
+
+ /** The compartments default visibility for preferences */
+ public static final Map<String, Boolean> compartmentDefaultVisibilityMap;
+
+ /** The compartment titles default visibility for preferences */
+ public static final Map<String, Boolean> compartmentTitleDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ compartmentDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ compartmentDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$
+
+ compartmentTitleDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ compartmentTitleDefaultVisibilityMap.put("structure", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ compartmentTitleDefaultVisibilityMap.remove("structure"); //$NON-NLS-1$
+ compartmentTitleDefaultVisibilityMap.put("structure", Boolean.FALSE); //$NON-NLS-1$
+ // End of user code
+
+ Collections.unmodifiableMap(compartmentDefaultVisibilityMap);
+ Collections.unmodifiableMap(compartmentTitleDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public CustomConstraintPropertyCompositePreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_BLOCKPROPERTY_AS_COMPOSITE_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ // Start of user code custom default initializations
+// store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.WIDTH), 200);
+// store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.HEIGHT), 100);
+ store.setDefault(LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE), DISP_NAME | DISP_TYPE | DISP_UNDEFINED_TYPE);
+ // End of user code
+
+ // Initialize default visibility for compartments in preference page.
+ for(String compartmentName : compartmentDefaultVisibilityMap.keySet()) {
+ String showCompartmentKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferenceConstantHelper.COMPARTMENT_VISIBILITY);
+ store.setDefault(showCompartmentKey, compartmentDefaultVisibilityMap.get(compartmentName));
+ }
+
+ // Initialize default title visibility for compartments in preference page.
+ for(String compartmentName : compartmentTitleDefaultVisibilityMap.keySet()) {
+ String showCompartmentTitleKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, compartmentName, PreferenceConstantHelper.COMPARTMENT_NAME_VISIBILITY);
+ store.setDefault(showCompartmentTitleKey, compartmentTitleDefaultVisibilityMap.get(compartmentName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeCompartmentNamesList() {
+ for(String name : compartmentDefaultVisibilityMap.keySet()) {
+ this.compartmentNamesList.add(name);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeCompartmentTitlesList() {
+ for(String name : compartmentTitleDefaultVisibilityMap.keySet()) {
+ this.compartmentTitlesList.add(name);
+ }
+ }
+
+ /** buttons to select the display mask of the label */
+ protected Button bttnVisibility, bttnDerive, bttnName, bttnType, bttnUndefined_Type, bttnMultiplicity, bttnDefault_Multiplicity, bttnDefaultValue, bttnModifiers;
+
+ private String labelDisplayPreferenceKey = LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE);
+
+ /** current property display style */
+ private int propertyValue = getPreferenceStore().getInt(labelDisplayPreferenceKey);
+
+ /**
+ * Creates a button with the {@link SWT#CHECK} style.
+ *
+ * @param parent
+ * the parent of the button
+ * @param label
+ * the label of the button
+ * @param mask
+ * the value controlled by the button
+ * @return the button created
+ */
+ protected Button createCheckButton(Composite parent, String label, int mask) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setText(label);
+ button.addSelectionListener(new AppearenceSelectionListener(mask));
+ return button;
+ }
+
+ /**
+ * Creates the group and check boxes to choose the kind of display
+ *
+ * @param parent
+ * the parent composite that holds the group
+ */
+ protected void createLabelPreferencesButtons(Composite parent) {
+ // create group that host the buttons
+ Group group = new Group(parent, SWT.SHADOW_NONE);
+ group.setText("Label Display");
+ group.setLayout(new FormLayout());
+
+ FormData data;
+
+ bttnVisibility = createCheckButton(group, "Visibility", DISP_VISIBILITY);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ bttnVisibility.setLayoutData(data);
+
+ bttnDerive = createCheckButton(group, "Derive", DISP_DERIVE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnDerive.setLayoutData(data);
+
+ bttnName = createCheckButton(group, "Name", DISP_NAME);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnName.setLayoutData(data);
+
+ bttnType = createCheckButton(group, "Type", DISP_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnType.setLayoutData(data);
+
+ bttnUndefined_Type = createCheckButton(group, "Undefined_Type", DISP_UNDEFINED_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnUndefined_Type.setLayoutData(data);
+
+ bttnMultiplicity = createCheckButton(group, "Multiplicity", DISP_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnMultiplicity.setLayoutData(data);
+
+ bttnDefault_Multiplicity = createCheckButton(group, "Default_Multiplicity", DISP_DEFAULT_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnDefault_Multiplicity.setLayoutData(data);
+
+ bttnDefaultValue = createCheckButton(group, "DefaultValue", DISP_DEFAULTVALUE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnDefaultValue.setLayoutData(data);
+
+ bttnModifiers = createCheckButton(group, "Modifiers", DISP_MODIFIERS);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnUndefined_Type, ITabbedPropertyConstants.HSPACE);
+ bttnModifiers.setLayoutData(data);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createPageContents(Composite parent) {
+ super.createPageContents(parent);
+
+ // adds the label preferences check boxes
+ createLabelPreferencesButtons(parent);
+
+ refreshButtons();
+ }
+
+ /**
+ * Load the default preferences of the fields contained in this page
+ */
+ protected void loadDefaultPreferences() {
+ propertyValue = getPreferenceStore().getDefaultInt(labelDisplayPreferenceKey);
+ refreshButtons();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void performDefaults() {
+ loadDefaultPreferences();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean performOk() {
+ storePreferences();
+ return super.performOk();
+ }
+
+ /**
+ * Refresh the buttons that manages the display.
+ */
+ protected void refreshButtons() {
+
+ bttnVisibility.setSelection((propertyValue & DISP_VISIBILITY) == DISP_VISIBILITY);
+ bttnDerive.setSelection((propertyValue & DISP_DERIVE) == DISP_DERIVE);
+ bttnName.setSelection((propertyValue & DISP_NAME) == DISP_NAME);
+ bttnType.setSelection((propertyValue & DISP_TYPE) == DISP_TYPE);
+ bttnUndefined_Type.setSelection((propertyValue & DISP_UNDEFINED_TYPE) == DISP_UNDEFINED_TYPE);
+ bttnMultiplicity.setSelection((propertyValue & DISP_MULTIPLICITY) == DISP_MULTIPLICITY);
+ bttnDefault_Multiplicity.setSelection((propertyValue & DISP_DEFAULT_MULTIPLICITY) == DISP_DEFAULT_MULTIPLICITY);
+ bttnDefaultValue.setSelection((propertyValue & DISP_DEFAULTVALUE) == DISP_DEFAULTVALUE);
+ bttnModifiers.setSelection((propertyValue & DISP_MODIFIERS) == DISP_MODIFIERS);
+
+ }
+
+ /**
+ * Stores the values of the fields contained in this page into the preference store.
+ */
+ protected void storePreferences() {
+ super.storePreferences();
+ IPreferenceStore store = getPreferenceStore();
+ // checks the stored value and the actual one, so does not refresh diagram if it is not
+ // needed
+ if(propertyValue != store.getInt(labelDisplayPreferenceKey)) {
+ store.setValue(labelDisplayPreferenceKey, propertyValue);
+ }
+ }
+
+ /**
+ * Listeners for the check buttons that select the display.
+ */
+ private class AppearenceSelectionListener implements SelectionListener {
+
+ /** The constant which refers the element to display or not. */
+ final private int style;
+
+ /**
+ * Default Constructor.
+ *
+ * @param style
+ */
+ public AppearenceSelectionListener(int style) {
+ this.style = style;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // add or remove the flag to the display property value (invert the current value)
+ propertyValue = propertyValue ^ style;
+ // refresh buttons to show current values
+ refreshButtons();
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomPreferenceInitializer.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomPreferenceInitializer.java
new file mode 100644
index 00000000000..907960e23ca
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/CustomPreferenceInitializer.java
@@ -0,0 +1,80 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.Activator;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+
+/**
+ * Custom preferences initializer.
+ */
+public class CustomPreferenceInitializer extends ParametricDiagramPreferenceInitializer {
+
+ protected IPreferenceStore getPreferenceStore() {
+ return Activator.getInstance().getPreferenceStore();
+ }
+
+ @Override
+ public void initializeDefaultPreferences() {
+ super.initializeDefaultPreferences();
+
+ IPreferenceStore store = getPreferenceStore();
+
+ PortAsBorderItemPreferencePage.initDefaults(store);
+ ConstraintParameterAsBorderItemPreferencePage.initDefaults(store);
+ FlowPortAsBorderItemPreferencePage.initDefaults(store);
+ BlockPropertyCompositePreferencePage.initDefaults(store);
+ CustomConstraintPropertyCompositePreferencePage.initDefaults(store);
+ CustomConnectorPreferencePage.initDefaults(store);
+
+ // Initialize default positions for labels.
+ initDefaultPosition(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID, UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID, 0, -10);
+ initDefaultPosition(UMLGraphicalTypes.LINK_UML_DEPENDENCY_ID, UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID, 0, -30);
+
+ initDefaultPosition(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID, 0, -10);
+ initDefaultPosition(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, UMLGraphicalTypes.LINKLABEL_UML_APPLIEDSTEREOTYPE_ID, 0, -30);
+ initDefaultPosition(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID, 0, 10);
+ initDefaultPosition(UMLGraphicalTypes.LINK_UML_CONNECTOR_ID, UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID, 0, 10);
+
+ initDefaultPosition(UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID, 30, 0);
+ initDefaultPosition(UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID, UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID, 30, -20);
+
+ initDefaultPosition(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID, 30, 0);
+ initDefaultPosition(SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID, UMLGraphicalTypes.AFFIXEDLABEL_UML_APPLIEDSTEREOTYPE_ID, 30, -20);
+ }
+
+ /**
+ * Initialize default position of a link label in preferences.
+ *
+ * @param parentGraphicalType
+ * the graphical type of the view owning the label
+ * @param graphicalType
+ * the graphical type of the label
+ * @param x
+ * @param y
+ */
+ protected void initDefaultPosition(String parentGraphicalType, String graphicalType, int x, int y) {
+ IPreferenceStore store = getPreferenceStore();
+
+ String xKey = PreferenceConstantHelper.getElementConstant(ElementTypes.DIAGRAM_ID + "_" + parentGraphicalType + "-" + graphicalType, PreferenceConstantHelper.LOCATION_X);
+ String yKey = PreferenceConstantHelper.getElementConstant(ElementTypes.DIAGRAM_ID + "_" + parentGraphicalType + "-" + graphicalType, PreferenceConstantHelper.LOCATION_Y);
+
+ store.setDefault(xKey, x);
+ store.setDefault(yKey, y);
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramAppearancePreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramAppearancePreferencePage.java
deleted file mode 100644
index ac8ef06f668..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramAppearancePreferencePage.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramAppearancePreferencePage extends AppearancePreferencePage {
-
- /**
- * @generated
- */
- public DiagramAppearancePreferencePage() {
- setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramConnectionsPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramConnectionsPreferencePage.java
deleted file mode 100644
index 5434ff57fdb..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramConnectionsPreferencePage.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage {
-
- /**
- * @generated
- */
- public DiagramConnectionsPreferencePage() {
- setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramGeneralPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramGeneralPreferencePage.java
deleted file mode 100644
index a6f94f2690f..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramGeneralPreferencePage.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.DiagramPreferencePage;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramGeneralPreferencePage extends DiagramPreferencePage {
-
- /**
- * @generated
- */
- public DiagramGeneralPreferencePage() {
- setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
- setPreferenceKey(ParametricEditPart.MODEL_ID);
-
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramPreferenceInitializer.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramPreferenceInitializer.java
deleted file mode 100644
index 3a217ec08c0..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramPreferenceInitializer.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer {
-
- /**
- * @generated
- */
- public void initializeDefaultPreferences() {
- IPreferenceStore store = getPreferenceStore();
-
- ConstraintPropertyPreferencePage.initDefaults(store);
-
- PropertyPreferencePage.initDefaults(store);
-
- ConnectorPreferencePage.initDefaults(store);
-
- }
-
- /**
- * @generated
- */
- protected IPreferenceStore getPreferenceStore() {
- return SysmlDiagramEditorPlugin.getInstance().getPreferenceStore();
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramPrintingPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramPrintingPreferencePage.java
deleted file mode 100644
index 4965ef42992..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramPrintingPreferencePage.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramPrintingPreferencePage extends PrintingPreferencePage {
-
- /**
- * @generated
- */
- public DiagramPrintingPreferencePage() {
- setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramRulersAndGridPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramRulersAndGridPreferencePage.java
deleted file mode 100644
index fd700ed4eda..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/DiagramRulersAndGridPreferencePage.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class DiagramRulersAndGridPreferencePage extends RulerGridPreferencePage {
-
- /**
- * @generated
- */
- public DiagramRulersAndGridPreferencePage() {
- setPreferenceStore(SysmlDiagramEditorPlugin.getInstance().getPreferenceStore());
-
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/FlowPortAsBorderItemPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/FlowPortAsBorderItemPreferencePage.java
new file mode 100644
index 00000000000..277a5cdfc3a
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/FlowPortAsBorderItemPreferencePage.java
@@ -0,0 +1,310 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULTVALUE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DERIVE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DIRECTION;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MODIFIERS;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_NAME;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_UNDEFINED_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_VISIBILITY;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+/**
+ * FlowPort preference page.
+ */
+public class FlowPortAsBorderItemPreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID; //$NON-NLS-1$
+
+ public static String prefLabelKey = prefKey + "-" + SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID; //$NON-NLS-1$
+
+ /** The labels default visibility for preferences */
+ public static final Map<String, Boolean> labelDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ labelDefaultVisibilityMap.put("Stereotype", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("Label", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(labelDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public FlowPortAsBorderItemPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + SysMLGraphicalTypes.SHAPE_SYSML_FLOWPORT_AS_AFFIXED_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+
+ store.setDefault(LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE), DISP_DIRECTION | DISP_NAME | DISP_TYPE | DISP_UNDEFINED_TYPE);
+
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.WIDTH), 20);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.HEIGHT), 20);
+
+ // Initialize default visibility for labels in preference page.
+ for(String labelName : labelDefaultVisibilityMap.keySet()) {
+ String showLabelKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
+ store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeLabelsList() {
+ for(String name : labelDefaultVisibilityMap.keySet()) {
+ this.labelsList.add(name);
+ }
+ }
+
+ /** buttons to select the display mask of the label */
+ protected Button bttnDirection, bttnVisibility, bttnDerive, bttnName, bttnType, bttnUndefined_Type, bttnMultiplicity, bttnDefault_Multiplicity, bttnDefaultValue, bttnModifiers;
+
+ private String labelDisplayPreferenceKey = LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE);
+
+ /** current property display style */
+ private int propertyValue = getPreferenceStore().getInt(labelDisplayPreferenceKey);
+
+ /**
+ * Creates a button with the {@link SWT#CHECK} style.
+ *
+ * @param parent
+ * the parent of the button
+ * @param label
+ * the label of the button
+ * @param mask
+ * the value controlled by the button
+ * @return the button created
+ */
+ protected Button createCheckButton(Composite parent, String label, int mask) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setText(label);
+ button.addSelectionListener(new AppearenceSelectionListener(mask));
+ return button;
+ }
+
+ /**
+ * Creates the group and check boxes to choose the kind of display
+ *
+ * @param parent
+ * the parent composite that holds the group
+ */
+ protected void createLabelPreferencesButtons(Composite parent) {
+ // create group that host the buttons
+ Group group = new Group(parent, SWT.SHADOW_NONE);
+ group.setText("Label Display");
+ group.setLayout(new FormLayout());
+
+ FormData data;
+
+ bttnDirection = createCheckButton(group, "Direction", DISP_DIRECTION);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ bttnDirection.setLayoutData(data);
+
+ bttnVisibility = createCheckButton(group, "Visibility", DISP_VISIBILITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDirection, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnVisibility.setLayoutData(data);
+
+ bttnDerive = createCheckButton(group, "Derive", DISP_DERIVE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnDerive.setLayoutData(data);
+
+ bttnName = createCheckButton(group, "Name", DISP_NAME);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnName.setLayoutData(data);
+
+ bttnType = createCheckButton(group, "Type", DISP_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnDirection, ITabbedPropertyConstants.HSPACE);
+ bttnType.setLayoutData(data);
+
+ bttnUndefined_Type = createCheckButton(group, "Undefined_Type", DISP_UNDEFINED_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDirection, 85);
+ data.top = new FormAttachment(bttnDirection, ITabbedPropertyConstants.HSPACE);
+ bttnUndefined_Type.setLayoutData(data);
+
+ bttnMultiplicity = createCheckButton(group, "Multiplicity", DISP_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(bttnDirection, ITabbedPropertyConstants.HSPACE);
+ bttnMultiplicity.setLayoutData(data);
+
+ bttnDefault_Multiplicity = createCheckButton(group, "Default_Multiplicity", DISP_DEFAULT_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(bttnDirection, ITabbedPropertyConstants.HSPACE);
+ bttnDefault_Multiplicity.setLayoutData(data);
+
+ bttnDefaultValue = createCheckButton(group, "DefaultValue", DISP_DEFAULTVALUE);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnType, ITabbedPropertyConstants.HSPACE);
+ bttnDefaultValue.setLayoutData(data);
+
+ bttnModifiers = createCheckButton(group, "Modifiers", DISP_MODIFIERS);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDirection, 85);
+ data.top = new FormAttachment(bttnType, ITabbedPropertyConstants.HSPACE);
+ bttnModifiers.setLayoutData(data);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createPageContents(Composite parent) {
+ super.createPageContents(parent);
+
+ // adds the label preferences check boxes
+ createLabelPreferencesButtons(parent);
+
+ refreshButtons();
+ }
+
+ /**
+ * Load the default preferences of the fields contained in this page
+ */
+ protected void loadDefaultPreferences() {
+ propertyValue = getPreferenceStore().getDefaultInt(labelDisplayPreferenceKey);
+ refreshButtons();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void performDefaults() {
+ loadDefaultPreferences();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean performOk() {
+ storePreferences();
+ return super.performOk();
+ }
+
+ /**
+ * Refresh the buttons that manages the display.
+ */
+ protected void refreshButtons() {
+
+ bttnDirection.setSelection((propertyValue & DISP_DIRECTION) == DISP_DIRECTION);
+ bttnVisibility.setSelection((propertyValue & DISP_VISIBILITY) == DISP_VISIBILITY);
+ bttnDerive.setSelection((propertyValue & DISP_DERIVE) == DISP_DERIVE);
+ bttnName.setSelection((propertyValue & DISP_NAME) == DISP_NAME);
+ bttnType.setSelection((propertyValue & DISP_TYPE) == DISP_TYPE);
+ bttnUndefined_Type.setSelection((propertyValue & DISP_UNDEFINED_TYPE) == DISP_UNDEFINED_TYPE);
+ bttnMultiplicity.setSelection((propertyValue & DISP_MULTIPLICITY) == DISP_MULTIPLICITY);
+ bttnDefault_Multiplicity.setSelection((propertyValue & DISP_DEFAULT_MULTIPLICITY) == DISP_DEFAULT_MULTIPLICITY);
+ bttnDefaultValue.setSelection((propertyValue & DISP_DEFAULTVALUE) == DISP_DEFAULTVALUE);
+ bttnModifiers.setSelection((propertyValue & DISP_MODIFIERS) == DISP_MODIFIERS);
+
+ }
+
+ /**
+ * Stores the values of the fields contained in this page into the preference store.
+ */
+ protected void storePreferences() {
+ super.storePreferences();
+ IPreferenceStore store = getPreferenceStore();
+ // checks the stored value and the actual one, so does not refresh diagram if it is not
+ // needed
+ if(propertyValue != store.getInt(labelDisplayPreferenceKey)) {
+ store.setValue(labelDisplayPreferenceKey, propertyValue);
+ }
+ }
+
+ /**
+ * Listeners for the check buttons that select the display.
+ */
+ private class AppearenceSelectionListener implements SelectionListener {
+
+ /** The constant which refers the element to display or not. */
+ final private int style;
+
+ /**
+ * Default Constructor.
+ *
+ * @param style
+ */
+ public AppearenceSelectionListener(int style) {
+ this.style = style;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // add or remove the flag to the display property value (invert the current value)
+ propertyValue = propertyValue ^ style;
+ // refresh buttons to show current values
+ refreshButtons();
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PortAsBorderItemPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PortAsBorderItemPreferencePage.java
new file mode 100644
index 00000000000..5848eef2df0
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PortAsBorderItemPreferencePage.java
@@ -0,0 +1,301 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
+
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULTVALUE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DEFAULT_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_DERIVE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MODIFIERS;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_MULTIPLICITY;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_NAME;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_UNDEFINED_TYPE;
+import static org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants.DISP_VISIBILITY;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.ILabelPreferenceConstants;
+import org.eclipse.papyrus.sysml.diagram.common.preferences.LabelPreferenceHelper;
+import org.eclipse.papyrus.sysml.diagram.parametric.provider.ElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants;
+
+/**
+ * {@link Port} preference page.
+ */
+public class PortAsBorderItemPreferencePage extends ParametricDiagramNodePreferencePage {
+
+ /** Constant key to access preferences */
+ public static String prefKey = ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID; //$NON-NLS-1$
+
+ public static String prefLabelKey = prefKey + "-" + UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID; //$NON-NLS-1$
+
+ /** The labels default visibility for preferences */
+ public static final Map<String, Boolean> labelDefaultVisibilityMap;
+
+ /** Static attribute initialization */
+ static {
+ labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
+ labelDefaultVisibilityMap.put("Stereotype", Boolean.TRUE); //$NON-NLS-1$
+ labelDefaultVisibilityMap.put("Label", Boolean.TRUE); //$NON-NLS-1$
+
+ // Start of user code custom static initializations
+ // End of user code
+
+ Collections.unmodifiableMap(labelDefaultVisibilityMap);
+ }
+
+ /** Constructor */
+ public PortAsBorderItemPreferencePage() {
+ super();
+ setPreferenceKey(ElementTypes.DIAGRAM_ID + "_" + UMLGraphicalTypes.SHAPE_UML_PORT_AS_AFFIXED_ID); //$NON-NLS-1$
+ }
+
+ /** Default preferences initializer */
+ public static void initDefaults(IPreferenceStore store) {
+ store.setDefault(LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE), DISP_NAME | DISP_TYPE | DISP_MULTIPLICITY | DISP_UNDEFINED_TYPE);
+
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.WIDTH), 20);
+ store.setDefault(PreferenceConstantHelper.getElementConstant(prefKey, PreferenceConstantHelper.HEIGHT), 20);
+
+ // Initialize default visibility for labels in preference page.
+ for(String labelName : labelDefaultVisibilityMap.keySet()) {
+ String showLabelKey = PreferenceConstantHelper.getCompartmentElementConstant(prefKey, labelName, PreferenceConstantHelper.LABEL_VISIBILITY);
+ store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeLabelsList() {
+ for(String name : labelDefaultVisibilityMap.keySet()) {
+ this.labelsList.add(name);
+ }
+ }
+
+ /** buttons to select the display mask of the label */
+ protected Button bttnVisibility, bttnDerive, bttnName, bttnType, bttnUndefined_Type, bttnMultiplicity, bttnDefault_Multiplicity, bttnDefaultValue, bttnModifiers;
+
+ private String labelDisplayPreferenceKey = LabelPreferenceHelper.getPreferenceConstant(prefLabelKey, ILabelPreferenceConstants.LABEL_DISPLAY_PREFERENCE);
+
+ /** current property display style */
+ private int propertyValue = getPreferenceStore().getInt(labelDisplayPreferenceKey);
+
+ /**
+ * Creates a button with the {@link SWT#CHECK} style.
+ *
+ * @param parent
+ * the parent of the button
+ * @param label
+ * the label of the button
+ * @param mask
+ * the value controlled by the button
+ * @return the button created
+ */
+ protected Button createCheckButton(Composite parent, String label, int mask) {
+ Button button = new Button(parent, SWT.CHECK);
+ button.setText(label);
+ button.addSelectionListener(new AppearenceSelectionListener(mask));
+ return button;
+ }
+
+ /**
+ * Creates the group and check boxes to choose the kind of display
+ *
+ * @param parent
+ * the parent composite that holds the group
+ */
+ protected void createLabelPreferencesButtons(Composite parent) {
+ // create group that host the buttons
+ Group group = new Group(parent, SWT.SHADOW_NONE);
+ group.setText("Label Display");
+ group.setLayout(new FormLayout());
+
+ FormData data;
+
+ bttnVisibility = createCheckButton(group, "Visibility", DISP_VISIBILITY);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(0, 0);
+ bttnVisibility.setLayoutData(data);
+
+ bttnDerive = createCheckButton(group, "Derive", DISP_DERIVE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnDerive.setLayoutData(data);
+
+ bttnName = createCheckButton(group, "Name", DISP_NAME);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnName.setLayoutData(data);
+
+ bttnType = createCheckButton(group, "Type", DISP_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(0, 0);
+ bttnType.setLayoutData(data);
+
+ bttnUndefined_Type = createCheckButton(group, "Undefined_Type", DISP_UNDEFINED_TYPE);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnUndefined_Type.setLayoutData(data);
+
+ bttnMultiplicity = createCheckButton(group, "Multiplicity", DISP_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnVisibility, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnMultiplicity.setLayoutData(data);
+
+ bttnDefault_Multiplicity = createCheckButton(group, "Default_Multiplicity", DISP_DEFAULT_MULTIPLICITY);
+ data = new FormData();
+ data.left = new FormAttachment(bttnDerive, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnDefault_Multiplicity.setLayoutData(data);
+
+ bttnDefaultValue = createCheckButton(group, "DefaultValue", DISP_DEFAULTVALUE);
+ data = new FormData();
+ data.left = new FormAttachment(bttnName, 85);
+ data.top = new FormAttachment(bttnVisibility, ITabbedPropertyConstants.HSPACE);
+ bttnDefaultValue.setLayoutData(data);
+
+ bttnModifiers = createCheckButton(group, "Modifiers", DISP_MODIFIERS);
+ data = new FormData();
+ data.left = new FormAttachment(0, 0);
+ data.top = new FormAttachment(bttnUndefined_Type, ITabbedPropertyConstants.HSPACE);
+ bttnModifiers.setLayoutData(data);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createPageContents(Composite parent) {
+ super.createPageContents(parent);
+
+ // adds the label preferences check boxes
+ createLabelPreferencesButtons(parent);
+
+ refreshButtons();
+ }
+
+ /**
+ * Load the default preferences of the fields contained in this page
+ */
+ protected void loadDefaultPreferences() {
+ propertyValue = getPreferenceStore().getDefaultInt(labelDisplayPreferenceKey);
+ refreshButtons();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void performDefaults() {
+ loadDefaultPreferences();
+ super.performDefaults();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean performOk() {
+ storePreferences();
+ return super.performOk();
+ }
+
+ /**
+ * Refresh the buttons that manages the display.
+ */
+ protected void refreshButtons() {
+
+ bttnVisibility.setSelection((propertyValue & DISP_VISIBILITY) == DISP_VISIBILITY);
+ bttnDerive.setSelection((propertyValue & DISP_DERIVE) == DISP_DERIVE);
+ bttnName.setSelection((propertyValue & DISP_NAME) == DISP_NAME);
+ bttnType.setSelection((propertyValue & DISP_TYPE) == DISP_TYPE);
+ bttnUndefined_Type.setSelection((propertyValue & DISP_UNDEFINED_TYPE) == DISP_UNDEFINED_TYPE);
+ bttnMultiplicity.setSelection((propertyValue & DISP_MULTIPLICITY) == DISP_MULTIPLICITY);
+ bttnDefault_Multiplicity.setSelection((propertyValue & DISP_DEFAULT_MULTIPLICITY) == DISP_DEFAULT_MULTIPLICITY);
+ bttnDefaultValue.setSelection((propertyValue & DISP_DEFAULTVALUE) == DISP_DEFAULTVALUE);
+ bttnModifiers.setSelection((propertyValue & DISP_MODIFIERS) == DISP_MODIFIERS);
+
+ }
+
+ /**
+ * Stores the values of the fields contained in this page into the preference store.
+ */
+ protected void storePreferences() {
+ super.storePreferences();
+ IPreferenceStore store = getPreferenceStore();
+ // checks the stored value and the actual one, so does not refresh diagram if it is not
+ // needed
+ if(propertyValue != store.getInt(labelDisplayPreferenceKey)) {
+ store.setValue(labelDisplayPreferenceKey, propertyValue);
+ }
+ }
+
+ /**
+ * Listeners for the check buttons that select the display.
+ */
+ private class AppearenceSelectionListener implements SelectionListener {
+
+ /** The constant which refers the element to display or not. */
+ final private int style;
+
+ /**
+ * Default Constructor.
+ *
+ * @param style
+ */
+ public AppearenceSelectionListener(int style) {
+ this.style = style;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // add or remove the flag to the display property value (invert the current value)
+ propertyValue = propertyValue ^ style;
+ // refresh buttons to show current values
+ refreshButtons();
+ }
+ }
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PropertyPreferencePage.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PropertyPreferencePage.java
deleted file mode 100644
index 543e336780a..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/preferences/PropertyPreferencePage.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.preferences;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusNodePreferencePage;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class PropertyPreferencePage extends AbstractPapyrusNodePreferencePage {
-
- /**
- * @generated
- */
- public PropertyPreferencePage() {
- super();
- setPreferenceKey(ParametricEditPart.MODEL_ID + "_Property");
- }
-
- /**
- * @generated
- */
- @Override
- protected String getBundleId() {
- return SysmlDiagramEditorPlugin.ID;
- }
-
- /**
- * @generated
- */
- public static void initDefaults(IPreferenceStore store) {
-
- String key = ParametricEditPart.MODEL_ID + "_Property";
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.WIDTH), 40);
- store.setDefault(PreferenceConstantHelper.getElementConstant(key, PreferenceConstantHelper.HEIGHT), 40);
-
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_FILL), new org.eclipse.swt.graphics.RGB(255, 255, 255));
- //org.eclipse.jface.preference.PreferenceConverter.setDefault(store, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_LINE), new org.eclipse.swt.graphics.RGB(0, 0, 0));
-
- // Set the default for the gradient
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.GRADIENT_POLICY),false);
- //org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter gradientPreferenceConverter = new org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter(
- // new org.eclipse.swt.graphics.RGB(255, 255, 255),
- // new org.eclipse.swt.graphics.RGB(0, 0, 0), 0, 0);
- //store.setDefault(org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.getElementConstant(elementName, org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper.COLOR_GRADIENT), gradientPreferenceConverter.getPreferenceValue());
-
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPolicyProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPolicyProvider.java
new file mode 100644
index 00000000000..9a5df313ee8
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/CustomEditPolicyProvider.java
@@ -0,0 +1,188 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultCreationEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultGraphicalNodeEditPolicy;
+import org.eclipse.papyrus.gmf.diagram.common.edit.policy.DefaultXYLayoutEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.BlockPropertyStructureCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.ConstraintBlockPropertyCompositeEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.FlowPortAffixedNodeEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.part.StructureCompartmentEditPart;
+import org.eclipse.papyrus.sysml.diagram.common.edit.policy.CustomDuplicatePasteEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.part.InternalBlockDiagramEditPart;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomBlockCompositeSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomBlockPropertyCompositeDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDefaultSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDiagramDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.CustomDragDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.EncapsulatedClassifierDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.StructureClassifierDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.internalblock.edit.policy.TypedElementDropEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.CustomBlockCompositeEditPartTN;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.part.ParametricDiagramEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.policies.CustomParametricSemanticPolicy;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementBorderEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.AbstractElementLinkEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConnectorEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.ConstraintParameterAffixedNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.DependencyEditPart;
+import org.eclipse.papyrus.uml.diagram.common.edit.part.PortAffixedNodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.DuplicatePasteEditPolicy;
+import org.eclipse.papyrus.uml.diagram.composite.edit.parts.CommentEditPart;
+import org.eclipse.papyrus.uml.diagram.composite.edit.parts.CommentEditPartCN;
+import org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintEditPart;
+import org.eclipse.papyrus.uml.diagram.composite.edit.parts.ConstraintEditPartCN;
+
+/**
+ * Custom edit policy provider.
+ */
+public class CustomEditPolicyProvider extends ParametricDiagramEditPolicyProvider {
+
+ @Override
+ public boolean provides(IOperation operation) {
+
+ CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
+ if(!(epOperation.getEditPart() instanceof IGraphicalEditPart)) {
+ return false;
+ }
+
+ // Make sure this concern Parametric Diagram only
+ IGraphicalEditPart gep = (IGraphicalEditPart)epOperation.getEditPart();
+ String diagramType = gep.getNotationView().getDiagram().getType();
+ if(!ElementTypes.DIAGRAM_ID.equals(diagramType)) {
+ return false;
+ }
+
+ // provides for the main diagram edit part
+ if(gep instanceof ParametricDiagramEditPart) {
+ return true;
+ }
+
+ // Provides for edit parts that represent nodes in Internal Block diagram
+ if(gep instanceof AbstractElementEditPart) {
+ return true;
+ }
+ if(gep instanceof AbstractElementBorderEditPart) {
+ return true;
+ }
+
+ // Provides for edit parts that represent edges in Internal Block diagram
+ if(gep instanceof AbstractElementLinkEditPart) {
+ return true;
+ }
+
+ if(gep instanceof ResizableCompartmentEditPart) {
+ return true;
+ }
+
+ return super.provides(operation);
+ }
+
+ @Override
+ public void createEditPolicies(EditPart editPart) {
+ super.createEditPolicies(editPart);
+
+ if(editPart instanceof InternalBlockDiagramEditPart) {
+ editPart.installEditPolicy(DuplicatePasteEditPolicy.PASTE_ROLE, new CustomDuplicatePasteEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDiagramDropEditPolicy());
+ // no installation of other policies.
+ return;
+ }
+
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomDragDropEditPolicy());
+
+ if((editPart instanceof ConstraintEditPart) || (editPart instanceof ConstraintEditPartCN)) {
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDefaultSemanticEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
+ editPart.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+ }
+
+ if((editPart instanceof CommentEditPart) || (editPart instanceof CommentEditPartCN)) {
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDefaultSemanticEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.CREATION_ROLE, new DefaultCreationEditPolicy());
+ editPart.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE, new DefaultGraphicalNodeEditPolicy());
+ }
+
+ if(editPart instanceof FlowPortAffixedNodeEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new TypedElementDropEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+
+ if(editPart instanceof PortAffixedNodeEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new TypedElementDropEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+
+ if(editPart instanceof BlockPropertyCompositeEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomBlockPropertyCompositeDropEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+
+ /*
+ * if(editPart instanceof NestedBlockPropertyCompositeEditPart) {
+ * editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomBlockPropertyCompositeDropEditPolicy());
+ * editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomNestedBlockPropertyCompositeSemanticEditPolicy());
+ * }
+ */
+
+ if(editPart instanceof BlockPropertyStructureCompartmentEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomBlockPropertyStructureCompartmentEditPartDropEditPolicy());
+ editPart.installEditPolicy(EditPolicy.LAYOUT_ROLE, new DefaultXYLayoutEditPolicy());
+ }
+
+ if(editPart instanceof BlockCompositeEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new EncapsulatedClassifierDropEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomBlockCompositeSemanticEditPolicy());
+ }
+
+ if(editPart instanceof StructureCompartmentEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new StructureClassifierDropEditPolicy());
+ editPart.installEditPolicy(EditPolicy.LAYOUT_ROLE, new DefaultXYLayoutEditPolicy());
+ }
+
+ if(editPart instanceof DependencyEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDefaultSemanticEditPolicy());
+ }
+
+ if(editPart instanceof ConnectorEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomDefaultSemanticEditPolicy());
+ }
+
+ if(editPart instanceof ConstraintBlockPropertyCompositeEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new CustomBlockPropertyCompositeDropEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+ if(editPart instanceof ConstraintParameterAffixedNodeEditPart) {
+ editPart.installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE, new TypedElementDropEditPolicy());
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+ if(editPart instanceof CustomBlockCompositeEditPartTN) {
+ editPart.installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new CustomParametricSemanticPolicy());
+ }
+
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParserProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParserProvider.java
new file mode 100644
index 00000000000..f42d1cf88f5
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/provider/ParserProvider.java
@@ -0,0 +1,107 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.provider;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.common.parser.FlowPortLabelParser;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.sysml.diagram.parametric.parser.ParametricFrameParser;
+import org.eclipse.papyrus.uml.diagram.common.parser.ConnectorLabelParser;
+import org.eclipse.papyrus.uml.diagram.common.parser.ConstraintLabelParser;
+import org.eclipse.papyrus.uml.diagram.common.parser.MultiplicityElementLabelParser;
+import org.eclipse.papyrus.uml.diagram.common.parser.NamedElementLabelParser;
+import org.eclipse.papyrus.uml.diagram.common.parser.PropertyLabelParser;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+
+/**
+ * Parser provider for labels used by this diagram.
+ */
+public class ParserProvider extends AbstractProvider implements IParserProvider {
+
+ /** map from graphical hint to parsers */
+ private static final Map<String, IParser> graphicalHintToParser = new HashMap<String, IParser>();
+
+ static {
+ graphicalHintToParser.put(SysMLGraphicalTypes.LABEL_SYSML_BLOCK_NAME_ID, new ParametricFrameParser());
+ graphicalHintToParser.put(UMLGraphicalTypes.LABEL_UML_PROPERTY_LABEL_ID, new PropertyLabelParser());
+ graphicalHintToParser.put(UMLGraphicalTypes.SHAPE_UML_CONSTRAINT_AS_LABEL_ID, new ConstraintLabelParser());
+
+ graphicalHintToParser.put(UMLGraphicalTypes.AFFIXEDLABEL_UML_PORT_LABEL_ID, new PropertyLabelParser());
+ graphicalHintToParser.put(SysMLGraphicalTypes.AFFIXEDLABEL_SYSML_FLOWPORT_LABEL_ID, new FlowPortLabelParser());
+
+ graphicalHintToParser.put(UMLGraphicalTypes.LINKLABEL_UML_NAMEDELEMENT_NAME_ID, new NamedElementLabelParser());
+ graphicalHintToParser.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_LABEL_ID, new ConnectorLabelParser());
+ graphicalHintToParser.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_SOURCE_MULTIPLICITY_ID, new MultiplicityElementLabelParser());
+ graphicalHintToParser.put(UMLGraphicalTypes.LINKLABEL_UML_CONNECTOR_TARGET_MULTIPLICITY_ID, new MultiplicityElementLabelParser());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean provides(IOperation operation) {
+ if(operation instanceof GetParserOperation) {
+ IAdaptable hint = ((GetParserOperation)operation).getHint();
+
+ if(!ElementTypes.DIAGRAM_ID.equals(getDiagramType(hint))) {
+ return false;
+ }
+
+ return getParser(hint) != null;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IParser getParser(IAdaptable hint) {
+ String parserHint = (String)hint.getAdapter(String.class);
+ if(parserHint != null) {
+ IParser parser = graphicalHintToParser.get(parserHint);
+ if(parser != null) {
+ return parser;
+ }
+ }
+
+ View view = (View)hint.getAdapter(View.class);
+ if(view != null) {
+ IParser parser = graphicalHintToParser.get(view.getType());
+ if(parser != null) {
+ return parser;
+ }
+ }
+
+ return null;
+ }
+
+ private String getDiagramType(IAdaptable hint) {
+ Diagram diagram = (Diagram)hint.getAdapter(Diagram.class);
+ if(diagram != null) {
+ return diagram.getType();
+ }
+
+ return "undefined";
+ }
+
+}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ElementInitializers.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ElementInitializers.java
deleted file mode 100644
index 6d0aabf99a3..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/ElementInitializers.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-
-/**
- * @generated
- */
-public class ElementInitializers {
-
- protected ElementInitializers() {
- // use #getInstance to access cached instance
- }
-
- /**
- * @generated
- */
- public static ElementInitializers getInstance() {
- ElementInitializers cached = SysmlDiagramEditorPlugin.getInstance().getElementInitializers();
- if(cached == null) {
- SysmlDiagramEditorPlugin.getInstance().setElementInitializers(cached = new ElementInitializers());
- }
- return cached;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlEditPartProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlEditPartProvider.java
deleted file mode 100644
index 96765925ad2..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlEditPartProvider.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import java.lang.ref.WeakReference;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.AbstractEditPartProvider;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.SysmlEditPartFactory;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-
-/**
- * @generated
- */
-public class SysmlEditPartProvider extends AbstractEditPartProvider {
-
- /**
- * @generated
- */
- private EditPartFactory factory;
-
- /**
- * @generated
- */
- private boolean allowCaching;
-
- /**
- * @generated
- */
- private WeakReference cachedPart;
-
- /**
- * @generated
- */
- private WeakReference cachedView;
-
- /**
- * @generated
- */
- public SysmlEditPartProvider() {
- setFactory(new SysmlEditPartFactory());
- setAllowCaching(true);
- }
-
- /**
- * @generated
- */
- public final EditPartFactory getFactory() {
- return factory;
- }
-
- /**
- * @generated
- */
- protected void setFactory(EditPartFactory factory) {
- this.factory = factory;
- }
-
- /**
- * @generated
- */
- public final boolean isAllowCaching() {
- return allowCaching;
- }
-
- /**
- * @generated
- */
- protected synchronized void setAllowCaching(boolean allowCaching) {
- this.allowCaching = allowCaching;
- if(!allowCaching) {
- cachedPart = null;
- cachedView = null;
- }
- }
-
- /**
- * @generated
- */
- protected IGraphicalEditPart createEditPart(View view) {
- EditPart part = factory.createEditPart(null, view);
- if(part instanceof IGraphicalEditPart) {
- return (IGraphicalEditPart)part;
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IGraphicalEditPart getCachedPart(View view) {
- if(cachedView != null && cachedView.get() == view) {
- return (IGraphicalEditPart)cachedPart.get();
- }
- return null;
- }
-
- /**
- * @generated
- */
- public synchronized IGraphicalEditPart createGraphicEditPart(View view) {
- if(isAllowCaching()) {
- IGraphicalEditPart part = getCachedPart(view);
- cachedPart = null;
- cachedView = null;
- if(part != null) {
- return part;
- }
- }
- return createEditPart(view);
- }
-
- /**
- * @generated
- */
- public synchronized boolean provides(IOperation operation) {
- if(operation instanceof CreateGraphicEditPartOperation) {
- View view = ((IEditPartOperation)operation).getView();
- if(!ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(view))) {
- return false;
- }
- if(isAllowCaching() && getCachedPart(view) != null) {
- return true;
- }
- IGraphicalEditPart part = createEditPart(view);
- if(part != null) {
- if(isAllowCaching()) {
- cachedPart = new WeakReference(part);
- cachedView = new WeakReference(view);
- }
- return true;
- }
- }
- return false;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlElementTypes.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlElementTypes.java
deleted file mode 100644
index 68610eb87ab..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlElementTypes.java
+++ /dev/null
@@ -1,252 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.papyrus.resource.ResourcePackage;
-import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class SysmlElementTypes {
-
- /**
- * @generated
- */
- private SysmlElementTypes() {
- }
-
- /**
- * @generated
- */
- private static Map<IElementType, ENamedElement> elements;
-
- /**
- * @generated
- */
- private static ImageRegistry imageRegistry;
-
- /**
- * @generated
- */
- private static Set<IElementType> KNOWN_ELEMENT_TYPES;
-
- /**
- * @generated
- */
- public static final IElementType Resource_1000 = getElementType("org.eclipse.papyrus.sysml.diagram.parametric.Resource_1000"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType ConstraintProperty_2003 = getElementType("org.eclipse.papyrus.sysml.diagram.parametric.ConstraintProperty_2003"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Property_2005 = getElementType("org.eclipse.papyrus.sysml.diagram.parametric.Property_2005"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Property_3002 = getElementType("org.eclipse.papyrus.sysml.diagram.parametric.Property_3002"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final IElementType Connector_4001 = getElementType("org.eclipse.papyrus.sysml.diagram.parametric.Connector_4001"); //$NON-NLS-1$
-
- /**
- * @generated
- */
- private static ImageRegistry getImageRegistry() {
- if(imageRegistry == null) {
- imageRegistry = new ImageRegistry();
- }
- return imageRegistry;
- }
-
- /**
- * @generated
- */
- private static String getImageRegistryKey(ENamedElement element) {
- return element.getName();
- }
-
- /**
- * @generated
- */
- private static ImageDescriptor getProvidedImageDescriptor(ENamedElement element) {
- if(element instanceof EStructuralFeature) {
- EStructuralFeature feature = ((EStructuralFeature)element);
- EClass eContainingClass = feature.getEContainingClass();
- EClassifier eType = feature.getEType();
- if(eContainingClass != null && !eContainingClass.isAbstract()) {
- element = eContainingClass;
- } else if(eType instanceof EClass && !((EClass)eType).isAbstract()) {
- element = eType;
- }
- }
- if(element instanceof EClass) {
- EClass eClass = (EClass)element;
- if(!eClass.isAbstract()) {
- return SysmlDiagramEditorPlugin.getInstance().getItemImageDescriptor(eClass.getEPackage().getEFactoryInstance().create(eClass));
- }
- }
- // TODO : support structural features
- return null;
- }
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(ENamedElement element) {
- String key = getImageRegistryKey(element);
- ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(key);
- if(imageDescriptor == null) {
- imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(key, imageDescriptor);
- }
- return imageDescriptor;
- }
-
- /**
- * @generated
- */
- public static Image getImage(ENamedElement element) {
- String key = getImageRegistryKey(element);
- Image image = getImageRegistry().get(key);
- if(image == null) {
- ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
- if(imageDescriptor == null) {
- imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- getImageRegistry().put(key, imageDescriptor);
- image = getImageRegistry().get(key);
- }
- return image;
- }
-
- /**
- * @generated
- */
- public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
- ENamedElement element = getElement(hint);
- if(element == null) {
- return null;
- }
- return getImageDescriptor(element);
- }
-
- /**
- * @generated
- */
- public static Image getImage(IAdaptable hint) {
- ENamedElement element = getElement(hint);
- if(element == null) {
- return null;
- }
- return getImage(element);
- }
-
- /**
- * Returns 'type' of the ecore object associated with the hint.
- *
- * @generated
- */
- public static ENamedElement getElement(IAdaptable hint) {
- Object type = hint.getAdapter(IElementType.class);
- if(elements == null) {
- elements = new IdentityHashMap<IElementType, ENamedElement>();
-
- elements.put(Resource_1000, ResourcePackage.eINSTANCE.getResource());
-
- elements.put(ConstraintProperty_2003, ConstraintsPackage.eINSTANCE.getConstraintProperty());
-
- elements.put(Property_2005, UMLPackage.eINSTANCE.getProperty());
-
- elements.put(Property_3002, UMLPackage.eINSTANCE.getProperty());
-
- elements.put(Connector_4001, UMLPackage.eINSTANCE.getConnector());
- }
- return (ENamedElement)elements.get(type);
- }
-
- /**
- * @generated
- */
- private static IElementType getElementType(String id) {
- return ElementTypeRegistry.getInstance().getType(id);
- }
-
- /**
- * @generated
- */
- public static boolean isKnownElementType(IElementType elementType) {
- if(KNOWN_ELEMENT_TYPES == null) {
- KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
- KNOWN_ELEMENT_TYPES.add(Resource_1000);
- KNOWN_ELEMENT_TYPES.add(ConstraintProperty_2003);
- KNOWN_ELEMENT_TYPES.add(Property_2005);
- KNOWN_ELEMENT_TYPES.add(Property_3002);
- KNOWN_ELEMENT_TYPES.add(Connector_4001);
- }
- return KNOWN_ELEMENT_TYPES.contains(elementType);
- }
-
- /**
- * @generated
- */
- public static IElementType getElementType(int visualID) {
- switch(visualID) {
- case ParametricEditPart.VISUAL_ID:
- return Resource_1000;
- case ConstraintPropertyEditPart.VISUAL_ID:
- return ConstraintProperty_2003;
- case PropertyEditPart.VISUAL_ID:
- return Property_2005;
- case Property2EditPart.VISUAL_ID:
- return Property_3002;
- case ConnectorEditPart.VISUAL_ID:
- return Connector_4001;
- }
- return null;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlIconProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlIconProvider.java
deleted file mode 100644
index 59bfd52ef86..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlIconProvider.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.ui.services.icon.GetIconOperation;
-import org.eclipse.gmf.runtime.common.ui.services.icon.IIconProvider;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @generated
- */
-public class SysmlIconProvider extends AbstractProvider implements IIconProvider {
-
- /**
- * @generated
- */
- public Image getIcon(IAdaptable hint, int flags) {
- return SysmlElementTypes.getImage(hint);
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if(operation instanceof GetIconOperation) {
- return ((GetIconOperation)operation).execute(this) != null;
- }
- return false;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlMarkerNavigationProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlMarkerNavigationProvider.java
deleted file mode 100644
index 208d2957396..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlMarkerNavigationProvider.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import java.util.Arrays;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNavigationProvider;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorUtil;
-
-/**
- * @generated
- */
-public class SysmlMarkerNavigationProvider extends AbstractModelMarkerNavigationProvider {
-
- /**
- * @generated
- */
- public static final String MARKER_TYPE = SysmlDiagramEditorPlugin.ID + ".diagnostic"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- protected void doGotoMarker(IMarker marker) {
- String elementId = marker.getAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, null);
- if(elementId == null || !(getEditor() instanceof DiagramEditor)) {
- return;
- }
- DiagramEditor editor = (DiagramEditor)getEditor();
- Map editPartRegistry = editor.getDiagramGraphicalViewer().getEditPartRegistry();
- EObject targetView = editor.getDiagram().eResource().getEObject(elementId);
- if(targetView == null) {
- return;
- }
- EditPart targetEditPart = (EditPart)editPartRegistry.get(targetView);
- if(targetEditPart != null) {
- SysmlDiagramEditorUtil.selectElementsInDiagram(editor, Arrays.asList(new EditPart[]{ targetEditPart }));
- }
- }
-
- /**
- * @generated
- */
- public static void deleteMarkers(IResource resource) {
- try {
- resource.deleteMarkers(MARKER_TYPE, true, IResource.DEPTH_ZERO);
- } catch (CoreException e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Failed to delete validation markers", e); //$NON-NLS-1$
- }
- }
-
- /**
- * @generated
- */
- public static IMarker addMarker(IFile file, String elementId, String location, String message, int statusSeverity) {
- IMarker marker = null;
- try {
- marker = file.createMarker(MARKER_TYPE);
- marker.setAttribute(IMarker.MESSAGE, message);
- marker.setAttribute(IMarker.LOCATION, location);
- marker.setAttribute(org.eclipse.gmf.runtime.common.ui.resources.IMarker.ELEMENT_ID, elementId);
- int markerSeverity = IMarker.SEVERITY_INFO;
- if(statusSeverity == IStatus.WARNING) {
- markerSeverity = IMarker.SEVERITY_WARNING;
- } else if(statusSeverity == IStatus.ERROR || statusSeverity == IStatus.CANCEL) {
- markerSeverity = IMarker.SEVERITY_ERROR;
- }
- marker.setAttribute(IMarker.SEVERITY, markerSeverity);
- } catch (CoreException e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Failed to create validation marker", e); //$NON-NLS-1$
- }
- return marker;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlModelingAssistantProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlModelingAssistantProvider.java
deleted file mode 100644
index d156ebcf763..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlModelingAssistantProvider.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.Messages;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * @generated
- */
-public class SysmlModelingAssistantProvider extends ModelingAssistantProvider {
-
- /**
- * @generated
- */
- public List getTypesForPopupBar(IAdaptable host) {
- IGraphicalEditPart editPart = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(editPart instanceof ParametricEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(2);
- types.add(SysmlElementTypes.ConstraintProperty_2003);
- types.add(SysmlElementTypes.Property_2005);
- return types;
- }
- if(editPart instanceof ConstraintPropertyEditPart) {
- ArrayList<IElementType> types = new ArrayList<IElementType>(1);
- types.add(SysmlElementTypes.Property_3002);
- return types;
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnSource(IAdaptable source) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof PropertyEditPart) {
- return ((PropertyEditPart)sourceEditPart).getMARelTypesOnSource();
- }
- if(sourceEditPart instanceof Property2EditPart) {
- return ((Property2EditPart)sourceEditPart).getMARelTypesOnSource();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnTarget(IAdaptable target) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(targetEditPart instanceof PropertyEditPart) {
- return ((PropertyEditPart)targetEditPart).getMARelTypesOnTarget();
- }
- if(targetEditPart instanceof Property2EditPart) {
- return ((Property2EditPart)targetEditPart).getMARelTypesOnTarget();
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof PropertyEditPart) {
- return ((PropertyEditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- if(sourceEditPart instanceof Property2EditPart) {
- return ((Property2EditPart)sourceEditPart).getMARelTypesOnSourceAndTarget(targetEditPart);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getTypesForSource(IAdaptable target, IElementType relationshipType) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)target.getAdapter(IGraphicalEditPart.class);
- if(targetEditPart instanceof PropertyEditPart) {
- return ((PropertyEditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- if(targetEditPart instanceof Property2EditPart) {
- return ((Property2EditPart)targetEditPart).getMATypesForSource(relationshipType);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public List getTypesForTarget(IAdaptable source, IElementType relationshipType) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)source.getAdapter(IGraphicalEditPart.class);
- if(sourceEditPart instanceof PropertyEditPart) {
- return ((PropertyEditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- if(sourceEditPart instanceof Property2EditPart) {
- return ((Property2EditPart)sourceEditPart).getMATypesForTarget(relationshipType);
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * @generated
- */
- public EObject selectExistingElementForSource(IAdaptable target, IElementType relationshipType) {
- return selectExistingElement(target, getTypesForSource(target, relationshipType));
- }
-
- /**
- * @generated
- */
- public EObject selectExistingElementForTarget(IAdaptable source, IElementType relationshipType) {
- return selectExistingElement(source, getTypesForTarget(source, relationshipType));
- }
-
- /**
- * @generated
- */
- protected EObject selectExistingElement(IAdaptable host, Collection types) {
- if(types.isEmpty()) {
- return null;
- }
- IGraphicalEditPart editPart = (IGraphicalEditPart)host.getAdapter(IGraphicalEditPart.class);
- if(editPart == null) {
- return null;
- }
- Diagram diagram = (Diagram)editPart.getRoot().getContents().getModel();
- HashSet<EObject> elements = new HashSet<EObject>();
- for(Iterator<EObject> it = diagram.getElement().eAllContents(); it.hasNext();) {
- EObject element = it.next();
- if(isApplicableElement(element, types)) {
- elements.add(element);
- }
- }
- if(elements.isEmpty()) {
- return null;
- }
- return selectElement((EObject[])elements.toArray(new EObject[elements.size()]));
- }
-
- /**
- * @generated
- */
- protected boolean isApplicableElement(EObject element, Collection types) {
- IElementType type = ElementTypeRegistry.getInstance().getElementType(element);
- return types.contains(type);
- }
-
- /**
- * @generated
- */
- protected EObject selectElement(EObject[] elements) {
- Shell shell = Display.getCurrent().getActiveShell();
- ILabelProvider labelProvider = new AdapterFactoryLabelProvider(SysmlDiagramEditorPlugin.getInstance().getItemProvidersAdapterFactory());
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, labelProvider);
- dialog.setMessage(Messages.SysmlModelingAssistantProviderMessage);
- dialog.setTitle(Messages.SysmlModelingAssistantProviderTitle);
- dialog.setMultipleSelection(false);
- dialog.setElements(elements);
- EObject selected = null;
- if(dialog.open() == Window.OK) {
- selected = (EObject)dialog.getFirstResult();
- }
- return selected;
- }
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java
deleted file mode 100644
index 069a3928697..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.ui.services.parser.GetParserOperation;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserProvider;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintLabelEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.parsers.ConnectorLabelParser;
-import org.eclipse.papyrus.sysml.diagram.parametric.parsers.ConstraintLabelParser;
-import org.eclipse.papyrus.sysml.diagram.parametric.parsers.ConstraintPropertyLabelParser;
-import org.eclipse.papyrus.sysml.diagram.parametric.parsers.PropertyLabelParser;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-
-/**
- * @generated
- */
-public class SysmlParserProvider extends AbstractProvider implements IParserProvider {
-
- /**
- * @generated
- */
- private ConstraintPropertyLabelParser constraintPropertyLabel_5001Parser;
-
- /**
- * @generated
- */
- private IParser getConstraintPropertyLabel_5001Parser() {
- if(constraintPropertyLabel_5001Parser == null) {
- constraintPropertyLabel_5001Parser = new ConstraintPropertyLabelParser();
- }
- return constraintPropertyLabel_5001Parser;
- }
-
- /**
- * @generated
- */
- private ConstraintLabelParser constraintPropertyLabel_5004Parser;
-
- /**
- * @generated
- */
- private IParser getConstraintPropertyLabel_5004Parser() {
- if(constraintPropertyLabel_5004Parser == null) {
- constraintPropertyLabel_5004Parser = new ConstraintLabelParser();
- }
- return constraintPropertyLabel_5004Parser;
- }
-
- /**
- * @generated
- */
- private PropertyLabelParser propertyName_5002Parser;
-
- /**
- * @generated
- */
- private IParser getPropertyName_5002Parser() {
- if(propertyName_5002Parser == null) {
- propertyName_5002Parser = new PropertyLabelParser();
- }
- return propertyName_5002Parser;
- }
-
- /**
- * @generated
- */
- private PropertyLabelParser propertyName_5003Parser;
-
- /**
- * @generated
- */
- private IParser getPropertyName_5003Parser() {
- if(propertyName_5003Parser == null) {
- propertyName_5003Parser = new PropertyLabelParser();
- }
- return propertyName_5003Parser;
- }
-
- /**
- * @generated
- */
- private ConnectorLabelParser connectorName_6001Parser;
-
- /**
- * @generated
- */
- private IParser getConnectorName_6001Parser() {
- if(connectorName_6001Parser == null) {
- connectorName_6001Parser = new ConnectorLabelParser();
- }
- return connectorName_6001Parser;
- }
-
- /**
- * @generated
- */
- protected IParser getParser(int visualID) {
- switch(visualID) {
- case ConstraintPropertyNameEditPart.VISUAL_ID:
- return getConstraintPropertyLabel_5001Parser();
- case ConstraintLabelEditPart.VISUAL_ID:
- return getConstraintPropertyLabel_5004Parser();
- case PropertyNameEditPart.VISUAL_ID:
- return getPropertyName_5002Parser();
- case PropertyName2EditPart.VISUAL_ID:
- return getPropertyName_5003Parser();
- case ConnectorNameEditPart.VISUAL_ID:
- return getConnectorName_6001Parser();
- }
- return null;
- }
-
- /**
- * Utility method that consults ParserService
- *
- * @generated
- */
- public static IParser getParser(IElementType type, EObject object, String parserHint) {
- return ParserService.getInstance().getParser(new HintAdapter(type, object, parserHint));
- }
-
- /**
- * @generated
- */
- public IParser getParser(IAdaptable hint) {
- String vid = (String)hint.getAdapter(String.class);
- if(vid != null) {
- return getParser(SysmlVisualIDRegistry.getVisualID(vid));
- }
- View view = (View)hint.getAdapter(View.class);
- if(view != null) {
- return getParser(SysmlVisualIDRegistry.getVisualID(view));
- }
- return null;
- }
-
- /**
- * @generated
- */
- public boolean provides(IOperation operation) {
- if(operation instanceof GetParserOperation) {
- IAdaptable hint = ((GetParserOperation)operation).getHint();
- if(SysmlElementTypes.getElement(hint) == null) {
- return false;
- }
- return getParser(hint) != null;
- }
- return false;
- }
-
- /**
- * @generated
- */
- private static class HintAdapter extends ParserHintAdapter {
-
- /**
- * @generated
- */
- private final IElementType elementType;
-
- /**
- * @generated
- */
- public HintAdapter(IElementType type, EObject object, String parserHint) {
- super(object, parserHint);
- assert type != null;
- elementType = type;
- }
-
- /**
- * @generated
- */
- public Object getAdapter(Class adapter) {
- if(IElementType.class.equals(adapter)) {
- return elementType;
- }
- return super.getAdapter(adapter);
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlValidationProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlValidationProvider.java
deleted file mode 100644
index d2ef28d8f7c..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlValidationProvider.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.validation.AbstractModelConstraint;
-import org.eclipse.emf.validation.IValidationContext;
-import org.eclipse.emf.validation.model.IClientSelector;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.blocks.NestedConnectorEnd;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.helper.ModelValidationHelper;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * @generated
- */
-public class SysmlValidationProvider {
-
- /**
- * @generated
- */
- private static boolean constraintsActive = false;
-
- /**
- * @generated
- */
- public static boolean shouldConstraintsBePrivate() {
- return false;
- }
-
- /**
- * @generated
- */
- public static void runWithConstraints(TransactionalEditingDomain editingDomain, Runnable operation) {
- final Runnable op = operation;
- Runnable task = new Runnable() {
-
- public void run() {
- try {
- constraintsActive = true;
- op.run();
- } finally {
- constraintsActive = false;
- }
- }
- };
- if(editingDomain != null) {
- try {
- editingDomain.runExclusive(task);
- } catch (Exception e) {
- SysmlDiagramEditorPlugin.getInstance().logError("Validation failed", e); //$NON-NLS-1$
- }
- } else {
- task.run();
- }
- }
-
- /**
- * @generated
- */
- static boolean isInDefaultEditorContext(Object object) {
- if(shouldConstraintsBePrivate() && !constraintsActive) {
- return false;
- }
- if(object instanceof View) {
- return constraintsActive && ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID((View)object));
- }
- return true;
- }
-
- /**
- * @generated
- */
- public static class DefaultCtx implements IClientSelector {
-
- /**
- * @generated
- */
- public boolean selects(Object object) {
- return isInDefaultEditorContext(object);
- }
- }
-
- /**
- * @generated
- */
- public static class Adapter1 extends AbstractModelConstraint {
-
- /**
- * @generated
- */
- public IStatus validate(IValidationContext ctx) {
- Connector context = (Connector)ctx.getTarget();
- return ModelValidationHelper.validateConnector(context, ctx);
- }
- }
-
- /**
- * @generated
- */
- public static class Adapter2 extends AbstractModelConstraint {
-
- /**
- * @generated
- */
- public IStatus validate(IValidationContext ctx) {
- Property context = (Property)ctx.getTarget();
- return ModelValidationHelper.validateProperty(context, ctx);
- }
- }
-
- /**
- * @generated
- */
- public static class Adapter3 extends AbstractModelConstraint {
-
- /**
- * @generated
- */
- public IStatus validate(IValidationContext ctx) {
- ConnectorEnd context = (ConnectorEnd)ctx.getTarget();
- return ModelValidationHelper.validateConnectorEnd(context, ctx);
- }
- }
-
- /**
- * @generated
- */
- public static class Adapter4 extends AbstractModelConstraint {
-
- /**
- * @generated
- */
- public IStatus validate(IValidationContext ctx) {
- NestedConnectorEnd context = (NestedConnectorEnd)ctx.getTarget();
- return ModelValidationHelper.validateNestedConnectorEnd(context, ctx);
- }
- }
-
- /**
- * @generated
- */
- static String formatElement(EObject object) {
- return EMFCoreUtil.getQualifiedName(object, true);
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java
deleted file mode 100644
index 626f32b3c17..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java
+++ /dev/null
@@ -1,489 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.providers;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.providers.IViewProvider;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateDiagramViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateEdgeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateNodeViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewForKindOperation;
-import org.eclipse.gmf.runtime.diagram.core.services.view.CreateViewOperation;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Connector;
-import org.eclipse.gmf.runtime.notation.DecorationNode;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.MeasurementUnit;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationFactory;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.gmf.runtime.notation.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.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintLabelEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ParametricEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.uml.diagram.common.helper.PreferenceInitializerForElementHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.StructuredClassifier;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * @generated
- */
-public class SysmlViewProvider extends AbstractProvider implements IViewProvider {
-
- /**
- * @generated
- */
- public final boolean provides(IOperation operation) {
- if(operation instanceof CreateViewForKindOperation) {
- return provides((CreateViewForKindOperation)operation);
- }
- assert operation instanceof CreateViewOperation;
- if(operation instanceof CreateDiagramViewOperation) {
- return provides((CreateDiagramViewOperation)operation);
- } else if(operation instanceof CreateEdgeViewOperation) {
- return provides((CreateEdgeViewOperation)operation);
- } else if(operation instanceof CreateNodeViewOperation) {
- return provides((CreateNodeViewOperation)operation);
- }
- return false;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateViewForKindOperation op) {
- /*
- * if (op.getViewKind() == Node.class)
- * return getNodeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- * if (op.getViewKind() == Edge.class)
- * return getEdgeViewClass(op.getSemanticAdapter(), op.getContainerView(), op.getSemanticHint()) != null;
- */
-
- // check Diagram Type should be the class diagram
- String modelID = SysmlVisualIDRegistry.getModelID(op.getContainerView());
- if(!getDiagramProvidedId().equals(modelID)) {
- return false;
- }
-
- int visualID = SysmlVisualIDRegistry.getVisualID(op.getSemanticHint());
- if(Node.class.isAssignableFrom(op.getViewKind())) {
- return SysmlVisualIDRegistry.canCreateNode(op.getContainerView(), visualID);
- }
-
- return true;
- }
-
- /**
- * @generated
- */
- protected String getDiagramProvidedId() {
- /*
- * Indicates for which diagram this provider works for.
- * <p>
- * This method can be overloaded when diagram editor inherits from another one, but should never be <code>null</code>
- * </p>
- *
- * @return the unique identifier of the diagram for which views are provided.
- */
- return ParametricEditPart.MODEL_ID;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateDiagramViewOperation op) {
- return ParametricEditPart.MODEL_ID.equals(op.getSemanticHint()) && SysmlVisualIDRegistry.getDiagramVisualID(getSemanticElement(op.getSemanticAdapter())) != -1;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateNodeViewOperation op) {
- if(op.getContainerView() == null) {
- return false;
- }
- IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- int visualID;
- if(op.getSemanticHint() == null) {
- // Semantic hint is not specified. Can be a result of call from CanonicalEditPolicy.
- // In this situation there should be NO elementType, visualID will be determined
- // by VisualIDRegistry.getNodeVisualID() for domainElement.
- if(elementType != null || domainElement == null) {
- return false;
- }
- visualID = SysmlVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement);
- } else {
- visualID = SysmlVisualIDRegistry.getVisualID(op.getSemanticHint());
- if(elementType != null) {
- if(!SysmlElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
- return false; // foreign element type
- }
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(!op.getSemanticHint().equals(elementTypeHint)) {
- return false; // if semantic hint is specified it should be the same as in element type
- }
- if(domainElement != null && visualID != SysmlVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
- return false; // visual id for node EClass should match visual id from element type
- }
- } else {
- if(!ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(op.getContainerView()))) {
- return false; // foreign diagram
- }
- switch(visualID) {
- case ConstraintPropertyEditPart.VISUAL_ID:
- case Property2EditPart.VISUAL_ID:
- case PropertyEditPart.VISUAL_ID:
- if(domainElement == null || visualID != SysmlVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
- return false; // visual id in semantic hint should match visual id for domain element
- }
- break;
- default:
- return false;
- }
- }
- }
- return ConstraintPropertyEditPart.VISUAL_ID == visualID || PropertyEditPart.VISUAL_ID == visualID || Property2EditPart.VISUAL_ID == visualID;
- }
-
- /**
- * @generated
- */
- protected boolean provides(CreateEdgeViewOperation op) {
- IElementType elementType = getSemanticElementType(op.getSemanticAdapter());
- if(!SysmlElementTypes.isKnownElementType(elementType) || (!(elementType instanceof IHintedType))) {
- return false; // foreign element type
- }
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- if(elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
- return false; // our hint is visual id and must be specified, and it should be the same as in element type
- }
- int visualID = SysmlVisualIDRegistry.getVisualID(elementTypeHint);
- EObject domainElement = getSemanticElement(op.getSemanticAdapter());
- if(domainElement != null && visualID != SysmlVisualIDRegistry.getLinkWithClassVisualID(domainElement)) {
- return false; // visual id for link EClass should match visual id from element type
- }
- return true;
- }
-
- /**
- * @generated
- */
- public Diagram createDiagram(IAdaptable semanticAdapter, String diagramKind, PreferencesHint preferencesHint) {
- Diagram diagram = NotationFactory.eINSTANCE.createDiagram();
- diagram.getStyles().add(NotationFactory.eINSTANCE.createDiagramStyle());
- diagram.setType(ParametricEditPart.MODEL_ID);
- diagram.setElement(getSemanticElement(semanticAdapter));
- diagram.setMeasurementUnit(MeasurementUnit.PIXEL_LITERAL);
- return diagram;
- }
-
- /**
- * @generated
- */
- public Node createNode(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
- final EObject domainElement = getSemanticElement(semanticAdapter);
- final int visualID;
- if(semanticHint == null) {
- visualID = SysmlVisualIDRegistry.getNodeVisualID(containerView, domainElement);
- } else {
- visualID = SysmlVisualIDRegistry.getVisualID(semanticHint);
- }
- switch(visualID) {
- case ConstraintPropertyEditPart.VISUAL_ID:
- return createConstraintProperty_2003(domainElement, containerView, index, persisted, preferencesHint);
- case PropertyEditPart.VISUAL_ID:
- return createProperty_2005(domainElement, containerView, index, persisted, preferencesHint);
- case Property2EditPart.VISUAL_ID:
- return createProperty_3002(domainElement, containerView, index, persisted, preferencesHint);
- }
- // can't happen, provided #provides(CreateNodeViewOperation) is correct
- return null;
- }
-
- /**
- * @generated
- */
- public Edge createEdge(IAdaptable semanticAdapter, View containerView, String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint) {
- IElementType elementType = getSemanticElementType(semanticAdapter);
- String elementTypeHint = ((IHintedType)elementType).getSemanticHint();
- switch(SysmlVisualIDRegistry.getVisualID(elementTypeHint)) {
- case ConnectorEditPart.VISUAL_ID:
- return createConnector_4001(getSemanticElement(semanticAdapter), containerView, index, persisted, preferencesHint);
- }
- // can never happen, provided #provides(CreateEdgeViewOperation) is correct
- return null;
- }
-
- /**
- * @generated NOT
- */
- public Node createConstraintProperty_2003(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(SysmlVisualIDRegistry.getType(ConstraintPropertyEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // node.setElement(((ConstraintProperty) domainElement).getBase_Property());
-
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- initForegroundFromPrefs(node, prefStore, "ConstraintProperty");
-
- initFontStyleFromPrefs(node, prefStore, "ConstraintProperty");
-
- initBackgroundFromPrefs(node, prefStore, "ConstraintProperty");
-
- Node label5001 = createLabel(node, SysmlVisualIDRegistry.getType(ConstraintPropertyNameEditPart.VISUAL_ID));
- Node label5004 = createLabel(node, SysmlVisualIDRegistry.getType(ConstraintLabelEditPart.VISUAL_ID));
-
- // create the associated properties
- Type type = ((ConstraintProperty)domainElement).getBase_Property().getType();
- if(type != null && type instanceof StructuredClassifier) {
- for(Property property : ((StructuredClassifier)type).getOwnedAttributes()) {
- createProperty_3002(property, node, index, persisted, preferencesHint);
- }
- }
- return node;
- }
-
- /**
- * @generated
- */
- public Node createProperty_2005(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Shape node = NotationFactory.eINSTANCE.createShape();
- node.setLayoutConstraint(NotationFactory.eINSTANCE.createBounds());
- node.setType(SysmlVisualIDRegistry.getType(PropertyEditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- stampShortcut(containerView, node);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Property");
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Property");
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Property");
-
- Node label5002 = createLabel(node, SysmlVisualIDRegistry.getType(PropertyNameEditPart.VISUAL_ID));
-
- return node;
- }
-
- /**
- * @generated
- */
- public Node createProperty_3002(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(SysmlVisualIDRegistry.getType(Property2EditPart.VISUAL_ID));
- ViewUtil.insertChildView(containerView, node, index, persisted);
- node.setElement(domainElement);
- // initializeFromPreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(node, prefStore, "Property");
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(node, prefStore, "Property");
-
- PreferenceInitializerForElementHelper.initBackgroundFromPrefs(node, prefStore, "Property");
-
- Node label5003 = createLabel(node, SysmlVisualIDRegistry.getType(PropertyName2EditPart.VISUAL_ID));
- label5003.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
-
- Location location5003 = (Location)label5003.getLayoutConstraint();
- location5003.setX(0);
- location5003.setY(5);
-
- return node;
- }
-
- /**
- * @generated
- */
- public Edge createConnector_4001(EObject domainElement, View containerView, int index, boolean persisted, PreferencesHint preferencesHint) {
- Connector edge = NotationFactory.eINSTANCE.createConnector();
- edge.getStyles().add(NotationFactory.eINSTANCE.createFontStyle());
- RelativeBendpoints bendpoints = NotationFactory.eINSTANCE.createRelativeBendpoints();
- ArrayList<RelativeBendpoint> points = new ArrayList<RelativeBendpoint>(2);
- points.add(new RelativeBendpoint());
- points.add(new RelativeBendpoint());
- bendpoints.setPoints(points);
- edge.setBendpoints(bendpoints);
- ViewUtil.insertChildView(containerView, edge, index, persisted);
- edge.setType(SysmlVisualIDRegistry.getType(ConnectorEditPart.VISUAL_ID));
- edge.setElement(domainElement);
- // initializePreferences
- final IPreferenceStore prefStore = (IPreferenceStore)preferencesHint.getPreferenceStore();
-
- PreferenceInitializerForElementHelper.initForegroundFromPrefs(edge, prefStore, "Connector");
-
- PreferenceInitializerForElementHelper.initFontStyleFromPrefs(edge, prefStore, "Connector");
-
- //org.eclipse.gmf.runtime.notation.Routing routing = org.eclipse.gmf.runtime.notation.Routing.get(prefStore.getInt(org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceConstants.PREF_LINE_STYLE));
- //if (routing != null) {
- // org.eclipse.gmf.runtime.diagram.core.util.ViewUtil.setStructuralFeatureValue(edge, org.eclipse.gmf.runtime.notation.NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- //}
-
- PreferenceInitializerForElementHelper.initRountingFromPrefs(edge, prefStore, "Connector");
-
- Node label6001 = createLabel(edge, SysmlVisualIDRegistry.getType(ConnectorNameEditPart.VISUAL_ID));
- label6001.setLayoutConstraint(NotationFactory.eINSTANCE.createLocation());
- Location location6001 = (Location)label6001.getLayoutConstraint();
- location6001.setX(0);
- location6001.setY(40);
-
- PreferenceInitializerForElementHelper.initLabelVisibilityFromPrefs(edge, prefStore, "Connector");
-
- return edge;
- }
-
- /**
- * @generated
- */
- protected void stampShortcut(View containerView, Node target) {
- if(!ParametricEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(containerView))) {
- EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
- shortcutAnnotation.setSource("Shortcut"); //$NON-NLS-1$
- shortcutAnnotation.getDetails().put("modelID", ParametricEditPart.MODEL_ID); //$NON-NLS-1$
- target.getEAnnotations().add(shortcutAnnotation);
- }
- }
-
- /**
- * @generated
- */
- protected Node createLabel(View owner, String hint) {
- DecorationNode rv = NotationFactory.eINSTANCE.createDecorationNode();
- rv.setType(hint);
- ViewUtil.insertChildView(owner, rv, ViewUtil.APPEND, true);
- return rv;
- }
-
- /**
- * @generated
- */
- protected EObject getSemanticElement(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
- return null;
- }
- EObject eObject = (EObject)semanticAdapter.getAdapter(EObject.class);
- if(eObject != null) {
- return EMFCoreUtil.resolve(TransactionUtil.getEditingDomain(eObject), eObject);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IElementType getSemanticElementType(IAdaptable semanticAdapter) {
- if(semanticAdapter == null) {
- return null;
- }
- return (IElementType)semanticAdapter.getAdapter(IElementType.class);
- }
-
- /**
- * @generated
- */
- private void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String fontConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.FONT);
- String fontColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FONT);
-
- FontStyle viewFontStyle = (FontStyle)view.getStyle(NotationPackage.Literals.FONT_STYLE);
- if(viewFontStyle != null) {
- FontData fontData = PreferenceConverter.getFontData(store, fontConstant);
- viewFontStyle.setFontName(fontData.getName());
- viewFontStyle.setFontHeight(fontData.getHeight());
- viewFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
- viewFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
-
- org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(store, fontColorConstant);
- viewFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
- }
- }
-
- /**
- * @generated
- */
- private void initForegroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String lineColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_LINE);
- org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(store, lineColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
- }
-
- /**
- * @generated
- */
- private void initBackgroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- String fillColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_FILL);
- String gradientColorConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.COLOR_GRADIENT);
- String gradientPolicyConstant = PreferenceConstantHelper.getElementConstant(elementName, PreferenceConstantHelper.GRADIENT_POLICY);
-
- org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(store, fillColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
-
- FillStyle fillStyle = (FillStyle)view.getStyle(NotationPackage.Literals.FILL_STYLE);
- fillStyle.setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue());
-
- ;
- if(store.getBoolean(gradientPolicyConstant)) {
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.getString(gradientColorConstant));
- fillStyle.setGradient(gradientPreferenceConverter.getGradientData());
- fillStyle.setTransparency(gradientPreferenceConverter.getTransparency());
- }
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/sheet/SysmlPropertySection.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/sheet/SysmlPropertySection.java
deleted file mode 100644
index 5ffcc9dabaa..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/sheet/SysmlPropertySection.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.sheet;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.ui.provider.PropertySource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-/**
- * @generated
- */
-public class SysmlPropertySection extends AdvancedPropertySection implements IPropertySourceProvider {
-
- /**
- * @generated
- */
- public IPropertySource getPropertySource(Object object) {
- if(object instanceof IPropertySource) {
- return (IPropertySource)object;
- }
- AdapterFactory af = getAdapterFactory(object);
- if(af != null) {
- IItemPropertySource ips = (IItemPropertySource)af.adapt(object, IItemPropertySource.class);
- if(ips != null) {
- return new PropertySource(object, ips);
- }
- }
- if(object instanceof IAdaptable) {
- return (IPropertySource)((IAdaptable)object).getAdapter(IPropertySource.class);
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected IPropertySourceProvider getPropertySourceProvider() {
- return this;
- }
-
- /**
- * Modify/unwrap selection.
- *
- * @generated
- */
- protected Object transformSelection(Object selected) {
-
- if(selected instanceof EditPart) {
- Object model = ((EditPart)selected).getModel();
- return model instanceof View ? ((View)model).getElement() : null;
- }
- if(selected instanceof View) {
- return ((View)selected).getElement();
- }
- if(selected instanceof IAdaptable) {
- View view = (View)((IAdaptable)selected).getAdapter(View.class);
- if(view != null) {
- return view.getElement();
- }
- }
- return selected;
- }
-
- /**
- * @generated
- */
- public void setInput(IWorkbenchPart part, ISelection selection) {
- if(selection.isEmpty() || false == selection instanceof StructuredSelection) {
- super.setInput(part, selection);
- return;
- }
- final StructuredSelection structuredSelection = ((StructuredSelection)selection);
- ArrayList transformedSelection = new ArrayList(structuredSelection.size());
- for(Iterator it = structuredSelection.iterator(); it.hasNext();) {
- Object r = transformSelection(it.next());
- if(r != null) {
- transformedSelection.add(r);
- }
- }
- super.setInput(part, new StructuredSelection(transformedSelection));
- }
-
- /**
- * @generated
- */
- protected AdapterFactory getAdapterFactory(Object object) {
- if(getEditingDomain() instanceof AdapterFactoryEditingDomain) {
- return ((AdapterFactoryEditingDomain)getEditingDomain()).getAdapterFactory();
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(object);
- if(editingDomain != null) {
- return ((AdapterFactoryEditingDomain)editingDomain).getAdapterFactory();
- }
- return null;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/sheet/SysmlSheetLabelProvider.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/sheet/SysmlSheetLabelProvider.java
deleted file mode 100644
index c4f8dcb6faf..00000000000
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/sheet/SysmlSheetLabelProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.diagram.parametric.sheet;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.BaseLabelProvider;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.sysml.diagram.parametric.navigator.SysmlNavigatorGroup;
-import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * @generated
- */
-public class SysmlSheetLabelProvider extends BaseLabelProvider implements ILabelProvider {
-
- /**
- * @generated
- */
- public String getText(Object element) {
- element = unwrap(element);
- if(element instanceof SysmlNavigatorGroup) {
- return ((SysmlNavigatorGroup)element).getGroupName();
- }
- IElementType etype = getElementType(getView(element));
- return etype == null ? "" : etype.getDisplayName();
- }
-
- /**
- * @generated
- */
- public Image getImage(Object element) {
- IElementType etype = getElementType(getView(unwrap(element)));
- return etype == null ? null : SysmlElementTypes.getImage(etype);
- }
-
- /**
- * @generated
- */
- private Object unwrap(Object element) {
- if(element instanceof IStructuredSelection) {
- return ((IStructuredSelection)element).getFirstElement();
- }
- return element;
- }
-
- /**
- * @generated
- */
- private View getView(Object element) {
- if(element instanceof View) {
- return (View)element;
- }
- if(element instanceof IAdaptable) {
- return (View)((IAdaptable)element).getAdapter(View.class);
- }
- return null;
- }
-
- /**
- * @generated
- */
- private IElementType getElementType(View view) {
- // For intermediate views climb up the containment hierarchy to find the one associated with an element type.
- while(view != null) {
- int vid = SysmlVisualIDRegistry.getVisualID(view);
- IElementType etype = SysmlElementTypes.getElementType(vid);
- if(etype != null) {
- return etype;
- }
- view = view.eContainer() instanceof View ? (View)view.eContainer() : null;
- }
- return null;
- }
-
-}
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/BlockDropHelper.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/BlockDropHelper.java
new file mode 100644
index 00000000000..f1fff6394d6
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/utils/BlockDropHelper.java
@@ -0,0 +1,239 @@
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.utils;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.ISpecializationType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.ViewDescriptorUtil;
+import org.eclipse.papyrus.infra.services.edit.commands.ConfigureFeatureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.diagram.common.helper.ElementHelper;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.uml2.uml.Actor;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.TypedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This class provides convenience methods to create Block specific drop action (Part or Reference creation).
+ */
+public class BlockDropHelper extends ElementHelper {
+
+ public BlockDropHelper(TransactionalEditingDomain editDomain) {
+ this.editDomain = editDomain;
+ }
+
+ public Command getDropAsStructureItemOnPart(DropObjectsRequest request, GraphicalEditPart host, IElementType elementType) {
+ String label = "";
+ if(elementType == SysMLElementTypes.PART_PROPERTY) {
+ label = "Create a new Part";
+ }
+ if(elementType == SysMLElementTypes.REFERENCE_PROPERTY) {
+ label = "Create a new Reference";
+ }
+ if(elementType == SysMLElementTypes.ACTOR_PART_PROPERTY) {
+ label = "Create a new ActorPart";
+ }
+ if(elementType == SysMLElementTypes.VALUE_PROPERTY) {
+ label = "Create a new Value";
+ }
+ if(elementType == UMLElementTypes.PROPERTY) {
+ label = "Create a new Property";
+ }
+ CompoundCommand cc = new CompoundCommand(label);
+
+ Object droppedEObject = request.getObjects().get(0);
+ if(!isValidStructureItemType(droppedEObject, elementType)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ // Verify target nature
+ EObject target = getHostEObject(host);
+ if((!(target instanceof TypedElement)) || (((TypedElement)target).getType() == null)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ // The target type has to be a Block (will hold the created Port)
+ Type targetType = ((TypedElement)target).getType();
+ if(!((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(targetType)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ // Prepare a command for the element creation and the drop in diagram
+
+ // 1. Prepare creation command
+ ICommand createElementCommand = null;
+ CreateElementRequest createElementRequest = new CreateElementRequest(getEditingDomain(), targetType, elementType);
+ createElementRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getTypedElement_Type(), request.getObjects().get(0)));
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetType);
+ if(provider != null) {
+ createElementCommand = provider.getEditCommand(createElementRequest);
+ }
+ IAdaptable createElementRequestAdapter = new CreateElementRequestAdapter(createElementRequest);
+
+ // 2. Prepare the drop command
+ ViewDescriptor descriptor = new ViewDescriptor(createElementRequestAdapter, Node.class, /* explicit semantic hint is mandatory */ null, ViewDescriptorUtil.PERSISTED, host.getDiagramPreferencesHint());
+ CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
+ createViewRequest.setLocation(request.getLocation().getCopy());
+ Command viewCreateCommand = host.getCommand(createViewRequest);
+
+ // 3. Create the compound command
+ cc.add(new ICommandProxy(createElementCommand));
+ cc.add(viewCreateCommand);
+
+ return cc;
+ }
+
+ public Command getDropAsStructureItem(DropObjectsRequest request, GraphicalEditPart host, IElementType elementType) {
+ Object droppedEObject = request.getObjects().get(0);
+ String label = "";
+
+ // Filter part/reference : a property type by a ConstraintBlock MUST be a ConstraintProperty
+ if(elementType == SysMLElementTypes.PART_PROPERTY) {
+ label = "Create a new Part";
+ if (droppedEObject instanceof Type) {
+ if (((ISpecializationType)SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type)droppedEObject)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ }
+ if(elementType == SysMLElementTypes.REFERENCE_PROPERTY) {
+ label = "Create a new Reference";
+ if (droppedEObject instanceof Type) {
+ if (((ISpecializationType)SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type)droppedEObject)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ }
+ if(elementType == SysMLElementTypes.ACTOR_PART_PROPERTY) {
+ label = "Create a new ActorPart";
+ }
+ if(elementType == SysMLElementTypes.VALUE_PROPERTY) {
+ label = "Create a new Value";
+ }
+ if(elementType == UMLElementTypes.PROPERTY) {
+ label = "Create a new Property";
+ }
+
+ if(elementType == SysMLElementTypes.CONSTRAINT_PROPERTY) {
+ label = "Create a new ConstraintProperty";
+ // Constraint Property on ConstraintBlock strictly
+ if (droppedEObject instanceof Type) {
+ if (!((ISpecializationType)SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches((Type)droppedEObject)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ }
+ CompoundCommand cc = new CompoundCommand(label);
+
+ if(!isValidStructureItemType(droppedEObject, elementType)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ // Prepare a command for the element creation and the drop in diagram
+
+ // 1. Prepare creation command
+ ICommand createElementCommand = null;
+ CreateElementRequest createElementRequest = new CreateElementRequest(getEditingDomain(), getHostEObject(host), elementType);
+ createElementRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new ConfigureFeatureCommandFactory(UMLPackage.eINSTANCE.getTypedElement_Type(), request.getObjects().get(0)));
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(getHostEObject(host));
+ if(provider != null) {
+ createElementCommand = provider.getEditCommand(createElementRequest);
+ }
+ IAdaptable createElementRequestAdapter = new CreateElementRequestAdapter(createElementRequest);
+
+ // 2. Prepare the drop command
+ ViewDescriptor descriptor = new ViewDescriptor(createElementRequestAdapter, Node.class, /* explicit semantic hint is mandatory */ null, ViewDescriptorUtil.PERSISTED, host.getDiagramPreferencesHint());
+ CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
+ createViewRequest.setLocation(request.getLocation().getCopy());
+ Command viewCreateCommand = host.getCommand(createViewRequest);
+
+ // 3. Create the compound command
+ cc.add(new ICommandProxy(createElementCommand));
+ cc.add(viewCreateCommand);
+
+ return cc;
+ }
+
+ private boolean isValidStructureItemType(Object object, IElementType elementType) {
+ boolean isValid = false;
+
+ if((object != null) && (object instanceof Type) && !(object instanceof Association)) {
+
+ Type type = (Type)object;
+ if((elementType == SysMLElementTypes.PART_PROPERTY) || (elementType == SysMLElementTypes.REFERENCE_PROPERTY)) {
+ if(((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(type)) {
+ isValid = true;
+ }
+ }
+ if(elementType == SysMLElementTypes.ACTOR_PART_PROPERTY) {
+ if(type instanceof Actor) {
+ isValid = true;
+ }
+ }
+ if(elementType == SysMLElementTypes.VALUE_PROPERTY) {
+ if(((ISpecializationType)SysMLElementTypes.VALUE_TYPE).getMatcher().matches(type) || (type instanceof DataType)) {
+ isValid = true;
+ }
+ }
+ if((elementType == SysMLElementTypes.CONSTRAINT_PROPERTY)) {
+ if(((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(type)) {
+ isValid = true;
+ }
+ }
+ if(elementType == UMLElementTypes.PROPERTY) {
+ if(!((ISpecializationType)SysMLElementTypes.BLOCK).getMatcher().matches(type)
+ && !(type instanceof Actor)
+ && !(type instanceof DataType)
+ && !((ISpecializationType)SysMLElementTypes.VALUE_TYPE).getMatcher().matches(type)) {
+ isValid = true;
+ }
+ }
+ }
+
+ return isValid;
+ }
+
+ /**
+ * return the host Edit Part's semantic element, if the semantic element
+ * is <code>null</code> or unresolvable it will return <code>null</code>
+ *
+ * @return EObject
+ */
+ protected EObject getHostEObject(GraphicalEditPart host) {
+ return ViewUtil.resolveSemanticElement((View)host.getModel());
+ }
+}
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.classpath b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.classpath
index e5fbd3dd27a..7e8449de039 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.classpath
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.classpath
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-gen"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.project b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.project
index 849e59b88b1..75c4d55ac8c 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.project
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/.project
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.sysml.modelexplorer</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.emf.facet.common.ProjectNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.modelexplorer</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.emf.facet.common.ProjectNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
index 57db304d458..ee1fea2b0ad 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/META-INF/MANIFEST.MF
@@ -1,39 +1,39 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.emf.facet.infra.common.core,
- org.eclipse.emf.facet.infra.query.core,
- org.eclipse.uml2.uml,
- org.eclipse.papyrus.sysml;bundle-version="0.10.1",
- org.eclipse.swt,
- org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
- org.eclipse.papyrus.sysml.service.types;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.service.types;bundle-version="0.10.1",
- org.eclipse.papyrus.views.modelexplorer;bundle-version="0.10.1",
- org.eclipse.ui.navigator;bundle-version="3.5.0",
- org.eclipse.papyrus.sysml.diagram.common;bundle-version="0.10.1",
- org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.0",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.200",
- org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
- org.eclipse.ui.ide;bundle-version="3.8.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.tools;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.widgets;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.modelexplorer;bundle-version="0.10.1"
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .,
- bin
-Bundle-Version: 0.10.1.qualifier
-Bundle-Localization: plugin
-Bundle-Name: %pluginName
-Bundle-Activator: org.eclipse.papyrus.sysml.modelexplorer.Activator
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.sysml.modelexplorer;singleton
- :=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.facet.infra.common.core,
+ org.eclipse.emf.facet.infra.query.core,
+ org.eclipse.uml2.uml,
+ org.eclipse.papyrus.sysml;bundle-version="0.10.1",
+ org.eclipse.swt,
+ org.eclipse.papyrus.uml.diagram.common;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
+ org.eclipse.papyrus.sysml.service.types;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.service.types;bundle-version="0.10.1",
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="0.10.1",
+ org.eclipse.ui.navigator;bundle-version="3.5.0",
+ org.eclipse.papyrus.sysml.diagram.common;bundle-version="0.10.1",
+ org.eclipse.emf.facet.infra.browser.uicore;bundle-version="0.1.0",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.200",
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
+ org.eclipse.ui.ide;bundle-version="3.8.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.tools;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.modelexplorer;bundle-version="0.10.1"
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .,
+ bin
+Bundle-Version: 0.10.1.qualifier
+Bundle-Localization: plugin
+Bundle-Name: %pluginName
+Bundle-Activator: org.eclipse.papyrus.sysml.modelexplorer.Activator
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.modelexplorer;singleton
+ :=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/about.html b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/about.html
index 82d49bf5f81..d35d5aed64c 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/about.html
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/build.properties b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/build.properties
index 3c9eb7e4933..9df3ee6bf0d 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/build.properties
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/build.properties
@@ -1,7 +1,7 @@
-#
-#Mon Sep 12 09:30:16 CEST 2011
-bin.includes=META-INF/,.,plugin.xml,resources/,about.html,plugin.properties
-output..=bin/
-src.includes = about.html
-source..=src/,src-gen/
-bin..=bin/
+#
+#Mon Sep 12 09:30:16 CEST 2011
+bin.includes=META-INF/,.,plugin.xml,resources/,about.html,plugin.properties
+output..=bin/
+src.includes = about.html
+source..=src/,src-gen/
+bin..=bin/
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
index 320e0f9e2a7..0733c0705cb 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/plugin.xml
@@ -1,723 +1,723 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse version="3.4"?>
-<plugin>
-
-<!-- SysML ModelExplorer customization -->
-<extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
- <browserCustomization
- file="resources/SysMLDefaultExplorerCustomization.uiCustom"
- loadByDefault="true"/>
-</extension>
-
-<extension point="org.eclipse.emf.facet.infra.query.registration">
- <modelqueryset file="resources/SysMLDefaultExplorerQueries.querySet"/>
-</extension>
-
-<!-- This declaration is added in order command (CommandHandler) status to be
- verified (isVisible and isEnabled) before any attempt to execute the command,
- and to mask the command in case it is not supported or executable.
- -->
-
-<!-- Creation command declarations -->
-<extension point="org.eclipse.ui.handlers">
-
- <!-- Handler for ActorPart -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ActorPartPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ActorPartCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Allocate -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AllocateHandler" commandId="org.eclipse.papyrus.sysml.service.types.AllocateCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Association -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for AssociationComposite -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationCompositeHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for AssociationCompositeDirected -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationCompositeDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeDirectedCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for AssociationNone -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationNoneHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for AssociationNoneDirected -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationNoneDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneDirectedCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for AssociationShared -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationSharedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for AssociationSharedDirected -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationSharedDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedDirectedCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Block -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.BlockHandler" commandId="org.eclipse.papyrus.sysml.service.types.BlockCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Conform -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ConformHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConformCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ConstraintBlock -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ConstraintBlockHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ConstraintBlockParameter -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ConstraintBlockParameterHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockParameterCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ConstraintProperty -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ConstraintPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintPropertyCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Copy -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.CopyHandler" commandId="org.eclipse.papyrus.sysml.service.types.CopyCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for DeriveReqt -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.DeriveReqtHandler" commandId="org.eclipse.papyrus.sysml.service.types.DeriveReqtCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Dimension -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.DimensionHandler" commandId="org.eclipse.papyrus.sysml.service.types.DimensionCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for FlowPort -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPortHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPortCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for FlowPort_InOut -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPort_InOutHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InOutCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for FlowPort_In -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPort_InHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for FlowPort_Out -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPort_OutHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_OutCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for FlowPort_NA -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPort_NAHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_NACreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for FlowProperty -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPropertyCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for FlowSpecification -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowSpecificationHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowSpecificationCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ItemFlow -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ItemFlowHandler" commandId="org.eclipse.papyrus.sysml.service.types.ItemFlowCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for PartProperty -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.PartPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.PartPropertyCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Problem -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ProblemHandler" commandId="org.eclipse.papyrus.sysml.service.types.ProblemCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Rationale -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.RationaleHandler" commandId="org.eclipse.papyrus.sysml.service.types.RationaleCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ReferenceProperty -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ReferencePropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ReferencePropertyCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Requirement -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.RequirementHandler" commandId="org.eclipse.papyrus.sysml.service.types.RequirementCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Satisfy -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.SatisfyHandler" commandId="org.eclipse.papyrus.sysml.service.types.SatisfyCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Unit -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.UnitHandler" commandId="org.eclipse.papyrus.sysml.service.types.UnitCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ValueProperty -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ValuePropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValuePropertyCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ValueType -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ValueTypeHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueTypeCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ValueType_Enumeration -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ValueType_EnumerationHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueType_EnumerationCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ValueType_PrimitiveType -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ValueType_PrimitiveTypeHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueType_PrimitiveTypeCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for Verify -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.VerifyHandler" commandId="org.eclipse.papyrus.sysml.service.types.VerifyCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for View -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ViewHandler" commandId="org.eclipse.papyrus.sysml.service.types.ViewCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
- <!-- Handler for ViewPoint -->
- <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ViewPointHandler" commandId="org.eclipse.papyrus.sysml.service.types.ViewPointCreateCommand">
- <activeWhen>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
- </equals>
- </with>
- </activeWhen>
- </handler>
-
-</extension>
-
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+<!-- SysML ModelExplorer customization -->
+<extension point="org.eclipse.emf.facet.infra.browser.custom.core.registration">
+ <browserCustomization
+ file="resources/SysMLDefaultExplorerCustomization.uiCustom"
+ loadByDefault="true"/>
+</extension>
+
+<extension point="org.eclipse.emf.facet.infra.query.registration">
+ <modelqueryset file="resources/SysMLDefaultExplorerQueries.querySet"/>
+</extension>
+
+<!-- This declaration is added in order command (CommandHandler) status to be
+ verified (isVisible and isEnabled) before any attempt to execute the command,
+ and to mask the command in case it is not supported or executable.
+ -->
+
+<!-- Creation command declarations -->
+<extension point="org.eclipse.ui.handlers">
+
+ <!-- Handler for ActorPart -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ActorPartPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ActorPartCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Allocate -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AllocateHandler" commandId="org.eclipse.papyrus.sysml.service.types.AllocateCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Association -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for AssociationComposite -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationCompositeHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for AssociationCompositeDirected -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationCompositeDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeDirectedCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for AssociationNone -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationNoneHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for AssociationNoneDirected -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationNoneDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneDirectedCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for AssociationShared -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationSharedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for AssociationSharedDirected -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.AssociationSharedDirectedHandler" commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedDirectedCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Block -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.BlockHandler" commandId="org.eclipse.papyrus.sysml.service.types.BlockCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Conform -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ConformHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConformCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ConstraintBlock -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ConstraintBlockHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ConstraintBlockParameter -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ConstraintBlockParameterHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockParameterCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ConstraintProperty -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ConstraintPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ConstraintPropertyCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Copy -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.CopyHandler" commandId="org.eclipse.papyrus.sysml.service.types.CopyCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for DeriveReqt -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.DeriveReqtHandler" commandId="org.eclipse.papyrus.sysml.service.types.DeriveReqtCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Dimension -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.DimensionHandler" commandId="org.eclipse.papyrus.sysml.service.types.DimensionCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for FlowPort -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPortHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPortCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for FlowPort_InOut -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPort_InOutHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InOutCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for FlowPort_In -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPort_InHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for FlowPort_Out -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPort_OutHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_OutCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for FlowPort_NA -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPort_NAHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_NACreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for FlowProperty -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowPropertyCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for FlowSpecification -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.FlowSpecificationHandler" commandId="org.eclipse.papyrus.sysml.service.types.FlowSpecificationCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ItemFlow -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ItemFlowHandler" commandId="org.eclipse.papyrus.sysml.service.types.ItemFlowCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for PartProperty -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.PartPropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.PartPropertyCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Problem -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ProblemHandler" commandId="org.eclipse.papyrus.sysml.service.types.ProblemCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Rationale -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.RationaleHandler" commandId="org.eclipse.papyrus.sysml.service.types.RationaleCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ReferenceProperty -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ReferencePropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ReferencePropertyCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Requirement -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.RequirementHandler" commandId="org.eclipse.papyrus.sysml.service.types.RequirementCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Satisfy -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.SatisfyHandler" commandId="org.eclipse.papyrus.sysml.service.types.SatisfyCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Unit -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.UnitHandler" commandId="org.eclipse.papyrus.sysml.service.types.UnitCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ValueProperty -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ValuePropertyHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValuePropertyCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ValueType -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ValueTypeHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueTypeCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ValueType_Enumeration -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ValueType_EnumerationHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueType_EnumerationCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ValueType_PrimitiveType -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ValueType_PrimitiveTypeHandler" commandId="org.eclipse.papyrus.sysml.service.types.ValueType_PrimitiveTypeCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for Verify -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.VerifyHandler" commandId="org.eclipse.papyrus.sysml.service.types.VerifyCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for View -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ViewHandler" commandId="org.eclipse.papyrus.sysml.service.types.ViewCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+ <!-- Handler for ViewPoint -->
+ <handler class="org.eclipse.papyrus.sysml.modelexplorer.handler.ViewPointHandler" commandId="org.eclipse.papyrus.sysml.service.types.ViewPointCreateCommand">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.views.modelexplorer.modelexplorer">
+ </equals>
+ </with>
+ </activeWhen>
+ </handler>
+
+</extension>
+
<!-- UI Menu declaration for creation commands -->
-<extension point="org.eclipse.ui.menus">
-
- <!-- Sub-menu declaration -->
- <menuContribution locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup" allPopups="false">
- <menu id="org.eclipse.papyrus.views.modelexplorer.popupmenu.createsysmlchild"
- label="New SysML Child">
- </menu>
- </menuContribution>
-
- <!-- Create SysML element menu content -->
- <menuContribution locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.createsysmlchild" allPopups="false">
-
- <!-- Creation menu action for ActorPart -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ActorPartCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new ActorPart" style="push" tooltip="Create a new ActorPart">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Allocate -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.AllocateCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Abstraction.gif" label="Create a new Allocate" style="push" tooltip="Create a new Allocate">
- <visibleWhen checkEnabled="true"/>
- </command>
-
+<extension point="org.eclipse.ui.menus">
+
+ <!-- Sub-menu declaration -->
+ <menuContribution locationURI="popup:org.eclipse.papyrus.views.modelexplorer.modelexplorer.popup" allPopups="false">
+ <menu id="org.eclipse.papyrus.views.modelexplorer.popupmenu.createsysmlchild"
+ label="New SysML Child">
+ </menu>
+ </menuContribution>
+
+ <!-- Create SysML element menu content -->
+ <menuContribution locationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.createsysmlchild" allPopups="false">
+
+ <!-- Creation menu action for ActorPart -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ActorPartCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new ActorPart" style="push" tooltip="Create a new ActorPart">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Allocate -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.AllocateCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Abstraction.gif" label="Create a new Allocate" style="push" tooltip="Create a new Allocate">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
<!-- Creation menu action for Association -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new Association" style="push" tooltip="Create a new Association">
+ <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new Association" style="push" tooltip="Create a new Association">
<visibleWhen checkEnabled="true"/>
</command>
<!-- Creation menu action for AssociationComposite -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationComposite" style="push" tooltip="Create a new AssociationComposite">
+ <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationComposite" style="push" tooltip="Create a new AssociationComposite">
<visibleWhen checkEnabled="true"/>
</command>
<!-- Creation menu action for AssociationCompositeDirected -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeDirectedCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationCompositeDirected" style="push" tooltip="Create a new AssociationCompositeDirected">
+ <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationCompositeDirectedCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationCompositeDirected" style="push" tooltip="Create a new AssociationCompositeDirected">
<visibleWhen checkEnabled="true"/>
</command>
<!-- Creation menu action for AssociationNone -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationNone" style="push" tooltip="Create a new AssociationNone">
+ <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationNone" style="push" tooltip="Create a new AssociationNone">
<visibleWhen checkEnabled="true"/>
</command>
<!-- Creation menu action for AssociationNoneDirected -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneDirectedCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationNoneDirected" style="push" tooltip="Create a new AssociationNoneDirected">
+ <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationNoneDirectedCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationNoneDirected" style="push" tooltip="Create a new AssociationNoneDirected">
<visibleWhen checkEnabled="true"/>
</command>
<!-- Creation menu action for AssociationShared -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationShared" style="push" tooltip="Create a new AssociationShared">
+ <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationShared" style="push" tooltip="Create a new AssociationShared">
<visibleWhen checkEnabled="true"/>
</command>
<!-- Creation menu action for AssociationSharedDirected -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedDirectedCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationSharedDirected" style="push" tooltip="Create a new AssociationSharedDirected">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Block -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.BlockCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif" label="Create a new Block" style="push" tooltip="Create a new Block">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Conform -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ConformCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Conform.gif" label="Create a new Conform" style="push" tooltip="Create a new Conform">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ConstraintBlock -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintBlock.gif" label="Create a new ConstraintBlock" style="push" tooltip="Create a new ConstraintBlock">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ConstraintBlock Parameter -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockParameterCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new Parameter" style="push" tooltip="Create a new Parameter">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ConstraintProperty -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ConstraintPropertyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintProperty.gif" label="Create a new ConstraintProperty" style="push" tooltip="Create a new ConstraintProperty">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Copy -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.CopyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Copy.gif" label="Create a new Copy" style="push" tooltip="Create a new Copy">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for DeriveReqt -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.DeriveReqtCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/DeriveReqt.gif" label="Create a new DeriveReqt" style="push" tooltip="Create a new DeriveReqt">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Dimension -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.DimensionCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Dimension.gif" label="Create a new Dimension" style="push" tooltip="Create a new Dimension">
- <visibleWhen checkEnabled="true"/>
- </command>
-
+ <command commandId="org.eclipse.papyrus.sysml.service.types.AssociationSharedDirectedCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Association.gif" label="Create a new AssociationSharedDirected" style="push" tooltip="Create a new AssociationSharedDirected">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Block -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.BlockCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif" label="Create a new Block" style="push" tooltip="Create a new Block">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Conform -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ConformCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Conform.gif" label="Create a new Conform" style="push" tooltip="Create a new Conform">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ConstraintBlock -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintBlock.gif" label="Create a new ConstraintBlock" style="push" tooltip="Create a new ConstraintBlock">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ConstraintBlock Parameter -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ConstraintBlockParameterCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new Parameter" style="push" tooltip="Create a new Parameter">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ConstraintProperty -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ConstraintPropertyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintProperty.gif" label="Create a new ConstraintProperty" style="push" tooltip="Create a new ConstraintProperty">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Copy -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.CopyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Copy.gif" label="Create a new Copy" style="push" tooltip="Create a new Copy">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for DeriveReqt -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.DeriveReqtCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/DeriveReqt.gif" label="Create a new DeriveReqt" style="push" tooltip="Create a new DeriveReqt">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Dimension -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.DimensionCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Dimension.gif" label="Create a new Dimension" style="push" tooltip="Create a new Dimension">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
<!-- Creation menu action for FlowPort -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPortCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif" label="Create a new FlowPort" style="push" tooltip="Create a new FlowPort">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for FlowPort_InOut -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InOutCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_INOUT.gif" label="Create a new FlowPort_InOut" style="push" tooltip="Create a new FlowPort_InOut">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for FlowPort_In -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_IN.gif" label="Create a new FlowPort_In" style="push" tooltip="Create a new FlowPort_In">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for FlowPort_Out -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_OutCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_OUT.gif" label="Create a new FlowPort_Out" style="push" tooltip="Create a new FlowPort_Out">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for FlowPort_NA -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_NACreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_NA.gif" label="Create a new FlowPort (non atomic)" style="push" tooltip="Create a new FlowPort (non atomic)">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for FlowProperty -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPropertyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowProperty.gif" label="Create a new FlowProperty" style="push" tooltip="Create a new FlowProperty">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for FlowSpecification -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.FlowSpecificationCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowSpecification.gif" label="Create a new FlowSpecification" style="push" tooltip="Create a new FlowSpecification">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ItemFlow -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ItemFlowCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/ItemFlow.gif" label="Create a new ItemFlow" style="push" tooltip="Create a new ItemFlow">
- <visibleWhen checkEnabled="true"/>
- </command>
-
+ <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPortCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif" label="Create a new FlowPort" style="push" tooltip="Create a new FlowPort">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for FlowPort_InOut -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InOutCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_INOUT.gif" label="Create a new FlowPort_InOut" style="push" tooltip="Create a new FlowPort_InOut">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for FlowPort_In -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_IN.gif" label="Create a new FlowPort_In" style="push" tooltip="Create a new FlowPort_In">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for FlowPort_Out -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_OutCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_OUT.gif" label="Create a new FlowPort_Out" style="push" tooltip="Create a new FlowPort_Out">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for FlowPort_NA -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_NACreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_NA.gif" label="Create a new FlowPort (non atomic)" style="push" tooltip="Create a new FlowPort (non atomic)">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for FlowProperty -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.FlowPropertyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowProperty.gif" label="Create a new FlowProperty" style="push" tooltip="Create a new FlowProperty">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for FlowSpecification -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.FlowSpecificationCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowSpecification.gif" label="Create a new FlowSpecification" style="push" tooltip="Create a new FlowSpecification">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ItemFlow -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ItemFlowCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/ItemFlow.gif" label="Create a new ItemFlow" style="push" tooltip="Create a new ItemFlow">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
<!-- Creation menu action for PartProperty -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.PartPropertyCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new Part" style="push" tooltip="Create a new Part">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Problem -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ProblemCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Problem.gif" label="Create a new Problem" style="push" tooltip="Create a new Problem">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Rationale -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.RationaleCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Rationale.gif" label="Create a new Rationale" style="push" tooltip="Create a new Rationale">
- <visibleWhen checkEnabled="true"/>
- </command>
-
+ <command commandId="org.eclipse.papyrus.sysml.service.types.PartPropertyCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new Part" style="push" tooltip="Create a new Part">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Problem -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ProblemCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Problem.gif" label="Create a new Problem" style="push" tooltip="Create a new Problem">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Rationale -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.RationaleCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Rationale.gif" label="Create a new Rationale" style="push" tooltip="Create a new Rationale">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
<!-- Creation menu action for ReferenceProperty -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ReferencePropertyCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new Reference" style="push" tooltip="Create a new Reference">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Requirement -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.RequirementCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Requirement.gif" label="Create a new Requirement" style="push" tooltip="Create a new Requirement">
- <visibleWhen checkEnabled="true"/>
- </command>
-
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ReferencePropertyCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new Reference" style="push" tooltip="Create a new Reference">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Requirement -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.RequirementCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Requirement.gif" label="Create a new Requirement" style="push" tooltip="Create a new Requirement">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
<!-- Creation menu action for Satisfy -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.SatisfyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Satisfy.gif" label="Create a new Satisfy" style="push" tooltip="Create a new Satisfy">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Unit -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.UnitCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Unit.gif" label="Create a new Unit" style="push" tooltip="Create a new Unit">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ValueProperty -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ValuePropertyCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new Value" style="push" tooltip="Create a new Value">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ValueType -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ValueTypeCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" label="Create a new ValueType" style="push" tooltip="Create a new ValueType">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ValueType_Enumeration -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ValueType_EnumerationCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" label="Create a new ValueType_Enumeration" style="push" tooltip="Create a new ValueType_Enumeration">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ValueType_PrimitiveType -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ValueType_PrimitiveTypeCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" label="Create a new ValueType_PrimitiveType" style="push" tooltip="Create a new ValueType_PrimitiveType">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for Verify -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.VerifyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Verify.gif" label="Create a new Verify" style="push" tooltip="Create a new Verify">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for View -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ViewCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/View.gif" label="Create a new View" style="push" tooltip="Create a new View">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- <!-- Creation menu action for ViewPoint -->
- <command commandId="org.eclipse.papyrus.sysml.service.types.ViewPointCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Viewpoint.gif" label="Create a new ViewPoint" style="push" tooltip="Create a new ViewPoint">
- <visibleWhen checkEnabled="true"/>
- </command>
-
- </menuContribution>
-
-</extension>
-
-<!-- Key bindings associated to creation commands -->
-<extension point="org.eclipse.ui.bindings">
-
- <!-- "CTRL+I" : Create In FlowPort -->
- <key commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InCreateCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+I">
- </key>
-
- <!-- "CTRL+O" : Create Out FlowPort -->
- <key commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_OutCreateCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+O">
- </key>
-
-</extension>
-</plugin>
+ <command commandId="org.eclipse.papyrus.sysml.service.types.SatisfyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Satisfy.gif" label="Create a new Satisfy" style="push" tooltip="Create a new Satisfy">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Unit -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.UnitCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Unit.gif" label="Create a new Unit" style="push" tooltip="Create a new Unit">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ValueProperty -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ValuePropertyCreateCommand" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" label="Create a new Value" style="push" tooltip="Create a new Value">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ValueType -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ValueTypeCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" label="Create a new ValueType" style="push" tooltip="Create a new ValueType">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ValueType_Enumeration -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ValueType_EnumerationCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" label="Create a new ValueType_Enumeration" style="push" tooltip="Create a new ValueType_Enumeration">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ValueType_PrimitiveType -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ValueType_PrimitiveTypeCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" label="Create a new ValueType_PrimitiveType" style="push" tooltip="Create a new ValueType_PrimitiveType">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for Verify -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.VerifyCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Verify.gif" label="Create a new Verify" style="push" tooltip="Create a new Verify">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for View -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ViewCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/View.gif" label="Create a new View" style="push" tooltip="Create a new View">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ <!-- Creation menu action for ViewPoint -->
+ <command commandId="org.eclipse.papyrus.sysml.service.types.ViewPointCreateCommand" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Viewpoint.gif" label="Create a new ViewPoint" style="push" tooltip="Create a new ViewPoint">
+ <visibleWhen checkEnabled="true"/>
+ </command>
+
+ </menuContribution>
+
+</extension>
+
+<!-- Key bindings associated to creation commands -->
+<extension point="org.eclipse.ui.bindings">
+
+ <!-- "CTRL+I" : Create In FlowPort -->
+ <key commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_InCreateCommand"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="CTRL+I">
+ </key>
+
+ <!-- "CTRL+O" : Create Out FlowPort -->
+ <key commandId="org.eclipse.papyrus.sysml.service.types.FlowPort_OutCreateCommand"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="CTRL+O">
+ </key>
+
+</extension>
+</plugin>
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerCustomization.uiCustom b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerCustomization.uiCustom
index 346212a760d..b4d90abcd3c 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerCustomization.uiCustom
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerCustomization.uiCustom
@@ -1,9122 +1,9122 @@
-<?xml version="1.0" encoding="ASCII"?>
-<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://www.eclipse.org/uml2/4.0.0/UML">
- <types metaclassName="uml.Element">
- <customizedFeatures customizedFeature="icon">
- <valueCases>
- <value xsi:type="uicustom:DerivedFeatureValue">
- <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/SysMLDefaultExplorerQueries#getImage"/>
- </value>
- <condition xsi:type="query:JavaModelQuery" href="emffacet:/query/SysMLDefaultExplorerQueries#hasImage"/>
- </valueCases>
- </customizedFeatures>
- <customizedFeatures customizedFeature="hideMetaclassName">
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
- </customizedFeatures>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="eAnnotations">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Package">
- <customizedFeatures customizedFeature="hideMetaclassName">
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
- </customizedFeatures>
- <references referenceName="profileApplication">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="nestedPackage">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedType">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="nestingPackage">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="packagedElement">
- <customizedFeatures customizedFeature="collapseLink">
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.NamedElement">
- <customizedFeatures customizedFeature="label">
- <defaultValue xsi:type="uicustom:DerivedFeatureValue">
- <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/SysMLDefaultExplorerQueries#getLabel"/>
- </defaultValue>
- </customizedFeatures>
- <references referenceName="eAnnotations">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Comment">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.PackageableElement">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Dependency">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DirectedRelationship">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Relationship">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Namespace">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ElementImport">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.PackageImport">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Constraint">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ValueSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TypedElement">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Type">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Association">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="endType">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Classifier">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.RedefinableElement">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TemplateableElement">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TemplateBinding">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TemplateSignature">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TemplateParameter">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ParameterableElement">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TemplateParameterSubstitution">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Generalization">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.GeneralizationSet">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Feature">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Substitution">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Realization">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Abstraction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.OpaqueExpression">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="result">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Parameter">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="end">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.MultiplicityElement">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ConnectableElement">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="end">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ConnectorEnd">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="definingEnd">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Property">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="end">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="opposite">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DeploymentTarget">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Deployment">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DeployedArtifact">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DeploymentSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Artifact">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Manifestation">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Operation">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="type">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.BehavioralFeature">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Behavior">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Class">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.BehavioredClassifier">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InterfaceRealization">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Interface">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Reception">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Signal">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ProtocolStateMachine">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StateMachine">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Region">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Vertex">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="outgoing">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="incoming">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Transition">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Trigger">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Event">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Port">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="end">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="opposite">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="required">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="provided">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.State">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="outgoing">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="incoming">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ConnectionPointReference">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="outgoing">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="incoming">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Pseudostate">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="outgoing">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="incoming">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ProtocolConformance">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.EncapsulatedClassifier">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StructuredClassifier">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Connector">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Extension">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="endType">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="metaclass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExtensionEnd">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="end">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="opposite">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Stereotype">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Image">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Profile">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedType">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="nestedPackage">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="nestingPackage">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedStereotype">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Model">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedType">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="nestedPackage">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="nestingPackage">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ParameterSet">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DataType">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.OperationTemplateParameter">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StructuralFeature">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="featuringClassifier">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ConnectableElementTemplateParameter">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CollaborationUse">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Collaboration">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.UseCase">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Include">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Extend">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExtensionPoint">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.RedefinableTemplateSignature">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedParameter">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ClassifierTemplateParameter">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StringExpression">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Expression">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Usage">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.PackageMerge">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ProfileApplication">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Enumeration">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.EnumerationLiteral">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InstanceSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Slot">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.PrimitiveType">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LiteralSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LiteralInteger">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LiteralString">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LiteralBoolean">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LiteralNull">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InstanceValue">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LiteralUnlimitedNatural">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.OpaqueBehavior">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.FunctionBehavior">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.OpaqueAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Action">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExecutableNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ActivityNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StructuredActivityNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="subgroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedEdge">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ActivityGroup">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="subgroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedEdge">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Activity">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="structuredNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Variable">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="end">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ActivityEdge">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ActivityPartition">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="subgroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedEdge">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InterruptibleActivityRegion">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="subgroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedEdge">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExceptionHandler">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ObjectNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.OutputPin">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Pin">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InputPin">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CallAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InvocationAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.SendSignalAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CallOperationAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CallBehaviorAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.SequenceNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="subgroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedEdge">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ControlNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ControlFlow">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InitialNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ActivityParameterNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ValuePin">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Message">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="signature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.MessageEnd">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Interaction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InteractionFragment">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Lifeline">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.PartDecomposition">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InteractionUse">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Gate">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.GeneralOrdering">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.OccurrenceSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InteractionOperand">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InteractionConstraint">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExecutionSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StateInvariant">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ActionExecutionSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.BehaviorExecutionSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.MessageEvent">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.MessageOccurrenceSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExecutionOccurrenceSpecification">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Actor">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CallEvent">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ChangeEvent">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.SignalEvent">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.AnyReceiveEvent">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ForkNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.FlowFinalNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.FinalNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CentralBufferNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.MergeNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DecisionNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ObjectFlow">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ActivityFinalNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ComponentRealization">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Component">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="required">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="provided">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Node">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CommunicationPath">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="endType">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Device">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExecutionEnvironment">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="deployedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CombinedFragment">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Continuation">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ConsiderIgnoreFragment">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CreateObjectAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DestroyObjectAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TestIdentityAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReadSelfAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StructuralFeatureAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReadStructuralFeatureAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.WriteStructuralFeatureAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ClearStructuralFeatureAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.RemoveStructuralFeatureValueAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.AddStructuralFeatureValueAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LinkAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LinkEndData">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.QualifierValue">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReadLinkAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LinkEndCreationData">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CreateLinkAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.WriteLinkAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DestroyLinkAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LinkEndDestructionData">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ClearAssociationAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.BroadcastSignalAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.SendObjectAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ValueSpecificationAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TimeExpression">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Observation">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Duration">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DurationInterval">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Interval">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TimeConstraint">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.IntervalConstraint">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TimeInterval">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DurationConstraint">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TimeObservation">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DurationObservation">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.FinalState">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="outgoing">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="incoming">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.TimeEvent">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.VariableAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReadVariableAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.WriteVariableAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ClearVariableAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.AddVariableValueAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.RemoveVariableValueAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.RaiseExceptionAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ActionInputPin">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InformationItem">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.InformationFlow">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="source">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="target">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReadExtentAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReclassifyObjectAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReadIsClassifiedObjectAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StartClassifierBehaviorAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReadLinkObjectEndAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReadLinkObjectEndQualifierAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.CreateLinkObjectAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.AcceptEventAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.AcceptCallAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReplyAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.UnmarshallAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ReduceAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.StartObjectBehaviorAction">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.JoinNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.DataStoreNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ConditionalNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="subgroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedEdge">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.Clause">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.LoopNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="subgroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedEdge">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExpansionNode">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ExpansionRegion">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="output">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="input">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="context">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="subgroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superGroup">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedEdge">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="containedNode">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.ProtocolTransition">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="referred">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
- <types metaclassName="uml.AssociationClass">
- <references referenceName="ownedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="owner">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="namespace">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="member">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="importedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="redefinitionContext">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="package">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="feature">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="inheritedMember">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="general">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="attribute">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="part">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="role">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="ownedPort">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="superClass">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="extension">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="relatedElement">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- <references referenceName="endType">
- <customizedFeatures>
- <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
- </customizedFeatures>
- </references>
- </types>
-</uicustom:MetamodelView>
+<?xml version="1.0" encoding="ASCII"?>
+<uicustom:MetamodelView xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" xmlns:uicustom="http://www.eclipse.org/EmfFacet/infra/browser/custom/0.8" metamodelURI="http://www.eclipse.org/uml2/4.0.0/UML">
+ <types metaclassName="uml.Element">
+ <customizedFeatures customizedFeature="icon">
+ <valueCases>
+ <value xsi:type="uicustom:DerivedFeatureValue">
+ <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/SysMLDefaultExplorerQueries#getImage"/>
+ </value>
+ <condition xsi:type="query:JavaModelQuery" href="emffacet:/query/SysMLDefaultExplorerQueries#hasImage"/>
+ </valueCases>
+ </customizedFeatures>
+ <customizedFeatures customizedFeature="hideMetaclassName">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="eAnnotations">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Package">
+ <customizedFeatures customizedFeature="hideMetaclassName">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ <references referenceName="profileApplication">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="nestedPackage">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedType">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="nestingPackage">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="packagedElement">
+ <customizedFeatures customizedFeature="collapseLink">
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="true"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.NamedElement">
+ <customizedFeatures customizedFeature="label">
+ <defaultValue xsi:type="uicustom:DerivedFeatureValue">
+ <valueCalculator xsi:type="query:JavaModelQuery" href="emffacet:/query/SysMLDefaultExplorerQueries#getLabel"/>
+ </defaultValue>
+ </customizedFeatures>
+ <references referenceName="eAnnotations">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Comment">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.PackageableElement">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Dependency">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DirectedRelationship">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Relationship">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Namespace">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ElementImport">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.PackageImport">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Constraint">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ValueSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TypedElement">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Type">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Association">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="endType">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Classifier">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.RedefinableElement">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TemplateableElement">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TemplateBinding">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TemplateSignature">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TemplateParameter">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ParameterableElement">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TemplateParameterSubstitution">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Generalization">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.GeneralizationSet">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Feature">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Substitution">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Realization">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Abstraction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.OpaqueExpression">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="result">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Parameter">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="end">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.MultiplicityElement">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ConnectableElement">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="end">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ConnectorEnd">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="definingEnd">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Property">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="end">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="opposite">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DeploymentTarget">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Deployment">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DeployedArtifact">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DeploymentSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Artifact">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Manifestation">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Operation">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="type">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.BehavioralFeature">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Behavior">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Class">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.BehavioredClassifier">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InterfaceRealization">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Interface">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Reception">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Signal">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ProtocolStateMachine">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StateMachine">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Region">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Vertex">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="outgoing">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="incoming">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Transition">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Trigger">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Event">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Port">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="end">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="opposite">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="required">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="provided">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.State">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="outgoing">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="incoming">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ConnectionPointReference">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="outgoing">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="incoming">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Pseudostate">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="outgoing">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="incoming">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ProtocolConformance">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.EncapsulatedClassifier">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StructuredClassifier">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Connector">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Extension">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="endType">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="metaclass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExtensionEnd">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="end">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="opposite">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Stereotype">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Image">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Profile">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedType">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="nestedPackage">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="nestingPackage">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedStereotype">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Model">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedType">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="nestedPackage">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="nestingPackage">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ParameterSet">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DataType">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.OperationTemplateParameter">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StructuralFeature">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="featuringClassifier">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ConnectableElementTemplateParameter">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CollaborationUse">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Collaboration">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.UseCase">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Include">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Extend">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExtensionPoint">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.RedefinableTemplateSignature">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedParameter">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ClassifierTemplateParameter">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StringExpression">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Expression">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Usage">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.PackageMerge">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ProfileApplication">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Enumeration">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.EnumerationLiteral">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InstanceSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Slot">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.PrimitiveType">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LiteralSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LiteralInteger">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LiteralString">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LiteralBoolean">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LiteralNull">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InstanceValue">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LiteralUnlimitedNatural">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.OpaqueBehavior">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.FunctionBehavior">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.OpaqueAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Action">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExecutableNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ActivityNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StructuredActivityNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="subgroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedEdge">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ActivityGroup">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="subgroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedEdge">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Activity">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="structuredNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Variable">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="end">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ActivityEdge">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ActivityPartition">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="subgroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedEdge">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InterruptibleActivityRegion">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="subgroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedEdge">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExceptionHandler">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ObjectNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.OutputPin">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Pin">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InputPin">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CallAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InvocationAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.SendSignalAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CallOperationAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CallBehaviorAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.SequenceNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="subgroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedEdge">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ControlNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ControlFlow">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InitialNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ActivityParameterNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ValuePin">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Message">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="signature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.MessageEnd">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Interaction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InteractionFragment">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Lifeline">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.PartDecomposition">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InteractionUse">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Gate">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.GeneralOrdering">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.OccurrenceSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InteractionOperand">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InteractionConstraint">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExecutionSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StateInvariant">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ActionExecutionSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.BehaviorExecutionSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.MessageEvent">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.MessageOccurrenceSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExecutionOccurrenceSpecification">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Actor">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CallEvent">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ChangeEvent">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.SignalEvent">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.AnyReceiveEvent">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ForkNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.FlowFinalNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.FinalNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CentralBufferNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.MergeNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DecisionNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ObjectFlow">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ActivityFinalNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ComponentRealization">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Component">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="required">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="provided">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Node">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CommunicationPath">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="endType">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Device">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExecutionEnvironment">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="deployedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CombinedFragment">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Continuation">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ConsiderIgnoreFragment">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CreateObjectAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DestroyObjectAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TestIdentityAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReadSelfAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StructuralFeatureAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReadStructuralFeatureAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.WriteStructuralFeatureAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ClearStructuralFeatureAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.RemoveStructuralFeatureValueAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.AddStructuralFeatureValueAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LinkAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LinkEndData">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.QualifierValue">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReadLinkAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LinkEndCreationData">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CreateLinkAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.WriteLinkAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DestroyLinkAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LinkEndDestructionData">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ClearAssociationAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.BroadcastSignalAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.SendObjectAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ValueSpecificationAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TimeExpression">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Observation">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Duration">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DurationInterval">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Interval">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TimeConstraint">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.IntervalConstraint">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TimeInterval">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DurationConstraint">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TimeObservation">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DurationObservation">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.FinalState">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="outgoing">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="incoming">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.TimeEvent">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.VariableAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReadVariableAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.WriteVariableAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ClearVariableAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.AddVariableValueAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.RemoveVariableValueAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.RaiseExceptionAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ActionInputPin">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InformationItem">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.InformationFlow">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="source">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="target">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReadExtentAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReclassifyObjectAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReadIsClassifiedObjectAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StartClassifierBehaviorAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReadLinkObjectEndAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReadLinkObjectEndQualifierAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.CreateLinkObjectAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.AcceptEventAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.AcceptCallAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReplyAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.UnmarshallAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ReduceAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.StartObjectBehaviorAction">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.JoinNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.DataStoreNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ConditionalNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="subgroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedEdge">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.Clause">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.LoopNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="subgroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedEdge">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExpansionNode">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ExpansionRegion">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="output">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="input">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="context">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="subgroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superGroup">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedEdge">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="containedNode">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.ProtocolTransition">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="referred">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+ <types metaclassName="uml.AssociationClass">
+ <references referenceName="ownedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="owner">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="namespace">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="member">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="importedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="redefinitionContext">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="package">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="feature">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="inheritedMember">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="general">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="attribute">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="part">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="role">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="ownedPort">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="superClass">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="extension">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="relatedElement">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ <references referenceName="endType">
+ <customizedFeatures>
+ <defaultValue xsi:type="uicustom:StaticFeatureValue" value="false"/>
+ </customizedFeatures>
+ </references>
+ </types>
+</uicustom:MetamodelView>
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerQueries.querySet b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerQueries.querySet
index c6d30b5baf4..56733b2bf6b 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerQueries.querySet
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/resources/SysMLDefaultExplorerQueries.querySet
@@ -1,17 +1,17 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<query:ModelQuerySet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="SysMLDefaultExplorerQueries">
- <associatedMetamodels href="http://www.eclipse.org/uml2/4.0.0/UML#/"/>
- <associatedMetamodels href="http://www.eclipse.org/uml2/4.0.0/Types#/"/>
- <queries xsi:type="query:JavaModelQuery" name="getLabel" description="Basic label provider for named elements" lowerBound="1" implementationClassName="org.eclipse.papyrus.sysml.modelexplorer.query.GetLabelQuery">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
- <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//NamedElement"/>
- </queries>
- <queries xsi:type="query:JavaModelQuery" name="getImage" description="SysML icon provider" implementationClassName="org.eclipse.papyrus.sysml.modelexplorer.query.GetImageQuery">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
- <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
- </queries>
- <queries xsi:type="query:JavaModelQuery" name="hasImage" description="SysML icon tester" implementationClassName="org.eclipse.papyrus.sysml.modelexplorer.query.HasImageQuery">
- <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//Boolean"/>
- <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
- </queries>
-</query:ModelQuerySet>
+<?xml version="1.0" encoding="UTF-8"?>
+<query:ModelQuerySet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:query="http://www.eclipse.org/EmfFacet/infra/query/0.8.incubation" name="SysMLDefaultExplorerQueries">
+ <associatedMetamodels href="http://www.eclipse.org/uml2/4.0.0/UML#/"/>
+ <associatedMetamodels href="http://www.eclipse.org/uml2/4.0.0/Types#/"/>
+ <queries xsi:type="query:JavaModelQuery" name="getLabel" description="Basic label provider for named elements" lowerBound="1" implementationClassName="org.eclipse.papyrus.sysml.modelexplorer.query.GetLabelQuery">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//NamedElement"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="getImage" description="SysML icon provider" implementationClassName="org.eclipse.papyrus.sysml.modelexplorer.query.GetImageQuery">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//String"/>
+ <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
+ </queries>
+ <queries xsi:type="query:JavaModelQuery" name="hasImage" description="SysML icon tester" implementationClassName="org.eclipse.papyrus.sysml.modelexplorer.query.HasImageQuery">
+ <returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/4.0.0/Types#//Boolean"/>
+ <scope href="http://www.eclipse.org/uml2/4.0.0/UML#//Element"/>
+ </queries>
+</query:ModelQuerySet>
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src-gen/org/eclipse/papyrus/sysml/modelexplorer/handler/ConstraintPropertyHandler.java b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src-gen/org/eclipse/papyrus/sysml/modelexplorer/handler/ConstraintPropertyHandler.java
index 9a34c292fc3..d70faf68fd8 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src-gen/org/eclipse/papyrus/sysml/modelexplorer/handler/ConstraintPropertyHandler.java
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src-gen/org/eclipse/papyrus/sysml/modelexplorer/handler/ConstraintPropertyHandler.java
@@ -11,7 +11,18 @@
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.handler;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.UnexecutableCommand;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+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.requests.CreateElementRequest;
+import org.eclipse.papyrus.infra.services.edit.commands.IConfigureCommandFactory;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.sysml.diagram.common.commands.CreateConstraintPropertyWithTypeConfigureCommandFactory;
+import org.eclipse.papyrus.sysml.diagram.common.commands.CreatePartWithTypeConfigureCommandFactory;
import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
/**
@@ -37,4 +48,37 @@ public class ConstraintPropertyHandler extends AbstractSysmlModelExplorerCreateC
protected IElementType getElementTypeToCreate() {
return SysMLElementTypes.CONSTRAINT_PROPERTY;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command buildCommand() {
+
+ if(getCommandContext() == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ EObject container = getCommandContext().getContainer();
+ EReference reference = getCommandContext().getReference();
+
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(container);
+ if(provider == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ CreateElementRequest createRequest = null;
+ if(reference == null) {
+ createRequest = new CreateElementRequest(container, getElementTypeToCreate());
+ } else {
+ createRequest = new CreateElementRequest(container, getElementTypeToCreate(), reference);
+ }
+ createRequest.setParameter(IConfigureCommandFactory.CONFIGURE_COMMAND_FACTORY_ID, new CreateConstraintPropertyWithTypeConfigureCommandFactory());
+
+ // Retrieve create command from the Element Edit service
+ ICommand createGMFCommand = provider.getEditCommand(createRequest);
+ Command emfCommand = new org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper(createGMFCommand);
+ return emfCommand;
+ }
+
}
diff --git a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/handler/AbstractSysmlModelExplorerCreateCommandHandler.java b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/handler/AbstractSysmlModelExplorerCreateCommandHandler.java
index e5b30040bd1..0c94e02f38c 100644
--- a/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/handler/AbstractSysmlModelExplorerCreateCommandHandler.java
+++ b/plugins/sysml/modelexplorer/org.eclipse.papyrus.sysml.modelexplorer/src/org/eclipse/papyrus/sysml/modelexplorer/handler/AbstractSysmlModelExplorerCreateCommandHandler.java
@@ -1,34 +1,34 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.modelexplorer.handler;
-
-import org.eclipse.papyrus.sysml.service.types.handlers.AbstractSysmlCreateCommandHandler;
-import org.eclipse.papyrus.uml.modelexplorer.util.ModelExplorerUtils;
-import org.eclipse.papyrus.uml.service.types.utils.ICommandContext;
-
-
-/**
- * Abstract handler supertype for every generated handler for the creation of SysML elements from the model explorer.
- * (Create SysML child...)
- */
-public abstract class AbstractSysmlModelExplorerCreateCommandHandler extends AbstractSysmlCreateCommandHandler {
-
- /**
- *
- * @see org.eclipse.papyrus.uml.service.types.handlers.AbstractCommandHandler#getCommandContext()
- *
- * @return
- */
- protected ICommandContext getCommandContext() {
- return ModelExplorerUtils.getSelectionCommandContext();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.modelexplorer.handler;
+
+import org.eclipse.papyrus.sysml.service.types.handlers.AbstractSysmlCreateCommandHandler;
+import org.eclipse.papyrus.uml.modelexplorer.util.ModelExplorerUtils;
+import org.eclipse.papyrus.uml.service.types.utils.ICommandContext;
+
+
+/**
+ * Abstract handler supertype for every generated handler for the creation of SysML elements from the model explorer.
+ * (Create SysML child...)
+ */
+public abstract class AbstractSysmlModelExplorerCreateCommandHandler extends AbstractSysmlCreateCommandHandler {
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.service.types.handlers.AbstractCommandHandler#getCommandContext()
+ *
+ * @return
+ */
+ protected ICommandContext getCommandContext() {
+ return ModelExplorerUtils.getSelectionCommandContext();
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.classpath b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.classpath
index ed2585fb3f4..59cf3977c7e 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.classpath
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.classpath
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="src-gen"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="src-gen"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.project b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.project
index f7424987423..1f051b2f80f 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.project
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.project
@@ -1,28 +1,28 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.sysml.service.types</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.service.types</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.settings/org.eclipse.jdt.core.prefs b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.settings/org.eclipse.jdt.core.prefs
index 3f19b57c802..76fa8533dd3 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/.settings/org.eclipse.jdt.core.prefs
@@ -1,21 +1,21 @@
-#Mon Jul 05 17:51:04 CEST 2010
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.source=1.5
+#Mon Jul 05 17:51:04 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF
index 92edac66ef2..20827ffab44 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/META-INF/MANIFEST.MF
@@ -1,31 +1,31 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.uml2.uml;bundle-version="3.1.0",
- org.eclipse.papyrus.sysml;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
- org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
- org.eclipse.papyrus.uml.service.types;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
- org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
- org.eclipse.uml2.uml.profile.l2;bundle-version="1.0.0",
- org.eclipse.core.expressions,
- org.eclipse.papyrus.infra.tools;bundle-version="0.10.1"
-Export-Package: org.eclipse.papyrus.sysml.service.types,
- org.eclipse.papyrus.sysml.service.types.element,
- org.eclipse.papyrus.sysml.service.types.handlers,
- org.eclipse.papyrus.sysml.service.types.helper,
- org.eclipse.papyrus.sysml.service.types.matcher,
- org.eclipse.papyrus.sysml.service.types.menu,
- org.eclipse.papyrus.sysml.service.types.utils
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 0.10.1.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.sysml.service.types.Activator
-Bundle-SymbolicName: org.eclipse.papyrus.sysml.service.types;singleton
- :=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.uml2.uml;bundle-version="3.1.0",
+ org.eclipse.papyrus.sysml;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.emf.type.core;bundle-version="1.4.0",
+ org.eclipse.papyrus.uml.service.types;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
+ org.eclipse.uml2.uml.profile.l2;bundle-version="1.0.0",
+ org.eclipse.core.expressions,
+ org.eclipse.papyrus.infra.tools;bundle-version="0.10.1"
+Export-Package: org.eclipse.papyrus.sysml.service.types,
+ org.eclipse.papyrus.sysml.service.types.element,
+ org.eclipse.papyrus.sysml.service.types.handlers,
+ org.eclipse.papyrus.sysml.service.types.helper,
+ org.eclipse.papyrus.sysml.service.types.matcher,
+ org.eclipse.papyrus.sysml.service.types.menu,
+ org.eclipse.papyrus.sysml.service.types.utils
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 0.10.1.qualifier
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.sysml.service.types.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.service.types;singleton
+ :=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/about.html b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/about.html
index 82d49bf5f81..d35d5aed64c 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/about.html
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/build.properties b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/build.properties
index 27f23f72872..35f7a358179 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/build.properties
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/build.properties
@@ -1,10 +1,10 @@
-bin.includes = META-INF/,\
- .,\
- plugin.properties,\
- about.html,\
- plugin.xml,\
- about.html
-output..=bin/
-src.includes = about.html
-source..=src/,src-gen/
-bin..=bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties,\
+ about.html,\
+ plugin.xml,\
+ about.html
+output..=bin/
+src.includes = about.html
+source..=src/,src-gen/
+bin..=bin/
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/model/ElementTypeModelForSySML.domaincontextcodegen b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/model/ElementTypeModelForSySML.domaincontextcodegen
index 2ed6cdb7f92..4c249096291 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/model/ElementTypeModelForSySML.domaincontextcodegen
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/model/ElementTypeModelForSySML.domaincontextcodegen
@@ -1,150 +1,150 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<domaincontextcodegen:DomainContext xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:domaincontextcodegen="http://www.eclipse.org/papyrus/2010/domaincontextcodegen" typeProjectName="org.eclipse.papyrus.sysml.service.types" handlerProjectName="org.eclipse.papyrus.sysml.modelexplorer" IClientContextID="" elementTypeIDPrefix="org.eclipse.papyrus.sysml" elementTypeNamePrefix="SysML" defaultHelperPath="" generatedSourceFolder="src-gen">
- <metamodel href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#/"/>
- <specializationOf href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#/"/>
- <elementTypes>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Allocate" helper="org.eclipse.papyrus.sysml.service.types.helper.AllocateEditHelperAdvice" matcher="org.eclipse.papyrus.sysml.service.types.matcher.AllocateMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Association" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationEditHelperAdvice" matcher="org.eclipse.papyrus.sysml.service.types.matcher.AssociationMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.18"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationComposite" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationCompositeEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationCompositeDirected" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationCompositeDirectedEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationNone" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationNoneEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationNoneDirected" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationNoneDirectedEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationShared" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationSharedEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationSharedDirected" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationSharedDirectedEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Block" helper="org.eclipse.papyrus.sysml.service.types.helper.BlockEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.31"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Conform" helper="org.eclipse.papyrus.sysml.service.types.helper.ConformEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Conform.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ConformMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.62"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ConstraintBlock" helper="org.eclipse.papyrus.sysml.service.types.helper.ConstraintBlockEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintBlock.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ConstraintBlockMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.31"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ConstraintProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.ConstraintPropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintProperty.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ConstraintPropertyMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Copy" helper="org.eclipse.papyrus.sysml.service.types.helper.CopyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Copy.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.CopyMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="DeriveReqt" helper="org.eclipse.papyrus.sysml.service.types.helper.DeriveReqtEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/DeriveReqt.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.DeriveReqtMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Dimension" helper="org.eclipse.papyrus.sysml.service.types.helper.DimensionEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Dimension.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.DimensionMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.110"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.167"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort_InOut" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortInOutEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_INOUT.gif" ref="//@elementTypes/@types.15" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortInOutMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort_In" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortInEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_IN.gif" ref="//@elementTypes/@types.15" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortInMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort_Out" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortOutEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_OUT.gif" ref="//@elementTypes/@types.15" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortOutMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort_NA" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortNAEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_NA.gif" ref="//@elementTypes/@types.15" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortNAMatcher"/>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowProperty.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPropertyMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowSpecification" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowSpecificationEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowSpecification.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowSpecificationMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.117"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ItemFlow" helper="org.eclipse.papyrus.sysml.service.types.helper.ItemFlowEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/ItemFlow.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ItemFlowMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.106"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="PartProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.PartPropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Problem" helper="org.eclipse.papyrus.sysml.service.types.helper.ProblemEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Problem.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ProblemMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.41"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Rationale" helper="org.eclipse.papyrus.sysml.service.types.helper.RationaleEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Rationale.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.RationaleMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.41"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ReferenceProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.ReferencePropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ReferencePropertyMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Requirement" helper="org.eclipse.papyrus.sysml.service.types.helper.RequirementEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Requirement.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.31"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Satisfy" helper="org.eclipse.papyrus.sysml.service.types.helper.SatisfyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Satisfy.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.SatisfyMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Unit" helper="org.eclipse.papyrus.sysml.service.types.helper.UnitEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Unit.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.UnitMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.110"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ValueProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.ValuePropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ValuePropertyMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ValueType" helper="org.eclipse.papyrus.sysml.service.types.helper.ValueTypeEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ValueTypeMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.60"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ValueType_Enumeration" helper="org.eclipse.papyrus.sysml.service.types.helper.ValueTypeEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ValueTypeEnumerationMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.79"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ValueType_PrimitiveType" helper="org.eclipse.papyrus.sysml.service.types.helper.ValueTypeEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ValueTypePrimitiveTypeMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.168"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="Verify" helper="org.eclipse.papyrus.sysml.service.types.helper.VerifyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Verify.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.VerifyMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="View" helper="org.eclipse.papyrus.sysml.service.types.helper.ViewEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/View.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ViewMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.158"/>
- </types>
- <types xsi:type="domaincontextcodegen:SpecializationType" name="ViewPoint" helper="org.eclipse.papyrus.sysml.service.types.helper.ViewPointEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Viewpoint.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ViewPointMatcher">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.31"/>
- </types>
- </elementTypes>
- <advices adviceID="org.eclipse.papyrus.sysml.advice.ConstraintBlockPropertyHelperAdvice" advicePath="org.eclipse.papyrus.sysml.service.types.helper.ConstraintBlockPropertyEditHelperAdvice" inheritance="all">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
- </advices>
- <advices adviceID="org.eclipse.papyrus.sysml.advice.Classifier" advicePath="org.eclipse.papyrus.sysml.service.types.helper.advice.ClassifierEditHelperAdvice" inheritance="all">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.32"/>
- </advices>
- <advices adviceID="org.eclipse.papyrus.sysml.advice.Property" advicePath="org.eclipse.papyrus.sysml.service.types.helper.advice.PropertyEditHelperAdvice" inheritance="all">
- <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
- </advices>
- <bindings clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext">
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.0"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.1"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.2"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.3"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.4"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.5"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.6"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.7"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.8"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.9"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.10"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.11"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.12"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.13"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.14"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.15"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.16"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.17"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.18"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.19"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.20"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.21"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.22"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.23"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.24"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.25"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.26"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.27"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.28"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.29"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.30"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.31"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.32"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.33"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.34"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.35"/>
- <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.36"/>
- <bindings xsi:type="domaincontextcodegen:AdviceBinding" ref="//@advices.0"/>
- <bindings xsi:type="domaincontextcodegen:AdviceBinding" ref="//@advices.1"/>
- <bindings xsi:type="domaincontextcodegen:AdviceBinding" ref="//@advices.2"/>
- </bindings>
- <genHandlers handlerPackage="org.eclipse.papyrus.sysml.modelexplorer.handler" superClass="CreateCommandHandler" superClassPackage="org.eclipse.papyrus.sysml.modelexplorer.handler" elementTypeEnumerator="SysMLElementTypes" elementTypeEnumeratorPackage="org.eclipse.papyrus.sysml.service.types.element" visibleCreateChildHandlers="//@elementTypes/@types.8 //@elementTypes/@types.10 //@elementTypes/@types.11 //@elementTypes/@types.14 //@elementTypes/@types.15 //@elementTypes/@types.17 //@elementTypes/@types.16 //@elementTypes/@types.18 //@elementTypes/@types.20 //@elementTypes/@types.21 //@elementTypes/@types.23 //@elementTypes/@types.24 //@elementTypes/@types.25 //@elementTypes/@types.26 //@elementTypes/@types.27 //@elementTypes/@types.29 //@elementTypes/@types.30 //@elementTypes/@types.31 //@elementTypes/@types.35 //@elementTypes/@types.36" createChildMenuLocationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.createsysmlchild"/>
-</domaincontextcodegen:DomainContext>
+<?xml version="1.0" encoding="UTF-8"?>
+<domaincontextcodegen:DomainContext xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:domaincontextcodegen="http://www.eclipse.org/papyrus/2010/domaincontextcodegen" typeProjectName="org.eclipse.papyrus.sysml.service.types" handlerProjectName="org.eclipse.papyrus.sysml.modelexplorer" IClientContextID="" elementTypeIDPrefix="org.eclipse.papyrus.sysml" elementTypeNamePrefix="SysML" defaultHelperPath="" generatedSourceFolder="src-gen">
+ <metamodel href="../../../plugin/org.eclipse.uml2.uml/model/UML.ecore#/"/>
+ <specializationOf href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#/"/>
+ <elementTypes>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Allocate" helper="org.eclipse.papyrus.sysml.service.types.helper.AllocateEditHelperAdvice" matcher="org.eclipse.papyrus.sysml.service.types.matcher.AllocateMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Association" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationEditHelperAdvice" matcher="org.eclipse.papyrus.sysml.service.types.matcher.AssociationMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.18"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationComposite" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationCompositeEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationCompositeDirected" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationCompositeDirectedEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationNone" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationNoneEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationNoneDirected" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationNoneDirectedEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationShared" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationSharedEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="AssociationSharedDirected" helper="org.eclipse.papyrus.sysml.service.types.helper.advice.AssociationSharedDirectedEditHelperAdvice" ref="//@elementTypes/@types.1" matcher="org.eclipse.papyrus.sysml.service.types.matcher.NoMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Block" helper="org.eclipse.papyrus.sysml.service.types.helper.BlockEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Block.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.31"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Conform" helper="org.eclipse.papyrus.sysml.service.types.helper.ConformEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Conform.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ConformMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.62"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ConstraintBlock" helper="org.eclipse.papyrus.sysml.service.types.helper.ConstraintBlockEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintBlock.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ConstraintBlockMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.31"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ConstraintProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.ConstraintPropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/constraints/ConstraintProperty.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ConstraintPropertyMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Copy" helper="org.eclipse.papyrus.sysml.service.types.helper.CopyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Copy.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.CopyMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="DeriveReqt" helper="org.eclipse.papyrus.sysml.service.types.helper.DeriveReqtEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/DeriveReqt.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.DeriveReqtMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Dimension" helper="org.eclipse.papyrus.sysml.service.types.helper.DimensionEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Dimension.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.DimensionMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.110"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.167"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort_InOut" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortInOutEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_INOUT.gif" ref="//@elementTypes/@types.15" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortInOutMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort_In" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortInEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_IN.gif" ref="//@elementTypes/@types.15" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortInMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort_Out" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortOutEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_OUT.gif" ref="//@elementTypes/@types.15" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortOutMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowPort_NA" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPortNAEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowPort_NA.gif" ref="//@elementTypes/@types.15" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPortNAMatcher"/>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowPropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowProperty.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowPropertyMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="FlowSpecification" helper="org.eclipse.papyrus.sysml.service.types.helper.FlowSpecificationEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/FlowSpecification.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.FlowSpecificationMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.117"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ItemFlow" helper="org.eclipse.papyrus.sysml.service.types.helper.ItemFlowEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/portandflows/ItemFlow.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ItemFlowMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.106"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="PartProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.PartPropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Problem" helper="org.eclipse.papyrus.sysml.service.types.helper.ProblemEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Problem.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ProblemMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.41"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Rationale" helper="org.eclipse.papyrus.sysml.service.types.helper.RationaleEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Rationale.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.RationaleMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.41"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ReferenceProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.ReferencePropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ReferencePropertyMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Requirement" helper="org.eclipse.papyrus.sysml.service.types.helper.RequirementEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Requirement.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.31"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Satisfy" helper="org.eclipse.papyrus.sysml.service.types.helper.SatisfyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Satisfy.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.SatisfyMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Unit" helper="org.eclipse.papyrus.sysml.service.types.helper.UnitEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/Unit.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.UnitMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.110"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ValueProperty" helper="org.eclipse.papyrus.sysml.service.types.helper.ValuePropertyEditHelperAdvice" icon="platform:/plugin/org.eclipse.uml2.uml.edit/icons/full/obj16/Property.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ValuePropertyMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ValueType" helper="org.eclipse.papyrus.sysml.service.types.helper.ValueTypeEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ValueTypeMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.60"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ValueType_Enumeration" helper="org.eclipse.papyrus.sysml.service.types.helper.ValueTypeEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ValueTypeEnumerationMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.79"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ValueType_PrimitiveType" helper="org.eclipse.papyrus.sysml.service.types.helper.ValueTypeEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/blocks/ValueType.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ValueTypePrimitiveTypeMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.168"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="Verify" helper="org.eclipse.papyrus.sysml.service.types.helper.VerifyEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/requirements/Verify.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.VerifyMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.0"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="View" helper="org.eclipse.papyrus.sysml.service.types.helper.ViewEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/View.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ViewMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.158"/>
+ </types>
+ <types xsi:type="domaincontextcodegen:SpecializationType" name="ViewPoint" helper="org.eclipse.papyrus.sysml.service.types.helper.ViewPointEditHelperAdvice" icon="platform:/plugin/org.eclipse.papyrus.sysml/icons/modelelements/Viewpoint.gif" matcher="org.eclipse.papyrus.sysml.service.types.matcher.ViewPointMatcher">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.31"/>
+ </types>
+ </elementTypes>
+ <advices adviceID="org.eclipse.papyrus.sysml.advice.ConstraintBlockPropertyHelperAdvice" advicePath="org.eclipse.papyrus.sysml.service.types.helper.ConstraintBlockPropertyEditHelperAdvice" inheritance="all">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
+ </advices>
+ <advices adviceID="org.eclipse.papyrus.sysml.advice.Classifier" advicePath="org.eclipse.papyrus.sysml.service.types.helper.advice.ClassifierEditHelperAdvice" inheritance="all">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.32"/>
+ </advices>
+ <advices adviceID="org.eclipse.papyrus.sysml.advice.Property" advicePath="org.eclipse.papyrus.sysml.service.types.helper.advice.PropertyEditHelperAdvice" inheritance="all">
+ <ref xsi:type="domaincontextcodegen:MetaClassType" href="../../org.eclipse.papyrus.uml.service.types/model/ElementTypeModelForUML.domaincontextcodegen#//@elementTypes/@types.171"/>
+ </advices>
+ <bindings clientContextID="org.eclipse.papyrus.infra.services.edit.TypeContext">
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.0"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.1"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.2"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.3"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.4"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.5"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.6"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.7"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.8"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.9"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.10"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.11"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.12"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.13"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.14"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.15"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.16"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.17"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.18"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.19"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.20"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.21"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.22"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.23"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.24"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.25"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.26"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.27"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.28"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.29"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.30"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.31"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.32"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.33"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.34"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.35"/>
+ <bindings xsi:type="domaincontextcodegen:ElementTypeBinding" ref="//@elementTypes/@types.36"/>
+ <bindings xsi:type="domaincontextcodegen:AdviceBinding" ref="//@advices.0"/>
+ <bindings xsi:type="domaincontextcodegen:AdviceBinding" ref="//@advices.1"/>
+ <bindings xsi:type="domaincontextcodegen:AdviceBinding" ref="//@advices.2"/>
+ </bindings>
+ <genHandlers handlerPackage="org.eclipse.papyrus.sysml.modelexplorer.handler" superClass="CreateCommandHandler" superClassPackage="org.eclipse.papyrus.sysml.modelexplorer.handler" elementTypeEnumerator="SysMLElementTypes" elementTypeEnumeratorPackage="org.eclipse.papyrus.sysml.service.types.element" visibleCreateChildHandlers="//@elementTypes/@types.8 //@elementTypes/@types.10 //@elementTypes/@types.11 //@elementTypes/@types.14 //@elementTypes/@types.15 //@elementTypes/@types.17 //@elementTypes/@types.16 //@elementTypes/@types.18 //@elementTypes/@types.20 //@elementTypes/@types.21 //@elementTypes/@types.23 //@elementTypes/@types.24 //@elementTypes/@types.25 //@elementTypes/@types.26 //@elementTypes/@types.27 //@elementTypes/@types.29 //@elementTypes/@types.30 //@elementTypes/@types.31 //@elementTypes/@types.35 //@elementTypes/@types.36" createChildMenuLocationURI="popup:org.eclipse.papyrus.views.modelexplorer.popupmenu.createsysmlchild"/>
+</domaincontextcodegen:DomainContext>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/plugin.xml b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/plugin.xml
index 59d9e5db567..8d3211aca15 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/plugin.xml
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/plugin.xml
@@ -433,7 +433,7 @@
</metamodel>
</extension>
-
+
<!-- SysML ModelElements package stereotype declarations -->
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
@@ -821,7 +821,7 @@
</metamodel>
</extension>
-
+
<!-- SysML ElementType bindings to Papyrus shared IClientContext -->
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
@@ -929,9 +929,9 @@
<advice ref="org.eclipse.papyrus.sysml.advice.BlockConnector" />
<advice ref="org.eclipse.papyrus.sysml.advice.Connector" />
<advice ref="org.eclipse.papyrus.sysml.advice.Property" />
- <advice ref="org.eclipse.papyrus.sysml.advice.Package" />
+ <advice ref="org.eclipse.papyrus.sysml.advice.Package" />
<advice ref="org.eclipse.papyrus.sysml.advice.Actor" />
- <advice ref="org.eclipse.papyrus.sysml.stereotype.advice.Block" />
+ <advice ref="org.eclipse.papyrus.sysml.stereotype.advice.Block" />
</binding>
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/command/SetNestedPathCommand.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/command/SetNestedPathCommand.java
index f86f0c59f13..1d2a87c1dba 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/command/SetNestedPathCommand.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/command/SetNestedPathCommand.java
@@ -1,161 +1,161 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.command;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-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.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
-import org.eclipse.papyrus.sysml.blocks.NestedConnectorEnd;
-import org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.util.UMLUtil;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/**
- * <pre>
- * Set SysML {@link NestedConnectorEnd} stereotype information for {@link ConnectorEnd}.
- * </pre>
- */
-public class SetNestedPathCommand extends EditElementCommand {
-
- private ConnectorUtils utils = new ConnectorUtils();
-
- /**
- * The ordered list of {@link Property} to follow in order to reach the nested {@link ConnectableElement}.
- */
- private List<Property> nestedPath;
-
- /**
- * Indicates that the source of the {@link Connector} is nested.
- */
- public final static int NESTED_SOURCE = 1;
-
- /**
- * Indicates that the target of the {@link Connector} is nested.
- */
- public final static int NESTED_TARGET = 2;
-
- /**
- * Indicates whether or not the source of the target of the {@link Connector} is nested.
- * One of {@link #NESTED_SOURCE} or {@link #NESTED_TARGET}.
- */
- private final int nestedEndDirection;
-
- /**
- *
- * Constructor.
- *
- * @param label the command label.
- * @param elementToEdit the element to edit.
- * @param request the request this command contribute to ({@link CreateRelationshipRequest} or {@link ReorientRelationshipRequest})
- * @param nestedPath the property path to set (in {@link NestedConnectorEnd#getPropertyPath()} ).
- * @param nestedEndDirection the direction ({@link #NESTED_SOURCE} or {@link #NESTED_TARGET}) of the {@link ConnectorEnd} to modify.
- */
- public SetNestedPathCommand(String label, EObject elementToEdit, IEditCommandRequest request, List<Property> nestedPath, int nestedEndDirection) {
- super(label, elementToEdit, request);
- this.nestedPath = nestedPath;
- this.nestedEndDirection = nestedEndDirection;
- }
-
- /**
- * Test whether the command can be executed or not.
- */
- public boolean canExecute() {
-
- // Verify the kind of request
- if(! (getRequest() instanceof CreateRelationshipRequest)
- && ! (getRequest() instanceof ReorientRelationshipRequest)) {
-
- return false;
- }
-
- // Verify (basic) that the related Connector well-formed.
- // In case of Connector creation, the connector is most probably not created yet
- if ((getConnector() != null)
- && (getConnector().getEnds().size() != 2)) {
-
- return false; // binary connector expected.
- }
-
- return true;
- }
-
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(!canExecute()) {
- throw new ExecutionException("Unexecutable command."); //$NON-NLS-1$
- }
-
- ConnectorEnd modifiedEnd = getModifiedConnectorEnd();
- NestedConnectorEnd nestedConnectorEnd = UMLUtil.getStereotypeApplication(modifiedEnd, NestedConnectorEnd.class);
-
- if(nestedPath.isEmpty()) {
- // Remove stereotype if applied
- if(nestedConnectorEnd != null) {
- EcoreUtil.delete(nestedConnectorEnd, true);
- }
-
- } else {
- // Add stereotype if not applied and set new path if different from existing
- if(nestedConnectorEnd == null) {
- // apply stereotype
- nestedConnectorEnd = (NestedConnectorEnd)StereotypeApplicationHelper.INSTANCE.applyStereotype(modifiedEnd, BlocksPackage.eINSTANCE.getNestedConnectorEnd());
- }
-
- // Set path
- if(!nestedConnectorEnd.getPropertyPath().equals(nestedPath)) {
- nestedConnectorEnd.getPropertyPath().clear();
- nestedConnectorEnd.getPropertyPath().addAll(nestedPath);
- }
- }
-
- return CommandResult.newOKCommandResult(getConnector());
- }
-
- /**
- * Get the {@link ConnectorEnd} currently modified by the command.
- * @return the modified {@link ConnectorEnd}.
- */
- private ConnectorEnd getModifiedConnectorEnd() {
- return (nestedEndDirection == NESTED_SOURCE) ? utils.getSourceConnectorEnd(getConnector()) : utils.getTargetConnectorEnd(getConnector());
- }
-
- /**
- * Get the {@link Connector} currently under creation or re-orient that hold {@link ConnectorEnd} to update.
- * @return the related {@link Connector}.
- */
- private Connector getConnector() {
- Connector connector = null;
- if(getRequest() instanceof CreateRelationshipRequest) {
- connector = (Connector)((CreateRelationshipRequest)getRequest()).getNewElement();
- }
-
- if(getRequest() instanceof ReorientRelationshipRequest) {
- connector = (Connector)((ReorientRelationshipRequest)getRequest()).getRelationship();
- }
- return connector;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.command;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+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.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.sysml.blocks.NestedConnectorEnd;
+import org.eclipse.papyrus.sysml.service.types.utils.ConnectorUtils;
+import org.eclipse.uml2.uml.ConnectableElement;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.ConnectorEnd;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.util.UMLUtil;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/**
+ * <pre>
+ * Set SysML {@link NestedConnectorEnd} stereotype information for {@link ConnectorEnd}.
+ * </pre>
+ */
+public class SetNestedPathCommand extends EditElementCommand {
+
+ private ConnectorUtils utils = new ConnectorUtils();
+
+ /**
+ * The ordered list of {@link Property} to follow in order to reach the nested {@link ConnectableElement}.
+ */
+ private List<Property> nestedPath;
+
+ /**
+ * Indicates that the source of the {@link Connector} is nested.
+ */
+ public final static int NESTED_SOURCE = 1;
+
+ /**
+ * Indicates that the target of the {@link Connector} is nested.
+ */
+ public final static int NESTED_TARGET = 2;
+
+ /**
+ * Indicates whether or not the source of the target of the {@link Connector} is nested.
+ * One of {@link #NESTED_SOURCE} or {@link #NESTED_TARGET}.
+ */
+ private final int nestedEndDirection;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param label the command label.
+ * @param elementToEdit the element to edit.
+ * @param request the request this command contribute to ({@link CreateRelationshipRequest} or {@link ReorientRelationshipRequest})
+ * @param nestedPath the property path to set (in {@link NestedConnectorEnd#getPropertyPath()} ).
+ * @param nestedEndDirection the direction ({@link #NESTED_SOURCE} or {@link #NESTED_TARGET}) of the {@link ConnectorEnd} to modify.
+ */
+ public SetNestedPathCommand(String label, EObject elementToEdit, IEditCommandRequest request, List<Property> nestedPath, int nestedEndDirection) {
+ super(label, elementToEdit, request);
+ this.nestedPath = nestedPath;
+ this.nestedEndDirection = nestedEndDirection;
+ }
+
+ /**
+ * Test whether the command can be executed or not.
+ */
+ public boolean canExecute() {
+
+ // Verify the kind of request
+ if(! (getRequest() instanceof CreateRelationshipRequest)
+ && ! (getRequest() instanceof ReorientRelationshipRequest)) {
+
+ return false;
+ }
+
+ // Verify (basic) that the related Connector well-formed.
+ // In case of Connector creation, the connector is most probably not created yet
+ if ((getConnector() != null)
+ && (getConnector().getEnds().size() != 2)) {
+
+ return false; // binary connector expected.
+ }
+
+ return true;
+ }
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(!canExecute()) {
+ throw new ExecutionException("Unexecutable command."); //$NON-NLS-1$
+ }
+
+ ConnectorEnd modifiedEnd = getModifiedConnectorEnd();
+ NestedConnectorEnd nestedConnectorEnd = UMLUtil.getStereotypeApplication(modifiedEnd, NestedConnectorEnd.class);
+
+ if(nestedPath.isEmpty()) {
+ // Remove stereotype if applied
+ if(nestedConnectorEnd != null) {
+ EcoreUtil.delete(nestedConnectorEnd, true);
+ }
+
+ } else {
+ // Add stereotype if not applied and set new path if different from existing
+ if(nestedConnectorEnd == null) {
+ // apply stereotype
+ nestedConnectorEnd = (NestedConnectorEnd)StereotypeApplicationHelper.INSTANCE.applyStereotype(modifiedEnd, BlocksPackage.eINSTANCE.getNestedConnectorEnd());
+ }
+
+ // Set path
+ if(!nestedConnectorEnd.getPropertyPath().equals(nestedPath)) {
+ nestedConnectorEnd.getPropertyPath().clear();
+ nestedConnectorEnd.getPropertyPath().addAll(nestedPath);
+ }
+ }
+
+ return CommandResult.newOKCommandResult(getConnector());
+ }
+
+ /**
+ * Get the {@link ConnectorEnd} currently modified by the command.
+ * @return the modified {@link ConnectorEnd}.
+ */
+ private ConnectorEnd getModifiedConnectorEnd() {
+ return (nestedEndDirection == NESTED_SOURCE) ? utils.getSourceConnectorEnd(getConnector()) : utils.getTargetConnectorEnd(getConnector());
+ }
+
+ /**
+ * Get the {@link Connector} currently under creation or re-orient that hold {@link ConnectorEnd} to update.
+ * @return the related {@link Connector}.
+ */
+ private Connector getConnector() {
+ Connector connector = null;
+ if(getRequest() instanceof CreateRelationshipRequest) {
+ connector = (Connector)((CreateRelationshipRequest)getRequest()).getNewElement();
+ }
+
+ if(getRequest() instanceof ReorientRelationshipRequest) {
+ connector = (Connector)((ReorientRelationshipRequest)getRequest()).getRelationship();
+ }
+ return connector;
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/handlers/AbstractSysmlCreateCommandHandler.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/handlers/AbstractSysmlCreateCommandHandler.java
index e84aad7714f..e3d23cd7930 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/handlers/AbstractSysmlCreateCommandHandler.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/handlers/AbstractSysmlCreateCommandHandler.java
@@ -1,32 +1,32 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.handlers;
-
-import org.eclipse.papyrus.sysml.service.types.filter.SysmlCommandFilter;
-import org.eclipse.papyrus.uml.service.types.filter.ICommandFilter;
-import org.eclipse.papyrus.uml.service.types.handlers.AbstractCreateCommandHandler;
-
-/**
- *
- * Abstract handler for every creation command for Sysml elements
- * used in the ModelExplorer contextual ("Create new child") menu
- *
- */
-public abstract class AbstractSysmlCreateCommandHandler extends AbstractCreateCommandHandler {
-
- private static final ICommandFilter filter = SysmlCommandFilter.INSTANCE;
-
- public ICommandFilter getCommandFilter() {
- return filter;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Juan Cadavid (CEA LIST) juan.cadavid@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.handlers;
+
+import org.eclipse.papyrus.sysml.service.types.filter.SysmlCommandFilter;
+import org.eclipse.papyrus.uml.service.types.filter.ICommandFilter;
+import org.eclipse.papyrus.uml.service.types.handlers.AbstractCreateCommandHandler;
+
+/**
+ *
+ * Abstract handler for every creation command for Sysml elements
+ * used in the ModelExplorer contextual ("Create new child") menu
+ *
+ */
+public abstract class AbstractSysmlCreateCommandHandler extends AbstractCreateCommandHandler {
+
+ private static final ICommandFilter filter = SysmlCommandFilter.INSTANCE;
+
+ public ICommandFilter getCommandFilter() {
+ return filter;
+ }
+
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AbstractPropertyEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AbstractPropertyEditHelperAdvice.java
index 40e51848964..f341bbb284b 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AbstractPropertyEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AbstractPropertyEditHelperAdvice.java
@@ -1,203 +1,203 @@
-/**
- *
- */
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import java.util.Collections;
-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.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.papyrus.sysml.service.types.Activator;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.Association;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Property;
-
-
-/**
- * Abstract edit helper advice for SysML specific Properties: part and reference
- */
-public abstract class AbstractPropertyEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeDuplicateCommand(DuplicateElementsRequest request) {
- Object targetContainer = request.getParameter("Target_Owner");
- // additional element should be a set of elements that will be duplicated. If this is null, the request will be ignored.
- if(!(targetContainer instanceof EObject)) {
- return super.getBeforeDuplicateCommand(request);
- }
- Property propertyToBeDuplicated = getDuplicatedProperty(request);
- if(propertyToBeDuplicated == null) {
- return super.getBeforeDuplicateCommand(request);
- }
-
- Property newPart = (Property)request.getAllDuplicatedElementsMap().get(propertyToBeDuplicated);
- if(newPart == null) {
- Activator.log.debug("Trying to create a command for a new sysml property which has not been created yet");
- return super.getBeforeDuplicateCommand(request);
- }
-
- // check association has not be duplicated yet
- Association originalAssociation = propertyToBeDuplicated.getAssociation();
- Association newAssociation = (Association)request.getAllDuplicatedElementsMap().get(originalAssociation);
- if(newAssociation != null && newAssociation.equals(newPart.getAssociation())) {
- return super.getBeforeDuplicateCommand(request);
- }
-
- TransactionalEditingDomain editingDomain = getEditingDomain(propertyToBeDuplicated);
- if(editingDomain == null) {
- return super.getBeforeDuplicateCommand(request);
- }
-
- Package targetPackage = getTargetContainer((EObject)targetContainer, propertyToBeDuplicated, newPart, request.getAllDuplicatedElementsMap());
- return new DuplicatePapyrusAssociationCommand(editingDomain, "Duplicate Association", originalAssociation, request.getAllDuplicatedElementsMap(), targetPackage);
- }
-
- /**
- * Returns the duplicate Part or Reference.
- * @param request the duplicate request for which we try to find the property
- * @return the found Property
- */
- protected abstract Property getDuplicatedProperty(DuplicateElementsRequest request);
-
- /**
- * Computes the target container for the new association
- *
- * @param targetContainer
- * the target container of the association creation request
- * @param partToBeDuplicated
- * the part which was duplicated
- * @param newPart
- * the new part linked to the association
- * @param allDuplicatedElementsMap
- * the map of all duplicated elements
- * @return the target {@link Package} for the new association or <code>null</code> if no package was found
- */
- protected Package getTargetContainer(EObject targetContainer, Property partToBeDuplicated, Property newPart, Map allDuplicatedElementsMap) {
-
- // 1. look if the new part has a nearest package
- // 2. look if the part to be duplicated has a package which has a copy
- // 3. if target container == package => this can be the place where the association could be placed
- // 4. look for the nearest package of the target container
-
- Package result = newPart.getNearestPackage();
- if(result != null) {
- return result;
- }
-
- Package originalPackage = partToBeDuplicated.getNearestPackage();
- // look for its equivalent in the list of duplicated objects
- Object o = allDuplicatedElementsMap.get(originalPackage);
- if(o instanceof Package) {
- return (Package)o;
- }
-
- if(targetContainer instanceof Package) {
- return ((Package)targetContainer);
- }
-
- if(targetContainer instanceof Element) {
- return ((Element)targetContainer).getNearestPackage();
- }
-
- return null;
- }
-
- /**
- * Get the editing domain from an {@link EObject}
- *
- * @param eObject
- * @return
- */
- protected TransactionalEditingDomain getEditingDomain(EObject eObject) {
- EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
- if(editingDomain instanceof TransactionalEditingDomain) {
- return (TransactionalEditingDomain)editingDomain;
- }
- return null;
- }
-
- /**
- * Command to duplicate an association and place it in a new container.
- */
- public class DuplicatePapyrusAssociationCommand extends DuplicateEObjectsCommand {
-
- /** association to be duplicated */
- private final Association associationToDuplicate;
-
- /** target container */
- private final Package targetContainer;
-
-
- /**
- * Constructs a new duplicate EObjects command with the specified label and
- * list of EObjects. Also sets the list of affected files to be the files,
- * where the targetContainer is stored. Target container specifies the
- * eObject into which the duplicated eObjects will be added.
- *
- * @param editingDomain
- * the editing domain through which model changes are made
- * @param label
- * The label for the new command.
- * @param originalAssociation
- * <code>Association</code> to be duplicated.
- * @param allDuplicatedObjectsMap
- * An empty map to be populated with the duplicated objects.
- * @param targetContainer
- * target package
- */
- public DuplicatePapyrusAssociationCommand(TransactionalEditingDomain editingDomain, String label, Association originalAssociation, Map allDuplicatedObjectsMap, Package targetContainer) {
- super(editingDomain, label, Collections.singletonList(originalAssociation), allDuplicatedObjectsMap, targetContainer);
- this.associationToDuplicate = originalAssociation;
- this.targetContainer = targetContainer;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- // Remove elements whose container is getting copied.
- // ClipboardSupportUtil.getCopyElements(getObjectsToBeDuplicated());
-
- // Perform the copy and update the references.
- EcoreUtil.Copier copier = new EcoreUtil.Copier();
- copier.putAll(getAllDuplicatedObjectsMap());
- copier.copy(associationToDuplicate);
- copier.copyReferences();
-
- Association newAssociation = (Association)copier.get(associationToDuplicate);
- if(newAssociation == null) {
- return CommandResult.newErrorCommandResult("Impossible to find the copied association");
- }
-
- // note: can be executed only if targetcontainer is instanceof package, this means that there is no need to tests for null targetContainer
- newAssociation.setPackage(targetContainer);
- String associationName = NamedElementHelper.getDefaultNameWithIncrementFromBase("Association", targetContainer.eContents()); //$NON-NLS-1$
- newAssociation.setName(associationName);
- return CommandResult.newOKCommandResult(getAllDuplicatedObjectsMap());
- }
-
- @Override
- public boolean canExecute() {
- // should add some tests here? no need to test containement feature like previous, Table has no owner...
- return targetContainer instanceof Package;
- }
- }
-}
+/**
+ *
+ */
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import java.util.Collections;
+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.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
+import org.eclipse.papyrus.sysml.service.types.Activator;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+
+
+/**
+ * Abstract edit helper advice for SysML specific Properties: part and reference
+ */
+public abstract class AbstractPropertyEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getBeforeDuplicateCommand(DuplicateElementsRequest request) {
+ Object targetContainer = request.getParameter("Target_Owner");
+ // additional element should be a set of elements that will be duplicated. If this is null, the request will be ignored.
+ if(!(targetContainer instanceof EObject)) {
+ return super.getBeforeDuplicateCommand(request);
+ }
+ Property propertyToBeDuplicated = getDuplicatedProperty(request);
+ if(propertyToBeDuplicated == null) {
+ return super.getBeforeDuplicateCommand(request);
+ }
+
+ Property newPart = (Property)request.getAllDuplicatedElementsMap().get(propertyToBeDuplicated);
+ if(newPart == null) {
+ Activator.log.debug("Trying to create a command for a new sysml property which has not been created yet");
+ return super.getBeforeDuplicateCommand(request);
+ }
+
+ // check association has not be duplicated yet
+ Association originalAssociation = propertyToBeDuplicated.getAssociation();
+ Association newAssociation = (Association)request.getAllDuplicatedElementsMap().get(originalAssociation);
+ if(newAssociation != null && newAssociation.equals(newPart.getAssociation())) {
+ return super.getBeforeDuplicateCommand(request);
+ }
+
+ TransactionalEditingDomain editingDomain = getEditingDomain(propertyToBeDuplicated);
+ if(editingDomain == null) {
+ return super.getBeforeDuplicateCommand(request);
+ }
+
+ Package targetPackage = getTargetContainer((EObject)targetContainer, propertyToBeDuplicated, newPart, request.getAllDuplicatedElementsMap());
+ return new DuplicatePapyrusAssociationCommand(editingDomain, "Duplicate Association", originalAssociation, request.getAllDuplicatedElementsMap(), targetPackage);
+ }
+
+ /**
+ * Returns the duplicate Part or Reference.
+ * @param request the duplicate request for which we try to find the property
+ * @return the found Property
+ */
+ protected abstract Property getDuplicatedProperty(DuplicateElementsRequest request);
+
+ /**
+ * Computes the target container for the new association
+ *
+ * @param targetContainer
+ * the target container of the association creation request
+ * @param partToBeDuplicated
+ * the part which was duplicated
+ * @param newPart
+ * the new part linked to the association
+ * @param allDuplicatedElementsMap
+ * the map of all duplicated elements
+ * @return the target {@link Package} for the new association or <code>null</code> if no package was found
+ */
+ protected Package getTargetContainer(EObject targetContainer, Property partToBeDuplicated, Property newPart, Map allDuplicatedElementsMap) {
+
+ // 1. look if the new part has a nearest package
+ // 2. look if the part to be duplicated has a package which has a copy
+ // 3. if target container == package => this can be the place where the association could be placed
+ // 4. look for the nearest package of the target container
+
+ Package result = newPart.getNearestPackage();
+ if(result != null) {
+ return result;
+ }
+
+ Package originalPackage = partToBeDuplicated.getNearestPackage();
+ // look for its equivalent in the list of duplicated objects
+ Object o = allDuplicatedElementsMap.get(originalPackage);
+ if(o instanceof Package) {
+ return (Package)o;
+ }
+
+ if(targetContainer instanceof Package) {
+ return ((Package)targetContainer);
+ }
+
+ if(targetContainer instanceof Element) {
+ return ((Element)targetContainer).getNearestPackage();
+ }
+
+ return null;
+ }
+
+ /**
+ * Get the editing domain from an {@link EObject}
+ *
+ * @param eObject
+ * @return
+ */
+ protected TransactionalEditingDomain getEditingDomain(EObject eObject) {
+ EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject);
+ if(editingDomain instanceof TransactionalEditingDomain) {
+ return (TransactionalEditingDomain)editingDomain;
+ }
+ return null;
+ }
+
+ /**
+ * Command to duplicate an association and place it in a new container.
+ */
+ public class DuplicatePapyrusAssociationCommand extends DuplicateEObjectsCommand {
+
+ /** association to be duplicated */
+ private final Association associationToDuplicate;
+
+ /** target container */
+ private final Package targetContainer;
+
+
+ /**
+ * Constructs a new duplicate EObjects command with the specified label and
+ * list of EObjects. Also sets the list of affected files to be the files,
+ * where the targetContainer is stored. Target container specifies the
+ * eObject into which the duplicated eObjects will be added.
+ *
+ * @param editingDomain
+ * the editing domain through which model changes are made
+ * @param label
+ * The label for the new command.
+ * @param originalAssociation
+ * <code>Association</code> to be duplicated.
+ * @param allDuplicatedObjectsMap
+ * An empty map to be populated with the duplicated objects.
+ * @param targetContainer
+ * target package
+ */
+ public DuplicatePapyrusAssociationCommand(TransactionalEditingDomain editingDomain, String label, Association originalAssociation, Map allDuplicatedObjectsMap, Package targetContainer) {
+ super(editingDomain, label, Collections.singletonList(originalAssociation), allDuplicatedObjectsMap, targetContainer);
+ this.associationToDuplicate = originalAssociation;
+ this.targetContainer = targetContainer;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ // Remove elements whose container is getting copied.
+ // ClipboardSupportUtil.getCopyElements(getObjectsToBeDuplicated());
+
+ // Perform the copy and update the references.
+ EcoreUtil.Copier copier = new EcoreUtil.Copier();
+ copier.putAll(getAllDuplicatedObjectsMap());
+ copier.copy(associationToDuplicate);
+ copier.copyReferences();
+
+ Association newAssociation = (Association)copier.get(associationToDuplicate);
+ if(newAssociation == null) {
+ return CommandResult.newErrorCommandResult("Impossible to find the copied association");
+ }
+
+ // note: can be executed only if targetcontainer is instanceof package, this means that there is no need to tests for null targetContainer
+ newAssociation.setPackage(targetContainer);
+ String associationName = NamedElementHelper.getDefaultNameWithIncrementFromBase("Association", targetContainer.eContents()); //$NON-NLS-1$
+ newAssociation.setName(associationName);
+ return CommandResult.newOKCommandResult(getAllDuplicatedObjectsMap());
+ }
+
+ @Override
+ public boolean canExecute() {
+ // should add some tests here? no need to test containement feature like previous, Table has no owner...
+ return targetContainer instanceof Package;
+ }
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ActorPartPropertyEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ActorPartPropertyEditHelperAdvice.java
index 752cf7fd5c4..2d84151b780 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ActorPartPropertyEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ActorPartPropertyEditHelperAdvice.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.IElementMatcher;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.sysml.blocks.Block;
-import org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.AggregationKind;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-
-/** SysML Property ActorPart edit helper advice */
-public class ActorPartPropertyEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * Check if the creation context is a {@link Block}.
- *
- * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param request
- * @return true if the request is approved
- */
- @Override
- public boolean approveRequest(IEditCommandRequest request) {
- boolean isApproved = super.approveRequest(request);
-
- if((request != null) && (request instanceof GetEditContextRequest)) {
-
- // Retrieve the edit context from request
- GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
-
- // Test if the edit context is a Block
- if(editContextRequest.getEditContext() instanceof Element) {
- Element contextElement = (Element)editContextRequest.getEditContext();
-
- IElementMatcher matcher = new BlockMatcher();
- if(!matcher.matches(contextElement)) {
- isApproved = false;
- }
- }
- }
-
- return isApproved;
- }
-
- /** Complete creation process by setting name and default aggregation */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Property element = (Property)request.getElementToConfigure();
- if(element != null) {
-
- // Set default name
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase("actorPart", element.eContainer().eContents()); //$NON-NLS-1$
- element.setName(initializedName);
- // Initialize the aggregation to composite.
- element.setAggregation(AggregationKind.COMPOSITE_LITERAL);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.IElementMatcher;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.AggregationKind;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+
+/** SysML Property ActorPart edit helper advice */
+public class ActorPartPropertyEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * Check if the creation context is a {@link Block}.
+ *
+ * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ *
+ * @param request
+ * @return true if the request is approved
+ */
+ @Override
+ public boolean approveRequest(IEditCommandRequest request) {
+ boolean isApproved = super.approveRequest(request);
+
+ if((request != null) && (request instanceof GetEditContextRequest)) {
+
+ // Retrieve the edit context from request
+ GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
+
+ // Test if the edit context is a Block
+ if(editContextRequest.getEditContext() instanceof Element) {
+ Element contextElement = (Element)editContextRequest.getEditContext();
+
+ IElementMatcher matcher = new BlockMatcher();
+ if(!matcher.matches(contextElement)) {
+ isApproved = false;
+ }
+ }
+ }
+
+ return isApproved;
+ }
+
+ /** Complete creation process by setting name and default aggregation */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ Property element = (Property)request.getElementToConfigure();
+ if(element != null) {
+
+ // Set default name
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase("actorPart", element.eContainer().eContents()); //$NON-NLS-1$
+ element.setName(initializedName);
+ // Initialize the aggregation to composite.
+ element.setAggregation(AggregationKind.COMPOSITE_LITERAL);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AllocateEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AllocateEditHelperAdvice.java
index cad044bb8da..53f5309c793 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AllocateEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/AllocateEditHelperAdvice.java
@@ -1,55 +1,55 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.allocations.Allocate;
-import org.eclipse.papyrus.sysml.allocations.AllocationsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link Allocate} edit helper advice */
-public class AllocateEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public AllocateEditHelperAdvice() {
- requiredProfiles.add(AllocationsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, AllocationsPackage.eINSTANCE.getAllocate());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(AllocationsPackage.eINSTANCE.getAllocate().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.allocations.Allocate;
+import org.eclipse.papyrus.sysml.allocations.AllocationsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link Allocate} edit helper advice */
+public class AllocateEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public AllocateEditHelperAdvice() {
+ requiredProfiles.add(AllocationsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, AllocationsPackage.eINSTANCE.getAllocate());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(AllocationsPackage.eINSTANCE.getAllocate().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/BlockEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/BlockEditHelperAdvice.java
index c99f7c3fec1..e7ea9c782dd 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/BlockEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/BlockEditHelperAdvice.java
@@ -1,146 +1,146 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.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.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.sysml.service.types.matcher.FlowSpecificationMatcher;
-import org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.EMFUtil;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML Block edit helper advice */
-public class BlockEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public BlockEditHelperAdvice() {
- requiredProfiles.add(BlocksPackage.eINSTANCE);
- }
-
- /**
- * Check if the creation context is allowed.
- *
- * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param request
- * @return true if the request is approved
- */
- @Override
- public boolean approveRequest(IEditCommandRequest request) {
- boolean isApproved = super.approveRequest(request);
-
- if((request != null) && (request instanceof GetEditContextRequest)) {
-
- // Retrieve the edit context from request
- GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
-
- // Test context type
- if(editContextRequest.getEditContext() instanceof Element) {
- Element contextElement = (Element)editContextRequest.getEditContext();
-
- IElementMatcher matcher;
-
- // Cannot create a nested Block in FlowSpecification
- matcher = new FlowSpecificationMatcher();
- if(matcher.matches(contextElement)) {
- isApproved = false;
- }
-
- // Cannot create a nested Block in Requirement
- matcher = new RequirementMatcher();
- if(matcher.matches(contextElement)) {
- isApproved = false;
- }
- }
- }
-
- return isApproved;
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, BlocksPackage.eINSTANCE.getBlock());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(BlocksPackage.eINSTANCE.getBlock().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-
- @Override
- protected ICommand getBeforeCreateRelationshipCommand(CreateRelationshipRequest request) {
- // test if the creation is for a SysML association
-
- IElementType type = request.getElementType();
- if(hasSuperType(type, SysMLElementTypes.ASSOCIATION)) {
- // test source and target...
- EObject source = request.getSource();
- // The source of an association cannot be read-only.
- if (EMFUtil.isReadOnly(source)) {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
- return super.getBeforeCreateRelationshipCommand(request);
- }
-
- protected boolean hasSuperType(IElementType elementType, IElementType typeToTest) {
- if(elementType == null || typeToTest == null) {
- return false;
- }
-
- if(elementType.equals(typeToTest)) {
- return true;
- }
-
- List<IElementType> superTypes = Arrays.asList(elementType.getAllSuperTypes());
- if(superTypes.contains(typeToTest)) {
- return true;
- }
-
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.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.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.sysml.service.types.matcher.FlowSpecificationMatcher;
+import org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.EMFUtil;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML Block edit helper advice */
+public class BlockEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public BlockEditHelperAdvice() {
+ requiredProfiles.add(BlocksPackage.eINSTANCE);
+ }
+
+ /**
+ * Check if the creation context is allowed.
+ *
+ * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ *
+ * @param request
+ * @return true if the request is approved
+ */
+ @Override
+ public boolean approveRequest(IEditCommandRequest request) {
+ boolean isApproved = super.approveRequest(request);
+
+ if((request != null) && (request instanceof GetEditContextRequest)) {
+
+ // Retrieve the edit context from request
+ GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
+
+ // Test context type
+ if(editContextRequest.getEditContext() instanceof Element) {
+ Element contextElement = (Element)editContextRequest.getEditContext();
+
+ IElementMatcher matcher;
+
+ // Cannot create a nested Block in FlowSpecification
+ matcher = new FlowSpecificationMatcher();
+ if(matcher.matches(contextElement)) {
+ isApproved = false;
+ }
+
+ // Cannot create a nested Block in Requirement
+ matcher = new RequirementMatcher();
+ if(matcher.matches(contextElement)) {
+ isApproved = false;
+ }
+ }
+ }
+
+ return isApproved;
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, BlocksPackage.eINSTANCE.getBlock());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(BlocksPackage.eINSTANCE.getBlock().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+
+ @Override
+ protected ICommand getBeforeCreateRelationshipCommand(CreateRelationshipRequest request) {
+ // test if the creation is for a SysML association
+
+ IElementType type = request.getElementType();
+ if(hasSuperType(type, SysMLElementTypes.ASSOCIATION)) {
+ // test source and target...
+ EObject source = request.getSource();
+ // The source of an association cannot be read-only.
+ if (EMFUtil.isReadOnly(source)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+
+ return super.getBeforeCreateRelationshipCommand(request);
+ }
+
+ protected boolean hasSuperType(IElementType elementType, IElementType typeToTest) {
+ if(elementType == null || typeToTest == null) {
+ return false;
+ }
+
+ if(elementType.equals(typeToTest)) {
+ return true;
+ }
+
+ List<IElementType> superTypes = Arrays.asList(elementType.getAllSuperTypes());
+ if(superTypes.contains(typeToTest)) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConformEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConformEditHelperAdvice.java
index 18c1accd4de..7d80d788b16 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConformEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConformEditHelperAdvice.java
@@ -1,55 +1,55 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.modelelements.Conform;
-import org.eclipse.papyrus.sysml.modelelements.ModelelementsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link Conform} edit helper advice */
-public class ConformEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public ConformEditHelperAdvice() {
- requiredProfiles.add(ModelelementsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ModelelementsPackage.eINSTANCE.getConform());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(ModelelementsPackage.eINSTANCE.getConform().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.modelelements.Conform;
+import org.eclipse.papyrus.sysml.modelelements.ModelelementsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link Conform} edit helper advice */
+public class ConformEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public ConformEditHelperAdvice() {
+ requiredProfiles.add(ModelelementsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ModelelementsPackage.eINSTANCE.getConform());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(ModelelementsPackage.eINSTANCE.getConform().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockEditHelperAdvice.java
index 503c08ca3c1..c0e8cc72c18 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockEditHelperAdvice.java
@@ -1,87 +1,87 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
-import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link ConstraintBlock} edit helper advice */
-public class ConstraintBlockEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public ConstraintBlockEditHelperAdvice() {
- requiredProfiles.add(ConstraintsPackage.eINSTANCE);
- }
-
- /**
- * Restriction on ConstraintBlock owned Structural and Behavioral features.
- *
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeCreateCommand(CreateElementRequest request) {
-
- IElementType elementToCreate = request.getElementType();
-
- if(UMLElementTypes.STRUCTURAL_FEATURE.getEClass().isSuperTypeOf(elementToCreate.getEClass())) {
- if(elementToCreate != SysMLElementTypes.CONSTRAINT_PROPERTY && elementToCreate != UMLElementTypes.PROPERTY) {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
- if(UMLElementTypes.BEHAVIORAL_FEATURE.getEClass().isSuperTypeOf(elementToCreate.getEClass())) {
- return UnexecutableCommand.INSTANCE;
- }
-
- return super.getBeforeCreateCommand(request);
- }
-
- /**
- * Complete creation process by applying the expected stereotype
- *
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ConstraintsPackage.eINSTANCE.getConstraintBlock());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(ConstraintsPackage.eINSTANCE.getConstraintBlock().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
+import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link ConstraintBlock} edit helper advice */
+public class ConstraintBlockEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public ConstraintBlockEditHelperAdvice() {
+ requiredProfiles.add(ConstraintsPackage.eINSTANCE);
+ }
+
+ /**
+ * Restriction on ConstraintBlock owned Structural and Behavioral features.
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getBeforeCreateCommand(CreateElementRequest request) {
+
+ IElementType elementToCreate = request.getElementType();
+
+ if(UMLElementTypes.STRUCTURAL_FEATURE.getEClass().isSuperTypeOf(elementToCreate.getEClass())) {
+ if(elementToCreate != SysMLElementTypes.CONSTRAINT_PROPERTY && elementToCreate != UMLElementTypes.PROPERTY) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+
+ if(UMLElementTypes.BEHAVIORAL_FEATURE.getEClass().isSuperTypeOf(elementToCreate.getEClass())) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ return super.getBeforeCreateCommand(request);
+ }
+
+ /**
+ * Complete creation process by applying the expected stereotype
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ConstraintsPackage.eINSTANCE.getConstraintBlock());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(ConstraintsPackage.eINSTANCE.getConstraintBlock().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockPropertyEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockPropertyEditHelperAdvice.java
index a63a23fd821..242195f840b 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockPropertyEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintBlockPropertyEditHelperAdvice.java
@@ -1,54 +1,54 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.ISpecializationType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.uml2.uml.AggregationKind;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-
-/** Specific advice for Property creation owned by a {@link ConstraintBlock} */
-public class ConstraintBlockPropertyEditHelperAdvice extends AbstractEditHelperAdvice {
-
- /**
- * Every {@link Property} created in the context of a {@link ConstraintBlock} is Composite.
- *
- * {@inheritDoc}
- */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Property element = (Property)request.getElementToConfigure();
- if(element != null) {
-
- Element owner = element.getOwner();
- if (((ISpecializationType)SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches(owner)) {
- element.setAggregation(AggregationKind.COMPOSITE_LITERAL);
- }
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.ISpecializationType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.uml2.uml.AggregationKind;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+
+/** Specific advice for Property creation owned by a {@link ConstraintBlock} */
+public class ConstraintBlockPropertyEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ /**
+ * Every {@link Property} created in the context of a {@link ConstraintBlock} is Composite.
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ Property element = (Property)request.getElementToConfigure();
+ if(element != null) {
+
+ Element owner = element.getOwner();
+ if (((ISpecializationType)SysMLElementTypes.CONSTRAINT_BLOCK).getMatcher().matches(owner)) {
+ element.setAggregation(AggregationKind.COMPOSITE_LITERAL);
+ }
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintParameterEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintParameterEditHelperAdvice.java
new file mode 100644
index 00000000000..36ce939ab2f
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintParameterEditHelperAdvice.java
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
+import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/** Specific advice for Property creation owned by a {@link ConstraintBlock}
+ * ConstraintParameter are defined in ConstraintProperty but really owned by ConstraintBlock
+ */
+public class ConstraintParameterEditHelperAdvice extends AbstractEditHelperAdvice {
+
+ @Override
+ public ICommand getBeforeEditCommand(IEditCommandRequest request) {
+ if (request instanceof ConfigureRequest) {
+ EObject elementToConfigure = ((ConfigureRequest)request).getElementToConfigure();
+ if (elementToConfigure != null && elementToConfigure instanceof Property) {
+ EObject container = elementToConfigure.eContainer();
+ if (container != null && container instanceof Property) {
+ Property constraintProperty = (Property) container;
+ if (UMLUtil.getStereotypeApplication(constraintProperty, ConstraintProperty.class) != null) {
+ Type type = constraintProperty.getType();
+ if (type != null && type instanceof Class && UMLUtil.getStereotypeApplication(type, ConstraintBlock.class) != null) {
+ ((Class)type).getOwnedAttributes().add((Property)elementToConfigure);
+ }
+ }
+ }
+ }
+ }
+ return super.getBeforeEditCommand(request);
+ }
+
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintPropertyEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintPropertyEditHelperAdvice.java
index b3248f9da43..c8cce361892 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintPropertyEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ConstraintPropertyEditHelperAdvice.java
@@ -1,85 +1,85 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
-import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
-import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.util.UMLUtil;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link ConstraintProperty} edit helper advice */
-public class ConstraintPropertyEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public ConstraintPropertyEditHelperAdvice() {
- requiredProfiles.add(ConstraintsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ConstraintsPackage.eINSTANCE.getConstraintProperty());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(ConstraintsPackage.eINSTANCE.getConstraintProperty().getName().toLowerCase(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-
- /**
- * Restrict allowed types to {@link ConstraintBlock}
- */
- @Override
- protected ICommand getBeforeSetCommand(SetRequest request) {
-
- // Only allow ConstraintBlock or null as new type
- if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(request.getFeature())) {
- if(request.getValue() != null) {
-
- if(!(request.getValue() instanceof Element)) {
- return UnexecutableCommand.INSTANCE;
- }
-
- ConstraintBlock constraint = UMLUtil.getStereotypeApplication((Element)request.getValue(), ConstraintBlock.class);
- if(constraint == null) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- }
-
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.sysml.constraints.ConstraintBlock;
+import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
+import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.util.UMLUtil;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link ConstraintProperty} edit helper advice */
+public class ConstraintPropertyEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public ConstraintPropertyEditHelperAdvice() {
+ requiredProfiles.add(ConstraintsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ConstraintsPackage.eINSTANCE.getConstraintProperty());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(ConstraintsPackage.eINSTANCE.getConstraintProperty().getName().toLowerCase(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+
+ /**
+ * Restrict allowed types to {@link ConstraintBlock}
+ */
+ @Override
+ protected ICommand getBeforeSetCommand(SetRequest request) {
+
+ // Only allow ConstraintBlock or null as new type
+ if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(request.getFeature())) {
+ if(request.getValue() != null) {
+
+ if(!(request.getValue() instanceof Element)) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ ConstraintBlock constraint = UMLUtil.getStereotypeApplication((Element)request.getValue(), ConstraintBlock.class);
+ if(constraint == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/CopyEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/CopyEditHelperAdvice.java
index be375263e0e..d3d717aee98 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/CopyEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/CopyEditHelperAdvice.java
@@ -1,55 +1,55 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.requirements.Copy;
-import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link Copy} edit helper advice */
-public class CopyEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public CopyEditHelperAdvice() {
- requiredProfiles.add(RequirementsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, RequirementsPackage.eINSTANCE.getCopy());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(RequirementsPackage.eINSTANCE.getCopy().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.requirements.Copy;
+import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link Copy} edit helper advice */
+public class CopyEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public CopyEditHelperAdvice() {
+ requiredProfiles.add(RequirementsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, RequirementsPackage.eINSTANCE.getCopy());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(RequirementsPackage.eINSTANCE.getCopy().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DeriveReqtEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DeriveReqtEditHelperAdvice.java
index b61c7039d09..207c5c55e92 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DeriveReqtEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DeriveReqtEditHelperAdvice.java
@@ -1,57 +1,57 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML DeriveReqt edit helper advice */
-public class DeriveReqtEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public DeriveReqtEditHelperAdvice() {
- requiredProfiles.add(RequirementsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, RequirementsPackage.eINSTANCE.getDeriveReqt());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(RequirementsPackage.eINSTANCE.getDeriveReqt().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.requirements.RequirementsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML DeriveReqt edit helper advice */
+public class DeriveReqtEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public DeriveReqtEditHelperAdvice() {
+ requiredProfiles.add(RequirementsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, RequirementsPackage.eINSTANCE.getDeriveReqt());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(RequirementsPackage.eINSTANCE.getDeriveReqt().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DimensionEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DimensionEditHelperAdvice.java
index 7ec00a33396..0ebc9defc52 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DimensionEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/DimensionEditHelperAdvice.java
@@ -1,56 +1,56 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import java.awt.Dimension;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link Dimension} edit helper advice */
-public class DimensionEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public DimensionEditHelperAdvice() {
- requiredProfiles.add(BlocksPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, BlocksPackage.eINSTANCE.getDimension());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(BlocksPackage.eINSTANCE.getDimension().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import java.awt.Dimension;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.blocks.BlocksPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link Dimension} edit helper advice */
+public class DimensionEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public DimensionEditHelperAdvice() {
+ requiredProfiles.add(BlocksPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, BlocksPackage.eINSTANCE.getDimension());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(BlocksPackage.eINSTANCE.getDimension().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortEditHelperAdvice.java
index 7b7151bf25b..551a9500ca4 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortEditHelperAdvice.java
@@ -1,140 +1,140 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.papyrus.sysml.blocks.Block;
-import org.eclipse.papyrus.sysml.blocks.ValueType;
-import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.DataType;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Signal;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.util.UMLUtil;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML FlowPort#InOut edit helper advice */
-public class FlowPortEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public FlowPortEditHelperAdvice() {
- requiredProfiles.add(PortandflowsPackage.eINSTANCE);
- }
-
- /**
- * Check if the creation context is a Block.
- *
- * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param request
- * @return true if the request is approved
- */
- @Override
- public boolean approveRequest(IEditCommandRequest request) {
- boolean isApproved = super.approveRequest(request);
-
- if((request != null) && (request instanceof GetEditContextRequest)) {
-
- // Retrieve the edit context from request
- GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
-
- // Test if the edit context is a Block
- if(editContextRequest.getEditContext() instanceof Element) {
- Element contextElement = (Element)editContextRequest.getEditContext();
-
- IElementMatcher matcher = new BlockMatcher();
- if(!matcher.matches(contextElement)) {
- isApproved = false;
- }
- }
- }
-
- return isApproved;
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- Port port = (Port)request.getElementToConfigure();
- if(port != null) {
-
- // Apply FlowPort stereotype
- StereotypeApplicationHelper.INSTANCE.applyStereotype(port, PortandflowsPackage.eINSTANCE.getFlowPort());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(PortandflowsPackage.eINSTANCE.getFlowPort().getName().toLowerCase(), port.eContainer().eContents());
- port.setName(initializedName);
- }
-
- return CommandResult.newOKCommandResult(port);
- }
- };
- }
-
- /**
- * Restrict allowed types to {@link Block}, {@link Signal}, {@link DataType}, {@link ValueType}, {@link FlowSpecification}
- */
- @Override
- protected ICommand getBeforeSetCommand(SetRequest request) {
-
- // Only allow null, Block, Signal, DataType or ValueType as the new type
- if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(request.getFeature())) {
- if(request.getValue() != null) {
-
- if(!(request.getValue() instanceof Element)) {
- return UnexecutableCommand.INSTANCE; // Should not happen
- }
-
- Element value = (Element)request.getValue();
- if((value instanceof DataType) || (value instanceof Signal)) {
- return null; // accept these types
- }
-
- ValueType valueType = UMLUtil.getStereotypeApplication(value, ValueType.class);
- Block block = UMLUtil.getStereotypeApplication(value, Block.class);
- FlowSpecification flowspecification = UMLUtil.getStereotypeApplication(value, FlowSpecification.class);
-
- if((block != null) || (valueType != null) || (flowspecification != null)) {
- return null; // accept these types
- }
-
- return UnexecutableCommand.INSTANCE; // forbid other types
- }
- }
-
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.blocks.ValueType;
+import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Signal;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.util.UMLUtil;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML FlowPort#InOut edit helper advice */
+public class FlowPortEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public FlowPortEditHelperAdvice() {
+ requiredProfiles.add(PortandflowsPackage.eINSTANCE);
+ }
+
+ /**
+ * Check if the creation context is a Block.
+ *
+ * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ *
+ * @param request
+ * @return true if the request is approved
+ */
+ @Override
+ public boolean approveRequest(IEditCommandRequest request) {
+ boolean isApproved = super.approveRequest(request);
+
+ if((request != null) && (request instanceof GetEditContextRequest)) {
+
+ // Retrieve the edit context from request
+ GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
+
+ // Test if the edit context is a Block
+ if(editContextRequest.getEditContext() instanceof Element) {
+ Element contextElement = (Element)editContextRequest.getEditContext();
+
+ IElementMatcher matcher = new BlockMatcher();
+ if(!matcher.matches(contextElement)) {
+ isApproved = false;
+ }
+ }
+ }
+
+ return isApproved;
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ Port port = (Port)request.getElementToConfigure();
+ if(port != null) {
+
+ // Apply FlowPort stereotype
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(port, PortandflowsPackage.eINSTANCE.getFlowPort());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(PortandflowsPackage.eINSTANCE.getFlowPort().getName().toLowerCase(), port.eContainer().eContents());
+ port.setName(initializedName);
+ }
+
+ return CommandResult.newOKCommandResult(port);
+ }
+ };
+ }
+
+ /**
+ * Restrict allowed types to {@link Block}, {@link Signal}, {@link DataType}, {@link ValueType}, {@link FlowSpecification}
+ */
+ @Override
+ protected ICommand getBeforeSetCommand(SetRequest request) {
+
+ // Only allow null, Block, Signal, DataType or ValueType as the new type
+ if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(request.getFeature())) {
+ if(request.getValue() != null) {
+
+ if(!(request.getValue() instanceof Element)) {
+ return UnexecutableCommand.INSTANCE; // Should not happen
+ }
+
+ Element value = (Element)request.getValue();
+ if((value instanceof DataType) || (value instanceof Signal)) {
+ return null; // accept these types
+ }
+
+ ValueType valueType = UMLUtil.getStereotypeApplication(value, ValueType.class);
+ Block block = UMLUtil.getStereotypeApplication(value, Block.class);
+ FlowSpecification flowspecification = UMLUtil.getStereotypeApplication(value, FlowSpecification.class);
+
+ if((block != null) || (valueType != null) || (flowspecification != null)) {
+ return null; // accept these types
+ }
+
+ return UnexecutableCommand.INSTANCE; // forbid other types
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInEditHelperAdvice.java
index d42690c1554..2e9654be3a4 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInEditHelperAdvice.java
@@ -1,57 +1,57 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
-import org.eclipse.papyrus.sysml.portandflows.FlowPort;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/** SysML FlowPort#In edit helper advice */
-public class FlowPortInEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public FlowPortInEditHelperAdvice() {
- requiredProfiles.add(PortandflowsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- Port port = (Port)request.getElementToConfigure();
- FlowPort flowPort = UMLUtil.getStereotypeApplication(port, FlowPort.class);
- if(flowPort != null) {
- flowPort.setDirection(FlowDirection.IN);
- }
-
- return CommandResult.newOKCommandResult(port);
- }
- };
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
+import org.eclipse.papyrus.sysml.portandflows.FlowPort;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/** SysML FlowPort#In edit helper advice */
+public class FlowPortInEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public FlowPortInEditHelperAdvice() {
+ requiredProfiles.add(PortandflowsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ Port port = (Port)request.getElementToConfigure();
+ FlowPort flowPort = UMLUtil.getStereotypeApplication(port, FlowPort.class);
+ if(flowPort != null) {
+ flowPort.setDirection(FlowDirection.IN);
+ }
+
+ return CommandResult.newOKCommandResult(port);
+ }
+ };
+ }
+
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInOutEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInOutEditHelperAdvice.java
index 59bded5565a..0f093669ba8 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInOutEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortInOutEditHelperAdvice.java
@@ -1,56 +1,56 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
-import org.eclipse.papyrus.sysml.portandflows.FlowPort;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/** SysML FlowPort#InOut edit helper advice */
-public class FlowPortInOutEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public FlowPortInOutEditHelperAdvice() {
- requiredProfiles.add(PortandflowsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- Port port = (Port)request.getElementToConfigure();
- FlowPort flowPort = UMLUtil.getStereotypeApplication(port, FlowPort.class);
- if(flowPort != null) {
- flowPort.setDirection(FlowDirection.INOUT);
- }
-
- return CommandResult.newOKCommandResult(port);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
+import org.eclipse.papyrus.sysml.portandflows.FlowPort;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/** SysML FlowPort#InOut edit helper advice */
+public class FlowPortInOutEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public FlowPortInOutEditHelperAdvice() {
+ requiredProfiles.add(PortandflowsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ Port port = (Port)request.getElementToConfigure();
+ FlowPort flowPort = UMLUtil.getStereotypeApplication(port, FlowPort.class);
+ if(flowPort != null) {
+ flowPort.setDirection(FlowDirection.INOUT);
+ }
+
+ return CommandResult.newOKCommandResult(port);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortNAEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortNAEditHelperAdvice.java
index 2cb930b617e..fe18de89d98 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortNAEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortNAEditHelperAdvice.java
@@ -1,59 +1,59 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/** SysML FlowPort#In edit helper advice */
-public class FlowPortNAEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public FlowPortNAEditHelperAdvice() {
- requiredProfiles.add(PortandflowsPackage.eINSTANCE);
- }
-
- /** Verify that the new FlowPort is typed by a FlowSpecification */
- @Override
- protected ICommand getAfterConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- Port port = (Port)request.getElementToConfigure();
-
- // Ensure the type is a FlowSpecification
- if((port != null) && (port.getType() != null)) {
- if (UMLUtil.getStereotypeApplication(port.getType(), FlowSpecification.class) != null) {
- return CommandResult.newOKCommandResult(port);
- }
- }
-
- return CommandResult.newCancelledCommandResult();
- }
- };
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.portandflows.FlowSpecification;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/** SysML FlowPort#In edit helper advice */
+public class FlowPortNAEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public FlowPortNAEditHelperAdvice() {
+ requiredProfiles.add(PortandflowsPackage.eINSTANCE);
+ }
+
+ /** Verify that the new FlowPort is typed by a FlowSpecification */
+ @Override
+ protected ICommand getAfterConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ Port port = (Port)request.getElementToConfigure();
+
+ // Ensure the type is a FlowSpecification
+ if((port != null) && (port.getType() != null)) {
+ if (UMLUtil.getStereotypeApplication(port.getType(), FlowSpecification.class) != null) {
+ return CommandResult.newOKCommandResult(port);
+ }
+ }
+
+ return CommandResult.newCancelledCommandResult();
+ }
+ };
+ }
+
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortOutEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortOutEditHelperAdvice.java
index 75720c8e0fb..cccf6d78d25 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortOutEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPortOutEditHelperAdvice.java
@@ -1,56 +1,56 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
-import org.eclipse.papyrus.sysml.portandflows.FlowPort;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/** SysML FlowPort#Out edit helper advice */
-public class FlowPortOutEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public FlowPortOutEditHelperAdvice() {
- requiredProfiles.add(PortandflowsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- Port port = (Port)request.getElementToConfigure();
- FlowPort flowPort = UMLUtil.getStereotypeApplication(port, FlowPort.class);
- if(flowPort != null) {
- flowPort.setDirection(FlowDirection.OUT);
- }
-
- return CommandResult.newOKCommandResult(port);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.portandflows.FlowDirection;
+import org.eclipse.papyrus.sysml.portandflows.FlowPort;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/** SysML FlowPort#Out edit helper advice */
+public class FlowPortOutEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public FlowPortOutEditHelperAdvice() {
+ requiredProfiles.add(PortandflowsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ Port port = (Port)request.getElementToConfigure();
+ FlowPort flowPort = UMLUtil.getStereotypeApplication(port, FlowPort.class);
+ if(flowPort != null) {
+ flowPort.setDirection(FlowDirection.OUT);
+ }
+
+ return CommandResult.newOKCommandResult(port);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPropertyEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPropertyEditHelperAdvice.java
index 8125348cc2f..c7bfe313c81 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPropertyEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowPropertyEditHelperAdvice.java
@@ -1,136 +1,136 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.papyrus.sysml.blocks.Block;
-import org.eclipse.papyrus.sysml.blocks.ValueType;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher;
-import org.eclipse.papyrus.sysml.service.types.matcher.FlowSpecificationMatcher;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.DataType;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Signal;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.util.UMLUtil;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML FlowProperty edit helper advice */
-public class FlowPropertyEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public FlowPropertyEditHelperAdvice() {
- requiredProfiles.add(PortandflowsPackage.eINSTANCE);
- }
-
- /**
- * Check if the creation context is a FlowSpecification.
- *
- * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param request
- * @return true if the request is approved
- */
- @Override
- public boolean approveRequest(IEditCommandRequest request) {
- boolean isApproved = super.approveRequest(request);
-
- if((request != null) && (request instanceof GetEditContextRequest)) {
-
- // Retrieve the edit context from request
- GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
-
- // Test if the edit context is a FlowSpecification
- if(editContextRequest.getEditContext() instanceof Element) {
- Element contextElement = (Element)editContextRequest.getEditContext();
-
- IElementMatcher matcher = new FlowSpecificationMatcher();
- IElementMatcher blockMatcher = new BlockMatcher();
- if(!matcher.matches(contextElement) && !blockMatcher.matches(contextElement)) {
- isApproved = false;
- }
- }
- }
-
- return isApproved;
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, PortandflowsPackage.eINSTANCE.getFlowProperty());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(PortandflowsPackage.eINSTANCE.getFlowProperty().getName().toLowerCase(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-
- /**
- * Restrict allowed types to {@link Block}, {@link Signal}, {@link DataType}, {@link ValueType}
- */
- @Override
- protected ICommand getBeforeSetCommand(SetRequest request) {
-
- // Only allow null, FlowSpecification, Block, Signal, DataType or ValueType as new type.
- if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(request.getFeature())) {
- if(request.getValue() != null) {
-
- if(!(request.getValue() instanceof Element)) {
- return UnexecutableCommand.INSTANCE; // Should not happen
- }
-
- Element value = (Element)request.getValue();
- if((value instanceof DataType) || (value instanceof Signal)) {
- return null; // accept these types
- }
-
- ValueType valueType = UMLUtil.getStereotypeApplication(value, ValueType.class);
- Block block = UMLUtil.getStereotypeApplication(value, Block.class);
-
- if((block != null) || (valueType != null)) {
- return null; // accept these types
- }
-
- return UnexecutableCommand.INSTANCE; // forbid other types
- }
- }
-
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.blocks.ValueType;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher;
+import org.eclipse.papyrus.sysml.service.types.matcher.FlowSpecificationMatcher;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Signal;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.util.UMLUtil;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML FlowProperty edit helper advice */
+public class FlowPropertyEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public FlowPropertyEditHelperAdvice() {
+ requiredProfiles.add(PortandflowsPackage.eINSTANCE);
+ }
+
+ /**
+ * Check if the creation context is a FlowSpecification.
+ *
+ * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ *
+ * @param request
+ * @return true if the request is approved
+ */
+ @Override
+ public boolean approveRequest(IEditCommandRequest request) {
+ boolean isApproved = super.approveRequest(request);
+
+ if((request != null) && (request instanceof GetEditContextRequest)) {
+
+ // Retrieve the edit context from request
+ GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
+
+ // Test if the edit context is a FlowSpecification
+ if(editContextRequest.getEditContext() instanceof Element) {
+ Element contextElement = (Element)editContextRequest.getEditContext();
+
+ IElementMatcher matcher = new FlowSpecificationMatcher();
+ IElementMatcher blockMatcher = new BlockMatcher();
+ if(!matcher.matches(contextElement) && !blockMatcher.matches(contextElement)) {
+ isApproved = false;
+ }
+ }
+ }
+
+ return isApproved;
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, PortandflowsPackage.eINSTANCE.getFlowProperty());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(PortandflowsPackage.eINSTANCE.getFlowProperty().getName().toLowerCase(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+
+ /**
+ * Restrict allowed types to {@link Block}, {@link Signal}, {@link DataType}, {@link ValueType}
+ */
+ @Override
+ protected ICommand getBeforeSetCommand(SetRequest request) {
+
+ // Only allow null, FlowSpecification, Block, Signal, DataType or ValueType as new type.
+ if(UMLPackage.eINSTANCE.getTypedElement_Type().equals(request.getFeature())) {
+ if(request.getValue() != null) {
+
+ if(!(request.getValue() instanceof Element)) {
+ return UnexecutableCommand.INSTANCE; // Should not happen
+ }
+
+ Element value = (Element)request.getValue();
+ if((value instanceof DataType) || (value instanceof Signal)) {
+ return null; // accept these types
+ }
+
+ ValueType valueType = UMLUtil.getStereotypeApplication(value, ValueType.class);
+ Block block = UMLUtil.getStereotypeApplication(value, Block.class);
+
+ if((block != null) || (valueType != null)) {
+ return null; // accept these types
+ }
+
+ return UnexecutableCommand.INSTANCE; // forbid other types
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowSpecificationEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowSpecificationEditHelperAdvice.java
index 4f90474b6cc..995a215c69e 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowSpecificationEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/FlowSpecificationEditHelperAdvice.java
@@ -1,138 +1,138 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import java.util.Arrays;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-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.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.sysml.service.types.matcher.FlowSpecificationMatcher;
-import org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher;
-import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML FlowSpecification edit helper advice */
-public class FlowSpecificationEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public FlowSpecificationEditHelperAdvice() {
- requiredProfiles.add(PortandflowsPackage.eINSTANCE);
- }
-
- /**
- * FlowSpecification owned feature restrictions :
- * [1] Flow specifications cannot own operations or receptions (they can only own FlowProperties).
- * [2] Every “ownedAttribute” of a FlowSpecification must be a FlowProperty.
- */
- @Override
- protected ICommand getBeforeCreateCommand(CreateElementRequest request) {
-
- IElementType elementToCreate = request.getElementType();
-
- // [1] Flow specifications cannot own operations or receptions (they can only own FlowProperties).
- if(elementToCreate == UMLElementTypes.OPERATION) {
- return UnexecutableCommand.INSTANCE;
- }
- if(elementToCreate == UMLElementTypes.RECEPTION) {
- return UnexecutableCommand.INSTANCE;
- }
-
- // [2] Every “ownedAttribute” of a FlowSpecification must be a FlowProperty.
- if(UMLElementTypes.PROPERTY.getEClass().isSuperTypeOf(elementToCreate.getEClass())) {
- if((elementToCreate != SysMLElementTypes.FLOW_PROPERTY) && !(Arrays.asList(elementToCreate.getAllSuperTypes()).contains(SysMLElementTypes.FLOW_PROPERTY))) {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
- return super.getBeforeCreateCommand(request);
- }
-
- /**
- * Check if the creation context is allowed.
- *
- * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param request
- * @return true if the request is approved
- */
- @Override
- public boolean approveRequest(IEditCommandRequest request) {
- boolean isApproved = super.approveRequest(request);
-
- if((request != null) && (request instanceof GetEditContextRequest)) {
-
- // Retrieve the edit context from request
- GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
-
- // Test context type
- if(editContextRequest.getEditContext() instanceof Element) {
- Element contextElement = (Element)editContextRequest.getEditContext();
-
- IElementMatcher matcher;
-
- // Cannot create a nested FlowSpecification in FlowSpecification
- matcher = new FlowSpecificationMatcher();
- if(matcher.matches(contextElement)) {
- isApproved = false;
- }
-
- // Cannot create a nested FlowSpecification in Requirement
- matcher = new RequirementMatcher();
- if(matcher.matches(contextElement)) {
- isApproved = false;
- }
- }
- }
-
- return isApproved;
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, PortandflowsPackage.eINSTANCE.getFlowSpecification());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(PortandflowsPackage.eINSTANCE.getFlowSpecification().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import java.util.Arrays;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+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.GetEditContextRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.sysml.service.types.matcher.FlowSpecificationMatcher;
+import org.eclipse.papyrus.sysml.service.types.matcher.RequirementMatcher;
+import org.eclipse.papyrus.uml.service.types.element.UMLElementTypes;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML FlowSpecification edit helper advice */
+public class FlowSpecificationEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public FlowSpecificationEditHelperAdvice() {
+ requiredProfiles.add(PortandflowsPackage.eINSTANCE);
+ }
+
+ /**
+ * FlowSpecification owned feature restrictions :
+ * [1] Flow specifications cannot own operations or receptions (they can only own FlowProperties).
+ * [2] Every “ownedAttribute” of a FlowSpecification must be a FlowProperty.
+ */
+ @Override
+ protected ICommand getBeforeCreateCommand(CreateElementRequest request) {
+
+ IElementType elementToCreate = request.getElementType();
+
+ // [1] Flow specifications cannot own operations or receptions (they can only own FlowProperties).
+ if(elementToCreate == UMLElementTypes.OPERATION) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if(elementToCreate == UMLElementTypes.RECEPTION) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ // [2] Every “ownedAttribute” of a FlowSpecification must be a FlowProperty.
+ if(UMLElementTypes.PROPERTY.getEClass().isSuperTypeOf(elementToCreate.getEClass())) {
+ if((elementToCreate != SysMLElementTypes.FLOW_PROPERTY) && !(Arrays.asList(elementToCreate.getAllSuperTypes()).contains(SysMLElementTypes.FLOW_PROPERTY))) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+
+ return super.getBeforeCreateCommand(request);
+ }
+
+ /**
+ * Check if the creation context is allowed.
+ *
+ * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ *
+ * @param request
+ * @return true if the request is approved
+ */
+ @Override
+ public boolean approveRequest(IEditCommandRequest request) {
+ boolean isApproved = super.approveRequest(request);
+
+ if((request != null) && (request instanceof GetEditContextRequest)) {
+
+ // Retrieve the edit context from request
+ GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
+
+ // Test context type
+ if(editContextRequest.getEditContext() instanceof Element) {
+ Element contextElement = (Element)editContextRequest.getEditContext();
+
+ IElementMatcher matcher;
+
+ // Cannot create a nested FlowSpecification in FlowSpecification
+ matcher = new FlowSpecificationMatcher();
+ if(matcher.matches(contextElement)) {
+ isApproved = false;
+ }
+
+ // Cannot create a nested FlowSpecification in Requirement
+ matcher = new RequirementMatcher();
+ if(matcher.matches(contextElement)) {
+ isApproved = false;
+ }
+ }
+ }
+
+ return isApproved;
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, PortandflowsPackage.eINSTANCE.getFlowSpecification());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(PortandflowsPackage.eINSTANCE.getFlowSpecification().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ItemFlowEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ItemFlowEditHelperAdvice.java
index 86bc550f3fe..6a40252176b 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ItemFlowEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ItemFlowEditHelperAdvice.java
@@ -1,55 +1,55 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.portandflows.ItemFlow;
-import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link ItemFlow} edit helper advice */
-public class ItemFlowEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public ItemFlowEditHelperAdvice() {
- requiredProfiles.add(PortandflowsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- NamedElement element = (NamedElement)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, PortandflowsPackage.eINSTANCE.getItemFlow());
-
- // Set default name
- // Initialize the element name based on the created IElementType
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(PortandflowsPackage.eINSTANCE.getItemFlow().getName(), element.eContainer().eContents());
- element.setName(initializedName);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.portandflows.ItemFlow;
+import org.eclipse.papyrus.sysml.portandflows.PortandflowsPackage;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link ItemFlow} edit helper advice */
+public class ItemFlowEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public ItemFlowEditHelperAdvice() {
+ requiredProfiles.add(PortandflowsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ NamedElement element = (NamedElement)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, PortandflowsPackage.eINSTANCE.getItemFlow());
+
+ // Set default name
+ // Initialize the element name based on the created IElementType
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase(PortandflowsPackage.eINSTANCE.getItemFlow().getName(), element.eContainer().eContents());
+ element.setName(initializedName);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/PartPropertyEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/PartPropertyEditHelperAdvice.java
index 3a9eee08aaa..285655e0866 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/PartPropertyEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/PartPropertyEditHelperAdvice.java
@@ -1,161 +1,161 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
-import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.sysml.blocks.Block;
-import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
-import org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher;
-import org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher;
-import org.eclipse.papyrus.uml.service.types.utils.ElementUtil;
-import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
-import org.eclipse.uml2.uml.AggregationKind;
-import org.eclipse.uml2.uml.Association;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/** SysML Property Part edit helper advice */
-public class PartPropertyEditHelperAdvice extends AbstractPropertyEditHelperAdvice {
-
- /**
- * Check if the creation context is a {@link Block}.
- *
- * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
- *
- * @param request
- * @return true if the request is approved
- */
- @Override
- public boolean approveRequest(IEditCommandRequest request) {
- boolean isApproved = super.approveRequest(request);
-
- if((request != null) && (request instanceof GetEditContextRequest)) {
-
- // Retrieve the edit context from request
- GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
-
- // Test if the edit context is a Block
- if(editContextRequest.getEditContext() instanceof Element) {
- Element contextElement = (Element)editContextRequest.getEditContext();
-
- IElementMatcher matcher = new BlockMatcher();
- if(!matcher.matches(contextElement)) {
- isApproved = false;
- }
- }
- }
-
- return isApproved;
- }
-
- /** Complete creation process by setting name and default aggregation */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Property element = (Property)request.getElementToConfigure();
- if(element != null) {
-
- // Set default name
- String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase("part", element.eContainer().eContents()); //$NON-NLS-1$
- element.setName(initializedName);
- // Initialize the aggregation to composite.
- element.setAggregation(AggregationKind.COMPOSITE_LITERAL);
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-
- /**
- * Complete creation process by adding the related association.
- * This assumes the part type has been set at this point.
- */
- @Override
- protected ICommand getAfterConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Property sourcePart = (Property)request.getElementToConfigure();
- if((sourcePart != null) && (sourcePart.getType() != null)) {
-
- // Create association between element owner and element type
- Type sourceType = sourcePart.getClass_();
- //Type targetType = sourcePart.getType();
- Package associationContainer = sourceType.getNearestPackage();
-
- // Create targetProperty
- Property targetProperty = UMLFactory.eINSTANCE.createProperty();
- targetProperty.setType(sourceType);
- targetProperty.setName("");
-
- Association association = UMLFactory.eINSTANCE.createAssociation();
- association.getMemberEnds().add(sourcePart);
- association.getOwnedEnds().add(targetProperty);
- association.getMemberEnds().add(targetProperty);
-
- String associationName = NamedElementHelper.getDefaultNameWithIncrementFromBase("Association", associationContainer.eContents()); //$NON-NLS-1$
- association.setName(associationName);
-
- // Add SysML Nature on the new Association
- ElementUtil.addNature(association, SysMLElementTypes.SYSML_NATURE);
-
- association.setPackage(associationContainer);
- }
- return CommandResult.newOKCommandResult(sourcePart);
- }
- };
- }
-
- /**
- * Returns the Part to be duplicated
- *
- * @return the Part to be duplicated or <code>null</code> if this is not a part
- */
- protected Property getDuplicatedProperty(DuplicateElementsRequest request) {
- List<Object> elementsToBeDuplicated = request.getElementsToBeDuplicated();
- if(elementsToBeDuplicated == null || elementsToBeDuplicated.isEmpty()) {
- return null;
- }
- Object firstElement = elementsToBeDuplicated.get(0); // there should be only one element here
- if(!(firstElement instanceof Property)) {
- return null;
- }
- PartPropertyMatcher matcher = new PartPropertyMatcher();
- return matcher.matches((Property)firstElement) ? (Property)firstElement : null;
- }
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementMatcher;
+import org.eclipse.gmf.runtime.emf.type.core.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.GetEditContextRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.sysml.service.types.element.SysMLElementTypes;
+import org.eclipse.papyrus.sysml.service.types.matcher.BlockMatcher;
+import org.eclipse.papyrus.sysml.service.types.matcher.PartPropertyMatcher;
+import org.eclipse.papyrus.uml.service.types.utils.ElementUtil;
+import org.eclipse.papyrus.uml.service.types.utils.NamedElementHelper;
+import org.eclipse.uml2.uml.AggregationKind;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/** SysML Property Part edit helper advice */
+public class PartPropertyEditHelperAdvice extends AbstractPropertyEditHelperAdvice {
+
+ /**
+ * Check if the creation context is a {@link Block}.
+ *
+ * @see org.eclipse.papyrus.sysml.service.types.helper.AbstractStereotypedElementEditHelperAdvice#approveRequest(org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest)
+ *
+ * @param request
+ * @return true if the request is approved
+ */
+ @Override
+ public boolean approveRequest(IEditCommandRequest request) {
+ boolean isApproved = super.approveRequest(request);
+
+ if((request != null) && (request instanceof GetEditContextRequest)) {
+
+ // Retrieve the edit context from request
+ GetEditContextRequest editContextRequest = (GetEditContextRequest)request;
+
+ // Test if the edit context is a Block
+ if(editContextRequest.getEditContext() instanceof Element) {
+ Element contextElement = (Element)editContextRequest.getEditContext();
+
+ IElementMatcher matcher = new BlockMatcher();
+ if(!matcher.matches(contextElement)) {
+ isApproved = false;
+ }
+ }
+ }
+
+ return isApproved;
+ }
+
+ /** Complete creation process by setting name and default aggregation */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ Property element = (Property)request.getElementToConfigure();
+ if(element != null) {
+
+ // Set default name
+ String initializedName = NamedElementHelper.getDefaultNameWithIncrementFromBase("part", element.eContainer().eContents()); //$NON-NLS-1$
+ element.setName(initializedName);
+ // Initialize the aggregation to composite.
+ element.setAggregation(AggregationKind.COMPOSITE_LITERAL);
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+
+ /**
+ * Complete creation process by adding the related association.
+ * This assumes the part type has been set at this point.
+ */
+ @Override
+ protected ICommand getAfterConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ Property sourcePart = (Property)request.getElementToConfigure();
+ if((sourcePart != null) && (sourcePart.getType() != null)) {
+
+ // Create association between element owner and element type
+ Type sourceType = sourcePart.getClass_();
+ //Type targetType = sourcePart.getType();
+ Package associationContainer = sourceType.getNearestPackage();
+
+ // Create targetProperty
+ Property targetProperty = UMLFactory.eINSTANCE.createProperty();
+ targetProperty.setType(sourceType);
+ targetProperty.setName("");
+
+ Association association = UMLFactory.eINSTANCE.createAssociation();
+ association.getMemberEnds().add(sourcePart);
+ association.getOwnedEnds().add(targetProperty);
+ association.getMemberEnds().add(targetProperty);
+
+ String associationName = NamedElementHelper.getDefaultNameWithIncrementFromBase("Association", associationContainer.eContents()); //$NON-NLS-1$
+ association.setName(associationName);
+
+ // Add SysML Nature on the new Association
+ ElementUtil.addNature(association, SysMLElementTypes.SYSML_NATURE);
+
+ association.setPackage(associationContainer);
+ }
+ return CommandResult.newOKCommandResult(sourcePart);
+ }
+ };
+ }
+
+ /**
+ * Returns the Part to be duplicated
+ *
+ * @return the Part to be duplicated or <code>null</code> if this is not a part
+ */
+ protected Property getDuplicatedProperty(DuplicateElementsRequest request) {
+ List<Object> elementsToBeDuplicated = request.getElementsToBeDuplicated();
+ if(elementsToBeDuplicated == null || elementsToBeDuplicated.isEmpty()) {
+ return null;
+ }
+ Object firstElement = elementsToBeDuplicated.get(0); // there should be only one element here
+ if(!(firstElement instanceof Property)) {
+ return null;
+ }
+ PartPropertyMatcher matcher = new PartPropertyMatcher();
+ return matcher.matches((Property)firstElement) ? (Property)firstElement : null;
+ }
+
+
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ProblemEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ProblemEditHelperAdvice.java
index 29afaa4ba3b..e823543e635 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ProblemEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/ProblemEditHelperAdvice.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.modelelements.ModelelementsPackage;
-import org.eclipse.papyrus.sysml.modelelements.Problem;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link Problem} edit helper advice */
-public class ProblemEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public ProblemEditHelperAdvice() {
- requiredProfiles.add(ModelelementsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Element element = (Element)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ModelelementsPackage.eINSTANCE.getProblem());
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.modelelements.ModelelementsPackage;
+import org.eclipse.papyrus.sysml.modelelements.Problem;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link Problem} edit helper advice */
+public class ProblemEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public ProblemEditHelperAdvice() {
+ requiredProfiles.add(ModelelementsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ Element element = (Element)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ModelelementsPackage.eINSTANCE.getProblem());
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/RationaleEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/RationaleEditHelperAdvice.java
index 1fcea33dadb..d499887bb29 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/RationaleEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/RationaleEditHelperAdvice.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *****************************************************************************/
-package org.eclipse.papyrus.sysml.service.types.helper;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-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.commands.ConfigureElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.papyrus.sysml.modelelements.ModelelementsPackage;
-import org.eclipse.papyrus.sysml.modelelements.Rationale;
-import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
-
-/** SysML {@link Rationale} edit helper advice */
-public class RationaleEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
-
- /** Default constructor */
- public RationaleEditHelperAdvice() {
- requiredProfiles.add(ModelelementsPackage.eINSTANCE);
- }
-
- /** Complete creation process by applying the expected stereotype */
- @Override
- protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
-
- return new ConfigureElementCommand(request) {
-
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Element element = (Element)request.getElementToConfigure();
- if(element != null) {
- StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ModelelementsPackage.eINSTANCE.getRationale());
- }
- return CommandResult.newOKCommandResult(element);
- }
- };
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.service.types.helper;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.commands.ConfigureElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+import org.eclipse.papyrus.sysml.modelelements.ModelelementsPackage;
+import org.eclipse.papyrus.sysml.modelelements.Rationale;
+import org.eclipse.papyrus.uml.service.types.helper.advice.AbstractStereotypedElementEditHelperAdvice;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.util.UMLUtil.StereotypeApplicationHelper;
+
+/** SysML {@link Rationale} edit helper advice */
+public class RationaleEditHelperAdvice extends AbstractStereotypedElementEditHelperAdvice {
+
+ /** Default constructor */
+ public RationaleEditHelperAdvice() {
+ requiredProfiles.add(ModelelementsPackage.eINSTANCE);
+ }
+
+ /** Complete creation process by applying the expected stereotype */
+ @Override
+ protected ICommand getBeforeConfigureCommand(final ConfigureRequest request) {
+
+ return new ConfigureElementCommand(request) {
+
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ Element element = (Element)request.getElementToConfigure();
+ if(element != null) {
+ StereotypeApplicationHelper.INSTANCE.applyStereotype(element, ModelelementsPackage.eINSTANCE.getRationale());
+ }
+ return CommandResult.newOKCommandResult(element);
+ }
+ };
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.classpath b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.classpath
index 2d1a4302f04..64c5e31b7a2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.classpath
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.project b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.project
index b77457655b7..963f2cccf0a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.project
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.project
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.papyrus.uml.diagram.common</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.uml.diagram.common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.core.resources.prefs b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.core.resources.prefs
index 4824b802631..99f26c0203a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.core.resources.prefs
@@ -1,2 +1,2 @@
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.jdt.core.prefs b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.jdt.core.prefs
index c4474e7e443..c3efd154917 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,7 @@
-#Tue Sep 02 16:22:43 CEST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+#Tue Sep 02 16:22:43 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
index 05436e9e005..1bc93c08601 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
@@ -1,96 +1,96 @@
-Manifest-Version: 1.0
-Export-Package: org.eclipse.papyrus.uml.diagram.common,
- org.eclipse.papyrus.uml.diagram.common.actions,
- org.eclipse.papyrus.uml.diagram.common.actions.handlers,
- org.eclipse.papyrus.uml.diagram.common.command.wrappers,
- org.eclipse.papyrus.uml.diagram.common.commands,
- org.eclipse.papyrus.uml.diagram.common.dialogs,
- org.eclipse.papyrus.uml.diagram.common.directedit,
- org.eclipse.papyrus.uml.diagram.common.dragtracker,
- org.eclipse.papyrus.uml.diagram.common.draw2d,
- org.eclipse.papyrus.uml.diagram.common.draw2d.anchors,
- org.eclipse.papyrus.uml.diagram.common.editparts,
- org.eclipse.papyrus.uml.diagram.common.editpolicies,
- org.eclipse.papyrus.uml.diagram.common.figure.edge,
- org.eclipse.papyrus.uml.diagram.common.figure.layout,
- org.eclipse.papyrus.uml.diagram.common.figure.node,
- org.eclipse.papyrus.uml.diagram.common.handlers,
- org.eclipse.papyrus.uml.diagram.common.helper,
- org.eclipse.papyrus.uml.diagram.common.ids,
- org.eclipse.papyrus.uml.diagram.common.layout,
- org.eclipse.papyrus.uml.diagram.common.listeners,
- org.eclipse.papyrus.uml.diagram.common.locator,
- org.eclipse.papyrus.uml.diagram.common.parser,
- org.eclipse.papyrus.uml.diagram.common.parser.assist,
- org.eclipse.papyrus.uml.diagram.common.parser.custom,
- org.eclipse.papyrus.uml.diagram.common.parser.lookup,
- org.eclipse.papyrus.uml.diagram.common.parser.packageimport,
- org.eclipse.papyrus.uml.diagram.common.parser.stereotype,
- org.eclipse.papyrus.uml.diagram.common.parser.structural,
- org.eclipse.papyrus.uml.diagram.common.part,
- org.eclipse.papyrus.uml.diagram.common.preferences,
- org.eclipse.papyrus.uml.diagram.common.providers,
- org.eclipse.papyrus.uml.diagram.common.providers.assistant,
- org.eclipse.papyrus.uml.diagram.common.resourceupdate,
- org.eclipse.papyrus.uml.diagram.common.service,
- org.eclipse.papyrus.uml.diagram.common.service.palette,
- org.eclipse.papyrus.uml.diagram.common.sheet,
- org.eclipse.papyrus.uml.diagram.common.ui.dialogs,
- org.eclipse.papyrus.uml.diagram.common.ui.helper,
- org.eclipse.papyrus.uml.diagram.common.util,
- org.eclipse.papyrus.uml.diagram.common.util.functions,
- org.eclipse.papyrus.uml.diagram.common.util.predicates
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Created-By: 1.5.0_06-b05 (Sun Microsystems Inc.)
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
- org.eclipse.gmf.runtime.diagram.ui.resources.editor,
- org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="1.1.0",
- org.eclipse.papyrus.extensionpoints.editors;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
- org.eclipse.gmf.runtime.diagram.ui.properties;bundle-version="1.2.0",
- org.eclipse.papyrus.uml.diagram.wizards;bundle-version="0.10.1",
- org.eclipse.papyrus.editor;bundle-version="0.10.1",
- org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="1.3.0",
- org.eclipse.papyrus.uml.pastemanager;bundle-version="0.10.1",
- org.eclipse.ui,
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="0.10.1",
- org.eclipse.gmf.runtime.diagram.ui.actions,
- org.eclipse.gmf.runtime.draw2d.ui.render;bundle-version="1.4.0",
- org.eclipse.core.expressions,
- org.eclipse.papyrus.infra.extendedtypes;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.diagram.navigation;bundle-version="0.10.1",
- org.eclipse.gmf.runtime.diagram.ui.printing,
- org.eclipse.gmf.runtime.diagram.ui.providers.ide,
- org.eclipse.papyrus.infra.services.decoration;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.services.resourceloading;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.tools;bundle-version="0.10.1",
- com.google.guava;bundle-version="10.0.1",
- org.eclipse.papyrus.uml.profile;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.emf.appearance;bundle-version="0.10.1",
- org.eclipse.papyrus.uml.appearance;bundle-version="0.10.1",
- org.eclipse.uml2.uml.edit;bundle-version="4.0.0",
- org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1",
- org.eclipse.ui.ide;bundle-version="3.8.0",
- org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.widgets;bundle-version="0.10.1",
- org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.1",
- org.eclipse.jface
-Bundle-Vendor: %providerName
-Ant-Version: Apache Ant 1.7.0
-Bundle-Version: 0.10.1.qualifier
-Eclipse-BuddyPolicy: dependent
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.common.Activator
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.common;singleton:
- =true
-
+Manifest-Version: 1.0
+Export-Package: org.eclipse.papyrus.uml.diagram.common,
+ org.eclipse.papyrus.uml.diagram.common.actions,
+ org.eclipse.papyrus.uml.diagram.common.actions.handlers,
+ org.eclipse.papyrus.uml.diagram.common.command.wrappers,
+ org.eclipse.papyrus.uml.diagram.common.commands,
+ org.eclipse.papyrus.uml.diagram.common.dialogs,
+ org.eclipse.papyrus.uml.diagram.common.directedit,
+ org.eclipse.papyrus.uml.diagram.common.dragtracker,
+ org.eclipse.papyrus.uml.diagram.common.draw2d,
+ org.eclipse.papyrus.uml.diagram.common.draw2d.anchors,
+ org.eclipse.papyrus.uml.diagram.common.editparts,
+ org.eclipse.papyrus.uml.diagram.common.editpolicies,
+ org.eclipse.papyrus.uml.diagram.common.figure.edge,
+ org.eclipse.papyrus.uml.diagram.common.figure.layout,
+ org.eclipse.papyrus.uml.diagram.common.figure.node,
+ org.eclipse.papyrus.uml.diagram.common.handlers,
+ org.eclipse.papyrus.uml.diagram.common.helper,
+ org.eclipse.papyrus.uml.diagram.common.ids,
+ org.eclipse.papyrus.uml.diagram.common.layout,
+ org.eclipse.papyrus.uml.diagram.common.listeners,
+ org.eclipse.papyrus.uml.diagram.common.locator,
+ org.eclipse.papyrus.uml.diagram.common.parser,
+ org.eclipse.papyrus.uml.diagram.common.parser.assist,
+ org.eclipse.papyrus.uml.diagram.common.parser.custom,
+ org.eclipse.papyrus.uml.diagram.common.parser.lookup,
+ org.eclipse.papyrus.uml.diagram.common.parser.packageimport,
+ org.eclipse.papyrus.uml.diagram.common.parser.stereotype,
+ org.eclipse.papyrus.uml.diagram.common.parser.structural,
+ org.eclipse.papyrus.uml.diagram.common.part,
+ org.eclipse.papyrus.uml.diagram.common.preferences,
+ org.eclipse.papyrus.uml.diagram.common.providers,
+ org.eclipse.papyrus.uml.diagram.common.providers.assistant,
+ org.eclipse.papyrus.uml.diagram.common.resourceupdate,
+ org.eclipse.papyrus.uml.diagram.common.service,
+ org.eclipse.papyrus.uml.diagram.common.service.palette,
+ org.eclipse.papyrus.uml.diagram.common.sheet,
+ org.eclipse.papyrus.uml.diagram.common.ui.dialogs,
+ org.eclipse.papyrus.uml.diagram.common.ui.helper,
+ org.eclipse.papyrus.uml.diagram.common.util,
+ org.eclipse.papyrus.uml.diagram.common.util.functions,
+ org.eclipse.papyrus.uml.diagram.common.util.predicates
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Created-By: 1.5.0_06-b05 (Sun Microsystems Inc.)
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.diagram.ui.resources.editor,
+ org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="1.1.0",
+ org.eclipse.papyrus.extensionpoints.editors;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.diagram.ui.properties;bundle-version="1.2.0",
+ org.eclipse.papyrus.uml.diagram.wizards;bundle-version="0.10.1",
+ org.eclipse.papyrus.editor;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="1.3.0",
+ org.eclipse.papyrus.uml.pastemanager;bundle-version="0.10.1",
+ org.eclipse.ui,
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.preferences;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.diagram.ui.actions,
+ org.eclipse.gmf.runtime.draw2d.ui.render;bundle-version="1.4.0",
+ org.eclipse.core.expressions,
+ org.eclipse.papyrus.infra.extendedtypes;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.navigation;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.diagram.navigation;bundle-version="0.10.1",
+ org.eclipse.gmf.runtime.diagram.ui.printing,
+ org.eclipse.gmf.runtime.diagram.ui.providers.ide,
+ org.eclipse.papyrus.infra.services.decoration;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.resourceloading;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.tools;bundle-version="0.10.1",
+ com.google.guava;bundle-version="10.0.1",
+ org.eclipse.papyrus.uml.profile;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.emf.appearance;bundle-version="0.10.1",
+ org.eclipse.papyrus.uml.appearance;bundle-version="0.10.1",
+ org.eclipse.uml2.uml.edit;bundle-version="4.0.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1",
+ org.eclipse.ui.ide;bundle-version="3.8.0",
+ org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.emf;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.widgets;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.labelprovider;bundle-version="0.10.1",
+ org.eclipse.jface
+Bundle-Vendor: %providerName
+Ant-Version: Apache Ant 1.7.0
+Bundle-Version: 0.10.1.qualifier
+Eclipse-BuddyPolicy: dependent
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.uml.diagram.common.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.common;singleton:
+ =true
+
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/about.html b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/about.html
index 82d49bf5f81..d35d5aed64c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/about.html
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/build.properties b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/build.properties
index 36afbf22f4e..59194505490 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/build.properties
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/build.properties
@@ -1,6 +1,6 @@
-#
-#Mon Sep 12 09:29:43 CEST 2011
-bin.includes=META-INF/,icons/,.,about.html,messages.properties,plugin.properties,plugin.xml,custom-messages.properties,schema/
-src.includes = about.html
-source..=src/
-bin..=bin/
+#
+#Mon Sep 12 09:29:43 CEST 2011
+bin.includes=META-INF/,icons/,.,about.html,messages.properties,plugin.properties,plugin.xml,custom-messages.properties,schema/
+src.includes = about.html
+source..=src/
+bin..=bin/
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/icons/flower.svg b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/icons/flower.svg
deleted file mode 100644
index f8e0ba9ad68..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/icons/flower.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" id="svg2" sodipodi:version="0.32" inkscape:version="0.42.2" width="595.27559pt" height="841.88976pt" sodipodi:docbase="/home/peterm/afbeeldingen/svg" sodipodi:docname="flower.svg">
- <metadata id="metadata7">
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs id="defs5"/>
- <sodipodi:namedview inkscape:window-height="721" inkscape:window-width="1270" inkscape:pageshadow="2" inkscape:pageopacity="0.0" borderopacity="1.0" bordercolor="#666666" pagecolor="#ffffff" id="base" inkscape:zoom="0.37724655" inkscape:cx="372.04724" inkscape:cy="473.86360" inkscape:window-x="0" inkscape:window-y="0" inkscape:current-layer="svg2"/>
- <g id="g5840" transform="matrix(1.34022, 0, 0, 1.34022, -653.545, 7.79585)" inkscape:export-filename="/home/peterm/afbeeldingen/svg/flower.png" inkscape:export-xdpi="36.000000" inkscape:export-ydpi="36.000000">
- <path id="path2195" d="M 796.81250,295.50000 C 795.93675,295.58953 795.02004,295.90048 794.06250,296.43750 C 787.79894,299.95034 792.94621,401.31416 766.96875,492.87500 C 757.99251,468.07073 723.97814,435.17912 677.18750,408.96875 C 613.94367,373.54191 551.37941,363.73074 537.53125,387.06250 C 523.68311,410.39425 563.75619,458.07317 627.00000,493.50000 C 680.29990,523.35661 733.01238,534.94166 756.59375,523.90625 C 749.80980,541.56721 741.74050,558.44776 731.68750,573.43750 C 665.85161,671.60343 558.43455,646.62022 555.53125,652.12500 C 524.93426,710.13598 682.00788,693.04094 747.84375,594.87500 C 763.56137,571.43891 776.13295,541.18734 785.78125,508.96875 C 786.01584,509.37937 786.14083,509.85743 786.40625,510.25000 C 801.60278,532.72680 861.82618,516.81112 920.84375,474.71875 C 979.86133,432.62637 1015.4153,380.22680 1000.2188,357.75000 C 985.02229,335.27319 924.79883,351.18887 865.78125,393.28125 C 836.21031,414.37178 812.51619,438.04363 798.15625,459.25000 C 815.30406,375.03383 813.89002,293.75407 796.81250,295.50000 z " style="fill: rgb(53, 226, 62); fill-opacity: 1; fill-rule: nonzero; stroke: rgb(18, 137, 45); stroke-width: 17.005; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 4; stroke-dasharray: none; stroke-dashoffset: 0pt; stroke-opacity: 1;"/>
- <path transform="matrix(4.22499, 0, 0, 4.22499, -1287.37, -859.238)" d="M 521.87211,275.23304 C 478.85605,245.64532 524.04766,247.12359 474.76752,264.36545 C 448.25334,273.64209 478.36895,314.58051 486.35702,287.65007 C 501.20392,237.59626 513.76299,281.03285 482.13659,239.49268 C 465.12065,217.14283 435.49213,258.43515 463.57296,257.71029 C 515.76490,256.36306 478.33522,281.73008 508.06918,238.81498 C 524.06693,215.72537 475.63989,200.30700 485.00672,226.78946 C 502.41621,276.01063 466.72433,248.25173 516.72732,263.26890 C 543.63042,271.34859 543.32938,220.52720 521.03757,237.61911 C 479.60529,269.38671 494.97617,226.86374 496.14577,279.05997 C 496.77504,307.14309 545.01603,291.15212 521.87211,275.23304 z " inkscape:randomized="0.0000000" inkscape:rounded="1.0800000" inkscape:flatsided="false" sodipodi:arg2="2.8013060" sodipodi:arg1="0.60613533" sodipodi:r2="22.067102" sodipodi:r1="32.004192" sodipodi:cy="257.00040" sodipodi:cx="495.56927" sodipodi:sides="5" id="path1549" style="fill: rgb(250, 152, 6); fill-opacity: 1; fill-rule: nonzero; stroke: rgb(245, 128, 6); stroke-width: 4.02477; stroke-linecap: butt; stroke-linejoin: round; stroke-miterlimit: 4; stroke-dashoffset: 0pt; stroke-opacity: 1;" sodipodi:type="star"/>
- <path transform="matrix(4.22499, 0, 0, 4.22499, -1440.17, -885.757)" d="M 539.80589 261.93216 A 8.8174267 8.8174267 0 1 1 522.17104,261.93216 A 8.8174267 8.8174267 0 1 1 539.80589 261.93216 z" sodipodi:ry="8.8174267" sodipodi:rx="8.8174267" sodipodi:cy="261.93216" sodipodi:cx="530.98846" id="path1551" style="fill: rgb(250, 220, 6); fill-opacity: 1; fill-rule: nonzero; stroke: rgb(245, 128, 6); stroke-width: 4.02477; stroke-linecap: butt; stroke-linejoin: round; stroke-miterlimit: 4; stroke-dashoffset: 0pt; stroke-opacity: 1;" sodipodi:type="arc"/>
- </g>
-</svg> \ No newline at end of file
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Action.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Action.gmfgraph
index 49fb2b7442c..1e9767aaa17 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Action.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Action.gmfgraph
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="ActionFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="PapyrusRoundedNodeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusRoundedNodeFigure">
- <customChildren
- accessor="getNameLabel()">
- <typedFigure
- xsi:type="gmfgraph:Label"
- name="nameLabel"/>
- </customChildren>
- </actualFigure>
- <accessors
- accessor="getNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
- </descriptors>
- </figures>
- <nodes
- name="ActionFigureNode"
- figure="ActionFigureDescriptor"/>
- <labels
- name="ActionFigureNameDiagramLabel"
- figure="ActionFigureDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="ActionFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="PapyrusRoundedNodeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusRoundedNodeFigure">
+ <customChildren
+ accessor="getNameLabel()">
+ <typedFigure
+ xsi:type="gmfgraph:Label"
+ name="nameLabel"/>
+ </customChildren>
+ </actualFigure>
+ <accessors
+ accessor="getNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="ActionFigureNode"
+ figure="ActionFigureDescriptor"/>
+ <labels
+ name="ActionFigureNameDiagramLabel"
+ figure="ActionFigureDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Association.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Association.gmfgraph
index 4724e243dc2..4756ee94683 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Association.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Association.gmfgraph
@@ -1,175 +1,175 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="uml">
- <figures
- name="Default">
- <descriptors
- name="AssociationDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomConnection"
- name="CAssociationFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.CAssociationFigure">
- <foregroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <backgroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <children
- xsi:type="gmfgraph:Label"
- name="AssociationNameLabel"
- text=""/>
- <children
- xsi:type="gmfgraph:Label"
- name="AppliedStereotypeLabel"
- text=""/>
- <children
- xsi:type="gmfgraph:Label"
- name="RoleSourceLabel"
- text=""/>
- <children
- xsi:type="gmfgraph:Label"
- name="MultiplicitySourceLabel"
- text=""/>
- <children
- xsi:type="gmfgraph:Label"
- name="RoleTargetLabel"
- text=""/>
- <children
- xsi:type="gmfgraph:Label"
- name="MultiplicityTargetLabel"
- text=""/>
- </actualFigure>
- <accessors
- accessor="getAssociationNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- <accessors
- accessor="getAppliedStereotypeAssociationLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
- <accessors
- accessor="getRoleSourceLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
- <accessors
- accessor="getMultiplicitySourceLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.3"/>
- <accessors
- accessor="getRoleTargetLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.4"/>
- <accessors
- accessor="getMultiplicityTargetLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.5"/>
- </descriptors>
- <descriptors
- name="AssociationNodeDescriptor">
- <actualFigure
- xsi:type="gmfgraph:ScalablePolygon">
- <foregroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <backgroundColor
- xsi:type="gmfgraph:ConstantColor"/>
- <template
- x="5"/>
- <template
- x="5"
- y="10"/>
- <template
- x="10"
- y="5"/>
- <template
- y="5"/>
- </actualFigure>
- </descriptors>
- <descriptors
- name="AssociationBranchDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomConnection"
- name="CAssociationBranchFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.CAssociationBranchFigure">
- <foregroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <backgroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <children
- xsi:type="gmfgraph:Label"
- name="RoleLabel"
- text=""/>
- <children
- xsi:type="gmfgraph:Label"
- name="MultiplicityLabel"
- text=""/>
- </actualFigure>
- <accessors
- accessor="getRoleLabel"
- figure="//@figures.0/@descriptors.2/@actualFigure/@children.0"/>
- <accessors
- accessor="getMultiplicityLabel"
- figure="//@figures.0/@descriptors.2/@actualFigure/@children.1"/>
- </descriptors>
- </figures>
- <nodes
- name="AssociationNode"
- figure="AssociationNodeDescriptor"/>
- <connections
- name="AssociationConnection"
- figure="AssociationDescriptor"/>
- <connections
- name="AssociationBranchConnection"
- figure="AssociationBranchDescriptor"/>
- <labels
- name="AppliedStereotypeAssociationDiagramLabel"
- figure="AssociationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.1">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
- <labels
- name="AssociationNameDiagramLabel"
- figure="AssociationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
- <labels
- name="AssociationMultiplicitySourceDiagramLabel"
- figure="AssociationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.3">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"/>
- </labels>
- <labels
- name="AssociationRoleSourceDiagramLabel"
- figure="AssociationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.2">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"/>
- </labels>
- <labels
- name="AssociationMultiplicityTargetDiagramLabel"
- figure="AssociationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.5">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="END"/>
- </labels>
- <labels
- name="AssociationRoleTargetDiagramLabel"
- figure="AssociationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.4">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="END"/>
- </labels>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="uml">
+ <figures
+ name="Default">
+ <descriptors
+ name="AssociationDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomConnection"
+ name="CAssociationFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.CAssociationFigure">
+ <foregroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <backgroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="AssociationNameLabel"
+ text=""/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="AppliedStereotypeLabel"
+ text=""/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="RoleSourceLabel"
+ text=""/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="MultiplicitySourceLabel"
+ text=""/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="RoleTargetLabel"
+ text=""/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="MultiplicityTargetLabel"
+ text=""/>
+ </actualFigure>
+ <accessors
+ accessor="getAssociationNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getAppliedStereotypeAssociationLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
+ <accessors
+ accessor="getRoleSourceLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
+ <accessors
+ accessor="getMultiplicitySourceLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.3"/>
+ <accessors
+ accessor="getRoleTargetLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.4"/>
+ <accessors
+ accessor="getMultiplicityTargetLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.5"/>
+ </descriptors>
+ <descriptors
+ name="AssociationNodeDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:ScalablePolygon">
+ <foregroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <backgroundColor
+ xsi:type="gmfgraph:ConstantColor"/>
+ <template
+ x="5"/>
+ <template
+ x="5"
+ y="10"/>
+ <template
+ x="10"
+ y="5"/>
+ <template
+ y="5"/>
+ </actualFigure>
+ </descriptors>
+ <descriptors
+ name="AssociationBranchDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomConnection"
+ name="CAssociationBranchFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.CAssociationBranchFigure">
+ <foregroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <backgroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="RoleLabel"
+ text=""/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="MultiplicityLabel"
+ text=""/>
+ </actualFigure>
+ <accessors
+ accessor="getRoleLabel"
+ figure="//@figures.0/@descriptors.2/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getMultiplicityLabel"
+ figure="//@figures.0/@descriptors.2/@actualFigure/@children.1"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="AssociationNode"
+ figure="AssociationNodeDescriptor"/>
+ <connections
+ name="AssociationConnection"
+ figure="AssociationDescriptor"/>
+ <connections
+ name="AssociationBranchConnection"
+ figure="AssociationBranchDescriptor"/>
+ <labels
+ name="AppliedStereotypeAssociationDiagramLabel"
+ figure="AssociationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.1">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+ <labels
+ name="AssociationNameDiagramLabel"
+ figure="AssociationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+ <labels
+ name="AssociationMultiplicitySourceDiagramLabel"
+ figure="AssociationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.3">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"/>
+ </labels>
+ <labels
+ name="AssociationRoleSourceDiagramLabel"
+ figure="AssociationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.2">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"/>
+ </labels>
+ <labels
+ name="AssociationMultiplicityTargetDiagramLabel"
+ figure="AssociationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.5">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="END"/>
+ </labels>
+ <labels
+ name="AssociationRoleTargetDiagramLabel"
+ figure="AssociationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.4">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="END"/>
+ </labels>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Classifier.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Classifier.gmfgraph
index b004c94502f..ef01c45c513 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Classifier.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Classifier.gmfgraph
@@ -1,173 +1,173 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="OperationFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="OperationLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"/>
- </actualFigure>
- </descriptors>
- <descriptors
- name="PropertyFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="PropetyLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"/>
- </actualFigure>
- </descriptors>
- <descriptors
- name="ClassifierDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="ClassifierFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CClassifierFigure">
- <foregroundColor
- xsi:type="gmfgraph:RGBColor"
- red="177"
- green="207"
- blue="229"/>
- <backgroundColor
- xsi:type="gmfgraph:RGBColor"
- red="235"
- green="248"
- blue="255"/>
- <children
- xsi:type="gmfgraph:Label"
- name="ClassifierStereotypeLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="ClassifierNameLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"
- style="BOLD"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="ClassifierQualifiedName">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"
- style="ITALIC"/>
- </children>
- <children
- xsi:type="gmfgraph:Rectangle"
- name="AttributeCompartmentFigure"
- fill="false">
- <layout
- xsi:type="gmfgraph:StackLayout"/>
- </children>
- <children
- xsi:type="gmfgraph:Rectangle"
- name="OperationCompartmentFigure"
- fill="false">
- <layout
- xsi:type="gmfgraph:StackLayout"/>
- </children>
- <children
- xsi:type="gmfgraph:Rectangle"
- name="NestedClassifierFigure"
- fill="false">
- <layout
- xsi:type="gmfgraph:StackLayout"/>
- </children>
- </actualFigure>
- <accessors
- accessor="getClassifierNameLabel"
- figure="//@figures.0/@descriptors.2/@actualFigure/@children.1"/>
- <accessors
- accessor="getAttributeCompartmentFigure"
- figure="//@figures.0/@descriptors.2/@actualFigure/@children.3"/>
- <accessors
- accessor="getOperationCompartmentFigure"
- figure="//@figures.0/@descriptors.2/@actualFigure/@children.4"/>
- <accessors
- accessor="getClassifierStereotypeLabel"
- figure="//@figures.0/@descriptors.2/@actualFigure/@children.0"/>
- <accessors
- accessor="getClassifierQualifiedNameLabel"
- figure="//@figures.0/@descriptors.2/@actualFigure/@children.2"/>
- <accessors
- accessor="getNestedClassifierFigure"
- figure="//@figures.0/@descriptors.2/@actualFigure/@children.5"/>
- </descriptors>
- <descriptors
- name="NestedClassifierDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="NestedClassifierLabel"/>
- </descriptors>
- <descriptors
- name="ReceptionDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="ReceptionLabel"
- text=""/>
- </descriptors>
- </figures>
- <nodes
- name="ClassifierNode"
- figure="ClassifierDescriptor"/>
- <compartments
- name="AttributeCompartment"
- figure="ClassifierDescriptor"
- collapsible="true"
- accessor="//@figures.0/@descriptors.2/@accessors.1"/>
- <compartments
- name="OperationCompartment"
- figure="ClassifierDescriptor"
- collapsible="true"
- accessor="//@figures.0/@descriptors.2/@accessors.2"/>
- <compartments
- name="NestedClassifierCompartment"
- figure="ClassifierDescriptor"
- collapsible="true"
- accessor="//@figures.0/@descriptors.2/@accessors.5"/>
- <labels
- name="ClassifierStereotypeDiagramLabel"
- figure="ClassifierDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.2/@accessors.3"/>
- <labels
- name="ClassifierNameDiagramLabel"
- figure="ClassifierDescriptor"
- accessor="//@figures.0/@descriptors.2/@accessors.0"/>
- <labels
- name="ClassifierQualifiedNameDiagramLabel"
- figure="ClassifierDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.2/@accessors.4"/>
- <labels
- name="PropertyDiagramLabel"
- figure="PropertyFigureDescriptor"
- elementIcon="false"/>
- <labels
- name="OperationDiagramLabel"
- figure="OperationFigureDescriptor"
- elementIcon="false"/>
- <labels
- name="NestedClassifierDiagramLabel"
- figure="NestedClassifierDescriptor"/>
- <labels
- name="ReceptionDiagramLabel"
- figure="ReceptionDescriptor"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="OperationFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Label"
+ name="OperationLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"/>
+ </actualFigure>
+ </descriptors>
+ <descriptors
+ name="PropertyFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Label"
+ name="PropetyLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"/>
+ </actualFigure>
+ </descriptors>
+ <descriptors
+ name="ClassifierDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="ClassifierFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CClassifierFigure">
+ <foregroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="177"
+ green="207"
+ blue="229"/>
+ <backgroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="235"
+ green="248"
+ blue="255"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="ClassifierStereotypeLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="ClassifierNameLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"
+ style="BOLD"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="ClassifierQualifiedName">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"
+ style="ITALIC"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Rectangle"
+ name="AttributeCompartmentFigure"
+ fill="false">
+ <layout
+ xsi:type="gmfgraph:StackLayout"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Rectangle"
+ name="OperationCompartmentFigure"
+ fill="false">
+ <layout
+ xsi:type="gmfgraph:StackLayout"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Rectangle"
+ name="NestedClassifierFigure"
+ fill="false">
+ <layout
+ xsi:type="gmfgraph:StackLayout"/>
+ </children>
+ </actualFigure>
+ <accessors
+ accessor="getClassifierNameLabel"
+ figure="//@figures.0/@descriptors.2/@actualFigure/@children.1"/>
+ <accessors
+ accessor="getAttributeCompartmentFigure"
+ figure="//@figures.0/@descriptors.2/@actualFigure/@children.3"/>
+ <accessors
+ accessor="getOperationCompartmentFigure"
+ figure="//@figures.0/@descriptors.2/@actualFigure/@children.4"/>
+ <accessors
+ accessor="getClassifierStereotypeLabel"
+ figure="//@figures.0/@descriptors.2/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getClassifierQualifiedNameLabel"
+ figure="//@figures.0/@descriptors.2/@actualFigure/@children.2"/>
+ <accessors
+ accessor="getNestedClassifierFigure"
+ figure="//@figures.0/@descriptors.2/@actualFigure/@children.5"/>
+ </descriptors>
+ <descriptors
+ name="NestedClassifierDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Label"
+ name="NestedClassifierLabel"/>
+ </descriptors>
+ <descriptors
+ name="ReceptionDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Label"
+ name="ReceptionLabel"
+ text=""/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="ClassifierNode"
+ figure="ClassifierDescriptor"/>
+ <compartments
+ name="AttributeCompartment"
+ figure="ClassifierDescriptor"
+ collapsible="true"
+ accessor="//@figures.0/@descriptors.2/@accessors.1"/>
+ <compartments
+ name="OperationCompartment"
+ figure="ClassifierDescriptor"
+ collapsible="true"
+ accessor="//@figures.0/@descriptors.2/@accessors.2"/>
+ <compartments
+ name="NestedClassifierCompartment"
+ figure="ClassifierDescriptor"
+ collapsible="true"
+ accessor="//@figures.0/@descriptors.2/@accessors.5"/>
+ <labels
+ name="ClassifierStereotypeDiagramLabel"
+ figure="ClassifierDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.2/@accessors.3"/>
+ <labels
+ name="ClassifierNameDiagramLabel"
+ figure="ClassifierDescriptor"
+ accessor="//@figures.0/@descriptors.2/@accessors.0"/>
+ <labels
+ name="ClassifierQualifiedNameDiagramLabel"
+ figure="ClassifierDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.2/@accessors.4"/>
+ <labels
+ name="PropertyDiagramLabel"
+ figure="PropertyFigureDescriptor"
+ elementIcon="false"/>
+ <labels
+ name="OperationDiagramLabel"
+ figure="OperationFigureDescriptor"
+ elementIcon="false"/>
+ <labels
+ name="NestedClassifierDiagramLabel"
+ figure="NestedClassifierDescriptor"/>
+ <labels
+ name="ReceptionDiagramLabel"
+ figure="ReceptionDescriptor"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Comment.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Comment.gmfgraph
index 738a1ca681b..c5c34c517a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Comment.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Comment.gmfgraph
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="CornerBentDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="HTMLCornerBentFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure">
- <customChildren
- accessor="getCornerBentFigure()">
- <typedFigure
- xsi:type="gmfgraph:CustomFigure"
- name="HTMLCornerBentFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure"/>
- </customChildren>
- </actualFigure>
- <accessors
- accessor="getCornerBentFigure"
- figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
- </descriptors>
- <descriptors
- name="CommentLinkDescriptor">
- <actualFigure
- xsi:type="gmfgraph:PolylineConnection"
- name="CommentLinkPolilyne"
- lineKind="LINE_DASH"/>
- </descriptors>
- </figures>
- <nodes
- name="CornerBentNode"
- figure="CornerBentDescriptor"/>
- <connections
- name="CommentLinkConnection"
- figure="CommentLinkDescriptor"/>
- <labels
- name="CornerBentContentDiagramLabel"
- figure="CornerBentDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="CornerBentDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="HTMLCornerBentFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure">
+ <customChildren
+ accessor="getCornerBentFigure()">
+ <typedFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="HTMLCornerBentFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure"/>
+ </customChildren>
+ </actualFigure>
+ <accessors
+ accessor="getCornerBentFigure"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
+ </descriptors>
+ <descriptors
+ name="CommentLinkDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:PolylineConnection"
+ name="CommentLinkPolilyne"
+ lineKind="LINE_DASH"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="CornerBentNode"
+ figure="CornerBentDescriptor"/>
+ <connections
+ name="CommentLinkConnection"
+ figure="CommentLinkDescriptor"/>
+ <labels
+ name="CornerBentContentDiagramLabel"
+ figure="CornerBentDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Constraint.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Constraint.gmfgraph
index ec90d9fcbd8..9925071d033 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Constraint.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Constraint.gmfgraph
@@ -1,59 +1,59 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="ConstraintDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="ConstraintFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure">
- <customChildren
- accessor="getNameLabel()">
- <typedFigure
- xsi:type="gmfgraph:Label"
- name="nameLabel"/>
- </customChildren>
- <customChildren
- accessor="getConstraintFigure()">
- <typedFigure
- xsi:type="gmfgraph:CustomFigure"
- name="ConstraintFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure"/>
- </customChildren>
- </actualFigure>
- <accessors
- accessor="getConstraintFigure"
- figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.1/@typedFigure"/>
- <accessors
- accessor="getNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
- </descriptors>
- <descriptors
- name="ConstraintLinkDescriptor">
- <actualFigure
- xsi:type="gmfgraph:PolylineConnection"
- name="ConstraintLinkPolilyne"
- lineKind="LINE_DASH"/>
- </descriptors>
- </figures>
- <nodes
- name="ConstraintNode"
- figure="ConstraintDescriptor"/>
- <connections
- name="ConstraintLinkConnection"
- figure="ConstraintLinkDescriptor"/>
- <labels
- name="ConstraintBodyDiagramLabel"
- figure="ConstraintDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
- <labels
- name="ConstraintNameDiagramLabel"
- figure="ConstraintDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.1"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="ConstraintDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="ConstraintFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure">
+ <customChildren
+ accessor="getNameLabel()">
+ <typedFigure
+ xsi:type="gmfgraph:Label"
+ name="nameLabel"/>
+ </customChildren>
+ <customChildren
+ accessor="getConstraintFigure()">
+ <typedFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="ConstraintFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure"/>
+ </customChildren>
+ </actualFigure>
+ <accessors
+ accessor="getConstraintFigure"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.1/@typedFigure"/>
+ <accessors
+ accessor="getNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
+ </descriptors>
+ <descriptors
+ name="ConstraintLinkDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:PolylineConnection"
+ name="ConstraintLinkPolilyne"
+ lineKind="LINE_DASH"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="ConstraintNode"
+ figure="ConstraintDescriptor"/>
+ <connections
+ name="ConstraintLinkConnection"
+ figure="ConstraintLinkDescriptor"/>
+ <labels
+ name="ConstraintBodyDiagramLabel"
+ figure="ConstraintDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+ <labels
+ name="ConstraintNameDiagramLabel"
+ figure="ConstraintDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.1"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Dependency.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Dependency.gmfgraph
index b4b94c524a4..09746ee8123 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Dependency.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Dependency.gmfgraph
@@ -1,77 +1,77 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="uml">
- <figures
- name="Default">
- <descriptors
- name="DependencyDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomConnection"
- name="DashedEdgeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.DashedEdgeFigure">
- <foregroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <backgroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <children
- xsi:type="gmfgraph:Label"
- name="NameLabel"/>
- <children
- xsi:type="gmfgraph:Label"
- name="AppliedStereotypeLabel"/>
- </actualFigure>
- <accessors
- accessor="getNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- <accessors
- accessor="getAppliedStereotypeLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
- </descriptors>
- <descriptors
- name="DependencyNodeDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Ellipse">
- <foregroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <backgroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <maximumSize
- dx="10"
- dy="10"/>
- <minimumSize
- dx="10"
- dy="10"/>
- </actualFigure>
- </descriptors>
- </figures>
- <nodes
- name="DependencyNode"
- figure="DependencyNodeDescriptor"/>
- <connections
- name="DependencyConnection"
- figure="DependencyDescriptor"/>
- <labels
- name="DependencyNameDiagramLabel"
- figure="DependencyDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
- <labels
- name="DependencyAppliedStereotypeDiagramLabel"
- figure="DependencyDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.1">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="uml">
+ <figures
+ name="Default">
+ <descriptors
+ name="DependencyDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomConnection"
+ name="DashedEdgeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.DashedEdgeFigure">
+ <foregroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <backgroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="NameLabel"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="AppliedStereotypeLabel"/>
+ </actualFigure>
+ <accessors
+ accessor="getNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getAppliedStereotypeLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
+ </descriptors>
+ <descriptors
+ name="DependencyNodeDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Ellipse">
+ <foregroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <backgroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <maximumSize
+ dx="10"
+ dy="10"/>
+ <minimumSize
+ dx="10"
+ dy="10"/>
+ </actualFigure>
+ </descriptors>
+ </figures>
+ <nodes
+ name="DependencyNode"
+ figure="DependencyNodeDescriptor"/>
+ <connections
+ name="DependencyConnection"
+ figure="DependencyDescriptor"/>
+ <labels
+ name="DependencyNameDiagramLabel"
+ figure="DependencyDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+ <labels
+ name="DependencyAppliedStereotypeDiagramLabel"
+ figure="DependencyDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.1">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/DiamondNode.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/DiamondNode.gmfgraph
index b555d62cb6d..de53b47cbd7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/DiamondNode.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/DiamondNode.gmfgraph
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="DiamondNodeFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="DiamondNodeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.DiamondNode"/>
- </descriptors>
- </figures>
- <nodes
- name="DiamondNodeFigureNode"
- figure="DiamondNodeFigureDescriptor"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="DiamondNodeFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="DiamondNodeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.DiamondNode"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="DiamondNodeFigureNode"
+ figure="DiamondNodeFigureDescriptor"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Enumeration.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Enumeration.gmfgraph
index 15d909c8af7..1e28eb2c9da 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Enumeration.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Enumeration.gmfgraph
@@ -1,108 +1,108 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="EnumerationDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="EnumerationFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CEnumeration">
- <foregroundColor
- xsi:type="gmfgraph:RGBColor"
- red="204"
- green="204"
- blue="204"/>
- <backgroundColor
- xsi:type="gmfgraph:RGBColor"
- red="242"
- green="242"
- blue="242"/>
- <children
- xsi:type="gmfgraph:Label"
- name="EnumerationStereotypeLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="EnumerationNameLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"
- style="BOLD"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="EnumerationQualifiedName">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"
- style="ITALIC"/>
- </children>
- <children
- xsi:type="gmfgraph:Rectangle"
- name="EnumerationLiteralCompartmentFigure"
- fill="false">
- <layout
- xsi:type="gmfgraph:StackLayout"/>
- </children>
- </actualFigure>
- <accessors
- accessor="getEnumerationStereotypeLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- <accessors
- accessor="getEnumerationNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
- <accessors
- accessor="getEnumerationQualifiedNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
- <accessors
- accessor="getEnumerationLiteralCompartmentFigure"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.3"/>
- </descriptors>
- <descriptors
- name="LiteralEnumerationDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="LiteralEnumerationLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"/>
- </actualFigure>
- </descriptors>
- </figures>
- <nodes
- name="EnumerationNode"
- figure="EnumerationDescriptor"/>
- <compartments
- name="EnumerationLiteralCompartment"
- figure="EnumerationDescriptor"
- collapsible="true"
- accessor="//@figures.0/@descriptors.0/@accessors.3"/>
- <labels
- name="EnumerationStereotypeDiagramLabel"
- figure="EnumerationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
- <labels
- name="EnumerationNameDiagramLabel"
- figure="EnumerationDescriptor"
- accessor="//@figures.0/@descriptors.0/@accessors.1"/>
- <labels
- name="EnumerationQualifiedNameDiagramLabel"
- figure="EnumerationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.2"/>
- <labels
- name="LiteralEnumerationDiagramLabel"
- figure="LiteralEnumerationDescriptor"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="EnumerationDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="EnumerationFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CEnumeration">
+ <foregroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="204"
+ green="204"
+ blue="204"/>
+ <backgroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="242"
+ green="242"
+ blue="242"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="EnumerationStereotypeLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="EnumerationNameLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"
+ style="BOLD"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="EnumerationQualifiedName">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"
+ style="ITALIC"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Rectangle"
+ name="EnumerationLiteralCompartmentFigure"
+ fill="false">
+ <layout
+ xsi:type="gmfgraph:StackLayout"/>
+ </children>
+ </actualFigure>
+ <accessors
+ accessor="getEnumerationStereotypeLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getEnumerationNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
+ <accessors
+ accessor="getEnumerationQualifiedNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
+ <accessors
+ accessor="getEnumerationLiteralCompartmentFigure"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.3"/>
+ </descriptors>
+ <descriptors
+ name="LiteralEnumerationDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Label"
+ name="LiteralEnumerationLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"/>
+ </actualFigure>
+ </descriptors>
+ </figures>
+ <nodes
+ name="EnumerationNode"
+ figure="EnumerationDescriptor"/>
+ <compartments
+ name="EnumerationLiteralCompartment"
+ figure="EnumerationDescriptor"
+ collapsible="true"
+ accessor="//@figures.0/@descriptors.0/@accessors.3"/>
+ <labels
+ name="EnumerationStereotypeDiagramLabel"
+ figure="EnumerationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+ <labels
+ name="EnumerationNameDiagramLabel"
+ figure="EnumerationDescriptor"
+ accessor="//@figures.0/@descriptors.0/@accessors.1"/>
+ <labels
+ name="EnumerationQualifiedNameDiagramLabel"
+ figure="EnumerationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.2"/>
+ <labels
+ name="LiteralEnumerationDiagramLabel"
+ figure="LiteralEnumerationDescriptor"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FinalNode.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FinalNode.gmfgraph
index e793efe4034..adecc81d7b2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FinalNode.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FinalNode.gmfgraph
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="FinalNodeFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="FinalNodeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.FinalNode"/>
- </descriptors>
- </figures>
- <nodes
- name="FinalNodeFigureNode"
- figure="FinalNodeFigureDescriptor"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="FinalNodeFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="FinalNodeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.FinalNode"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="FinalNodeFigureNode"
+ figure="FinalNodeFigureDescriptor"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FlowFinalNode.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FlowFinalNode.gmfgraph
index 8116a210646..4ddf5f6194d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FlowFinalNode.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/FlowFinalNode.gmfgraph
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="FlowFinalNodeFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="FlowFinalNodeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.FlowFinalNode"/>
- </descriptors>
- </figures>
- <nodes
- name="FlowFinalNodeFigureNode"
- figure="FlowFinalNodeFigureDescriptor"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="FlowFinalNodeFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="FlowFinalNodeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.FlowFinalNode"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="FlowFinalNodeFigureNode"
+ figure="FlowFinalNodeFigureDescriptor"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ForkNode.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ForkNode.gmfgraph
index 74e0c907e50..793e059fc2d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ForkNode.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ForkNode.gmfgraph
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="ForkNodeFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="ForkNodeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ForkNode"/>
- </descriptors>
- </figures>
- <nodes
- name="ForkNodeFigureNode"
- figure="ForkNodeFigureDescriptor"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="ForkNodeFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="ForkNodeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ForkNode"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="ForkNodeFigureNode"
+ figure="ForkNodeFigureDescriptor"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Generalization.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Generalization.gmfgraph
index 2d39aac6a59..fd146cce2fa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Generalization.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Generalization.gmfgraph
@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="uml">
- <figures
- name="Default">
- <descriptors
- name="GeneralizationDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomConnection"
- name="CGeneralizationFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.CGeneralizationFigure">
- <foregroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <backgroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <children
- xsi:type="gmfgraph:Label"
- name="AppliedStereotypeLabel"/>
- </actualFigure>
- <accessors
- accessor="getAppliedStereotypeLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- </descriptors>
- </figures>
- <connections
- name="GeneralizationConnection"
- figure="GeneralizationDescriptor"/>
- <labels
- name="GeneralizationAppliedStereotypeDiagramLabel"
- figure="GeneralizationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="uml">
+ <figures
+ name="Default">
+ <descriptors
+ name="GeneralizationDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomConnection"
+ name="CGeneralizationFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.CGeneralizationFigure">
+ <foregroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <backgroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="AppliedStereotypeLabel"/>
+ </actualFigure>
+ <accessors
+ accessor="getAppliedStereotypeLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ </descriptors>
+ </figures>
+ <connections
+ name="GeneralizationConnection"
+ figure="GeneralizationDescriptor"/>
+ <labels
+ name="GeneralizationAppliedStereotypeDiagramLabel"
+ figure="GeneralizationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/GenericUML.gmfgen b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/GenericUML.gmfgen
index cda7ee31930..54f50b0cc44 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/GenericUML.gmfgen
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/GenericUML.gmfgen
@@ -1,2525 +1,2525 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgen:GenEditorGenerator
- 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"
- templateDirectory="">
- <diagram>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Constraint"
- displayName="Constraint_Semantic"
- definedExternally="true"/>
- <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"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.AddVariableValueAction"
- displayName="AddVariableValueAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AddVariableValueAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Abstraction"
- displayName="Abstraction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Abstraction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Dependency"
- displayName="Dependency_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Comment"
- displayName="Comment_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Stereotype"
- displayName="Stereotype_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Stereotype"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Class"
- displayName="Class_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Class"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.StringExpression"
- displayName="StringExpression_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StringExpression"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Expression"
- displayName="Expression_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Expression"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Package"
- displayName="Package_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TemplateSignature"
- displayName="TemplateSignature_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TemplateSignature"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TemplateParameter"
- displayName="TemplateParameter_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TemplateParameter"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TemplateBinding"
- displayName="TemplateBinding_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TemplateBinding"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TemplateParameterSubstitution"
- displayName="TemplateParameterSubstitution_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TemplateParameterSubstitution"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.PackageMerge"
- displayName="PackageMerge_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/PackageMerge"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ProfileApplication"
- displayName="ProfileApplication_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ProfileApplication"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Profile"
- displayName="Profile_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Profile"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ElementImport"
- displayName="ElementImport_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ElementImport"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.PackageImport"
- displayName="PackageImport_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/PackageImport"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Extension"
- displayName="Extension_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Extension"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Association"
- displayName="Association_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Association"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Property"
- displayName="Property_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Property"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ConnectorEnd"
- displayName="ConnectorEnd_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConnectorEnd"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ConnectableElementTemplateParameter"
- displayName="ConnectableElementTemplateParameter_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConnectableElementTemplateParameter"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Deployment"
- displayName="Deployment_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Deployment"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DeploymentSpecification"
- displayName="DeploymentSpecification_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DeploymentSpecification"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Artifact"
- displayName="Artifact_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Manifestation"
- displayName="Manifestation_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Manifestation"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Operation"
- displayName="Operation_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Operation"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InterfaceRealization"
- displayName="InterfaceRealization_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InterfaceRealization"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Realization"
- displayName="Realization_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Realization"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Interface"
- displayName="Interface_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interface"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Reception"
- displayName="Reception_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Reception"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Signal"
- displayName="Signal_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Signal"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ProtocolStateMachine"
- displayName="ProtocolStateMachine_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ProtocolStateMachine"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.StateMachine"
- displayName="StateMachine_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StateMachine"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Pseudostate"
- displayName="Pseudostate_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Pseudostate"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Region"
- displayName="Region_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Region"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.State"
- displayName="State_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/State"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ConnectionPointReference"
- displayName="ConnectionPointReference_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConnectionPointReference"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Trigger"
- displayName="Trigger_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Trigger"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Port"
- displayName="Port_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Port"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Transition"
- displayName="Transition_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Transition"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ProtocolConformance"
- displayName="ProtocolConformance_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ProtocolConformance"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Parameter"
- displayName="Parameter_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Parameter"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ParameterSet"
- displayName="ParameterSet_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ParameterSet"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DataType"
- displayName="DataType_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DataType"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.OperationTemplateParameter"
- displayName="OperationTemplateParameter_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OperationTemplateParameter"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ExtensionEnd"
- displayName="ExtensionEnd_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExtensionEnd"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Model"
- displayName="Model_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Model"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Enumeration"
- displayName="Enumeration_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Enumeration"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.EnumerationLiteral"
- displayName="EnumerationLiteral_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/EnumerationLiteral"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InstanceSpecification"
- displayName="InstanceSpecification_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InstanceSpecification"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Slot"
- displayName="Slot_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Slot"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.PrimitiveType"
- displayName="PrimitiveType_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/PrimitiveType"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Usage"
- displayName="Usage_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Usage"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CollaborationUse"
- displayName="CollaborationUse_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CollaborationUse"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Collaboration"
- displayName="Collaboration_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Collaboration"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Generalization"
- displayName="Generalization_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.GeneralizationSet"
- displayName="GeneralizationSet_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/GeneralizationSet"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.RedefinableTemplateSignature"
- displayName="RedefinableTemplateSignature_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/RedefinableTemplateSignature"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.UseCase"
- displayName="UseCase_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/UseCase"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Extend"
- displayName="Extend_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Extend"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ExtensionPoint"
- displayName="ExtensionPoint_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExtensionPoint"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Include"
- displayName="Include_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Include"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Substitution"
- displayName="Substitution_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Substitution"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ClassifierTemplateParameter"
- displayName="ClassifierTemplateParameter_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ClassifierTemplateParameter"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Connector"
- displayName="Connector_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Connector"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Image"
- displayName="Image_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Image"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.OpaqueExpression"
- displayName="OpaqueExpression_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueExpression"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.AcceptCallAction"
- displayName="AcceptCallAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AcceptCallAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.AcceptEventAction"
- displayName="AcceptEventAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AcceptEventAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Activity"
- displayName="Activity_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ActivityPartition"
- displayName="ActivityPartition_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityPartition"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.StructuredActivityNode"
- displayName="StructuredActivityNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredActivityNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InputPin"
- displayName="InputPin_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InputPin"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.OutputPin"
- displayName="OutputPin_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OutputPin"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Variable"
- displayName="Variable_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Variable"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InterruptibleActivityRegion"
- displayName="InterruptibleActivityRegion_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InterruptibleActivityRegion"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ExceptionHandler"
- displayName="ExceptionHandler_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExceptionHandler"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ActionExecutionSpecification"
- displayName="ActionExecutionSpecification_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActionExecutionSpecification"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Lifeline"
- displayName="Lifeline_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Lifeline"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.PartDecomposition"
- displayName="PartDecomposition_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/PartDecomposition"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InteractionUse"
- displayName="InteractionUse_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InteractionUse"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Gate"
- displayName="Gate_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Gate"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Message"
- displayName="Message_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Interaction"
- displayName="Interaction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InteractionOperand"
- displayName="InteractionOperand_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InteractionOperand"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InteractionConstraint"
- displayName="InteractionConstraint_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InteractionConstraint"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.GeneralOrdering"
- displayName="GeneralOrdering_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/GeneralOrdering"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.OccurrenceSpecification"
- displayName="OccurrenceSpecification_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OccurrenceSpecification"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ActionInputPin"
- displayName="ActionInputPin_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActionInputPin"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ActivityFinalNode"
- displayName="ActivityFinalNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityFinalNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ActivityParameterNode"
- displayName="ActivityParameterNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityParameterNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Actor"
- displayName="Actor_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Actor"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.AddStructuralFeatureValueAction"
- displayName="AddStructuralFeatureValueAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AddStructuralFeatureValueAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.AnyReceiveEvent"
- displayName="AnyReceiveEvent_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AnyReceiveEvent"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.AssociationClass"
- displayName="AssociationClass_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AssociationClass"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.BehaviorExecutionSpecification"
- displayName="BehaviorExecutionSpecification_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/BehaviorExecutionSpecification"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.BroadcastSignalAction"
- displayName="BroadcastSignalAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/BroadcastSignalAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CallBehaviorAction"
- displayName="CallBehaviorAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallBehaviorAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CallEvent"
- displayName="CallEvent_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallEvent"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CallOperationAction"
- displayName="CallOperationAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CentralBufferNode"
- displayName="CentralBufferNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CentralBufferNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ChangeEvent"
- displayName="ChangeEvent_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ChangeEvent"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Clause"
- displayName="Clause_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Clause"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ClearAssociationAction"
- displayName="ClearAssociationAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ClearAssociationAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ClearStructuralFeatureAction"
- displayName="ClearStructuralFeatureAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ClearStructuralFeatureAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ClearVariableAction"
- displayName="ClearVariableAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ClearVariableAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CombinedFragment"
- displayName="CombinedFragment_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CombinedFragment"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CommunicationPath"
- displayName="CommunicationPath_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CommunicationPath"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Component"
- displayName="Component_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Component"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ComponentRealization"
- displayName="ComponentRealization_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ComponentRealization"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ConditionalNode"
- displayName="ConditionalNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConditionalNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ConsiderIgnoreFragment"
- displayName="ConsiderIgnoreFragment_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConsiderIgnoreFragment"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Continuation"
- displayName="Continuation_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Continuation"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ControlFlow"
- displayName="ControlFlow_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ControlFlow"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CreateLinkAction"
- displayName="CreateLinkAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CreateLinkAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LinkEndData"
- displayName="LinkEndData_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LinkEndData"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.QualifierValue"
- displayName="QualifierValue_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/QualifierValue"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LinkEndCreationData"
- displayName="LinkEndCreationData_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LinkEndCreationData"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CreateLinkObjectAction"
- displayName="CreateLinkObjectAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CreateLinkObjectAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.CreateObjectAction"
- displayName="CreateObjectAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CreateObjectAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DataStoreNode"
- displayName="DataStoreNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DataStoreNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DecisionNode"
- displayName="DecisionNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DecisionNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ObjectFlow"
- displayName="ObjectFlow_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ObjectFlow"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DestroyLinkAction"
- displayName="DestroyLinkAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DestroyLinkAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LinkEndDestructionData"
- displayName="LinkEndDestructionData_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LinkEndDestructionData"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DestroyObjectAction"
- displayName="DestroyObjectAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DestroyObjectAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DestructionOccurrenceSpecification"
- displayName="DestructionOccurrenceSpecification_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DestructionOccurrenceSpecification"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.MessageOccurrenceSpecification"
- displayName="MessageOccurrenceSpecification_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/MessageOccurrenceSpecification"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Device"
- displayName="Device_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Device"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Node"
- displayName="Node_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Duration"
- displayName="Duration_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Duration"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DurationConstraint"
- displayName="DurationConstraint_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationConstraint"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.IntervalConstraint"
- displayName="IntervalConstraint_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/IntervalConstraint"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.Interval"
- displayName="Interval_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interval"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DurationInterval"
- displayName="DurationInterval_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationInterval"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.DurationObservation"
- displayName="DurationObservation_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationObservation"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ExecutionEnvironment"
- displayName="ExecutionEnvironment_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExecutionEnvironment"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ExecutionOccurrenceSpecification"
- displayName="ExecutionOccurrenceSpecification_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExecutionOccurrenceSpecification"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ExpansionNode"
- displayName="ExpansionNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExpansionNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ExpansionRegion"
- displayName="ExpansionRegion_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExpansionRegion"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.FinalState"
- displayName="FinalState_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FinalState"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.FlowFinalNode"
- displayName="FlowFinalNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FlowFinalNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ForkNode"
- displayName="ForkNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ForkNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.FunctionBehavior"
- displayName="FunctionBehavior_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FunctionBehavior"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.OpaqueBehavior"
- displayName="OpaqueBehavior_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueBehavior"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InformationFlow"
- displayName="InformationFlow_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InformationFlow"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InformationItem"
- displayName="InformationItem_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InformationItem"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InitialNode"
- displayName="InitialNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InitialNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.InstanceValue"
- displayName="InstanceValue_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InstanceValue"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.JoinNode"
- displayName="JoinNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/JoinNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LiteralBoolean"
- displayName="LiteralBoolean_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralBoolean"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LiteralInteger"
- displayName="LiteralInteger_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralInteger"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LiteralNull"
- displayName="LiteralNull_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralNull"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LiteralReal"
- displayName="LiteralReal_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralReal"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LiteralString"
- displayName="LiteralString_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralString"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LiteralUnlimitedNatural"
- displayName="LiteralUnlimitedNatural_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralUnlimitedNatural"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.LoopNode"
- displayName="LoopNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LoopNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.MergeNode"
- displayName="MergeNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/MergeNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.OpaqueAction"
- displayName="OpaqueAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ProtocolTransition"
- displayName="ProtocolTransition_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ProtocolTransition"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.RaiseExceptionAction"
- displayName="RaiseExceptionAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/RaiseExceptionAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReadExtentAction"
- displayName="ReadExtentAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadExtentAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReadIsClassifiedObjectAction"
- displayName="ReadIsClassifiedObjectAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadIsClassifiedObjectAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReadLinkAction"
- displayName="ReadLinkAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadLinkAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReadLinkObjectEndAction"
- displayName="ReadLinkObjectEndAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadLinkObjectEndAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReadLinkObjectEndQualifierAction"
- displayName="ReadLinkObjectEndQualifierAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadLinkObjectEndQualifierAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReadSelfAction"
- displayName="ReadSelfAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadSelfAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReadStructuralFeatureAction"
- displayName="ReadStructuralFeatureAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadStructuralFeatureAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReadVariableAction"
- displayName="ReadVariableAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadVariableAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReclassifyObjectAction"
- displayName="ReclassifyObjectAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReclassifyObjectAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReduceAction"
- displayName="ReduceAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReduceAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.RemoveStructuralFeatureValueAction"
- displayName="RemoveStructuralFeatureValueAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/RemoveStructuralFeatureValueAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.RemoveVariableValueAction"
- displayName="RemoveVariableValueAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/RemoveVariableValueAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ReplyAction"
- displayName="ReplyAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReplyAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.SendObjectAction"
- displayName="SendObjectAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/SendObjectAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.SendSignalAction"
- displayName="SendSignalAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/SendSignalAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.SequenceNode"
- displayName="SequenceNode_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/SequenceNode"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.SignalEvent"
- displayName="SignalEvent_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/SignalEvent"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.StartClassifierBehaviorAction"
- displayName="StartClassifierBehaviorAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StartClassifierBehaviorAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.StartObjectBehaviorAction"
- displayName="StartObjectBehaviorAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StartObjectBehaviorAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.StateInvariant"
- displayName="StateInvariant_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StateInvariant"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TestIdentityAction"
- displayName="TestIdentityAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TestIdentityAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TimeConstraint"
- displayName="TimeConstraint_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeConstraint"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TimeInterval"
- displayName="TimeInterval_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeInterval"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TimeExpression"
- displayName="TimeExpression_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeExpression"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TimeEvent"
- displayName="TimeEvent_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeEvent"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.TimeObservation"
- displayName="TimeObservation_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeObservation"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.UnmarshallAction"
- displayName="UnmarshallAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/UnmarshallAction"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ValuePin"
- displayName="ValuePin_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ValuePin"/>
- </modelFacet>
- </topLevelNodes>
- <topLevelNodes>
- <diagramRunTimeClass
- href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
- <elementType
- xsi:type="gmfgen:MetamodelType"
- uniqueIdentifier="org.eclipse.papyrus.uml.ValueSpecificationAction"
- displayName="ValueSpecificationAction_Semantic"
- definedExternally="true"/>
- <modelFacet>
- <metaClass
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ValueSpecificationAction"/>
- </modelFacet>
- </topLevelNodes>
- </diagram>
- <domainGenModel
- href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/>
-</gmfgen:GenEditorGenerator>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgen:GenEditorGenerator
+ 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"
+ templateDirectory="">
+ <diagram>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Diagram"/>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Constraint"
+ displayName="Constraint_Semantic"
+ definedExternally="true"/>
+ <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"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.AddVariableValueAction"
+ displayName="AddVariableValueAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AddVariableValueAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Abstraction"
+ displayName="Abstraction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Abstraction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Dependency"
+ displayName="Dependency_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Dependency"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Comment"
+ displayName="Comment_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Comment"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Stereotype"
+ displayName="Stereotype_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Stereotype"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Class"
+ displayName="Class_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Class"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.StringExpression"
+ displayName="StringExpression_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StringExpression"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Expression"
+ displayName="Expression_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Expression"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Package"
+ displayName="Package_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Package"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TemplateSignature"
+ displayName="TemplateSignature_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TemplateSignature"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TemplateParameter"
+ displayName="TemplateParameter_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TemplateParameter"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TemplateBinding"
+ displayName="TemplateBinding_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TemplateBinding"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TemplateParameterSubstitution"
+ displayName="TemplateParameterSubstitution_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TemplateParameterSubstitution"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.PackageMerge"
+ displayName="PackageMerge_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/PackageMerge"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ProfileApplication"
+ displayName="ProfileApplication_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ProfileApplication"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Profile"
+ displayName="Profile_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Profile"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ElementImport"
+ displayName="ElementImport_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ElementImport"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.PackageImport"
+ displayName="PackageImport_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/PackageImport"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Extension"
+ displayName="Extension_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Extension"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Association"
+ displayName="Association_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Association"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Property"
+ displayName="Property_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Property"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ConnectorEnd"
+ displayName="ConnectorEnd_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConnectorEnd"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ConnectableElementTemplateParameter"
+ displayName="ConnectableElementTemplateParameter_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConnectableElementTemplateParameter"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Deployment"
+ displayName="Deployment_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Deployment"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DeploymentSpecification"
+ displayName="DeploymentSpecification_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DeploymentSpecification"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Artifact"
+ displayName="Artifact_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Artifact"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Manifestation"
+ displayName="Manifestation_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Manifestation"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Operation"
+ displayName="Operation_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Operation"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InterfaceRealization"
+ displayName="InterfaceRealization_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InterfaceRealization"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Realization"
+ displayName="Realization_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Realization"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Interface"
+ displayName="Interface_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interface"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Reception"
+ displayName="Reception_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Reception"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Signal"
+ displayName="Signal_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Signal"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ProtocolStateMachine"
+ displayName="ProtocolStateMachine_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ProtocolStateMachine"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.StateMachine"
+ displayName="StateMachine_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StateMachine"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Pseudostate"
+ displayName="Pseudostate_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Pseudostate"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Region"
+ displayName="Region_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Region"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.State"
+ displayName="State_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/State"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ConnectionPointReference"
+ displayName="ConnectionPointReference_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConnectionPointReference"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Trigger"
+ displayName="Trigger_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Trigger"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Port"
+ displayName="Port_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Port"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Transition"
+ displayName="Transition_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Transition"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ProtocolConformance"
+ displayName="ProtocolConformance_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ProtocolConformance"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Parameter"
+ displayName="Parameter_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Parameter"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ParameterSet"
+ displayName="ParameterSet_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ParameterSet"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DataType"
+ displayName="DataType_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DataType"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.OperationTemplateParameter"
+ displayName="OperationTemplateParameter_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OperationTemplateParameter"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ExtensionEnd"
+ displayName="ExtensionEnd_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExtensionEnd"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Model"
+ displayName="Model_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Model"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Enumeration"
+ displayName="Enumeration_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Enumeration"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.EnumerationLiteral"
+ displayName="EnumerationLiteral_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/EnumerationLiteral"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InstanceSpecification"
+ displayName="InstanceSpecification_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InstanceSpecification"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Slot"
+ displayName="Slot_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Slot"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.PrimitiveType"
+ displayName="PrimitiveType_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/PrimitiveType"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Usage"
+ displayName="Usage_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Usage"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CollaborationUse"
+ displayName="CollaborationUse_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CollaborationUse"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Collaboration"
+ displayName="Collaboration_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Collaboration"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Generalization"
+ displayName="Generalization_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Generalization"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.GeneralizationSet"
+ displayName="GeneralizationSet_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/GeneralizationSet"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.RedefinableTemplateSignature"
+ displayName="RedefinableTemplateSignature_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/RedefinableTemplateSignature"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.UseCase"
+ displayName="UseCase_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/UseCase"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Extend"
+ displayName="Extend_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Extend"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ExtensionPoint"
+ displayName="ExtensionPoint_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExtensionPoint"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Include"
+ displayName="Include_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Include"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Substitution"
+ displayName="Substitution_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Substitution"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ClassifierTemplateParameter"
+ displayName="ClassifierTemplateParameter_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ClassifierTemplateParameter"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Connector"
+ displayName="Connector_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Connector"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Image"
+ displayName="Image_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Image"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.OpaqueExpression"
+ displayName="OpaqueExpression_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueExpression"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.AcceptCallAction"
+ displayName="AcceptCallAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AcceptCallAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.AcceptEventAction"
+ displayName="AcceptEventAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AcceptEventAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Activity"
+ displayName="Activity_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Activity"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ActivityPartition"
+ displayName="ActivityPartition_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityPartition"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.StructuredActivityNode"
+ displayName="StructuredActivityNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StructuredActivityNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InputPin"
+ displayName="InputPin_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InputPin"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.OutputPin"
+ displayName="OutputPin_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OutputPin"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Variable"
+ displayName="Variable_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Variable"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InterruptibleActivityRegion"
+ displayName="InterruptibleActivityRegion_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InterruptibleActivityRegion"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ExceptionHandler"
+ displayName="ExceptionHandler_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExceptionHandler"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ActionExecutionSpecification"
+ displayName="ActionExecutionSpecification_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActionExecutionSpecification"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Lifeline"
+ displayName="Lifeline_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Lifeline"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.PartDecomposition"
+ displayName="PartDecomposition_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/PartDecomposition"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InteractionUse"
+ displayName="InteractionUse_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InteractionUse"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Gate"
+ displayName="Gate_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Gate"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Message"
+ displayName="Message_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Message"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Interaction"
+ displayName="Interaction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interaction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InteractionOperand"
+ displayName="InteractionOperand_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InteractionOperand"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InteractionConstraint"
+ displayName="InteractionConstraint_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InteractionConstraint"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.GeneralOrdering"
+ displayName="GeneralOrdering_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/GeneralOrdering"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.OccurrenceSpecification"
+ displayName="OccurrenceSpecification_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OccurrenceSpecification"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ActionInputPin"
+ displayName="ActionInputPin_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActionInputPin"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ActivityFinalNode"
+ displayName="ActivityFinalNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityFinalNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ActivityParameterNode"
+ displayName="ActivityParameterNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ActivityParameterNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Actor"
+ displayName="Actor_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Actor"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.AddStructuralFeatureValueAction"
+ displayName="AddStructuralFeatureValueAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AddStructuralFeatureValueAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.AnyReceiveEvent"
+ displayName="AnyReceiveEvent_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AnyReceiveEvent"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.AssociationClass"
+ displayName="AssociationClass_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/AssociationClass"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.BehaviorExecutionSpecification"
+ displayName="BehaviorExecutionSpecification_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/BehaviorExecutionSpecification"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.BroadcastSignalAction"
+ displayName="BroadcastSignalAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/BroadcastSignalAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CallBehaviorAction"
+ displayName="CallBehaviorAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallBehaviorAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CallEvent"
+ displayName="CallEvent_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallEvent"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CallOperationAction"
+ displayName="CallOperationAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CallOperationAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CentralBufferNode"
+ displayName="CentralBufferNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CentralBufferNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ChangeEvent"
+ displayName="ChangeEvent_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ChangeEvent"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Clause"
+ displayName="Clause_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Clause"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ClearAssociationAction"
+ displayName="ClearAssociationAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ClearAssociationAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ClearStructuralFeatureAction"
+ displayName="ClearStructuralFeatureAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ClearStructuralFeatureAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ClearVariableAction"
+ displayName="ClearVariableAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ClearVariableAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CombinedFragment"
+ displayName="CombinedFragment_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CombinedFragment"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CommunicationPath"
+ displayName="CommunicationPath_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CommunicationPath"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Component"
+ displayName="Component_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Component"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ComponentRealization"
+ displayName="ComponentRealization_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ComponentRealization"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ConditionalNode"
+ displayName="ConditionalNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConditionalNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ConsiderIgnoreFragment"
+ displayName="ConsiderIgnoreFragment_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ConsiderIgnoreFragment"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Continuation"
+ displayName="Continuation_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Continuation"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ControlFlow"
+ displayName="ControlFlow_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ControlFlow"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CreateLinkAction"
+ displayName="CreateLinkAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CreateLinkAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LinkEndData"
+ displayName="LinkEndData_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LinkEndData"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.QualifierValue"
+ displayName="QualifierValue_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/QualifierValue"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LinkEndCreationData"
+ displayName="LinkEndCreationData_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LinkEndCreationData"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CreateLinkObjectAction"
+ displayName="CreateLinkObjectAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CreateLinkObjectAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.CreateObjectAction"
+ displayName="CreateObjectAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/CreateObjectAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DataStoreNode"
+ displayName="DataStoreNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DataStoreNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DecisionNode"
+ displayName="DecisionNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DecisionNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ObjectFlow"
+ displayName="ObjectFlow_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ObjectFlow"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DestroyLinkAction"
+ displayName="DestroyLinkAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DestroyLinkAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LinkEndDestructionData"
+ displayName="LinkEndDestructionData_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LinkEndDestructionData"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DestroyObjectAction"
+ displayName="DestroyObjectAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DestroyObjectAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DestructionOccurrenceSpecification"
+ displayName="DestructionOccurrenceSpecification_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DestructionOccurrenceSpecification"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.MessageOccurrenceSpecification"
+ displayName="MessageOccurrenceSpecification_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/MessageOccurrenceSpecification"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Device"
+ displayName="Device_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Device"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Node"
+ displayName="Node_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Node"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Duration"
+ displayName="Duration_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Duration"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DurationConstraint"
+ displayName="DurationConstraint_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationConstraint"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.IntervalConstraint"
+ displayName="IntervalConstraint_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/IntervalConstraint"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.Interval"
+ displayName="Interval_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Interval"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DurationInterval"
+ displayName="DurationInterval_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationInterval"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.DurationObservation"
+ displayName="DurationObservation_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/DurationObservation"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ExecutionEnvironment"
+ displayName="ExecutionEnvironment_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExecutionEnvironment"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ExecutionOccurrenceSpecification"
+ displayName="ExecutionOccurrenceSpecification_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExecutionOccurrenceSpecification"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ExpansionNode"
+ displayName="ExpansionNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExpansionNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ExpansionRegion"
+ displayName="ExpansionRegion_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ExpansionRegion"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.FinalState"
+ displayName="FinalState_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FinalState"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.FlowFinalNode"
+ displayName="FlowFinalNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FlowFinalNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ForkNode"
+ displayName="ForkNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ForkNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.FunctionBehavior"
+ displayName="FunctionBehavior_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/FunctionBehavior"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.OpaqueBehavior"
+ displayName="OpaqueBehavior_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueBehavior"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InformationFlow"
+ displayName="InformationFlow_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InformationFlow"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InformationItem"
+ displayName="InformationItem_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InformationItem"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InitialNode"
+ displayName="InitialNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InitialNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.InstanceValue"
+ displayName="InstanceValue_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/InstanceValue"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.JoinNode"
+ displayName="JoinNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/JoinNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LiteralBoolean"
+ displayName="LiteralBoolean_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralBoolean"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LiteralInteger"
+ displayName="LiteralInteger_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralInteger"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LiteralNull"
+ displayName="LiteralNull_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralNull"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LiteralReal"
+ displayName="LiteralReal_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralReal"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LiteralString"
+ displayName="LiteralString_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralString"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LiteralUnlimitedNatural"
+ displayName="LiteralUnlimitedNatural_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LiteralUnlimitedNatural"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.LoopNode"
+ displayName="LoopNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/LoopNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.MergeNode"
+ displayName="MergeNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/MergeNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.OpaqueAction"
+ displayName="OpaqueAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/OpaqueAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ProtocolTransition"
+ displayName="ProtocolTransition_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ProtocolTransition"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.RaiseExceptionAction"
+ displayName="RaiseExceptionAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/RaiseExceptionAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReadExtentAction"
+ displayName="ReadExtentAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadExtentAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReadIsClassifiedObjectAction"
+ displayName="ReadIsClassifiedObjectAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadIsClassifiedObjectAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReadLinkAction"
+ displayName="ReadLinkAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadLinkAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReadLinkObjectEndAction"
+ displayName="ReadLinkObjectEndAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadLinkObjectEndAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReadLinkObjectEndQualifierAction"
+ displayName="ReadLinkObjectEndQualifierAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadLinkObjectEndQualifierAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReadSelfAction"
+ displayName="ReadSelfAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadSelfAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReadStructuralFeatureAction"
+ displayName="ReadStructuralFeatureAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadStructuralFeatureAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReadVariableAction"
+ displayName="ReadVariableAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReadVariableAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReclassifyObjectAction"
+ displayName="ReclassifyObjectAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReclassifyObjectAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReduceAction"
+ displayName="ReduceAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReduceAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.RemoveStructuralFeatureValueAction"
+ displayName="RemoveStructuralFeatureValueAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/RemoveStructuralFeatureValueAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.RemoveVariableValueAction"
+ displayName="RemoveVariableValueAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/RemoveVariableValueAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ReplyAction"
+ displayName="ReplyAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ReplyAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.SendObjectAction"
+ displayName="SendObjectAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/SendObjectAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.SendSignalAction"
+ displayName="SendSignalAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/SendSignalAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.SequenceNode"
+ displayName="SequenceNode_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/SequenceNode"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.SignalEvent"
+ displayName="SignalEvent_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/SignalEvent"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.StartClassifierBehaviorAction"
+ displayName="StartClassifierBehaviorAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StartClassifierBehaviorAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.StartObjectBehaviorAction"
+ displayName="StartObjectBehaviorAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StartObjectBehaviorAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.StateInvariant"
+ displayName="StateInvariant_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/StateInvariant"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TestIdentityAction"
+ displayName="TestIdentityAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TestIdentityAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TimeConstraint"
+ displayName="TimeConstraint_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeConstraint"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TimeInterval"
+ displayName="TimeInterval_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeInterval"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TimeExpression"
+ displayName="TimeExpression_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeExpression"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TimeEvent"
+ displayName="TimeEvent_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeEvent"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.TimeObservation"
+ displayName="TimeObservation_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/TimeObservation"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.UnmarshallAction"
+ displayName="UnmarshallAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/UnmarshallAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ValuePin"
+ displayName="ValuePin_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ValuePin"/>
+ </modelFacet>
+ </topLevelNodes>
+ <topLevelNodes>
+ <diagramRunTimeClass
+ href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
+ <elementType
+ xsi:type="gmfgen:MetamodelType"
+ uniqueIdentifier="org.eclipse.papyrus.uml.ValueSpecificationAction"
+ displayName="ValueSpecificationAction_Semantic"
+ definedExternally="true"/>
+ <modelFacet>
+ <metaClass
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/ValueSpecificationAction"/>
+ </modelFacet>
+ </topLevelNodes>
+ </diagram>
+ <domainGenModel
+ href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#/"/>
+</gmfgen:GenEditorGenerator>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InitialNode.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InitialNode.gmfgraph
index 6907ea641ee..ad8c58ce2a6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InitialNode.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InitialNode.gmfgraph
@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="InitialNodeFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="InitialNodeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.InitialNode"/>
- </descriptors>
- </figures>
- <nodes
- name="InitialNodeFigureNode"
- figure="InitialNodeFigureDescriptor"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="InitialNodeFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="InitialNodeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.InitialNode"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="InitialNodeFigureNode"
+ figure="InitialNodeFigureDescriptor"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InstanceSpecification.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InstanceSpecification.gmfgraph
index 013bf2b7288..1b9feb6866b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InstanceSpecification.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InstanceSpecification.gmfgraph
@@ -1,110 +1,110 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="InstanceSpecificationDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="InstancespecificationFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CEnumeration">
- <foregroundColor
- xsi:type="gmfgraph:RGBColor"
- red="255"
- green="180"
- blue="180"/>
- <backgroundColor
- xsi:type="gmfgraph:RGBColor"
- red="255"
- green="219"
- blue="219"/>
- <children
- xsi:type="gmfgraph:Label"
- name="InstanceSpecificationStereotypeLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="InstanceSpecificationNameLabel"
- text="">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"
- style="BOLD"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="InstanceSpecificationQualifiedName">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"
- style="ITALIC"/>
- </children>
- <children
- xsi:type="gmfgraph:Rectangle"
- name="SlotCompartmentFigure"
- fill="false">
- <layout
- xsi:type="gmfgraph:StackLayout"/>
- </children>
- </actualFigure>
- <accessors
- accessor="getInstanceSpecificationStereotypeLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- <accessors
- accessor="getInstanceSpecificationNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
- <accessors
- accessor="getInstanceSpecificationQualifiedNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
- <accessors
- accessor="getSlotCompartmentFigure"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.3"/>
- </descriptors>
- <descriptors
- name="SlotDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="SlotLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"/>
- </actualFigure>
- </descriptors>
- </figures>
- <nodes
- name="InstanceSpecificationNode"
- figure="InstanceSpecificationDescriptor"/>
- <compartments
- name="SlotCompartment"
- figure="InstanceSpecificationDescriptor"
- collapsible="true"
- accessor="//@figures.0/@descriptors.0/@accessors.3"/>
- <labels
- name="InstanceSpecificationDiagramStereotypeLabel"
- figure="InstanceSpecificationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
- <labels
- name="InstanceSpecificationNameDiagramLabel"
- figure="InstanceSpecificationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.1"/>
- <labels
- name="InstanceSpecificationQualifiedNameDiagramLabel"
- figure="InstanceSpecificationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.2"/>
- <labels
- name="SlotDiagramLabel"
- figure="SlotDescriptor"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="InstanceSpecificationDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="InstancespecificationFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CEnumeration">
+ <foregroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="255"
+ green="180"
+ blue="180"/>
+ <backgroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="255"
+ green="219"
+ blue="219"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="InstanceSpecificationStereotypeLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="InstanceSpecificationNameLabel"
+ text="">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"
+ style="BOLD"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="InstanceSpecificationQualifiedName">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"
+ style="ITALIC"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Rectangle"
+ name="SlotCompartmentFigure"
+ fill="false">
+ <layout
+ xsi:type="gmfgraph:StackLayout"/>
+ </children>
+ </actualFigure>
+ <accessors
+ accessor="getInstanceSpecificationStereotypeLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getInstanceSpecificationNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
+ <accessors
+ accessor="getInstanceSpecificationQualifiedNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
+ <accessors
+ accessor="getSlotCompartmentFigure"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.3"/>
+ </descriptors>
+ <descriptors
+ name="SlotDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Label"
+ name="SlotLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"/>
+ </actualFigure>
+ </descriptors>
+ </figures>
+ <nodes
+ name="InstanceSpecificationNode"
+ figure="InstanceSpecificationDescriptor"/>
+ <compartments
+ name="SlotCompartment"
+ figure="InstanceSpecificationDescriptor"
+ collapsible="true"
+ accessor="//@figures.0/@descriptors.0/@accessors.3"/>
+ <labels
+ name="InstanceSpecificationDiagramStereotypeLabel"
+ figure="InstanceSpecificationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+ <labels
+ name="InstanceSpecificationNameDiagramLabel"
+ figure="InstanceSpecificationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.1"/>
+ <labels
+ name="InstanceSpecificationQualifiedNameDiagramLabel"
+ figure="InstanceSpecificationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.2"/>
+ <labels
+ name="SlotDiagramLabel"
+ figure="SlotDescriptor"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InterfaceRealization.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InterfaceRealization.gmfgraph
index cb320302fc7..5a13116828f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InterfaceRealization.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/InterfaceRealization.gmfgraph
@@ -1,56 +1,56 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="uml">
- <figures
- name="Default">
- <descriptors
- name="InterfaceRealizationDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomConnection"
- name="CInterfaceRealization"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.CInterfaceRealizationFigure">
- <foregroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <backgroundColor
- xsi:type="gmfgraph:ConstantColor"
- value="black"/>
- <children
- xsi:type="gmfgraph:Label"
- name="InterfaceRealizationNameLabel"/>
- <children
- xsi:type="gmfgraph:Label"
- name="AppliedStereotypeLabel"/>
- </actualFigure>
- <accessors
- accessor="getInterfaceRealizationNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- <accessors
- accessor="getAppliedStereotypeLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
- </descriptors>
- </figures>
- <connections
- name="InterfaceRealizationConnection"
- figure="InterfaceRealizationDescriptor"/>
- <labels
- name="InterfaceRealizationNameDiagramLabel"
- figure="InterfaceRealizationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
- <labels
- name="InterfaceRealizationAppliedStereotypeDiagramLabel"
- figure="InterfaceRealizationDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.1">
- <facets
- xsi:type="gmfgraph:AlignmentFacet"
- alignment="CENTER"/>
- </labels>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="uml">
+ <figures
+ name="Default">
+ <descriptors
+ name="InterfaceRealizationDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomConnection"
+ name="CInterfaceRealization"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.edge.CInterfaceRealizationFigure">
+ <foregroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <backgroundColor
+ xsi:type="gmfgraph:ConstantColor"
+ value="black"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="InterfaceRealizationNameLabel"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="AppliedStereotypeLabel"/>
+ </actualFigure>
+ <accessors
+ accessor="getInterfaceRealizationNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getAppliedStereotypeLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
+ </descriptors>
+ </figures>
+ <connections
+ name="InterfaceRealizationConnection"
+ figure="InterfaceRealizationDescriptor"/>
+ <labels
+ name="InterfaceRealizationNameDiagramLabel"
+ figure="InterfaceRealizationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+ <labels
+ name="InterfaceRealizationAppliedStereotypeDiagramLabel"
+ figure="InterfaceRealizationDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.1">
+ <facets
+ xsi:type="gmfgraph:AlignmentFacet"
+ alignment="CENTER"/>
+ </labels>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/NodeNamedElement.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/NodeNamedElement.gmfgraph
index 0663ade6b7b..2cdb31be8fb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/NodeNamedElement.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/NodeNamedElement.gmfgraph
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="NodeNamedElementFigure">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="NodeNamedElementFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure">
- <customChildren
- accessor="getNameLabel()">
- <typedFigure
- xsi:type="gmfgraph:Label"
- name="nameLabel"/>
- </customChildren>
- </actualFigure>
- <accessors
- accessor="getNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
- </descriptors>
- </figures>
- <nodes
- name="NamedElementFigureNode"
- figure="NodeNamedElementFigure"/>
- <labels
- name="NameOfNamedElementFigureDiagramLabel"
- figure="NodeNamedElementFigure"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="NodeNamedElementFigure">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="NodeNamedElementFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure">
+ <customChildren
+ accessor="getNameLabel()">
+ <typedFigure
+ xsi:type="gmfgraph:Label"
+ name="nameLabel"/>
+ </customChildren>
+ </actualFigure>
+ <accessors
+ accessor="getNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="NamedElementFigureNode"
+ figure="NodeNamedElementFigure"/>
+ <labels
+ name="NameOfNamedElementFigureDiagramLabel"
+ figure="NodeNamedElementFigure"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PackageElement.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PackageElement.gmfgraph
index 82670989e4e..3a1c486ae58 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PackageElement.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PackageElement.gmfgraph
@@ -1,89 +1,89 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="PackageFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="CPackageFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CPackageFigure">
- <foregroundColor
- xsi:type="gmfgraph:RGBColor"
- red="233"
- green="164"
- blue="96"/>
- <backgroundColor
- xsi:type="gmfgraph:RGBColor"
- red="255"
- green="199"
- blue="143"/>
- <children
- xsi:type="gmfgraph:Label"
- name="StereotypesLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="PackageNameLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"
- style="BOLD"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="PackageQualifiedName">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"
- style="ITALIC"/>
- </children>
- <children
- xsi:type="gmfgraph:Rectangle"
- name="PackageableElementContainer"/>
- </actualFigure>
- <accessors
- accessor="getPackageNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
- <accessors
- accessor="getPackageableElementFigure"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.3"/>
- <accessors
- accessor="getPackageQualifiedNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
- <accessors
- accessor="getStereotypesLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- </descriptors>
- </figures>
- <nodes
- name="PackageNode"
- figure="PackageFigureDescriptor"/>
- <compartments
- name="PackageableElementCompartment"
- figure="PackageFigureDescriptor"
- accessor="//@figures.0/@descriptors.0/@accessors.1"/>
- <labels
- name="PackageStereotypesDiagramLabel"
- figure="PackageFigureDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.3"/>
- <labels
- name="PackageNameDiagramLabel"
- figure="PackageFigureDescriptor"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
- <labels
- name="PackageQualifiedNameDiagramLabel"
- figure="PackageFigureDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.2"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="PackageFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="CPackageFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CPackageFigure">
+ <foregroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="233"
+ green="164"
+ blue="96"/>
+ <backgroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="255"
+ green="199"
+ blue="143"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="StereotypesLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="PackageNameLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"
+ style="BOLD"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="PackageQualifiedName">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"
+ style="ITALIC"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Rectangle"
+ name="PackageableElementContainer"/>
+ </actualFigure>
+ <accessors
+ accessor="getPackageNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
+ <accessors
+ accessor="getPackageableElementFigure"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.3"/>
+ <accessors
+ accessor="getPackageQualifiedNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
+ <accessors
+ accessor="getStereotypesLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="PackageNode"
+ figure="PackageFigureDescriptor"/>
+ <compartments
+ name="PackageableElementCompartment"
+ figure="PackageFigureDescriptor"
+ accessor="//@figures.0/@descriptors.0/@accessors.1"/>
+ <labels
+ name="PackageStereotypesDiagramLabel"
+ figure="PackageFigureDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.3"/>
+ <labels
+ name="PackageNameDiagramLabel"
+ figure="PackageFigureDescriptor"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+ <labels
+ name="PackageQualifiedNameDiagramLabel"
+ figure="PackageFigureDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.2"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PrimitiveType.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PrimitiveType.gmfgraph
index 4601d7b81a0..0ae84baff99 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PrimitiveType.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/PrimitiveType.gmfgraph
@@ -1,80 +1,80 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="PrimitiveTypeDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="CPrimitiveFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CPrimitiveFigure">
- <foregroundColor
- xsi:type="gmfgraph:RGBColor"
- red="204"
- green="204"
- blue="204"/>
- <backgroundColor
- xsi:type="gmfgraph:RGBColor"
- red="242"
- green="242"
- blue="242"/>
- <children
- xsi:type="gmfgraph:Label"
- name="StereotypesLabel"
- text="">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="PrimitiveTypeNameLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="10"
- style="BOLD"/>
- </children>
- <children
- xsi:type="gmfgraph:Label"
- name="PrimitiveTypeQualifiedNameLabel">
- <font
- xsi:type="gmfgraph:BasicFont"
- faceName="Arial"
- height="8"
- style="ITALIC"/>
- </children>
- </actualFigure>
- <accessors
- accessor="getStereotypesLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- <accessors
- accessor="getNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
- <accessors
- accessor="getQualifiedNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
- </descriptors>
- </figures>
- <nodes
- name="PrimitiveTypeNode"
- figure="PrimitiveTypeDescriptor"/>
- <labels
- name="PrimitiveTypeStereotypeLabel"
- figure="PrimitiveTypeDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
- <labels
- name="PrimitiveTypeNameLabel"
- figure="PrimitiveTypeDescriptor"
- accessor="//@figures.0/@descriptors.0/@accessors.1"/>
- <labels
- name="PrimitiveTypeQualifiedNameLabel"
- figure="PrimitiveTypeDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.2"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="PrimitiveTypeDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="CPrimitiveFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.CPrimitiveFigure">
+ <foregroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="204"
+ green="204"
+ blue="204"/>
+ <backgroundColor
+ xsi:type="gmfgraph:RGBColor"
+ red="242"
+ green="242"
+ blue="242"/>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="StereotypesLabel"
+ text="">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="PrimitiveTypeNameLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="10"
+ style="BOLD"/>
+ </children>
+ <children
+ xsi:type="gmfgraph:Label"
+ name="PrimitiveTypeQualifiedNameLabel">
+ <font
+ xsi:type="gmfgraph:BasicFont"
+ faceName="Arial"
+ height="8"
+ style="ITALIC"/>
+ </children>
+ </actualFigure>
+ <accessors
+ accessor="getStereotypesLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ <accessors
+ accessor="getNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.1"/>
+ <accessors
+ accessor="getQualifiedNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.2"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="PrimitiveTypeNode"
+ figure="PrimitiveTypeDescriptor"/>
+ <labels
+ name="PrimitiveTypeStereotypeLabel"
+ figure="PrimitiveTypeDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+ <labels
+ name="PrimitiveTypeNameLabel"
+ figure="PrimitiveTypeDescriptor"
+ accessor="//@figures.0/@descriptors.0/@accessors.1"/>
+ <labels
+ name="PrimitiveTypeQualifiedNameLabel"
+ figure="PrimitiveTypeDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.2"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ReceiveNodeFigure.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ReceiveNodeFigure.gmfgraph
index 3626d15f255..e901101d57f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ReceiveNodeFigure.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/ReceiveNodeFigure.gmfgraph
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="ReceiveNodeFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="ReceiveNodeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ReceiveNodeFigure">
- <customChildren
- accessor="getNameLabel()">
- <typedFigure
- xsi:type="gmfgraph:Label"
- name="nameLabel"/>
- </customChildren>
- </actualFigure>
- <accessors
- accessor="getNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
- </descriptors>
- </figures>
- <nodes
- name="ReceiveFigureNode"
- figure="ReceiveNodeFigureDescriptor"/>
- <labels
- name="ReceiveNodeFigureNameDiagramLabel"
- figure="ReceiveNodeFigureDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="ReceiveNodeFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="ReceiveNodeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.ReceiveNodeFigure">
+ <customChildren
+ accessor="getNameLabel()">
+ <typedFigure
+ xsi:type="gmfgraph:Label"
+ name="nameLabel"/>
+ </customChildren>
+ </actualFigure>
+ <accessors
+ accessor="getNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="ReceiveFigureNode"
+ figure="ReceiveNodeFigureDescriptor"/>
+ <labels
+ name="ReceiveNodeFigureNameDiagramLabel"
+ figure="ReceiveNodeFigureDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SendNodeFigure.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SendNodeFigure.gmfgraph
index bc65450c302..7af252f7cbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SendNodeFigure.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SendNodeFigure.gmfgraph
@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="SendNodeFigureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="SendNodeFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusSendNodeFigure">
- <customChildren
- accessor="getNameLabel()">
- <typedFigure
- xsi:type="gmfgraph:Label"
- name="nameLabel"/>
- </customChildren>
- </actualFigure>
- <accessors
- accessor="getNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
- </descriptors>
- </figures>
- <nodes
- name="SendNodeFigureNode"
- figure="SendNodeFigureDescriptor"/>
- <labels
- name="SendNodeFigureNameDiagramLabel"
- figure="SendNodeFigureDescriptor"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="SendNodeFigureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="SendNodeFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.PapyrusSendNodeFigure">
+ <customChildren
+ accessor="getNameLabel()">
+ <typedFigure
+ xsi:type="gmfgraph:Label"
+ name="nameLabel"/>
+ </customChildren>
+ </actualFigure>
+ <accessors
+ accessor="getNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="SendNodeFigureNode"
+ figure="SendNodeFigureDescriptor"/>
+ <labels
+ name="SendNodeFigureNameDiagramLabel"
+ figure="SendNodeFigureDescriptor"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SideNodeNamedElement.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SideNodeNamedElement.gmfgraph
index 027dd6bfc15..9b8a63d6bac 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SideNodeNamedElement.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/SideNodeNamedElement.gmfgraph
@@ -1,35 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="NodeNamedElementFigure">
- <actualFigure
- xsi:type="gmfgraph:CustomFigure"
- name="NodeNamedElementFigure"
- qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure">
- <customChildren
- accessor="getNameLabel()">
- <typedFigure
- xsi:type="gmfgraph:Label"
- name="nameLabel"/>
- </customChildren>
- </actualFigure>
- <accessors
- accessor="getNameLabel"
- figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
- </descriptors>
- </figures>
- <nodes
- name="SideNamedElementFigureNode"
- figure="NodeNamedElementFigure"
- affixedParentSide="WEST"/>
- <labels
- name="NameOfSideNamedElementFigureDiagramLabel"
- figure="NodeNamedElementFigure"
- elementIcon="false"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="NodeNamedElementFigure">
+ <actualFigure
+ xsi:type="gmfgraph:CustomFigure"
+ name="NodeNamedElementFigure"
+ qualifiedClassName="org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure">
+ <customChildren
+ accessor="getNameLabel()">
+ <typedFigure
+ xsi:type="gmfgraph:Label"
+ name="nameLabel"/>
+ </customChildren>
+ </actualFigure>
+ <accessors
+ accessor="getNameLabel"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@customChildren.0/@typedFigure"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="SideNamedElementFigureNode"
+ figure="NodeNamedElementFigure"
+ affixedParentSide="WEST"/>
+ <labels
+ name="NameOfSideNamedElementFigureDiagramLabel"
+ figure="NodeNamedElementFigure"
+ elementIcon="false"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Template.gmfgraph b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Template.gmfgraph
index 4a9c65f4269..0a9914f9888 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Template.gmfgraph
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/model/Template.gmfgraph
@@ -1,47 +1,47 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gmfgraph:Canvas xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
- <figures
- name="Default">
- <descriptors
- name="TemplateSignatureDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Rectangle"
- name="TemplateRectangle">
- <size
- x="100"
- y="60"/>
- <children
- xsi:type="gmfgraph:Rectangle"
- name="TemplateParameterRectangle">
- <layout
- xsi:type="gmfgraph:StackLayout"/>
- </children>
- </actualFigure>
- <accessors
- accessor="getTemplateParameterRectangle"
- figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
- </descriptors>
- <descriptors
- name="TemplateParameterDescriptor">
- <actualFigure
- xsi:type="gmfgraph:Label"
- name="TemplateParameterLabel"
- text="&lt;UNDEFINED>"/>
- </descriptors>
- </figures>
- <nodes
- name="TemplateSignatureNode"
- figure="TemplateSignatureDescriptor"
- affixedParentSide="NORTH"/>
- <compartments
- name="TemplateParameterCompartment"
- figure="TemplateSignatureDescriptor"
- accessor="//@figures.0/@descriptors.0/@accessors.0"/>
- <labels
- name="TemplateParameterDiagramLabel"
- figure="TemplateParameterDescriptor"
- elementIcon="false"/>
-</gmfgraph:Canvas>
+<?xml version="1.0" encoding="UTF-8"?>
+<gmfgraph:Canvas xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gmfgraph="http://www.eclipse.org/gmf/2006/GraphicalDefinition" name="umlclassdiagram">
+ <figures
+ name="Default">
+ <descriptors
+ name="TemplateSignatureDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Rectangle"
+ name="TemplateRectangle">
+ <size
+ x="100"
+ y="60"/>
+ <children
+ xsi:type="gmfgraph:Rectangle"
+ name="TemplateParameterRectangle">
+ <layout
+ xsi:type="gmfgraph:StackLayout"/>
+ </children>
+ </actualFigure>
+ <accessors
+ accessor="getTemplateParameterRectangle"
+ figure="//@figures.0/@descriptors.0/@actualFigure/@children.0"/>
+ </descriptors>
+ <descriptors
+ name="TemplateParameterDescriptor">
+ <actualFigure
+ xsi:type="gmfgraph:Label"
+ name="TemplateParameterLabel"
+ text="&lt;UNDEFINED>"/>
+ </descriptors>
+ </figures>
+ <nodes
+ name="TemplateSignatureNode"
+ figure="TemplateSignatureDescriptor"
+ affixedParentSide="NORTH"/>
+ <compartments
+ name="TemplateParameterCompartment"
+ figure="TemplateSignatureDescriptor"
+ accessor="//@figures.0/@descriptors.0/@accessors.0"/>
+ <labels
+ name="TemplateParameterDiagramLabel"
+ figure="TemplateParameterDescriptor"
+ elementIcon="false"/>
+</gmfgraph:Canvas>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
index 3c5b4a6560c..ce3c59b5759 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/plugin.xml
@@ -1,612 +1,612 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<!--
-##########################################################################################
-# Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat
-# de la Comunitat Valenciana . All rights reserved. This program
-# and the accompanying materials are made available under the terms of the
-# Eclipse Public License v1.0 which accompanies this distribution, and is
-# available at http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
-#
-########################################################################################
--->
-
-<plugin>
- <extension-point id="modelToEditorMap" name="ModelToEditorMap" schema="schema/modelToEditorMap.exsd"/>
- <extension-point id="editorAssistantProvider" name="editorAssistantProvider" schema="schema/editorAssistantProvider.exsd"/>
- <extension-point id="viewInfo" name="viewInfo" schema="schema/viewInfo.exsd"/>
- <extension-point id="moskittEditorFactory" name="moskittEditorFactory" schema="schema/moskittEditorFactory.exsd"/>
- <extension-point id="paletteDefinition" name="PaletteDefinition" schema="schema/paletteDefinition.exsd"/>
- <extension-point id="aspectToolProvider" name="aspectToolProvider" schema="schema/aspectToolProvider.exsd"/>
- <extension-point id="paletteCustomization" name="Palette customization" schema="schema/paletteCustomization.exsd"/>
-
- <extension point="org.eclipse.ui.views">
- <category
- id="org.eclipse.papyrus.views.category"
- name="Papyrus">
- </category>
-
-</extension>
-<extension
- point="org.eclipse.papyrus.infra.core.modelListener">
- <listener
- name="StereotypeApplicationListener"
- realization="org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener">
- </listener>
-</extension>
-
-<extension
- point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
- <paletteProvider
- class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
- <Priority
- name="Highest">
- </Priority>
- <contribution>
- <predefinedEntry
- id="standardGroup/noteStack/noteTool"
- remove="true">
- </predefinedEntry>
- <predefinedEntry
- id="standardGroup/noteStack/textTool"
- remove="true">
- </predefinedEntry>
- <predefinedEntry
- id="standardGroup/noteStack/noteattachmentTool"
- remove="true">
- </predefinedEntry>
- </contribution>
- <editor
- class="org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor(org.eclipse.papyrus.uml.diagram.common)">
- </editor>
- </paletteProvider>
-</extension>
-
-<extension
- point="org.eclipse.ui.views.properties.tabbed.propertySections">
- <propertySections contributorId="TreeOutlinePage">
- <propertySection
- afterSection=""
- class="org.eclipse.papyrus.uml.diagram.common.sheet.UMLPropertySection"
- id="AdvancedProperty"
- tab="advanced">
- <input type="java.lang.Object"/>
- </propertySection>
- </propertySections>
-</extension>
-<!-- The class doesn't exist
-<extension
- point="org.eclipse.ui.startup">
- <startup
- class="org.eclipse.papyrus.uml.diagram.common.Startup"></startup>
-</extension>
--->
-<extension
- point="org.eclipse.ui.menus">
-
- <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?endof=fileMenu"
- allPopups="false">
- <!--menuContribution
- locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContribution"-->
- <command
- commandId="org.eclipse.papyrus.uml.diagram.commands.LoadResourceAction"
- label="Load resource..."
- style="push">
- <visibleWhen>
- <or>
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- </or>
- </visibleWhen>
- </command>
- </menuContribution>
-</extension>
-<extension
- point="org.eclipse.ui.commands">
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- defaultHandler="org.eclipse.papyrus.uml.diagram.common.actions.LoadResourceAction"
- id="org.eclipse.papyrus.uml.diagram.commands.LoadResourceAction"
- name="Load Resource">
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+##########################################################################################
+# Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat
+# de la Comunitat Valenciana . All rights reserved. This program
+# and the accompanying materials are made available under the terms of the
+# Eclipse Public License v1.0 which accompanies this distribution, and is
+# available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
+#
+########################################################################################
+-->
+
+<plugin>
+ <extension-point id="modelToEditorMap" name="ModelToEditorMap" schema="schema/modelToEditorMap.exsd"/>
+ <extension-point id="editorAssistantProvider" name="editorAssistantProvider" schema="schema/editorAssistantProvider.exsd"/>
+ <extension-point id="viewInfo" name="viewInfo" schema="schema/viewInfo.exsd"/>
+ <extension-point id="moskittEditorFactory" name="moskittEditorFactory" schema="schema/moskittEditorFactory.exsd"/>
+ <extension-point id="paletteDefinition" name="PaletteDefinition" schema="schema/paletteDefinition.exsd"/>
+ <extension-point id="aspectToolProvider" name="aspectToolProvider" schema="schema/aspectToolProvider.exsd"/>
+ <extension-point id="paletteCustomization" name="Palette customization" schema="schema/paletteCustomization.exsd"/>
+
+ <extension point="org.eclipse.ui.views">
+ <category
+ id="org.eclipse.papyrus.views.category"
+ name="Papyrus">
+ </category>
+
+</extension>
+<extension
+ point="org.eclipse.papyrus.infra.core.modelListener">
+ <listener
+ name="StereotypeApplicationListener"
+ realization="org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener">
+ </listener>
+</extension>
+
+<extension
+ point="org.eclipse.gmf.runtime.diagram.ui.paletteProviders">
+ <paletteProvider
+ class="org.eclipse.gmf.runtime.diagram.ui.providers.DefaultPaletteProvider">
+ <Priority
+ name="Highest">
+ </Priority>
+ <contribution>
+ <predefinedEntry
+ id="standardGroup/noteStack/noteTool"
+ remove="true">
+ </predefinedEntry>
+ <predefinedEntry
+ id="standardGroup/noteStack/textTool"
+ remove="true">
+ </predefinedEntry>
+ <predefinedEntry
+ id="standardGroup/noteStack/noteattachmentTool"
+ remove="true">
+ </predefinedEntry>
+ </contribution>
+ <editor
+ class="org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor(org.eclipse.papyrus.uml.diagram.common)">
+ </editor>
+ </paletteProvider>
+</extension>
+
+<extension
+ point="org.eclipse.ui.views.properties.tabbed.propertySections">
+ <propertySections contributorId="TreeOutlinePage">
+ <propertySection
+ afterSection=""
+ class="org.eclipse.papyrus.uml.diagram.common.sheet.UMLPropertySection"
+ id="AdvancedProperty"
+ tab="advanced">
+ <input type="java.lang.Object"/>
+ </propertySection>
+ </propertySections>
+</extension>
+<!-- The class doesn't exist
+<extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.papyrus.uml.diagram.common.Startup"></startup>
+</extension>
+-->
+<extension
+ point="org.eclipse.ui.menus">
+
+ <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?endof=fileMenu"
+ allPopups="false">
+ <!--menuContribution
+ locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContribution"-->
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.commands.LoadResourceAction"
+ label="Load resource..."
+ style="push">
+ <visibleWhen>
+ <or>
+ <with
+ variable="activePartId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ </or>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+</extension>
+<extension
+ point="org.eclipse.ui.commands">
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.uml.diagram.common.actions.LoadResourceAction"
+ id="org.eclipse.papyrus.uml.diagram.commands.LoadResourceAction"
+ name="Load Resource">
</command>
</extension>
-<extension
- point="org.eclipse.papyrus.infra.core.modelListener">
- <listener
- description="This listener listens for profile (un)applications to update the palette"
- name="PaletteProfileApplicationListener"
- realization="org.eclipse.papyrus.uml.diagram.common.service.PaletteProfileApplicationListener">
- </listener>
-</extension>
-<extension
- point="org.eclipse.papyrus.infra.core.papyrusDiagram">
- <actionBarContributor
- id="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor"
- implementingClass="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor">
- </actionBarContributor>
-</extension>
-<extension
- point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
- <aspectToolProvider
- class="org.eclipse.papyrus.uml.diagram.common.service.palette.AssociationEndAspectActionProvider"
- description="This Provider handles actions taken after association creation. It modifies the 2 properties, member ends of the created association."
- icon="icons/obj16/Association_composite.gif"
- id="org.eclipse.papyrus.postaction.associationendactionprovider"
- name="Set Association ends properties">
- <Priority
- name="Lowest">
- </Priority>
- </aspectToolProvider>
-</extension>
-<extension
- point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
- <aspectToolProvider
- class="org.eclipse.papyrus.uml.diagram.common.service.palette.ChangeStereotypeDisplayAspectActionProvider"
- description="This changes the way stereotypes are displayed in the created element. (Vertical or horizontal display, icon or text, etc.)"
- icon="icons/stereotype_display.gif"
- id="org.eclipse.papyrus.postaction.changeStereotypeDisplayProvider"
- name="Set applied stereotypes appearance">
- <Priority
- name="Lowest">
- </Priority>
- </aspectToolProvider>
-</extension>
-<extension
- point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
- <aspectToolProvider
- class="org.eclipse.papyrus.uml.diagram.common.service.palette.StereotypeAspectActionProvider"
- description="This provider creates action that applies a list of stereotypes to the given element."
- icon="icons/stereotype.gif"
- id="org.eclipse.papyrus.applystereotypeactionprovider"
- name="Set list of applied stereotypes">
- <Priority
- name="Lowest">
- </Priority>
- </aspectToolProvider>
-</extension>
-<extension
- point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
- <aspectToolProvider
- class="org.eclipse.papyrus.uml.diagram.common.service.palette.SemanticAspectActionProvider"
- description="The actions provided by this extension modify a semantic element, giving static-defined values to some of his attributes"
- icon="icons/stack.gif"
- id="org.eclipse.papyrus.postaction.semanticactionprovider"
- name="Set meta-element properties">
- <Priority
- name="Lowest">
- </Priority>
- </aspectToolProvider>
-</extension>
-
-<extension
- point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
- <aspectToolProvider
- class="org.eclipse.papyrus.uml.diagram.common.service.palette.DisplayAppliedStereotypeAspectActionProvider"
- description="This action modifies the list of stereotype that will be displayed for the specified element, and if they are displayed using qualified name or simple name"
- icon="icons/stereotype_display.gif"
- id="org.eclipse.papyrus.postaction.displayAppliedStereotypeactionprovider"
- name="Set list of displayed stereotypes">
- <Priority
- name="Lowest">
- </Priority>
- </aspectToolProvider>
-</extension>
-<extension
- point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
- <aspectToolProvider
- class="org.eclipse.papyrus.uml.diagram.common.service.palette.DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider"
- description="This action modifies the list of stereotype properties that will be displayed for the specified element."
- icon="icons/stereotype_display.gif"
- id="org.eclipse.papyrus.postaction.displayAppliedStereotypePropertiesInCompartmentactionprovider"
- name="Set list of displayed stereotypes properties in Compartment">
- <Priority
- name="Lowest">
- </Priority>
- </aspectToolProvider>
-</extension>
-<extension
- point="org.eclipse.papyrus.uml.pastemanager.pasteCommandProvider">
- <PasteCommandProvider
- priority="Lowest"
- realization="org.eclipse.papyrus.uml.pastemanager.service.DefaultPasteCommandProvider">
- </PasteCommandProvider>
-</extension>
-<extension
- id="update-cmd-binding"
- point="org.eclipse.ui.bindings">
- <key
- commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"
- contextId="org.eclipse.gmf.runtime.diagram.ui.diagramContext"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="M2+DEL">
+<extension
+ point="org.eclipse.papyrus.infra.core.modelListener">
+ <listener
+ description="This listener listens for profile (un)applications to update the palette"
+ name="PaletteProfileApplicationListener"
+ realization="org.eclipse.papyrus.uml.diagram.common.service.PaletteProfileApplicationListener">
+ </listener>
+</extension>
+<extension
+ point="org.eclipse.papyrus.infra.core.papyrusDiagram">
+ <actionBarContributor
+ id="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor"
+ implementingClass="org.eclipse.papyrus.uml.diagram.common.part.UMLDiagramActionBarContributor">
+ </actionBarContributor>
+</extension>
+<extension
+ point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
+ <aspectToolProvider
+ class="org.eclipse.papyrus.uml.diagram.common.service.palette.AssociationEndAspectActionProvider"
+ description="This Provider handles actions taken after association creation. It modifies the 2 properties, member ends of the created association."
+ icon="icons/obj16/Association_composite.gif"
+ id="org.eclipse.papyrus.postaction.associationendactionprovider"
+ name="Set Association ends properties">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </aspectToolProvider>
+</extension>
+<extension
+ point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
+ <aspectToolProvider
+ class="org.eclipse.papyrus.uml.diagram.common.service.palette.ChangeStereotypeDisplayAspectActionProvider"
+ description="This changes the way stereotypes are displayed in the created element. (Vertical or horizontal display, icon or text, etc.)"
+ icon="icons/stereotype_display.gif"
+ id="org.eclipse.papyrus.postaction.changeStereotypeDisplayProvider"
+ name="Set applied stereotypes appearance">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </aspectToolProvider>
+</extension>
+<extension
+ point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
+ <aspectToolProvider
+ class="org.eclipse.papyrus.uml.diagram.common.service.palette.StereotypeAspectActionProvider"
+ description="This provider creates action that applies a list of stereotypes to the given element."
+ icon="icons/stereotype.gif"
+ id="org.eclipse.papyrus.applystereotypeactionprovider"
+ name="Set list of applied stereotypes">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </aspectToolProvider>
+</extension>
+<extension
+ point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
+ <aspectToolProvider
+ class="org.eclipse.papyrus.uml.diagram.common.service.palette.SemanticAspectActionProvider"
+ description="The actions provided by this extension modify a semantic element, giving static-defined values to some of his attributes"
+ icon="icons/stack.gif"
+ id="org.eclipse.papyrus.postaction.semanticactionprovider"
+ name="Set meta-element properties">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </aspectToolProvider>
+</extension>
+
+<extension
+ point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
+ <aspectToolProvider
+ class="org.eclipse.papyrus.uml.diagram.common.service.palette.DisplayAppliedStereotypeAspectActionProvider"
+ description="This action modifies the list of stereotype that will be displayed for the specified element, and if they are displayed using qualified name or simple name"
+ icon="icons/stereotype_display.gif"
+ id="org.eclipse.papyrus.postaction.displayAppliedStereotypeactionprovider"
+ name="Set list of displayed stereotypes">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </aspectToolProvider>
+</extension>
+<extension
+ point="org.eclipse.papyrus.uml.diagram.common.aspectToolProvider">
+ <aspectToolProvider
+ class="org.eclipse.papyrus.uml.diagram.common.service.palette.DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider"
+ description="This action modifies the list of stereotype properties that will be displayed for the specified element."
+ icon="icons/stereotype_display.gif"
+ id="org.eclipse.papyrus.postaction.displayAppliedStereotypePropertiesInCompartmentactionprovider"
+ name="Set list of displayed stereotypes properties in Compartment">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </aspectToolProvider>
+</extension>
+<extension
+ point="org.eclipse.papyrus.uml.pastemanager.pasteCommandProvider">
+ <PasteCommandProvider
+ priority="Lowest"
+ realization="org.eclipse.papyrus.uml.pastemanager.service.DefaultPasteCommandProvider">
+ </PasteCommandProvider>
+</extension>
+<extension
+ id="update-cmd-binding"
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"
+ contextId="org.eclipse.gmf.runtime.diagram.ui.diagramContext"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M2+DEL">
</key>
-</extension>
- <extension
- point="org.eclipse.papyrus.infra.core.papyrusDiagram">
- <diagramCategory
- class="org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand"
- description="Create Unified Modeling Language diagrams"
- icon="icons/category_uml.gif"
- id="uml"
- label="UML">
- </diagramCategory>
- </extension>
-
-<!-- Property tester to check the nature (UML Model or Profile) of currently opened project -->
-<extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.papyrus.uml.diagram.common.util.UMLSelectionTester"
- id="org.eclipse.papyrus.UMLSelectionTester"
- namespace="org.eclipse.papyrus.UMLSelectionTester"
- properties="isUMLModel, isUMLProfile"
- type="org.eclipse.jface.viewers.ISelection">
- </propertyTester>
-</extension>
-
-<!-- Reusable test definitions verifying:
- - Papyrus is the active editor
- - The model root element is a UML Model or Profile
- -->
-<extension
- point="org.eclipse.core.expressions.definitions">
-
- <definition id="org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLModel">
- <and>
-
- <with variable="activeEditorId">
- <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"/>
- </with>
-
- <with variable="selection">
- <test property="org.eclipse.papyrus.UMLSelectionTester.isUMLModel" value="true"
- forcePluginActivation="true"/>
- </with>
-
- </and>
- </definition>
-
- <definition id="org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLProfile">
- <and>
-
- <with variable="activeEditorId">
- <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"/>
- </with>
-
- <with variable="selection">
- <test property="org.eclipse.papyrus.UMLSelectionTester.isUMLProfile" value="true"
- forcePluginActivation="true"/>
- </with>
-
- </and>
- </definition>
-</extension>
-
-<!-- The location is based on menu id defined in GMF runtime
- (see org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds and
- org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider) -->
-<extension point="org.eclipse.ui.menus">
-
- <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?endof=editMenu"
- allPopups="false">
-
- <command
- commandId="org.eclipse.ui.edit.delete"
- disabledIcon="IMG_TOOL_DELETE_DISABLED"
- icon="IMG_TOOL_DELETE"
- label="Delete Selected Element"
- style="push">
- <visibleWhen>
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- <with
- variable="selection">
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof
- value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- </instanceof>
- </iterate>
- </with>
- </and>
- </visibleWhen>
- </command>
-
- <command commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"
- icon="icons/obj16/eraser.gif"
- label="Hide Selected Element"
- style="push">
- <visibleWhen>
- <and>
- <with variable="activeEditorId">
- <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"/>
- </with>
- <with variable="selection">
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"/>
- </iterate>
- </with>
- </and>
- </visibleWhen>
- </command>
-
- <separator
- name="org.eclipse.papyrus.uml.diagram.common.commands.LoadSeparator">
- </separator>
- <command
- commandId="org.eclipse.papyrus.uml.diagram.common.commands.Load"
- icon="icons/obj16/LoadResource.gif"
- label="Load"
- style="push">
- <visibleWhen>
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- <with
- variable="selection">
- <and>
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof
- value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- </instanceof>
- </iterate>
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.infra.services.resourceloading.tester.isAllNotLoaded"
- value="true" />
- </and>
- </with>
- </and>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.papyrus.uml.diagram.common.commands.Unload"
- icon="icons/obj16/UnloadResource.gif"
- label="Unload"
- style="push">
- <visibleWhen>
- <and>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- <with
- variable="selection">
- <and>
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof
- value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- </instanceof>
- </iterate>
- <test
- forcePluginActivation="true"
- property="org.eclipse.papyrus.infra.services.resourceloading.tester.isAllLoaded"
- value="true" />
- </and>
- </with>
- </and>
- </visibleWhen>
- </command>
-
+</extension>
+ <extension
+ point="org.eclipse.papyrus.infra.core.papyrusDiagram">
+ <diagramCategory
+ class="org.eclipse.papyrus.uml.diagram.common.commands.CreateUMLModelCommand"
+ description="Create Unified Modeling Language diagrams"
+ icon="icons/category_uml.gif"
+ id="uml"
+ label="UML">
+ </diagramCategory>
+ </extension>
+
+<!-- Property tester to check the nature (UML Model or Profile) of currently opened project -->
+<extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.papyrus.uml.diagram.common.util.UMLSelectionTester"
+ id="org.eclipse.papyrus.UMLSelectionTester"
+ namespace="org.eclipse.papyrus.UMLSelectionTester"
+ properties="isUMLModel, isUMLProfile"
+ type="org.eclipse.jface.viewers.ISelection">
+ </propertyTester>
+</extension>
+
+<!-- Reusable test definitions verifying:
+ - Papyrus is the active editor
+ - The model root element is a UML Model or Profile
+ -->
+<extension
+ point="org.eclipse.core.expressions.definitions">
+
+ <definition id="org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLModel">
+ <and>
+
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"/>
+ </with>
+
+ <with variable="selection">
+ <test property="org.eclipse.papyrus.UMLSelectionTester.isUMLModel" value="true"
+ forcePluginActivation="true"/>
+ </with>
+
+ </and>
+ </definition>
+
+ <definition id="org.eclipse.papyrus.uml.diagram.common.IsPapyrusActiveWithUMLProfile">
+ <and>
+
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"/>
+ </with>
+
+ <with variable="selection">
+ <test property="org.eclipse.papyrus.UMLSelectionTester.isUMLProfile" value="true"
+ forcePluginActivation="true"/>
+ </with>
+
+ </and>
+ </definition>
+</extension>
+
+<!-- The location is based on menu id defined in GMF runtime
+ (see org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds and
+ org.eclipse.gmf.runtime.diagram.ui.providers.DiagramContributionItemProvider) -->
+<extension point="org.eclipse.ui.menus">
+
+ <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu?endof=editMenu"
+ allPopups="false">
+
+ <command
+ commandId="org.eclipse.ui.edit.delete"
+ disabledIcon="IMG_TOOL_DELETE_DISABLED"
+ icon="IMG_TOOL_DELETE"
+ label="Delete Selected Element"
+ style="push">
+ <visibleWhen>
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ <with
+ variable="selection">
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
+ </instanceof>
+ </iterate>
+ </with>
+ </and>
+ </visibleWhen>
+ </command>
+
+ <command commandId="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"
+ icon="icons/obj16/eraser.gif"
+ label="Hide Selected Element"
+ style="push">
+ <visibleWhen>
+ <and>
+ <with variable="activeEditorId">
+ <equals value="org.eclipse.papyrus.infra.core.papyrusEditor"/>
+ </with>
+ <with variable="selection">
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart"/>
+ </iterate>
+ </with>
+ </and>
+ </visibleWhen>
+ </command>
+
+ <separator
+ name="org.eclipse.papyrus.uml.diagram.common.commands.LoadSeparator">
+ </separator>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.common.commands.Load"
+ icon="icons/obj16/LoadResource.gif"
+ label="Load"
+ style="push">
+ <visibleWhen>
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ <with
+ variable="selection">
+ <and>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
+ </instanceof>
+ </iterate>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.infra.services.resourceloading.tester.isAllNotLoaded"
+ value="true" />
+ </and>
+ </with>
+ </and>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.papyrus.uml.diagram.common.commands.Unload"
+ icon="icons/obj16/UnloadResource.gif"
+ label="Unload"
+ style="push">
+ <visibleWhen>
+ <and>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ <with
+ variable="selection">
+ <and>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
+ </instanceof>
+ </iterate>
+ <test
+ forcePluginActivation="true"
+ property="org.eclipse.papyrus.infra.services.resourceloading.tester.isAllLoaded"
+ value="true" />
+ </and>
+ </with>
+ </and>
+ </visibleWhen>
+ </command>
+
</menuContribution>
-</extension>
-
-<extension point="org.eclipse.ui.commands">
-
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- defaultHandler="org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromDiagramCommandHandler"
- description="Delete the selection from diagram"
- id="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"
- name="Delete From Diagram Command">
- </command>
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- defaultHandler="org.eclipse.papyrus.uml.diagram.common.handlers.LoadHandler"
- description="Load the corresponding submodel"
- id="org.eclipse.papyrus.uml.diagram.common.commands.Load"
- name="Load">
- </command>
- <command
- categoryId="org.eclipse.papyrus.editor.category"
- defaultHandler="org.eclipse.papyrus.uml.diagram.common.handlers.UnloadHandler"
- description="Unload the corresponding submodel"
- id="org.eclipse.papyrus.uml.diagram.common.commands.Unload"
- name="Unload">
- </command>
-</extension>
-
-<extension
- point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
- <decoratorProvider
- class="org.eclipse.papyrus.uml.diagram.common.service.InheritedDecoratorProvider">
- <Priority
- name="Lowest">
- </Priority>
- <object
- class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)"
- id="NODE">
- </object>
- <context
- decoratorTargets="NODE">
- </context>
- </decoratorProvider>
-</extension>
-<extension
- point="org.eclipse.ui.services">
- <sourceProvider
- provider="org.eclipse.papyrus.uml.diagram.common.providers.ActionStateSourceProvider">
- <variable
- name="deleteInDiagram"
- priorityLevel="workbench">
- </variable>
- <variable
- name="renameNamedElement"
- priorityLevel="workbench">
- </variable>
- </sourceProvider>
-</extension>
-<extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromModelCommandHandler"
- commandId="org.eclipse.ui.edit.delete">
- <activeWhen>
- <and>
- <with
- variable="deleteInDiagram">
- <equals
- value="enabled">
- </equals>
- </with>
- <with
- variable="activeEditorId">
- <equals
- value="org.eclipse.papyrus.infra.core.papyrusEditor">
- </equals>
- </with>
- <with
- variable="selection">
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof
- value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- </instanceof>
- </iterate>
- </with>
- </and>
- </activeWhen>
- </handler>
- <handler
- class="org.eclipse.papyrus.uml.diagram.common.handlers.RenamedElementHandler"
- commandId="org.eclipse.ui.edit.rename">
- <activeWhen>
- <and>
- <with
- variable="renameNamedElement">
- <equals
- value="enabled">
- </equals>
- </with>
- </and>
- </activeWhen>
- </handler>
</extension>
-<!--Declare a property tester. The tested properties allow to enable/disable handlers which listen these properties -->
-<extension
- point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester
- class="org.eclipse.papyrus.uml.diagram.common.util.DiagramTester"
- id="org.eclipse.papyrus.uml.diagram.common.diagram.tester"
- namespace="org.eclipse.papyrus.uml.diagram.common.diagram.tester"
- properties="diagramType"
- type="org.eclipse.ui.IEditorPart">
- </propertyTester>
-</extension>
-<extension
- point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders">
- <GlobalActionHandlerProvider
- class="org.eclipse.gmf.runtime.diagram.ui.printing.providers.DiagramWithPrintGlobalActionHandlerProvider"
- id="GenericDiagramActionHandlerProvider">
- <Priority
- name="Low">
- </Priority>
- <ViewId
- id="org.eclipse.papyrus.infra.core.papyrusEditor">
- <ElementType
- class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId
- actionId="save">
- </GlobalActionId>
- <GlobalActionId
- actionId="print">
- </GlobalActionId>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- <GlobalActionHandlerProvider
- class="org.eclipse.papyrus.uml.diagram.common.providers.PapyrusGlobalActionHandlerProvider"
- id="PapyrusDiagramActionHandlerProvider">
- <Priority
- name="Low">
- </Priority>
- <ViewId
- id="org.eclipse.papyrus.infra.core.papyrusEditor">
- <ElementType
- class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId
- actionId="delete">
- </GlobalActionId>
- <GlobalActionId
- actionId="cut">
- </GlobalActionId>
- <GlobalActionId
- actionId="copy">
- </GlobalActionId>
- <GlobalActionId
- actionId="paste">
- </GlobalActionId>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
- <GlobalActionHandlerProvider
- class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
- id="IDEDiagramActionHandlerProvider">
- <Priority
- name="Low">
- </Priority>
- <ViewId
- id="org.eclipse.papyrus.infra.core.papyrusEditor">
- <ElementType
- class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
- <GlobalActionId
- actionId="bookmark">
- </GlobalActionId>
- </ElementType>
- </ViewId>
- </GlobalActionHandlerProvider>
+
+<extension point="org.eclipse.ui.commands">
+
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromDiagramCommandHandler"
+ description="Delete the selection from diagram"
+ id="org.eclipse.papyrus.uml.diagram.common.commands.DeleteFromDiagram"
+ name="Delete From Diagram Command">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.uml.diagram.common.handlers.LoadHandler"
+ description="Load the corresponding submodel"
+ id="org.eclipse.papyrus.uml.diagram.common.commands.Load"
+ name="Load">
+ </command>
+ <command
+ categoryId="org.eclipse.papyrus.editor.category"
+ defaultHandler="org.eclipse.papyrus.uml.diagram.common.handlers.UnloadHandler"
+ description="Unload the corresponding submodel"
+ id="org.eclipse.papyrus.uml.diagram.common.commands.Unload"
+ name="Unload">
+ </command>
+</extension>
+
+<extension
+ point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
+ <decoratorProvider
+ class="org.eclipse.papyrus.uml.diagram.common.service.InheritedDecoratorProvider">
+ <Priority
+ name="Lowest">
+ </Priority>
+ <object
+ class="org.eclipse.gmf.runtime.notation.Node(org.eclipse.gmf.runtime.notation)"
+ id="NODE">
+ </object>
+ <context
+ decoratorTargets="NODE">
+ </context>
+ </decoratorProvider>
+</extension>
+<extension
+ point="org.eclipse.ui.services">
+ <sourceProvider
+ provider="org.eclipse.papyrus.uml.diagram.common.providers.ActionStateSourceProvider">
+ <variable
+ name="deleteInDiagram"
+ priorityLevel="workbench">
+ </variable>
+ <variable
+ name="renameNamedElement"
+ priorityLevel="workbench">
+ </variable>
+ </sourceProvider>
+</extension>
+<extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromModelCommandHandler"
+ commandId="org.eclipse.ui.edit.delete">
+ <activeWhen>
+ <and>
+ <with
+ variable="deleteInDiagram">
+ <equals
+ value="enabled">
+ </equals>
+ </with>
+ <with
+ variable="activeEditorId">
+ <equals
+ value="org.eclipse.papyrus.infra.core.papyrusEditor">
+ </equals>
+ </with>
+ <with
+ variable="selection">
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
+ </instanceof>
+ </iterate>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+ <handler
+ class="org.eclipse.papyrus.uml.diagram.common.handlers.RenamedElementHandler"
+ commandId="org.eclipse.ui.edit.rename">
+ <activeWhen>
+ <and>
+ <with
+ variable="renameNamedElement">
+ <equals
+ value="enabled">
+ </equals>
+ </with>
+ </and>
+ </activeWhen>
+ </handler>
+</extension>
+<!--Declare a property tester. The tested properties allow to enable/disable handlers which listen these properties -->
+<extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.papyrus.uml.diagram.common.util.DiagramTester"
+ id="org.eclipse.papyrus.uml.diagram.common.diagram.tester"
+ namespace="org.eclipse.papyrus.uml.diagram.common.diagram.tester"
+ properties="diagramType"
+ type="org.eclipse.ui.IEditorPart">
+ </propertyTester>
+</extension>
+<extension
+ point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders">
+ <GlobalActionHandlerProvider
+ class="org.eclipse.gmf.runtime.diagram.ui.printing.providers.DiagramWithPrintGlobalActionHandlerProvider"
+ id="GenericDiagramActionHandlerProvider">
+ <Priority
+ name="Low">
+ </Priority>
+ <ViewId
+ id="org.eclipse.papyrus.infra.core.papyrusEditor">
+ <ElementType
+ class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
+ <GlobalActionId
+ actionId="save">
+ </GlobalActionId>
+ <GlobalActionId
+ actionId="print">
+ </GlobalActionId>
+ </ElementType>
+ </ViewId>
+ </GlobalActionHandlerProvider>
+ <GlobalActionHandlerProvider
+ class="org.eclipse.papyrus.uml.diagram.common.providers.PapyrusGlobalActionHandlerProvider"
+ id="PapyrusDiagramActionHandlerProvider">
+ <Priority
+ name="Low">
+ </Priority>
+ <ViewId
+ id="org.eclipse.papyrus.infra.core.papyrusEditor">
+ <ElementType
+ class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
+ <GlobalActionId
+ actionId="delete">
+ </GlobalActionId>
+ <GlobalActionId
+ actionId="cut">
+ </GlobalActionId>
+ <GlobalActionId
+ actionId="copy">
+ </GlobalActionId>
+ <GlobalActionId
+ actionId="paste">
+ </GlobalActionId>
+ </ElementType>
+ </ViewId>
+ </GlobalActionHandlerProvider>
+ <GlobalActionHandlerProvider
+ class="org.eclipse.gmf.runtime.diagram.ui.providers.ide.providers.DiagramIDEGlobalActionHandlerProvider"
+ id="IDEDiagramActionHandlerProvider">
+ <Priority
+ name="Low">
+ </Priority>
+ <ViewId
+ id="org.eclipse.papyrus.infra.core.papyrusEditor">
+ <ElementType
+ class="org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart">
+ <GlobalActionId
+ actionId="bookmark">
+ </GlobalActionId>
+ </ElementType>
+ </ViewId>
+ </GlobalActionHandlerProvider>
+</extension>
+<extension
+ point="org.eclipse.papyrus.infra.hyperlink.tab.registration">
+ <hyperlinktab
+ position="250"
+ tab="org.eclipse.papyrus.infra.gmfdiag.hyperlink.ui.LocalDefaultLinkDiagramTab"
+ tabId="org.eclipse.papyrus.uml.diagram.common.heuristictab">
+ </hyperlinktab>
+</extension>
+<extension
+ point="org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders">
+ <editpolicyProvider
+ class="org.eclipse.papyrus.uml.diagram.common.providers.CommentEditPolicyProvider">
+ <Priority
+ name="Lowest">
+ </Priority>
+ </editpolicyProvider>
</extension>
-<extension
- point="org.eclipse.papyrus.infra.hyperlink.tab.registration">
- <hyperlinktab
- position="250"
- tab="org.eclipse.papyrus.infra.gmfdiag.hyperlink.ui.LocalDefaultLinkDiagramTab"
- tabId="org.eclipse.papyrus.uml.diagram.common.heuristictab">
- </hyperlinktab>
-</extension>
-<extension
- point="org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders">
- <editpolicyProvider
- class="org.eclipse.papyrus.uml.diagram.common.providers.CommentEditPolicyProvider">
- <Priority
- name="Lowest">
- </Priority>
- </editpolicyProvider>
-</extension>
-</plugin>
+</plugin>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/aspectToolProvider.exsd b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/aspectToolProvider.exsd
index e907d717353..959b8cd1c03 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/aspectToolProvider.exsd
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/aspectToolProvider.exsd
@@ -1,188 +1,188 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.uml.diagram.common" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.papyrus.uml.diagram.common" id="aspectToolProvider" name="Aspect Tool Provider"/>
- </appInfo>
- <documentation>
- This extension point provides the mechanism to add providers that create aspect actions on creation tools
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="aspectToolProvider"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="aspectToolProvider">
- <complexType>
- <sequence>
- <element ref="Priority"/>
- </sequence>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- name of this factory, used for example in menus
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
- unique identifier for this factory
- </documentation>
- </annotation>
- </attribute>
- <attribute name="description" type="string">
- <annotation>
- <documentation>
- description of the behavior of this factory
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- Icon used when displaying this factory
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- This is the class that implements the provider.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="Priority">
- <annotation>
- <documentation>
- The description for the priority of the palette provider
- </documentation>
- </annotation>
- <complexType>
- <attribute name="name" use="required">
- <annotation>
- <documentation>
- The priority of the provider. It can be one of the following values:
-[Lowest, Low, Medium, High, Highest]. Consideration of dependencies has to be done when choosing the priority. A provider that adds contributions to paths (menus | groups) contributed by other providers has to have a higher priority than them. Similarly, a provider that contributes palette entries that have been predefined by other providers has to have a higher priority than them.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="Lowest">
- </enumeration>
- <enumeration value="Low">
- </enumeration>
- <enumeration value="Medium">
- </enumeration>
- <enumeration value="High">
- </enumeration>
- <enumeration value="Highest">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 0.7.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- See this plugin for some examples
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- /*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.uml.diagram.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.papyrus.uml.diagram.common" id="aspectToolProvider" name="Aspect Tool Provider"/>
+ </appInfo>
+ <documentation>
+ This extension point provides the mechanism to add providers that create aspect actions on creation tools
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="aspectToolProvider"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="aspectToolProvider">
+ <complexType>
+ <sequence>
+ <element ref="Priority"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ name of this factory, used for example in menus
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ unique identifier for this factory
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="description" type="string">
+ <annotation>
+ <documentation>
+ description of the behavior of this factory
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+ Icon used when displaying this factory
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ This is the class that implements the provider.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="Priority">
+ <annotation>
+ <documentation>
+ The description for the priority of the palette provider
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" use="required">
+ <annotation>
+ <documentation>
+ The priority of the provider. It can be one of the following values:
+[Lowest, Low, Medium, High, Highest]. Consideration of dependencies has to be done when choosing the priority. A provider that adds contributions to paths (menus | groups) contributed by other providers has to have a higher priority than them. Similarly, a provider that contributes palette entries that have been predefined by other providers has to have a higher priority than them.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="Lowest">
+ </enumeration>
+ <enumeration value="Low">
+ </enumeration>
+ <enumeration value="Medium">
+ </enumeration>
+ <enumeration value="High">
+ </enumeration>
+ <enumeration value="Highest">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.7.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ See this plugin for some examples
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ /*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteCustomization.exsd b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteCustomization.exsd
index 863d3f3bcf3..b6b09ed6ff6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteCustomization.exsd
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteCustomization.exsd
@@ -1,102 +1,102 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.uml.diagram.common" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.papyrus.uml.diagram.common" id="paletteCustomization" name="Palette customization"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <choice>
- <element ref="customizer"/>
- </choice>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="customizer">
- <complexType>
- <attribute name="customizerDialog" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute kind="java"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.uml.diagram.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.papyrus.uml.diagram.common" id="paletteCustomization" name="Palette customization"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <choice>
+ <element ref="customizer"/>
+ </choice>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="customizer">
+ <complexType>
+ <attribute name="customizerDialog" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteDefinition.exsd b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteDefinition.exsd
index 761adcf7df9..21d6e5885ab 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteDefinition.exsd
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/schema/paletteDefinition.exsd
@@ -1,225 +1,225 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.papyrus.uml.diagram.common" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.papyrus.uml.diagram.common" id="paletteDefinition" name="PaletteDefinition"/>
- </appInfo>
- <documentation>
- This extension point describes the content of a palette. It completes the information given by the standard GMF extension point.
- </documentation>
- </annotation>
-
- <include schemaLocation="schema://org.eclipse.papyrus.infra.gmfdiag.common/schema/nestedEditor.exsd"/>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="paletteDefinition"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="paletteDefinition">
- <complexType>
- <sequence>
- <element ref="Priority"/>
- <element ref="editor" minOccurs="0" maxOccurs="1"/>
- </sequence>
- <attribute name="name" type="string" use="required">
- <annotation>
- <documentation>
- Name of this palette definition
- </documentation>
- </annotation>
- </attribute>
- <attribute name="ID" type="string" use="required">
- <annotation>
- <documentation>
- ID of this palette definition. Must be unique.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="provider" type="string">
- <annotation>
- <documentation>
- provider for this palette definition
- </documentation>
- </annotation>
- </attribute>
- <attribute name="path" type="string" use="required">
- <annotation>
- <documentation>
- path of the xml file in charge of this palette definition
- </documentation>
- </annotation>
- </attribute>
- <attribute name="icon" type="string">
- <annotation>
- <documentation>
- Icon for this palette definition
- </documentation>
- <appInfo>
- <meta.attribute kind="resource"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The provider class.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="Priority">
- <annotation>
- <documentation>
- The description for the priority of the palette provider
- </documentation>
- </annotation>
- <complexType>
- <attribute name="name" use="required">
- <annotation>
- <documentation>
- The priority of the provider. It can be one of the following values:
-{Lowest, Low, Medium, High, Highest}. Consideration of dependencies has to be done when choosing the priority. A provider that adds contributions to paths (menus | groups) contributed by other providers has to have a higher priority than them. Similarly, a provider that contributes palette entries that have been predefined by other providers has to have a higher priority than them.
- </documentation>
- </annotation>
- <simpleType>
- <restriction base="string">
- <enumeration value="Lowest">
- </enumeration>
- <enumeration value="Low">
- </enumeration>
- <enumeration value="Medium">
- </enumeration>
- <enumeration value="High">
- </enumeration>
- <enumeration value="Highest">
- </enumeration>
- </restriction>
- </simpleType>
- </attribute>
- </complexType>
- </element>
-
- <element name="editor">
- <annotation>
- <documentation>
- A descriptor for the targetted editor. The editor is not required when predefining palette entries.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
- The published id of the targetted editor. Although this field is optional, at least one of the two fields (id &amp; class) has to be specified.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string">
- <annotation>
- <documentation>
- The fully qualified name of a class/interface that is assignable from or adaptable to the target editor. The name could be followed (between paranthesis &quot;()&quot;) by the id of a plugin whose classloader is able to load that class. The finaly syntax is:
-className[(plugin id)]?
-
-Although this field is optional, at least one of the two fields (id &amp; class) has to be specified.
- </documentation>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 0.7.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- See standard Papyrus diagram editors.
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="copyright"/>
- </appInfo>
- <documentation>
- /*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
- </documentation>
- </annotation>
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.papyrus.uml.diagram.common" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.papyrus.uml.diagram.common" id="paletteDefinition" name="PaletteDefinition"/>
+ </appInfo>
+ <documentation>
+ This extension point describes the content of a palette. It completes the information given by the standard GMF extension point.
+ </documentation>
+ </annotation>
+
+ <include schemaLocation="schema://org.eclipse.papyrus.infra.gmfdiag.common/schema/nestedEditor.exsd"/>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="paletteDefinition"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="paletteDefinition">
+ <complexType>
+ <sequence>
+ <element ref="Priority"/>
+ <element ref="editor" minOccurs="0" maxOccurs="1"/>
+ </sequence>
+ <attribute name="name" type="string" use="required">
+ <annotation>
+ <documentation>
+ Name of this palette definition
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="ID" type="string" use="required">
+ <annotation>
+ <documentation>
+ ID of this palette definition. Must be unique.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="provider" type="string">
+ <annotation>
+ <documentation>
+ provider for this palette definition
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="path" type="string" use="required">
+ <annotation>
+ <documentation>
+ path of the xml file in charge of this palette definition
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="icon" type="string">
+ <annotation>
+ <documentation>
+ Icon for this palette definition
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+ The provider class.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="Priority">
+ <annotation>
+ <documentation>
+ The description for the priority of the palette provider
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="name" use="required">
+ <annotation>
+ <documentation>
+ The priority of the provider. It can be one of the following values:
+{Lowest, Low, Medium, High, Highest}. Consideration of dependencies has to be done when choosing the priority. A provider that adds contributions to paths (menus | groups) contributed by other providers has to have a higher priority than them. Similarly, a provider that contributes palette entries that have been predefined by other providers has to have a higher priority than them.
+ </documentation>
+ </annotation>
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="Lowest">
+ </enumeration>
+ <enumeration value="Low">
+ </enumeration>
+ <enumeration value="Medium">
+ </enumeration>
+ <enumeration value="High">
+ </enumeration>
+ <enumeration value="Highest">
+ </enumeration>
+ </restriction>
+ </simpleType>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="editor">
+ <annotation>
+ <documentation>
+ A descriptor for the targetted editor. The editor is not required when predefining palette entries.
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+ The published id of the targetted editor. Although this field is optional, at least one of the two fields (id &amp; class) has to be specified.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string">
+ <annotation>
+ <documentation>
+ The fully qualified name of a class/interface that is assignable from or adaptable to the target editor. The name could be followed (between paranthesis &quot;()&quot;) by the id of a plugin whose classloader is able to load that class. The finaly syntax is:
+className[(plugin id)]?
+
+Although this field is optional, at least one of the two fields (id &amp; class) has to be specified.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.7.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ See standard Papyrus diagram editors.
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+ /*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Activator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Activator.java
index 14378d50850..b664e884f99 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Activator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/Activator.java
@@ -1,594 +1,594 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.papyrus.infra.core.log.LogHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.OverlayVisibilityIcon;
-import org.eclipse.papyrus.uml.diagram.common.providers.AlternativeUMLItemProviderAdapterFactory;
-import org.eclipse.papyrus.uml.diagram.common.util.ColorManager;
-import org.eclipse.papyrus.uml.diagram.common.util.FontManager;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
-import org.eclipse.papyrus.uml.tools.utils.ImageUtil;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.VisibilityKind;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin {
-
- /** The Constant ID. */
- public static final String ID = "org.eclipse.papyrus.uml.diagram.common";
-
- /** Shared instance of the plug-in (singleton pattern) */
- private static Activator plugin;
-
- /** Logging helper */
- public static LogHelper log;
-
- /** The Constant UML_VIS_ICONS_16x16. */
- public static final String UML_VIS_ICONS_16x16 = "icons/obj16/";
-
- /** Default image. */
- public static final String DEFAULT_IMAGE = "icons/papyrus/PapyrusLogo16x16.gif";
-
- /** Color manager. */
- protected static ColorManager colorManager = /* new ColorManager(); */null;
-
- /** Font manager. */
- protected static FontManager fontManager = /* new FontManager(); */null;
-
- /** left Stereotype delimiters ('Guillemets francais'). */
- public static String ST_LEFT = String.valueOf("\u00AB");
-
- /** Right Stereotype delimiters ('Guillemets francais'). */
- public static String ST_RIGHT = String.valueOf("\u00BB");
-
- /**
- * The constructor
- */
- public Activator() {
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault() {
- return plugin;
- }
-
- /**
- * Return the color manager. Initialize it if required.
- *
- * @return
- */
- public static ColorManager getColorManager() {
- if(colorManager == null) {
- colorManager = new ColorManager();
- }
- return colorManager;
- }
-
- /**
- * Return the font managet. Initialize it if required.
- *
- * @return
- */
- public static FontManager getFontManager() {
- if(fontManager == null) {
- fontManager = new FontManager();
- }
- return fontManager;
- }
-
- /**
- * Returns an image descriptor for the image file at the given plug-in
- * relative path.
- *
- * @param path
- * the path for the image file
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
- }
-
- public static Image getImage(String key) {
- return getImage(key, "");
- }
-
- /**
- * Returns an <code>org.eclipse.swt.graphics.Image</code> identified by its
- * key.<BR>
- * By default, it returns a default image. This image is the image placed in
- * the directory <em>resources/icons/default.gif</em>
- *
- * @param key
- * the key of the image
- * @param visKey
- * must not be null : "" || "public" || "private" ...
- * @return the Image
- */
- public static Image getImage(String key, String visKey) {
-
- String image_id = key;
- if(!"".equals(visKey)) {
- image_id = image_id + "::" + visKey;
- }
-
- ImageRegistry registry = getDefault().getImageRegistry();
- Image image = registry.get(image_id);
-
- if(image == null) { // Image not yet in registry
-
- // Get the descriptor of the image without visibility
- ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(ID, key);
-
- if(!"".equals(visKey)) { // Add visibility overlay
-
- Image initialImage = desc.createImage();
- getDefault();
- ImageDescriptor visDesc = Activator.getImageDescriptor(UML_VIS_ICONS_16x16 + "VisibilityKind_" + visKey + ".gif");
-
- // Overlay custom image over base image
- OverlayVisibilityIcon overlayIcon = new OverlayVisibilityIcon(initialImage, visDesc);
- image = overlayIcon.getImage();
-
- registry.put(image_id, image);
-
- } else {
- registry.put(key, desc);
- }
-
- image = registry.get(image_id);
-
- }
-
- if((image == null) && !image_id.equals(DEFAULT_IMAGE)) {
- image = getImage(DEFAULT_IMAGE);
- }
-
- return image;
- }
-
- /**
- * This method returns an <code>org.eclipse.swt.graphics.Image</code> identified by its pluginId and iconPath.<BR>
- *
- * By default, it returns a default image. This image is the image placed in
- * the directory <em>resources/icons/default.gif</em>
- *
- * @param pluginId
- * id of plugin
- * @param iconpPath
- * the path of the icon image relative to the plugin
- * @return the Image
- */
- public static Image getPluginIconImage(String pluginId, String iconPath) {
- String key = pluginId + iconPath;
- ImageRegistry registry = getDefault().getImageRegistry();
- Image image = registry.get(key);
-
- if(image == null) {
-
- ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath);
-
- registry.put(key, desc);
- image = registry.get(key);
-
- }
- if((image == null) && !iconPath.equals(DEFAULT_IMAGE)) {
- image = getImage(DEFAULT_IMAGE);
- }
-
- return image;
- }
-
- /**
- * This method returns an <code>org.eclipse.swt.graphics.Image</code> identified by its pluginId and image Descriptor.<BR>
- *
- * By default, it returns a default image. This image is the image placed in
- * the directory <em>resources/icons/default.gif</em>
- *
- * @param pluginId
- * id of plugin
- * @param descriptor
- * the image descriptor of the image
- * @return the Image
- */
- public static Image getPluginIconImage(String pluginId, ImageDescriptor descriptor) {
- String key = pluginId + descriptor;
- ImageRegistry registry = getDefault().getImageRegistry();
- Image image = registry.get(key);
-
- if(image == null) {
-
- registry.put(key, descriptor);
- image = registry.get(key);
-
- }
- return image;
- }
-
- /**
- * this method returns the shape image that represents the first applied
- * stereotype.
- *
- * @param elt
- * the stereotyped element
- * @return {@link image} of the shape
- */
- public static Image getShapeElement(Element elt) {
- // getStereotypeImage can return null
- org.eclipse.uml2.uml.Image shape = ElementUtil.getStereotypeImage(elt, "shape");
- if(shape != null) {
- return getImageInRegistry(shape, null);
- } else {
- return null;
- }
- }
-
- /**
- * this method returns the icon image that represents the first applied
- * stereotype on the element.
- *
- * @param element
- * The element for which we will retrieve the stereotype icon
- * @return
- * The element's first applied stereotype's Image
- */
- public static Image getIconElement(Element element) {
- return getIconElement(element, false);
- }
-
- /**
- * this method returns the icon image that represents the first applied
- * stereotype.
- *
- * @param element
- * the stereotyped element
- * @return {@link image} of the icon
- */
- public static Image getIconElement(Element element, boolean withVisibilityDecorator) {
-
- List<Stereotype> stereotypeList = element.getAppliedStereotypes();
- if(stereotypeList == null || stereotypeList.isEmpty()) {
- return null;
- }
- return getIconElement(element, stereotypeList.get(0), withVisibilityDecorator);
- }
-
- /**
- * this method returns the collection of icon images that represents the
- * applied stereotypes.
- *
- * @param elt
- * the stereotyped element
- * @param stereotypes
- * the collection of stereotypes which icon has to be displayed
- * @param kind
- * the kind of display "icon" or "shape"
- * @return {@link image} of the icon
- */
- public static Collection<Image> getIconElements(Element elt, Collection<Stereotype> stereotypes, boolean withVisibilityDecorator) {
- Collection<Image> images = new ArrayList<Image>();
- VisibilityKind vis = null;
- if((elt instanceof NamedElement) && (withVisibilityDecorator)) {
- vis = ((NamedElement)elt).getVisibility();
- }
-
- // look in each stereotype and get the image for each of them
- for(Stereotype stereotype : stereotypes) {
- // getStereotypeImage can return null
- org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "icon");
- if(icon != null) {
- images.add(getImageInRegistry(icon, vis));
- }
- }
- return images;
- }
-
- /**
- * this method returns the icon image that represents the first applied
- * stereotype.
- *
- * @param elt
- * the stereotyped element
- * @param stereotype
- * the stereotype which icon has to be displayed
- * @param kind
- * the kind of display "icon" or "shape"
- * @return {@link image} of the icon
- */
- public static Image getIconElement(Element elt, Stereotype stereotype, boolean withVisibilityDecorator) {
-
- VisibilityKind vis = null;
- if((elt instanceof NamedElement) && (withVisibilityDecorator)) {
-
- vis = ((NamedElement)elt).getVisibility();
- }
-
- // getStereotypeImage can return null
- org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "icon");
- if(icon != null) {
- return getImageInRegistry(icon, vis);
- } else {
- return null;
- }
- }
-
- /** get the imageassociated to a image uml element **/
- public static Image getShape(Element elt, Stereotype stereotype, boolean withVisibilityDecorator) {
-
- VisibilityKind vis = null;
- if((elt instanceof NamedElement) && (withVisibilityDecorator)) {
-
- vis = ((NamedElement)elt).getVisibility();
- }
-
- // getStereotypeImage can return null
- org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "shape");
- if(icon != null) {
- return getImageInRegistry(icon, vis);
- } else {
- return null;
- }
- }
-
- /**
- * Find the image (SWT) in registry Store image in registry if it is not
- * found
- *
- * @param umlImage
- * to retrieve as SWT Image in registry
- * @return the stored SWT image
- */
- public static Image getImageInRegistry(org.eclipse.uml2.uml.Image umlImage, VisibilityKind visibility) {
- // Retrieve registry
- ImageRegistry papyrusRegistry = getDefault().getImageRegistry();
-
- // Get image id for registry
- String image_id = ImageUtil.getImageId(umlImage);
- if(visibility != null) {
- image_id = image_id + "_" + visibility.getLiteral();
- }
-
- // Get SWT image for shape in the registry
- Image image = papyrusRegistry.get(image_id);
-
- // If image was not found in registry,
- // try to find an image and to update registry
- if(image == null) {
-
- try {
- // Try to retrieve image from UML Image content property
- image = ImageUtil.getContent(umlImage);
- } catch (Exception e) {
- // Activator.log.error(e);
- }
-
- // If no image was found in Content
- // Try to retrieve image from UML Image location property
- if(image == null) {
- image = ImageUtil.getImageFromLocation(umlImage);
- }
-
- // Add visibility decorator
- if(visibility != null) {
-
- getDefault();
- ImageDescriptor visDesc = Activator.getImageDescriptor(UML_VIS_ICONS_16x16 + "VisibilityKind_" + visibility.getLiteral() + ".gif");
-
- // Overlay custom image over base image
- OverlayVisibilityIcon overlayIcon = new OverlayVisibilityIcon(image, visDesc);
- image = overlayIcon.getImage();
- }
-
- if(image != null) {
- // Store image in registry
- ImageData imdata = image.getImageData();
- papyrusRegistry.put(image_id, ImageDescriptor.createFromImageData(imdata));
- image = papyrusRegistry.get(image_id);
- }
- }
-
- return image;
- }
-
- /** The Constant DIAGRAM_PREFERENCES_HINT. */
- public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
-
- /** The adapter factory. */
- private ComposedAdapterFactory adapterFactory;
-
- /**
- * Start.
- *
- * @param context
- * the context
- *
- * @throws Exception
- * the exception
- *
- * @generated
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
- plugin = this;
- log = new LogHelper(plugin);
- }
-
- /**
- * Stop.
- *
- * @param context
- * the context
- *
- * @throws Exception
- * the exception
- *
- * @generated
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- log = null;
- plugin = null;
- }
-
- /**
- * Log error.
- *
- * @param error
- * the error
- */
- public void logError(String error) {
- logError(error, null);
- }
-
- /**
- * Log error.
- *
- * @param throwable
- * actual error or null could be passed
- * @param error
- * the error
- */
- public void logError(String error, Throwable throwable) {
- if(error == null && throwable != null) {
- error = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.ERROR, Activator.ID, IStatus.OK, error, throwable));
- debug(error, throwable);
- }
-
- /**
- * Log info.
- *
- * @param message
- * the message
- */
- public void logInfo(String message) {
- logInfo(message, null);
- }
-
- /**
- * Log info.
- *
- * @param throwable
- * actual error or null could be passed
- * @param message
- * the message
- */
- public void logInfo(String message, Throwable throwable) {
- if(message == null && throwable != null) {
- message = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.INFO, Activator.ID, IStatus.OK, message, throwable));
- debug(message, throwable);
- }
-
- public void logWarning(String warning, Throwable throwable) {
- if(warning == null && throwable != null) {
- warning = throwable.getMessage();
- }
- getLog().log(new Status(IStatus.WARNING, ID, IStatus.OK, warning, throwable));
- }
-
- /**
- * Debug.
- *
- * @param message
- * the message
- * @param throwable
- * the throwable
- */
- private void debug(String message, Throwable throwable) {
- if(!isDebugging()) {
- return;
- }
- if(message != null) {
- System.err.println(message);
- }
- if(throwable != null) {
- throwable.printStackTrace();
- }
- }
-
- /**
- * Creates the adapter factory.
- *
- * @return the composed adapter factory
- */
- protected ComposedAdapterFactory createAdapterFactory() {
- List factories = new ArrayList();
- fillItemProviderFactories(factories);
- return new ComposedAdapterFactory(factories);
- }
-
- /**
- * Use alternative UMLItemProviderAdapterFactory insteadof
- * UMLItemProviderAdapterFactory.
- *
- * @param factories
- * the factories
- *
- * @see org.eclipse.emf.edit.provider.ComposedAdapterFactory#getFactoryForTypes(java.util.Collection)
- */
- protected void fillItemProviderFactories(List factories) {
- // custom icons for diagram elements
- factories.add(new AlternativeUMLItemProviderAdapterFactory(getPreferenceStore()));
-
- factories.add(new UMLItemProviderAdapterFactory());
- factories.add(new EcoreItemProviderAdapterFactory());
- factories.add(new ResourceItemProviderAdapterFactory());
- factories.add(new ReflectiveItemProviderAdapterFactory());
- }
-
- /**
- * Gets the item providers adapter factory.
- *
- * @return the item providers adapter factory
- */
- public AdapterFactory getItemProvidersAdapterFactory() {
- if(adapterFactory == null) {
- adapterFactory = createAdapterFactory();
- }
- return adapterFactory;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.provider.EcoreItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
+import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.OverlayVisibilityIcon;
+import org.eclipse.papyrus.uml.diagram.common.providers.AlternativeUMLItemProviderAdapterFactory;
+import org.eclipse.papyrus.uml.diagram.common.util.ColorManager;
+import org.eclipse.papyrus.uml.diagram.common.util.FontManager;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.papyrus.uml.tools.utils.ImageUtil;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.VisibilityKind;
+import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ /** The Constant ID. */
+ public static final String ID = "org.eclipse.papyrus.uml.diagram.common";
+
+ /** Shared instance of the plug-in (singleton pattern) */
+ private static Activator plugin;
+
+ /** Logging helper */
+ public static LogHelper log;
+
+ /** The Constant UML_VIS_ICONS_16x16. */
+ public static final String UML_VIS_ICONS_16x16 = "icons/obj16/";
+
+ /** Default image. */
+ public static final String DEFAULT_IMAGE = "icons/papyrus/PapyrusLogo16x16.gif";
+
+ /** Color manager. */
+ protected static ColorManager colorManager = /* new ColorManager(); */null;
+
+ /** Font manager. */
+ protected static FontManager fontManager = /* new FontManager(); */null;
+
+ /** left Stereotype delimiters ('Guillemets francais'). */
+ public static String ST_LEFT = String.valueOf("\u00AB");
+
+ /** Right Stereotype delimiters ('Guillemets francais'). */
+ public static String ST_RIGHT = String.valueOf("\u00BB");
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Return the color manager. Initialize it if required.
+ *
+ * @return
+ */
+ public static ColorManager getColorManager() {
+ if(colorManager == null) {
+ colorManager = new ColorManager();
+ }
+ return colorManager;
+ }
+
+ /**
+ * Return the font managet. Initialize it if required.
+ *
+ * @return
+ */
+ public static FontManager getFontManager() {
+ if(fontManager == null) {
+ fontManager = new FontManager();
+ }
+ return fontManager;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in
+ * relative path.
+ *
+ * @param path
+ * the path for the image file
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin(ID, path);
+ }
+
+ public static Image getImage(String key) {
+ return getImage(key, "");
+ }
+
+ /**
+ * Returns an <code>org.eclipse.swt.graphics.Image</code> identified by its
+ * key.<BR>
+ * By default, it returns a default image. This image is the image placed in
+ * the directory <em>resources/icons/default.gif</em>
+ *
+ * @param key
+ * the key of the image
+ * @param visKey
+ * must not be null : "" || "public" || "private" ...
+ * @return the Image
+ */
+ public static Image getImage(String key, String visKey) {
+
+ String image_id = key;
+ if(!"".equals(visKey)) {
+ image_id = image_id + "::" + visKey;
+ }
+
+ ImageRegistry registry = getDefault().getImageRegistry();
+ Image image = registry.get(image_id);
+
+ if(image == null) { // Image not yet in registry
+
+ // Get the descriptor of the image without visibility
+ ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(ID, key);
+
+ if(!"".equals(visKey)) { // Add visibility overlay
+
+ Image initialImage = desc.createImage();
+ getDefault();
+ ImageDescriptor visDesc = Activator.getImageDescriptor(UML_VIS_ICONS_16x16 + "VisibilityKind_" + visKey + ".gif");
+
+ // Overlay custom image over base image
+ OverlayVisibilityIcon overlayIcon = new OverlayVisibilityIcon(initialImage, visDesc);
+ image = overlayIcon.getImage();
+
+ registry.put(image_id, image);
+
+ } else {
+ registry.put(key, desc);
+ }
+
+ image = registry.get(image_id);
+
+ }
+
+ if((image == null) && !image_id.equals(DEFAULT_IMAGE)) {
+ image = getImage(DEFAULT_IMAGE);
+ }
+
+ return image;
+ }
+
+ /**
+ * This method returns an <code>org.eclipse.swt.graphics.Image</code> identified by its pluginId and iconPath.<BR>
+ *
+ * By default, it returns a default image. This image is the image placed in
+ * the directory <em>resources/icons/default.gif</em>
+ *
+ * @param pluginId
+ * id of plugin
+ * @param iconpPath
+ * the path of the icon image relative to the plugin
+ * @return the Image
+ */
+ public static Image getPluginIconImage(String pluginId, String iconPath) {
+ String key = pluginId + iconPath;
+ ImageRegistry registry = getDefault().getImageRegistry();
+ Image image = registry.get(key);
+
+ if(image == null) {
+
+ ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath);
+
+ registry.put(key, desc);
+ image = registry.get(key);
+
+ }
+ if((image == null) && !iconPath.equals(DEFAULT_IMAGE)) {
+ image = getImage(DEFAULT_IMAGE);
+ }
+
+ return image;
+ }
+
+ /**
+ * This method returns an <code>org.eclipse.swt.graphics.Image</code> identified by its pluginId and image Descriptor.<BR>
+ *
+ * By default, it returns a default image. This image is the image placed in
+ * the directory <em>resources/icons/default.gif</em>
+ *
+ * @param pluginId
+ * id of plugin
+ * @param descriptor
+ * the image descriptor of the image
+ * @return the Image
+ */
+ public static Image getPluginIconImage(String pluginId, ImageDescriptor descriptor) {
+ String key = pluginId + descriptor;
+ ImageRegistry registry = getDefault().getImageRegistry();
+ Image image = registry.get(key);
+
+ if(image == null) {
+
+ registry.put(key, descriptor);
+ image = registry.get(key);
+
+ }
+ return image;
+ }
+
+ /**
+ * this method returns the shape image that represents the first applied
+ * stereotype.
+ *
+ * @param elt
+ * the stereotyped element
+ * @return {@link image} of the shape
+ */
+ public static Image getShapeElement(Element elt) {
+ // getStereotypeImage can return null
+ org.eclipse.uml2.uml.Image shape = ElementUtil.getStereotypeImage(elt, "shape");
+ if(shape != null) {
+ return getImageInRegistry(shape, null);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * this method returns the icon image that represents the first applied
+ * stereotype on the element.
+ *
+ * @param element
+ * The element for which we will retrieve the stereotype icon
+ * @return
+ * The element's first applied stereotype's Image
+ */
+ public static Image getIconElement(Element element) {
+ return getIconElement(element, false);
+ }
+
+ /**
+ * this method returns the icon image that represents the first applied
+ * stereotype.
+ *
+ * @param element
+ * the stereotyped element
+ * @return {@link image} of the icon
+ */
+ public static Image getIconElement(Element element, boolean withVisibilityDecorator) {
+
+ List<Stereotype> stereotypeList = element.getAppliedStereotypes();
+ if(stereotypeList == null || stereotypeList.isEmpty()) {
+ return null;
+ }
+ return getIconElement(element, stereotypeList.get(0), withVisibilityDecorator);
+ }
+
+ /**
+ * this method returns the collection of icon images that represents the
+ * applied stereotypes.
+ *
+ * @param elt
+ * the stereotyped element
+ * @param stereotypes
+ * the collection of stereotypes which icon has to be displayed
+ * @param kind
+ * the kind of display "icon" or "shape"
+ * @return {@link image} of the icon
+ */
+ public static Collection<Image> getIconElements(Element elt, Collection<Stereotype> stereotypes, boolean withVisibilityDecorator) {
+ Collection<Image> images = new ArrayList<Image>();
+ VisibilityKind vis = null;
+ if((elt instanceof NamedElement) && (withVisibilityDecorator)) {
+ vis = ((NamedElement)elt).getVisibility();
+ }
+
+ // look in each stereotype and get the image for each of them
+ for(Stereotype stereotype : stereotypes) {
+ // getStereotypeImage can return null
+ org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "icon");
+ if(icon != null) {
+ images.add(getImageInRegistry(icon, vis));
+ }
+ }
+ return images;
+ }
+
+ /**
+ * this method returns the icon image that represents the first applied
+ * stereotype.
+ *
+ * @param elt
+ * the stereotyped element
+ * @param stereotype
+ * the stereotype which icon has to be displayed
+ * @param kind
+ * the kind of display "icon" or "shape"
+ * @return {@link image} of the icon
+ */
+ public static Image getIconElement(Element elt, Stereotype stereotype, boolean withVisibilityDecorator) {
+
+ VisibilityKind vis = null;
+ if((elt instanceof NamedElement) && (withVisibilityDecorator)) {
+
+ vis = ((NamedElement)elt).getVisibility();
+ }
+
+ // getStereotypeImage can return null
+ org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "icon");
+ if(icon != null) {
+ return getImageInRegistry(icon, vis);
+ } else {
+ return null;
+ }
+ }
+
+ /** get the imageassociated to a image uml element **/
+ public static Image getShape(Element elt, Stereotype stereotype, boolean withVisibilityDecorator) {
+
+ VisibilityKind vis = null;
+ if((elt instanceof NamedElement) && (withVisibilityDecorator)) {
+
+ vis = ((NamedElement)elt).getVisibility();
+ }
+
+ // getStereotypeImage can return null
+ org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(elt, stereotype, "shape");
+ if(icon != null) {
+ return getImageInRegistry(icon, vis);
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Find the image (SWT) in registry Store image in registry if it is not
+ * found
+ *
+ * @param umlImage
+ * to retrieve as SWT Image in registry
+ * @return the stored SWT image
+ */
+ public static Image getImageInRegistry(org.eclipse.uml2.uml.Image umlImage, VisibilityKind visibility) {
+ // Retrieve registry
+ ImageRegistry papyrusRegistry = getDefault().getImageRegistry();
+
+ // Get image id for registry
+ String image_id = ImageUtil.getImageId(umlImage);
+ if(visibility != null) {
+ image_id = image_id + "_" + visibility.getLiteral();
+ }
+
+ // Get SWT image for shape in the registry
+ Image image = papyrusRegistry.get(image_id);
+
+ // If image was not found in registry,
+ // try to find an image and to update registry
+ if(image == null) {
+
+ try {
+ // Try to retrieve image from UML Image content property
+ image = ImageUtil.getContent(umlImage);
+ } catch (Exception e) {
+ // Activator.log.error(e);
+ }
+
+ // If no image was found in Content
+ // Try to retrieve image from UML Image location property
+ if(image == null) {
+ image = ImageUtil.getImageFromLocation(umlImage);
+ }
+
+ // Add visibility decorator
+ if(visibility != null) {
+
+ getDefault();
+ ImageDescriptor visDesc = Activator.getImageDescriptor(UML_VIS_ICONS_16x16 + "VisibilityKind_" + visibility.getLiteral() + ".gif");
+
+ // Overlay custom image over base image
+ OverlayVisibilityIcon overlayIcon = new OverlayVisibilityIcon(image, visDesc);
+ image = overlayIcon.getImage();
+ }
+
+ if(image != null) {
+ // Store image in registry
+ ImageData imdata = image.getImageData();
+ papyrusRegistry.put(image_id, ImageDescriptor.createFromImageData(imdata));
+ image = papyrusRegistry.get(image_id);
+ }
+ }
+
+ return image;
+ }
+
+ /** The Constant DIAGRAM_PREFERENCES_HINT. */
+ public static final PreferencesHint DIAGRAM_PREFERENCES_HINT = new PreferencesHint(ID);
+
+ /** The adapter factory. */
+ private ComposedAdapterFactory adapterFactory;
+
+ /**
+ * Start.
+ *
+ * @param context
+ * the context
+ *
+ * @throws Exception
+ * the exception
+ *
+ * @generated
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ PreferencesHint.registerPreferenceStore(DIAGRAM_PREFERENCES_HINT, getPreferenceStore());
+ plugin = this;
+ log = new LogHelper(plugin);
+ }
+
+ /**
+ * Stop.
+ *
+ * @param context
+ * the context
+ *
+ * @throws Exception
+ * the exception
+ *
+ * @generated
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ log = null;
+ plugin = null;
+ }
+
+ /**
+ * Log error.
+ *
+ * @param error
+ * the error
+ */
+ public void logError(String error) {
+ logError(error, null);
+ }
+
+ /**
+ * Log error.
+ *
+ * @param throwable
+ * actual error or null could be passed
+ * @param error
+ * the error
+ */
+ public void logError(String error, Throwable throwable) {
+ if(error == null && throwable != null) {
+ error = throwable.getMessage();
+ }
+ getLog().log(new Status(IStatus.ERROR, Activator.ID, IStatus.OK, error, throwable));
+ debug(error, throwable);
+ }
+
+ /**
+ * Log info.
+ *
+ * @param message
+ * the message
+ */
+ public void logInfo(String message) {
+ logInfo(message, null);
+ }
+
+ /**
+ * Log info.
+ *
+ * @param throwable
+ * actual error or null could be passed
+ * @param message
+ * the message
+ */
+ public void logInfo(String message, Throwable throwable) {
+ if(message == null && throwable != null) {
+ message = throwable.getMessage();
+ }
+ getLog().log(new Status(IStatus.INFO, Activator.ID, IStatus.OK, message, throwable));
+ debug(message, throwable);
+ }
+
+ public void logWarning(String warning, Throwable throwable) {
+ if(warning == null && throwable != null) {
+ warning = throwable.getMessage();
+ }
+ getLog().log(new Status(IStatus.WARNING, ID, IStatus.OK, warning, throwable));
+ }
+
+ /**
+ * Debug.
+ *
+ * @param message
+ * the message
+ * @param throwable
+ * the throwable
+ */
+ private void debug(String message, Throwable throwable) {
+ if(!isDebugging()) {
+ return;
+ }
+ if(message != null) {
+ System.err.println(message);
+ }
+ if(throwable != null) {
+ throwable.printStackTrace();
+ }
+ }
+
+ /**
+ * Creates the adapter factory.
+ *
+ * @return the composed adapter factory
+ */
+ protected ComposedAdapterFactory createAdapterFactory() {
+ List factories = new ArrayList();
+ fillItemProviderFactories(factories);
+ return new ComposedAdapterFactory(factories);
+ }
+
+ /**
+ * Use alternative UMLItemProviderAdapterFactory insteadof
+ * UMLItemProviderAdapterFactory.
+ *
+ * @param factories
+ * the factories
+ *
+ * @see org.eclipse.emf.edit.provider.ComposedAdapterFactory#getFactoryForTypes(java.util.Collection)
+ */
+ protected void fillItemProviderFactories(List factories) {
+ // custom icons for diagram elements
+ factories.add(new AlternativeUMLItemProviderAdapterFactory(getPreferenceStore()));
+
+ factories.add(new UMLItemProviderAdapterFactory());
+ factories.add(new EcoreItemProviderAdapterFactory());
+ factories.add(new ResourceItemProviderAdapterFactory());
+ factories.add(new ReflectiveItemProviderAdapterFactory());
+ }
+
+ /**
+ * Gets the item providers adapter factory.
+ *
+ * @return the item providers adapter factory
+ */
+ public AdapterFactory getItemProvidersAdapterFactory() {
+ if(adapterFactory == null) {
+ adapterFactory = createAdapterFactory();
+ }
+ return adapterFactory;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/AbstractShowHideAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/AbstractShowHideAction.java
index d401f1fcee3..3da74e8d78b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/AbstractShowHideAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/AbstractShowHideAction.java
@@ -1,657 +1,657 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.actions;
-
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.util.ViewServiceUtil;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
-import org.eclipse.ui.dialogs.SelectionDialog;
-
-/**
- *
- * Super Class for the ShowHide action
- *
- */
-public abstract class AbstractShowHideAction implements IActionDelegate, IWorkbenchWindowActionDelegate {
-
- /** the selected elements */
- protected List<IGraphicalEditPart> selectedElements;
-
- /** the initial selection */
- protected List<Object> initialSelection;
-
- /** key for the EditPolicy providing the action */
- private String editPolicyKey = null;
-
- /** title for the window */
- private String title = null;
-
- /** message for the window */
- private String message = null;
-
- /** label provider */
- private ILabelProvider labelProvider = null;
-
- /** content provider */
- private ITreeContentProvider contentProvider = null;
-
- /** the list of the views to destroy */
- protected List<EditPartRepresentation> viewsToDestroy;
-
- /** the list of the view to create */
- protected List<EditPartRepresentation> viewsToCreate;
-
- /** the list of the {@link EditPartRepresentation} */
- protected List<EditPartRepresentation> representations;
-
- /**
- *
- * Constructor.
- *
- * @param title
- * title for the dialog
- * @param message
- * message for the dialog
- * @param editPolicyKey
- * the EditPolicy used for this action
- */
- public AbstractShowHideAction(String title, String message, String editPolicyKey) {
- this.editPolicyKey = editPolicyKey;
- this.title = title;
- this.message = message;
- /* for further information, see bug 302555 */
- // ViewServiceUtil.forceLoad();
- }
-
- /**
- * {@inheritDoc}
- */
- public void dispose() {
- // nothing here
- }
-
- /**
- * {@inheritDoc}
- */
- public void init(IWorkbenchWindow window) {
- // nothing here
- }
-
- /**
- * {@inheritDoc}
- */
- public void run(IAction action) {
-
- if(!canRun()) {
- return;
- }
- initAction();
- buildInitialSelection();
- SelectionDialog selectionDialog = getSelectionDialog();
- selectionDialog.open();
- if(selectionDialog.getReturnCode() == Dialog.OK) {
- buildShowHideElementsList(selectionDialog.getResult());
- final Command command = getActionCommand();
- final TransactionalEditingDomain domain = this.selectedElements.get(0).getEditingDomain();
- if(command.canExecute()) {
- try {
- domain.runExclusive(new Runnable() {
-
- public void run() {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-
- // executing the command
- public void run() {
- domain.getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
- }
- });
- }
- });
- } catch (InterruptedException e) {
- Activator.log.error(e);
- }
- }
- }
- }
-
- /**
- * Creates and returns the selection dialog displayed by this action
- *
- * @return the created selection dialog
- */
- protected SelectionDialog getSelectionDialog() {
- CheckedTreeSelectionDialog selectionDialog = new CheckedTreeSelectionDialog(DisplayUtils.getDisplay().getActiveShell(), getEditorLabelProvider(), getContentProvider());
- selectionDialog.setTitle(title);
- selectionDialog.setMessage(message);
- selectionDialog.setContainerMode(true);
- selectionDialog.setInput(getInput());
- selectionDialog.setExpandedElements(getExpandedElements());
- selectionDialog.setInitialElementSelections(getInitialSelection());
- return selectionDialog;
- }
-
- /**
- * Returns the list of all elements
- *
- * @return the list of all elements
- */
- protected Object[] getExpandedElements() {
- List<Object> allElements = new ArrayList<Object>();
- for(EditPartRepresentation current : this.representations) {
- allElements.add(current);
- allElements.addAll(current.getPossibleElement());
- }
- return allElements.toArray();
- }
-
- /**
- *
- * Test if the action can be run! Useful when we press F4 and it's the first
- * action in Papyrus
- *
- * @return if the action can be run or not
- */
- public boolean canRun() {
-
- if(this.selectedElements.isEmpty()) {
- return false;
- }
- for(Object object : this.selectedElements) {
- if(!(object instanceof EditPart)) {
- return false;
- } else {
- EditPolicy policy = ((EditPart)object).getEditPolicy(editPolicyKey);
- if(policy == null) {
- return false;
- }
- }
- }
-
- return true;
- }
-
- /**
- *
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
- *
- * @param action
- * the current action
- * @param selection
- * the current selection
- */
- public void selectionChanged(IAction action, ISelection selection) {
- boolean enabled = false;
- if(editPolicyKey != null) {
- selectedElements = new ArrayList<IGraphicalEditPart>();
- if(selection instanceof StructuredSelection) {
- for(Object current : ((StructuredSelection)selection).toArray()) {
- if(current instanceof IGraphicalEditPart) {
- selectedElements.add((IGraphicalEditPart)current);
- EditPolicy policy = ((IGraphicalEditPart)current).getEditPolicy(editPolicyKey);
- if(policy != null) {
- enabled = true;
- break;
- }
- }
- }
- }
-
- }
- if(action != null) {
- action.setEnabled(enabled);
- }
- }
-
- /**
- * Initialize
- * <ul>
- * <li>{@link #labelProvider}</li>
- * <li> {@link #representations}</li>
- * </ul>
- *
- * This method should be override by subclasses to initialize {@link #contentProvider} for example.
- *
- */
- protected void initAction() {
- this.labelProvider = new EditPartRepresentationLabelProvider();
- this.representations = new ArrayList<AbstractShowHideAction.EditPartRepresentation>();
- }
-
- /**
- * Returns the initial selection for the Tree Dialog.
- *
- * @return The initial selection for the Tree Dialog
- */
- public List<Object> getInitialSelection() {
- return this.initialSelection;
-
- }
-
- /**
- * Build the initial selection for the tree
- */
- protected void buildInitialSelection() {
- this.initialSelection = new ArrayList<Object>();
- for(EditPartRepresentation current : this.representations) {
- contributeToInitialSelection(initialSelection, current);
- }
- }
-
- /**
- * Complete the list of initial selection for the given representation and its potential children
- *
- * @param listToComplete
- * the list of selected elements to complete
- * @param representation
- * the edit part representation that completes the list
- */
- protected void contributeToInitialSelection(List<Object> listToComplete, EditPartRepresentation representation) {
- listToComplete.addAll(representation.getInitialSelection());
- List<EditPartRepresentation> children = representation.getPossibleElement();
- if(children != null) {
- for(EditPartRepresentation child : children) {
- contributeToInitialSelection(listToComplete, child);
- }
- }
- }
-
- /**
- * Returns the input for the TreeDialog
- *
- * @return the input for the TreeDialog
- */
- abstract protected List<Object> getInput();
-
- /**
- * Fill the following fields with the elements to show and the elements to
- * hide
- * <ul>
- * <li>{@link #viewsToCreate}</li>
- * <li> {@link #viewsToDestroy}</li>
- * </ul>
- *
- * @param result
- * the interesting element selected in the tree
- */
- protected void buildShowHideElementsList(Object[] result) {
- this.viewsToCreate = new ArrayList<EditPartRepresentation>();
- this.viewsToDestroy = new ArrayList<EditPartRepresentation>();
- }
-
- /**
- * Returns the command done by this action
- *
- * @return the command done by this action
- */
- abstract protected Command getActionCommand();
-
- /**
- * Setter for {@link #labelProvider}
- *
- * @param provider
- * the label provider for the tree
- */
- protected void setEditorLabelProvider(ILabelProvider provider) {
- this.labelProvider = provider;
- }
-
- /**
- * Returns the label provider used by the dialog
- *
- * @return the labelProvider
- */
- protected ILabelProvider getEditorLabelProvider() {
- return labelProvider;
- }
-
- /**
- * Setter for {@link #contentProvider}
- *
- * @param provider
- * the provider for the tree
- */
- protected void setContentProvider(ITreeContentProvider provider) {
- this.contentProvider = provider;
- }
-
- /**
- * Returns the content provider for the selection dialog
- *
- * @return the contentProvider
- */
- protected ITreeContentProvider getContentProvider() {
- return contentProvider;
- }
-
- /**
- * Setter for {@link #selectedElements}. When this action is called by a
- * popup menu, {@link #selectedElements} is filled by {@link #selectionChanged(IAction, ISelection)} When this action is called
- * by a Handler, {@link #selectedElements} is filled with this method
- *
- * @param selection
- * the current selection
- */
- public void setSelection(List<IGraphicalEditPart> selection) {
- this.selectedElements = selection;
- }
-
- /**
- * Getter for {@link AbstractShowHideAction#editPolicyKey}
- *
- * @return
- *
- * {@link AbstractShowHideAction#editPolicyKey}
- */
- public String getEditPolicyKey() {
- return this.editPolicyKey;
- }
-
- /**
- *
- * This class provides some facilities to build the action.
- *
- */
- public class EditPartRepresentation {
-
- /** the editpart represented by this class */
- private IGraphicalEditPart representedEditPart;
-
- /** the initial selection */
- protected List<EditPartRepresentation> initialSelection;
-
- /** the possible element to show/hide */
- protected List<EditPartRepresentation> elementsToSelect;
-
- /** the semantic element represented by the EditPart */
- protected EObject eObject;
-
- /** parent edit part representation */
- final private EditPartRepresentation parentRepresentation;
-
- /**
- * Constructor.
- *
- * @param representedEditPart
- * the represented EditPart
- * @param eObject
- * the semantic element represented by EditPartRepresentation
- */
- public EditPartRepresentation(IGraphicalEditPart representedEditPart, EObject eObject) {
- this(representedEditPart, eObject, null);
- }
-
- /**
- *
- * Constructor.
- *
- * @param representedEditPart
- * the represented EditPart
- * @param eObject
- * the semantic element represented by EditPartRepresentation
- * @param parentRepresentation
- * parent representation of this edit part representation
- */
- public EditPartRepresentation(IGraphicalEditPart representedEditPart, EObject eObject, EditPartRepresentation parentRepresentation) {
- this.setRepresentedEditPart(representedEditPart);
- this.eObject = eObject;
- this.parentRepresentation = parentRepresentation;
- initRepresentation();
- }
-
- /**
- * Getter for {@link #representedEditPart}
- *
- * @return the represented editpart, {@link #representedEditPart}
- */
- public IGraphicalEditPart getRepresentedEditPart() {
- return this.representedEditPart;
- }
-
- /**
- * Getter for {@link #eObject}
- *
- * @return {@link #eObject}
- */
- public EObject getSemanticElement() {
- return this.eObject;
- }
-
- /**
- * Getter for {@link #initialSelection}
- *
- * @return {@link #initialSelection}
- */
- public List<EditPartRepresentation> getInitialSelection() {
- return this.initialSelection;
- }
-
- /**
- * initialize the following fields
- * <ul>
- * <li> {@link #initialSelection}</li>
- * <li>{@link #elementsToSelect}</li>
- * </ul>
- */
- protected void initRepresentation() {
- this.initialSelection = new ArrayList<EditPartRepresentation>();
- this.elementsToSelect = new ArrayList<EditPartRepresentation>();
- }
-
- /**
- * Setter for {@link #elementsToSelect}
- *
- * @return {@link #elementsToSelect}
- */
- public List<EditPartRepresentation> getPossibleElement() {
- return this.elementsToSelect;
- }
-
- /**
- * Returns the parent representation of this edit part representation
- *
- * @return the parent representation of this edit part representation
- */
- public EditPartRepresentation getParentRepresentation() {
- return parentRepresentation;
- }
-
- /**
- * Setter for the {@link #representedEditPart}
- *
- * @param representedEditPart
- * {@link #representedEditPart}
- */
- public void setRepresentedEditPart(IGraphicalEditPart representedEditPart) {
- this.representedEditPart = representedEditPart;
- }
-
- /**
- * Returns the display label for this edit part representation
- *
- * @return the display label for this edit part representation
- */
- public String getLabel() {
- EObject semanticElement = getSemanticElement();
- if(isElementInherited()) {
- StringBuffer buffer = new StringBuffer();
- buffer.append(getEditorLabelProvider().getText(getSemanticElement()));
- buffer.append(" ");
- buffer.append("(from ");
- buffer.append(getEditorLabelProvider().getText(getSemanticElement().eContainer()));
- buffer.append(")");
- return buffer.toString();
- }
- return getEditorLabelProvider().getText(semanticElement);
- }
-
- /**
- * Returns the display label for this edit part representation
- *
- * @return the display label for this edit part representation
- */
- public Image getImage() {
- return getEditorLabelProvider().getImage(getSemanticElement());
- }
-
- /**
- * Checks if the parent of the element linked to the given edit part representation is similar to the element of the parent representation
- *
- * @param representation
- * the edit part representation to check
- * @return <code>true</code> if the element is inherited
- */
- protected boolean isElementInherited() {
- EditPartRepresentation parentRepresentation = getParentRepresentation();
- if(parentRepresentation == null) { // no parent => can not be inherited
- return false;
- }
-
- // no uml element in representation, can not check
- if(getSemanticElement() == null) {
- return false;
- }
-
- EObject parentElement = parentRepresentation.getSemanticElement();
- EObject elementOwner = getSemanticElement().eContainer(); // Null for rer.getUMLElement was already check before.
- if(parentElement == null || elementOwner == null) { // no element in the parent representation
- return false;
- }
-
- if(!parentElement.equals(elementOwner)) {
- return true;
- }
- return false;
- }
- }
-
- /**
- * label provider that delegates to the edit part representation the label
- */
- protected class EditPartRepresentationLabelProvider extends LabelProvider {
-
- /** editor label provider */
- protected EMFLabelProvider editorLabelProvider;
-
- /**
- * Constructor.
- */
- public EditPartRepresentationLabelProvider() {
- this.editorLabelProvider = new EMFLabelProvider();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getText(Object element) {
- if(element instanceof EditPartRepresentation) {
- return ((EditPartRepresentation)element).getLabel();
- }
- return editorLabelProvider.getText(element);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Image getImage(Object element) {
- if(element instanceof EditPartRepresentation) {
- return ((EditPartRepresentation)element).getImage();
- }
- return editorLabelProvider.getImage(element);
- }
- }
-
- // /**
- // *
- // * EditorLabelProvider for the {@link CheckedTreeSelectionDialog}
- // *
- // */
- // public class CustomEditorLabelProvider extends EditorLabelProvider {
- //
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // public Image getImage(Object element) {
- // if(element instanceof EditPartRepresentation) {
- // element = ((EditPartRepresentation)element).getSemanticElement();
- // }
- // return super.getImage(element);
- // }
- //
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // public String getText(Object element) {
- // if(element instanceof CompartmentEditPartRepresentation) {
- // return ((CompartmentEditPartRepresentation)element).getCompartmentName();
- // } else if(element instanceof EditPartRepresentation) {
- // EObject semanticElement = ((EditPartRepresentation)element).getSemanticElement();
- // if(isElementInherited((EditPartRepresentation)element)) {
- // StringBuffer buffer = new StringBuffer();
- // buffer.append(super.getText(semanticElement));
- // buffer.append(" ");
- // buffer.append("(from ");
- // buffer.append(super.getText(((EditPartRepresentation)element).getSemanticElement().eContainer()));
- // buffer.append(")");
- // return buffer.toString();
- // } else {
- // return super.getText(semanticElement);
- // }
- // }
- // return super.getText(element);
- // }
- // }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.actions;
+
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.emf.providers.EMFLabelProvider;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.util.ViewServiceUtil;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
+import org.eclipse.ui.dialogs.SelectionDialog;
+
+/**
+ *
+ * Super Class for the ShowHide action
+ *
+ */
+public abstract class AbstractShowHideAction implements IActionDelegate, IWorkbenchWindowActionDelegate {
+
+ /** the selected elements */
+ protected List<IGraphicalEditPart> selectedElements;
+
+ /** the initial selection */
+ protected List<Object> initialSelection;
+
+ /** key for the EditPolicy providing the action */
+ private String editPolicyKey = null;
+
+ /** title for the window */
+ private String title = null;
+
+ /** message for the window */
+ private String message = null;
+
+ /** label provider */
+ private ILabelProvider labelProvider = null;
+
+ /** content provider */
+ private ITreeContentProvider contentProvider = null;
+
+ /** the list of the views to destroy */
+ protected List<EditPartRepresentation> viewsToDestroy;
+
+ /** the list of the view to create */
+ protected List<EditPartRepresentation> viewsToCreate;
+
+ /** the list of the {@link EditPartRepresentation} */
+ protected List<EditPartRepresentation> representations;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param title
+ * title for the dialog
+ * @param message
+ * message for the dialog
+ * @param editPolicyKey
+ * the EditPolicy used for this action
+ */
+ public AbstractShowHideAction(String title, String message, String editPolicyKey) {
+ this.editPolicyKey = editPolicyKey;
+ this.title = title;
+ this.message = message;
+ /* for further information, see bug 302555 */
+ // ViewServiceUtil.forceLoad();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dispose() {
+ // nothing here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void init(IWorkbenchWindow window) {
+ // nothing here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(IAction action) {
+
+ if(!canRun()) {
+ return;
+ }
+ initAction();
+ buildInitialSelection();
+ SelectionDialog selectionDialog = getSelectionDialog();
+ selectionDialog.open();
+ if(selectionDialog.getReturnCode() == Dialog.OK) {
+ buildShowHideElementsList(selectionDialog.getResult());
+ final Command command = getActionCommand();
+ final TransactionalEditingDomain domain = this.selectedElements.get(0).getEditingDomain();
+ if(command.canExecute()) {
+ try {
+ domain.runExclusive(new Runnable() {
+
+ public void run() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+
+ // executing the command
+ public void run() {
+ domain.getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ }
+ });
+ }
+ });
+ } catch (InterruptedException e) {
+ Activator.log.error(e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Creates and returns the selection dialog displayed by this action
+ *
+ * @return the created selection dialog
+ */
+ protected SelectionDialog getSelectionDialog() {
+ CheckedTreeSelectionDialog selectionDialog = new CheckedTreeSelectionDialog(DisplayUtils.getDisplay().getActiveShell(), getEditorLabelProvider(), getContentProvider());
+ selectionDialog.setTitle(title);
+ selectionDialog.setMessage(message);
+ selectionDialog.setContainerMode(true);
+ selectionDialog.setInput(getInput());
+ selectionDialog.setExpandedElements(getExpandedElements());
+ selectionDialog.setInitialElementSelections(getInitialSelection());
+ return selectionDialog;
+ }
+
+ /**
+ * Returns the list of all elements
+ *
+ * @return the list of all elements
+ */
+ protected Object[] getExpandedElements() {
+ List<Object> allElements = new ArrayList<Object>();
+ for(EditPartRepresentation current : this.representations) {
+ allElements.add(current);
+ allElements.addAll(current.getPossibleElement());
+ }
+ return allElements.toArray();
+ }
+
+ /**
+ *
+ * Test if the action can be run! Useful when we press F4 and it's the first
+ * action in Papyrus
+ *
+ * @return if the action can be run or not
+ */
+ public boolean canRun() {
+
+ if(this.selectedElements.isEmpty()) {
+ return false;
+ }
+ for(Object object : this.selectedElements) {
+ if(!(object instanceof EditPart)) {
+ return false;
+ } else {
+ EditPolicy policy = ((EditPart)object).getEditPolicy(editPolicyKey);
+ if(policy == null) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ *
+ * @param action
+ * the current action
+ * @param selection
+ * the current selection
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ boolean enabled = false;
+ if(editPolicyKey != null) {
+ selectedElements = new ArrayList<IGraphicalEditPart>();
+ if(selection instanceof StructuredSelection) {
+ for(Object current : ((StructuredSelection)selection).toArray()) {
+ if(current instanceof IGraphicalEditPart) {
+ selectedElements.add((IGraphicalEditPart)current);
+ EditPolicy policy = ((IGraphicalEditPart)current).getEditPolicy(editPolicyKey);
+ if(policy != null) {
+ enabled = true;
+ break;
+ }
+ }
+ }
+ }
+
+ }
+ if(action != null) {
+ action.setEnabled(enabled);
+ }
+ }
+
+ /**
+ * Initialize
+ * <ul>
+ * <li>{@link #labelProvider}</li>
+ * <li> {@link #representations}</li>
+ * </ul>
+ *
+ * This method should be override by subclasses to initialize {@link #contentProvider} for example.
+ *
+ */
+ protected void initAction() {
+ this.labelProvider = new EditPartRepresentationLabelProvider();
+ this.representations = new ArrayList<AbstractShowHideAction.EditPartRepresentation>();
+ }
+
+ /**
+ * Returns the initial selection for the Tree Dialog.
+ *
+ * @return The initial selection for the Tree Dialog
+ */
+ public List<Object> getInitialSelection() {
+ return this.initialSelection;
+
+ }
+
+ /**
+ * Build the initial selection for the tree
+ */
+ protected void buildInitialSelection() {
+ this.initialSelection = new ArrayList<Object>();
+ for(EditPartRepresentation current : this.representations) {
+ contributeToInitialSelection(initialSelection, current);
+ }
+ }
+
+ /**
+ * Complete the list of initial selection for the given representation and its potential children
+ *
+ * @param listToComplete
+ * the list of selected elements to complete
+ * @param representation
+ * the edit part representation that completes the list
+ */
+ protected void contributeToInitialSelection(List<Object> listToComplete, EditPartRepresentation representation) {
+ listToComplete.addAll(representation.getInitialSelection());
+ List<EditPartRepresentation> children = representation.getPossibleElement();
+ if(children != null) {
+ for(EditPartRepresentation child : children) {
+ contributeToInitialSelection(listToComplete, child);
+ }
+ }
+ }
+
+ /**
+ * Returns the input for the TreeDialog
+ *
+ * @return the input for the TreeDialog
+ */
+ abstract protected List<Object> getInput();
+
+ /**
+ * Fill the following fields with the elements to show and the elements to
+ * hide
+ * <ul>
+ * <li>{@link #viewsToCreate}</li>
+ * <li> {@link #viewsToDestroy}</li>
+ * </ul>
+ *
+ * @param result
+ * the interesting element selected in the tree
+ */
+ protected void buildShowHideElementsList(Object[] result) {
+ this.viewsToCreate = new ArrayList<EditPartRepresentation>();
+ this.viewsToDestroy = new ArrayList<EditPartRepresentation>();
+ }
+
+ /**
+ * Returns the command done by this action
+ *
+ * @return the command done by this action
+ */
+ abstract protected Command getActionCommand();
+
+ /**
+ * Setter for {@link #labelProvider}
+ *
+ * @param provider
+ * the label provider for the tree
+ */
+ protected void setEditorLabelProvider(ILabelProvider provider) {
+ this.labelProvider = provider;
+ }
+
+ /**
+ * Returns the label provider used by the dialog
+ *
+ * @return the labelProvider
+ */
+ protected ILabelProvider getEditorLabelProvider() {
+ return labelProvider;
+ }
+
+ /**
+ * Setter for {@link #contentProvider}
+ *
+ * @param provider
+ * the provider for the tree
+ */
+ protected void setContentProvider(ITreeContentProvider provider) {
+ this.contentProvider = provider;
+ }
+
+ /**
+ * Returns the content provider for the selection dialog
+ *
+ * @return the contentProvider
+ */
+ protected ITreeContentProvider getContentProvider() {
+ return contentProvider;
+ }
+
+ /**
+ * Setter for {@link #selectedElements}. When this action is called by a
+ * popup menu, {@link #selectedElements} is filled by {@link #selectionChanged(IAction, ISelection)} When this action is called
+ * by a Handler, {@link #selectedElements} is filled with this method
+ *
+ * @param selection
+ * the current selection
+ */
+ public void setSelection(List<IGraphicalEditPart> selection) {
+ this.selectedElements = selection;
+ }
+
+ /**
+ * Getter for {@link AbstractShowHideAction#editPolicyKey}
+ *
+ * @return
+ *
+ * {@link AbstractShowHideAction#editPolicyKey}
+ */
+ public String getEditPolicyKey() {
+ return this.editPolicyKey;
+ }
+
+ /**
+ *
+ * This class provides some facilities to build the action.
+ *
+ */
+ public class EditPartRepresentation {
+
+ /** the editpart represented by this class */
+ private IGraphicalEditPart representedEditPart;
+
+ /** the initial selection */
+ protected List<EditPartRepresentation> initialSelection;
+
+ /** the possible element to show/hide */
+ protected List<EditPartRepresentation> elementsToSelect;
+
+ /** the semantic element represented by the EditPart */
+ protected EObject eObject;
+
+ /** parent edit part representation */
+ final private EditPartRepresentation parentRepresentation;
+
+ /**
+ * Constructor.
+ *
+ * @param representedEditPart
+ * the represented EditPart
+ * @param eObject
+ * the semantic element represented by EditPartRepresentation
+ */
+ public EditPartRepresentation(IGraphicalEditPart representedEditPart, EObject eObject) {
+ this(representedEditPart, eObject, null);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param representedEditPart
+ * the represented EditPart
+ * @param eObject
+ * the semantic element represented by EditPartRepresentation
+ * @param parentRepresentation
+ * parent representation of this edit part representation
+ */
+ public EditPartRepresentation(IGraphicalEditPart representedEditPart, EObject eObject, EditPartRepresentation parentRepresentation) {
+ this.setRepresentedEditPart(representedEditPart);
+ this.eObject = eObject;
+ this.parentRepresentation = parentRepresentation;
+ initRepresentation();
+ }
+
+ /**
+ * Getter for {@link #representedEditPart}
+ *
+ * @return the represented editpart, {@link #representedEditPart}
+ */
+ public IGraphicalEditPart getRepresentedEditPart() {
+ return this.representedEditPart;
+ }
+
+ /**
+ * Getter for {@link #eObject}
+ *
+ * @return {@link #eObject}
+ */
+ public EObject getSemanticElement() {
+ return this.eObject;
+ }
+
+ /**
+ * Getter for {@link #initialSelection}
+ *
+ * @return {@link #initialSelection}
+ */
+ public List<EditPartRepresentation> getInitialSelection() {
+ return this.initialSelection;
+ }
+
+ /**
+ * initialize the following fields
+ * <ul>
+ * <li> {@link #initialSelection}</li>
+ * <li>{@link #elementsToSelect}</li>
+ * </ul>
+ */
+ protected void initRepresentation() {
+ this.initialSelection = new ArrayList<EditPartRepresentation>();
+ this.elementsToSelect = new ArrayList<EditPartRepresentation>();
+ }
+
+ /**
+ * Setter for {@link #elementsToSelect}
+ *
+ * @return {@link #elementsToSelect}
+ */
+ public List<EditPartRepresentation> getPossibleElement() {
+ return this.elementsToSelect;
+ }
+
+ /**
+ * Returns the parent representation of this edit part representation
+ *
+ * @return the parent representation of this edit part representation
+ */
+ public EditPartRepresentation getParentRepresentation() {
+ return parentRepresentation;
+ }
+
+ /**
+ * Setter for the {@link #representedEditPart}
+ *
+ * @param representedEditPart
+ * {@link #representedEditPart}
+ */
+ public void setRepresentedEditPart(IGraphicalEditPart representedEditPart) {
+ this.representedEditPart = representedEditPart;
+ }
+
+ /**
+ * Returns the display label for this edit part representation
+ *
+ * @return the display label for this edit part representation
+ */
+ public String getLabel() {
+ EObject semanticElement = getSemanticElement();
+ if(isElementInherited()) {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(getEditorLabelProvider().getText(getSemanticElement()));
+ buffer.append(" ");
+ buffer.append("(from ");
+ buffer.append(getEditorLabelProvider().getText(getSemanticElement().eContainer()));
+ buffer.append(")");
+ return buffer.toString();
+ }
+ return getEditorLabelProvider().getText(semanticElement);
+ }
+
+ /**
+ * Returns the display label for this edit part representation
+ *
+ * @return the display label for this edit part representation
+ */
+ public Image getImage() {
+ return getEditorLabelProvider().getImage(getSemanticElement());
+ }
+
+ /**
+ * Checks if the parent of the element linked to the given edit part representation is similar to the element of the parent representation
+ *
+ * @param representation
+ * the edit part representation to check
+ * @return <code>true</code> if the element is inherited
+ */
+ protected boolean isElementInherited() {
+ EditPartRepresentation parentRepresentation = getParentRepresentation();
+ if(parentRepresentation == null) { // no parent => can not be inherited
+ return false;
+ }
+
+ // no uml element in representation, can not check
+ if(getSemanticElement() == null) {
+ return false;
+ }
+
+ EObject parentElement = parentRepresentation.getSemanticElement();
+ EObject elementOwner = getSemanticElement().eContainer(); // Null for rer.getUMLElement was already check before.
+ if(parentElement == null || elementOwner == null) { // no element in the parent representation
+ return false;
+ }
+
+ if(!parentElement.equals(elementOwner)) {
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * label provider that delegates to the edit part representation the label
+ */
+ protected class EditPartRepresentationLabelProvider extends LabelProvider {
+
+ /** editor label provider */
+ protected EMFLabelProvider editorLabelProvider;
+
+ /**
+ * Constructor.
+ */
+ public EditPartRepresentationLabelProvider() {
+ this.editorLabelProvider = new EMFLabelProvider();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getText(Object element) {
+ if(element instanceof EditPartRepresentation) {
+ return ((EditPartRepresentation)element).getLabel();
+ }
+ return editorLabelProvider.getText(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Image getImage(Object element) {
+ if(element instanceof EditPartRepresentation) {
+ return ((EditPartRepresentation)element).getImage();
+ }
+ return editorLabelProvider.getImage(element);
+ }
+ }
+
+ // /**
+ // *
+ // * EditorLabelProvider for the {@link CheckedTreeSelectionDialog}
+ // *
+ // */
+ // public class CustomEditorLabelProvider extends EditorLabelProvider {
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public Image getImage(Object element) {
+ // if(element instanceof EditPartRepresentation) {
+ // element = ((EditPartRepresentation)element).getSemanticElement();
+ // }
+ // return super.getImage(element);
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public String getText(Object element) {
+ // if(element instanceof CompartmentEditPartRepresentation) {
+ // return ((CompartmentEditPartRepresentation)element).getCompartmentName();
+ // } else if(element instanceof EditPartRepresentation) {
+ // EObject semanticElement = ((EditPartRepresentation)element).getSemanticElement();
+ // if(isElementInherited((EditPartRepresentation)element)) {
+ // StringBuffer buffer = new StringBuffer();
+ // buffer.append(super.getText(semanticElement));
+ // buffer.append(" ");
+ // buffer.append("(from ");
+ // buffer.append(super.getText(((EditPartRepresentation)element).getSemanticElement().eContainer()));
+ // buffer.append(")");
+ // return buffer.toString();
+ // } else {
+ // return super.getText(semanticElement);
+ // }
+ // }
+ // return super.getText(element);
+ // }
+ // }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/LoadResourceAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/LoadResourceAction.java
index e42f625f0bc..c491d8b7e3d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/LoadResourceAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/LoadResourceAction.java
@@ -1,51 +1,51 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Francisco Javier Cano Muñoz (Prodevelop) - prepared the hadler for IDiagramWorkbenchParts
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.actions;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Load resource action hnalder. Works with any {@link IDiagramWorkbenchPart}.
- *
- * @author <a href="mailto:fjcano@prodevelop.es">Francisco Javier Cano Muñoz</a>
- *
- */
-public class LoadResourceAction extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event);
- Shell shell = diagramEditor.getEditorSite().getShell();
-
- IDiagramWorkbenchPart workbenchPart;
- if(diagramEditor instanceof IDiagramWorkbenchPart) {
- workbenchPart = (IDiagramWorkbenchPart)diagramEditor;
- } else {
- workbenchPart = (IDiagramWorkbenchPart)diagramEditor.getAdapter(IDiagramWorkbenchPart.class);
- }
- assert diagramEditor != null;
- TransactionalEditingDomain editingDomain = workbenchPart.getDiagramEditPart().getEditingDomain();
- org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog(shell, editingDomain);
- loadResourceDialog.open();
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Francisco Javier Cano Muñoz (Prodevelop) - prepared the hadler for IDiagramWorkbenchParts
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Load resource action hnalder. Works with any {@link IDiagramWorkbenchPart}.
+ *
+ * @author <a href="mailto:fjcano@prodevelop.es">Francisco Javier Cano Muñoz</a>
+ *
+ */
+public class LoadResourceAction extends AbstractHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event);
+ Shell shell = diagramEditor.getEditorSite().getShell();
+
+ IDiagramWorkbenchPart workbenchPart;
+ if(diagramEditor instanceof IDiagramWorkbenchPart) {
+ workbenchPart = (IDiagramWorkbenchPart)diagramEditor;
+ } else {
+ workbenchPart = (IDiagramWorkbenchPart)diagramEditor.getAdapter(IDiagramWorkbenchPart.class);
+ }
+ assert diagramEditor != null;
+ TransactionalEditingDomain editingDomain = workbenchPart.getDiagramEditPart().getEditingDomain();
+ org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog(shell, editingDomain);
+ loadResourceDialog.open();
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/ShowHideContentsAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/ShowHideContentsAction.java
index 6e56ad35d2f..fb64db0a4b3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/ShowHideContentsAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/ShowHideContentsAction.java
@@ -1,1040 +1,1040 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.actions;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-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.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IResizableCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideElementsRequest;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.util.CompartmentUtils;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.ui.IActionDelegate;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Type;
-
-/**
- *
- * This class provides an action to show/hide the owned members and the
- * inherited members for a Classifier
- *
- */
-public class ShowHideContentsAction extends AbstractShowHideAction implements IActionDelegate, IWorkbenchWindowActionDelegate {
-
- /** INCREMENT for the location of the elements to show(ports and properties) */
- private static int INCREMENT = 10;
-
- /**
- * Constructor.
- */
- public ShowHideContentsAction() {
- this(Messages.ShowHideContentsAction_Title, Messages.ShowHideContentsAction_Message, ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY);
- }
-
- /**
- *
- * Constructor.
- *
- * @param title
- * title for the dialog
- * @param message
- * message for the dialog
- * @param editPolicyKey
- * EditPolicy used for this action
- */
- public ShowHideContentsAction(String title, String message, String editPolicyKey) {
- super(title, message, editPolicyKey);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void selectionChanged(IAction action, ISelection selection) {
- if(selection instanceof StructuredSelection) {
- if(((StructuredSelection)selection).size() > 1) {
- action.setEnabled(false);
- return;
- }
- }
- super.selectionChanged(action, selection);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initAction() {
- super.initAction();
- for(IGraphicalEditPart current : this.selectedElements) {
- // the selected elements which aren't Classifier are ignored
- if(((View)current.getModel()).getElement() instanceof Classifier) {
- this.representations.add(new RootEditPartRepresentation(current, (Classifier)((View)current.getModel()).getElement()));
- }
- }
- // this.setEditorLabelProvider(new CustomEditorLabelProvider());
- this.setContentProvider(new ContentProvider());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected List<Object> getInput() {
- List<Object> list = new ArrayList<Object>();
- list.addAll(representations);
- return list;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Command getActionCommand() {
-
- ShowHideElementsRequest req = null;
- CompoundCommand completeCmd = new CompoundCommand("Show/Hide Inherited Elements Command"); //$NON-NLS-1$
-
- /*
- * the command to hide elements we need the corresponding editpart
- */
- for(EditPartRepresentation current : this.viewsToDestroy) {
- EditPart ep = current.getRepresentedEditPart(); // should not be null, because EP to destroy really exists
- if(ep != null) {
- req = new ShowHideElementsRequest(ep);
- EditPart parent = ep.getParent();
- if(parent instanceof CompartmentEditPart) {
- parent = parent.getParent();
- }
- Command cmd = parent.getCommand(req);
- if(cmd != null && cmd.canExecute()) {
- completeCmd.add(cmd);
- }
- } else {
- Activator.log.error("the edit part for this representation " + current + " should not be null", null);
- }
- }
-
- // the command to show element
- Point propertyLocation = new Point();
- Point portLocation = new Point(-10, -2 * INCREMENT + 1);
- for(EditPartRepresentation rep : this.viewsToCreate) {
- if(!(rep instanceof OptionalEditPartRepresentation)) {
- continue;
- }
- EditPart ep = ((OptionalEditPartRepresentation)rep).getParentRepresentation().getParentRepresentation().getRepresentedEditPart();
- View compartmentView = ((OptionalEditPartRepresentation)rep).getParentRepresentation().getRepresentedEditPart().getNotationView();
- if(compartmentView != null) {
- req = new ShowHideElementsRequest(compartmentView, ((OptionalEditPartRepresentation)rep).getSemanticElement());
- if(isXYLayout(compartmentView, ep)) {
- propertyLocation.x += INCREMENT;
- propertyLocation.y += INCREMENT;
- req.setLocation(new Point(propertyLocation));
-
- } else if(isAffixedChildNode(ep, ((OptionalEditPartRepresentation)rep).getSemanticElement())) {
- portLocation.y += INCREMENT;
- req.setLocation(new Point(portLocation));
- }
- Command cmd = ep.getCommand(req);
- if(cmd != null && cmd.canExecute()) {
- completeCmd.add(cmd);
- }
- }
- }
- return completeCmd;
- }
-
- /**
- * Test if the child is represented by an affixed child node
- * TODO This method will not work if we have an UML element E1 which inherits from
- * another element E2 and if E2 is represented by an affixed child node and
- * not E1!
- *
- * @param ep
- * the parent EditPart
- * @param child
- * the child to show
- * @return <ul>
- * <li><code>true</code> if child is represented by an affixed child node</li>
- * <li> <code>false</code> if not</li>
- * </ul>
- */
- protected boolean isAffixedChildNode(EditPart ep, EObject child) {
- TransactionalEditingDomain domain = ((IGraphicalEditPart)ep).getEditingDomain();
- ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(child), Node.class, null, ViewUtil.APPEND, false, ((IGraphicalEditPart)ep).getDiagramPreferencesHint());
- CreateCommand cmd = new CreateCommand(domain, viewDescriptor, (View)ep.getModel());
- if(cmd.canExecute()) {
- /*
- * the EditPart can own the child -> it's maybe an affixed child
- * node
- */
- return true;
- }
- return false;
- }
-
- /**
- * Test if the layout for this compartment is a XYLayout
- *
- * @param compartment
- * the compartment to test
- * @param ep
- * the editpart owning this compartment
- * @return <ul>
- * <li><code>true</code> if the layout for this compartment is a XYLayout</li>
- * <li> <code>false</code> if not</li>
- * </ul>
- */
- protected boolean isXYLayout(View compartment, EditPart ep) {
- List<?> children = ep.getChildren();
- for(Object current : children) {
- if(current instanceof EditPart) {
- if(((EditPart)current).getModel() == compartment) {
- EditPolicy editpolicy = ((EditPart)current).getEditPolicy(XYLayoutEditPolicy.LAYOUT_ROLE);
- if(editpolicy != null) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- * Return the EditParts owned by this EditPart. When the owned EditPart is a
- * CompartmentEditPart, we return its containing EditPart
- *
- *
- * @param ep
- * an editpart
- * @return The EditParts owned by this EditPart. When the owned EditPart is
- * a CompartmentEditPart, we return its containing EditPart
- */
- protected List<EditPart> getChildrenEditPart(EditPart ep) {
- List<EditPart> children = new ArrayList<EditPart>();
- List<?> tmp = ep.getChildren();
- for(Object current : tmp) {
- // we don't want the compartment used for the name
- if(current instanceof ITextAwareEditPart) {
- continue;
- // if it's a compartment, we want it's children
- } else if(current instanceof CompartmentEditPart) {
- children.addAll(((CompartmentEditPart)current).getChildren());
- // it's an affixed child node?!
- } else {
- children.add((EditPart)current);
- }
- }
-
- return children;
- }
-
- /**
- * Return the compartment which allows the creation of the EObject
- *
- * @param editPart
- * an editpart
- * @param child
- * an object to create
- * @return the compartment which allows the creation of this EObject or <code>null</code>
- */
- protected View getCompartmentForCreation(EditPart editPart, EObject child) {
- if(isAffixedChildNode(editPart, child)) {
- return (View)editPart.getModel();
- }
- TransactionalEditingDomain domain = ((IGraphicalEditPart)editPart).getEditingDomain();
- ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(child), Node.class, null, ViewUtil.APPEND, false, ((IGraphicalEditPart)editPart).getDiagramPreferencesHint());
-
- List<View> visibleCompartments = ((IGraphicalEditPart)editPart).getNotationView().getVisibleChildren();
- for(View currentComp : visibleCompartments) {
- CreateCommand cmd = new CreateCommand(domain, viewDescriptor, currentComp);
- if(cmd.canExecute()) {
- return currentComp;
- }
- }
- return null;
- }
-
- // /**
- // * Return the EditPart owning the Object or <code>null</code>
- // *
- // * @param obj
- // * @return the EditPart owning the Object or <code>null</code>
- // */
- // protected EditPart findEditPart(EditPartRepresentation obj) {
- // EditPart ep = null;
- // EditPart parentEditPart = obj.getParentRepresentation().getRepresentedEditPart();
- // for(Object child : parentEditPart.getChildren()) {
- // EditPart child = (EditPart)child;
- // }
- //
- // Iterator<EditPartRepresentation> it = representations.iterator();
- //
- // while(ep == null && it.hasNext()) {
- // List<EditPart> children = getChildrenEditPart(it.next().getRepresentedEditPart());
- // for(EditPart editPart : children) {
- // if(((View)editPart.getModel()).getElement() == obj) {
- // return editPart;
- // }
- // }
- // }
- // return null;
- // }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void buildShowHideElementsList(Object[] results) {
- super.buildShowHideElementsList(results);
-
- List<Object> result = new ArrayList<Object>();
-
- // we remove the EditPartRepresentation from the result
- for(int i = 0; i < results.length; i++) {
- if((results[i] instanceof RootEditPartRepresentation || results[i] instanceof CompartmentEditPartRepresentation)) {
- continue;
- } else {
- result.add(results[i]);
- }
- }
-
- // we are looking for the objects to show
- for(Object element : result) {
- if(initialSelection.contains(element)) {
- // we do nothing
- continue;
- } else if(element instanceof EditPartRepresentation) {
- viewsToCreate.add((EditPartRepresentation)element);
- }
- }
-
- // we are looking for the view to destroy
- for(Object current : this.initialSelection) {
- if(!result.contains(current) && current instanceof EditPartRepresentation) {
- viewsToDestroy.add((EditPartRepresentation)current);
- }
- }
- }
-
- /**
- * Return the editpart representation owning the element
- *
- * @param element
- * the element which we are looking for
- * @return the editpart representation owning the element
- */
- protected EditPartRepresentation findEditPartRepresentation(Object element) {
- for(EditPartRepresentation current : representations) {
- if(current.getPossibleElement().contains(element)) {
- return current;
- } else {
- EList<?> views = current.getRepresentedEditPart().getNotationView().getChildren();
- if(views.contains(element)) {
- return current;
- }
- }
- }
- return null;
- }
-
- public class CustomComparator implements Comparator<Object> {
-
- /** this list contains the name of all the classes which want sort */
- private List<String> classesList;
-
- /**
- * Constructor.
- *
- * @param members
- * the elements to sort
- */
- public CustomComparator(List<NamedElement> elements) {
- buildList(elements);
- }
-
- /**
- * Fill {@link #classesList} with the class name of each element to sort
- *
- * @param elements
- * the elements to sort
- */
- public void buildList(List<NamedElement> elements) {
- this.classesList = new ArrayList<String>();
- for(NamedElement namedElement : elements) {
- this.classesList.add(new String(namedElement.getClass().getSimpleName()));
- }
- Collections.sort(classesList);
- }
-
- /**
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Object o1, Object o2) {
-
- String name1 = o1.getClass().getSimpleName();
- String name2 = o2.getClass().getSimpleName();
- int index1 = classesList.indexOf(name1);
- int index2 = classesList.indexOf(name2);
- int classIndex = classesList.indexOf("ClassImpl"); //$NON-NLS-1$
- if(index1 == index2 && index1 == classIndex) {
- boolean metaclassO1 = Util.isMetaclass((Type)o1);
- boolean metaclassO2 = Util.isMetaclass((Type)o2);
- if(metaclassO1 && !metaclassO2) {
- return 1;
- } else if(!metaclassO1 && metaclassO2) {
- return -1;
- }
- return 0;
- }
- if(index1 == -1) {
- Activator.log.debug("The class " + name1 + " is unknown by " + this.getClass());//$NON-NLS-1$ //$NON-NLS-2$
- return -1;
- } else if(index1 == index2) {
- return 0;
- } else if(index1 > index2) {
- return 1;
- } else if(index1 < index2) {
- return -1;
- }
- return 0;
- }
-
- }
-
- /**
- * Content provider for the {@link CheckedTreeSelectionDialog}
- */
- public class ContentProvider implements ITreeContentProvider {
-
- /**
- * {@inheritDoc}
- */
- public void dispose() {
- // nothing here
- }
-
- /**
- * {@inheritDoc}
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // nothing here
- }
-
- /**
- * {@inheritDoc}
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List) {
- return ((List<?>)inputElement).toArray();
- }
- return new Object[0];
- }
-
- /**
- * {@inheritDoc}
- */
- public Object[] getChildren(Object parentElement) {
- // if(parentElement instanceof RootEditPartRepresentation) {
- // RootEditPartRepresentation parentRepresentation = (RootEditPartRepresentation)parentElement;
- // return parentRepresentation.getPossibleElement().toArray();
- // } else if(parentElement instanceof CompartmentEditPartRepresentation) {
- // CompartmentEditPartRepresentation compartmentRepresentation = (CompartmentEditPartRepresentation)parentElement;
- // return compartmentRepresentation.getPossibleElement().toArray();
- // }
- if(parentElement instanceof EditPartRepresentation) {
- return ((EditPartRepresentation)parentElement).getPossibleElement().toArray();
- }
- return new Object[0];
-
-
- // // in case of parent is the main edit part => returns all compartment
- // // if this is a compartment, returns all members that can be displayed
- // if(parentElement instanceof CompartmentEditPartRepresentation) {
- // CompartmentEditPartRepresentation compartmentRepresentation = (CompartmentEditPartRepresentation)parentElement;
- //
- // // case parent is a compartment edit part
- // EObject myClassifier = compartmentRepresentation.getUMLElement();
- // if(myClassifier instanceof Classifier) {
- // // returns all members that can be displayed in this compartment
- // List<NamedElement> members = new ArrayList<NamedElement>();
- // EList<NamedElement> localMembers = ((Classifier)myClassifier).getOwnedMembers();
- // for(NamedElement namedElement : localMembers) {
- // if(((EditPartRepresentation)parentElement).getPossibleElement().contains(namedElement)) {
- // members.add(namedElement);
- // }
- // }
- // Collections.sort(members, new CustomComparator(members));
- // return members.toArray();
- // }
- // } else if(parentElement instanceof EditPartRepresentation) {// case parent is the main edit part
- // EditPartRepresentation parentRepresentation = (EditPartRepresentation)parentElement;
- // Element element = parentRepresentation.getUMLElement();
- // if(element instanceof Classifier) {
- // List<CompartmentEditPartRepresentation> compartmentRepresentations = new ArrayList<CompartmentEditPartRepresentation>();
- // List<IResizableCompartmentEditPart> compartmentEditParts = CompartmentUtils.getAllCompartmentsEditPart(parentRepresentation.getRepresentedEditPart(), false);
- // for(IResizableCompartmentEditPart currentEditPart : compartmentEditParts) {
- // CompartmentEditPartRepresentation representation = new CompartmentEditPartRepresentation(currentEditPart, (Classifier)element);
- // compartmentRepresentations.add(representation);
- // }
- // return compartmentRepresentations.toArray();
- // }
- // }
- // return new Object[]{};
- }
-
- /**
- * {@inheritDoc}
- */
- public Object getParent(Object element) {
- if(element instanceof EditPartRepresentation) {
- EditPartRepresentation editPartRepresentation = (EditPartRepresentation)element;
- return editPartRepresentation.getParentRepresentation();
- }
-
- // if(!(element instanceof EditPartRepresentation)) {
- // EditPartRepresentation rep = findEditPartRepresentation(element);
- // if(rep != null) {
- //
- // Classifier classifier = (Classifier)(rep).getUMLElement();
- // if(classifier.getOwnedMembers().contains(element)) {
- // return rep;
- // } else {
- // // for(ClassifierRepresentation classRep : ((CustomEditPartRepresentation)rep).getSuperClasses()) {
- // // if(classRep.ownsElement(element)) {
- // // return classRep;
- // // }
- // // }
- // }
- // }
- // }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean hasChildren(Object element) {
- if(getChildren(element) != null && getChildren(element).length > 0) {
- return true;
- }
- return false;
- }
-
- }
-
- /**
- * Class that represents the root edit part taht contains the compartments
- */
- protected class RootEditPartRepresentation extends EditPartRepresentation {
-
- /**
- * Creates a new {@link RootEditPartRepresentation}
- *
- * @param representedEditPart
- * the edit part managed by this representation
- * @param classifier
- * the classifier managed by the represented edit part
- */
- public RootEditPartRepresentation(IGraphicalEditPart representedEditPart, Classifier classifier) {
- super(representedEditPart, classifier);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Classifier getSemanticElement() {
- return (Classifier)super.getSemanticElement();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initRepresentation() {
- super.initRepresentation();
-
- List<IResizableCompartmentEditPart> compartmentEditParts = CompartmentUtils.getAllCompartmentsEditPart(getRepresentedEditPart(), false);
- for(IResizableCompartmentEditPart currentEditPart : compartmentEditParts) {
- CompartmentEditPartRepresentation representation = new CompartmentEditPartRepresentation(currentEditPart, getSemanticElement(), this);
- elementsToSelect.add(representation);
- }
-
- // check if the element has a affixed child edit policy => will be treated as a compartment
- EditPolicy policy = getRepresentedEditPart().getEditPolicy(AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE);
- if(policy != null) {
- // there can be some affixed children, create a pseudo compartment edit part representation
- AffixedChildrenEditPartRepresentation representation = new AffixedChildrenEditPartRepresentation(getSemanticElement(), this);
- elementsToSelect.add(representation);
- }
- }
- }
-
- /**
- * Class that represents the compartment edit parts.
- */
- protected class CompartmentEditPartRepresentation extends EditPartRepresentation {
-
- /**
- * Creates a new {@link CompartmentEditPartRepresentation}
- *
- * @param compartmentEditPart
- * the compartment edit part managed by this representation
- * @param classifier
- * the classifier managed by the represented edit part
- * @param parentRepresentation
- * parent presentation of this parent
- */
- public CompartmentEditPartRepresentation(IResizableCompartmentEditPart compartmentEditPart, Classifier classifier, EditPartRepresentation parentRepresentation) {
- super(compartmentEditPart, classifier, parentRepresentation);
- }
-
- // /**
- // * Returns the title of the compartment
- // *
- // * @return the title of the compartment
- // */
- // public String getCompartmentName() {
- // if(getRepresentedEditPart() instanceof IResizableCompartmentEditPart) {
- // return ((IResizableCompartmentEditPart)getRepresentedEditPart()).getCompartmentName();
- // }
- // // this is not a compartment, but the virtual placeholder for border items
- // return "Not a Compartment";
- // }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getLabel() {
- if(getRepresentedEditPart() instanceof IResizableCompartmentEditPart) {
- return ((IResizableCompartmentEditPart)getRepresentedEditPart()).getCompartmentName();
- }
- return super.getLabel();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Classifier getSemanticElement() {
- return (Classifier)super.getSemanticElement();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initRepresentation() {
- // call super first
- super.initRepresentation();
-
- EList<NamedElement> members = getSemanticElement().getMembers();
- for(NamedElement namedElement : members) {
- if(canContain(namedElement)) {
- // create the leaf representation
- OptionalEditPartRepresentation editPartRepresentation = new OptionalEditPartRepresentation(null, namedElement, this);
- this.elementsToSelect.add(editPartRepresentation);
- // build the initial selection
- EList<?> childrenView = getRepresentedEditPart().getNotationView().getVisibleChildren();
- for(Object object : childrenView) {
- if(object instanceof View) {
- if(((View)object).getElement() == namedElement) {
- this.initialSelection.add(editPartRepresentation);
-
- // set the edit part in the optional edit part representation
- for(Object o : getRepresentedEditPart().getChildren()) {
- if(o instanceof IGraphicalEditPart) {
- if(((View)object).equals(((IGraphicalEditPart)o).getNotationView())) {
- editPartRepresentation.setRepresentedEditPart((IGraphicalEditPart)o);
- }
- }
- }
- break;
- }
- }
- }
- }
- }
-
- }
-
- /**
- * REturns <code>true</code> if the associated compartment edit part can contain the given element
- *
- * @param namedElement
- * the named element to show/hide
- * @return <code>true</code> if the compartment can display the element
- */
- protected boolean canContain(NamedElement namedElement) {
- TransactionalEditingDomain domain = getRepresentedEditPart().getEditingDomain();
- ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(namedElement), Node.class, null, ViewUtil.APPEND, false, getRepresentedEditPart().getDiagramPreferencesHint());
-
- CreateCommand cmd = new CreateCommand(domain, viewDescriptor, getRepresentedEditPart().getNotationView());
- return (cmd.canExecute());
- }
- }
-
- /**
- * Specific edit part representation for edit part that can display affixed children. It extends {@link CompartmentEditPartRepresentation}, as
- * this is displayed at the same level.
- */
- protected class AffixedChildrenEditPartRepresentation extends CompartmentEditPartRepresentation {
-
- /**
- * Constructor.
- *
- * @param classifier
- * uml element linked to this representation
- * @param parentRepresentation
- * the main edit part against which show/hide content action is performed
- */
- public AffixedChildrenEditPartRepresentation(Classifier classifier, EditPartRepresentation parentRepresentation) {
- super(null, classifier, parentRepresentation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean canContain(NamedElement namedElement) {
- TransactionalEditingDomain domain = getParentRepresentation().getRepresentedEditPart().getEditingDomain();
- ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(namedElement), Node.class, null, ViewUtil.APPEND, false, getParentRepresentation().getRepresentedEditPart().getDiagramPreferencesHint());
-
- CreateCommand cmd = new CreateCommand(domain, viewDescriptor, getParentRepresentation().getRepresentedEditPart().getNotationView());
- return (cmd.canExecute());
-
- //return super.canContain(namedElement);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IGraphicalEditPart getRepresentedEditPart() {
- return getParentRepresentation().getRepresentedEditPart();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getLabel() {
- return "Border Items";
- }
-
- @Override
- protected void initRepresentation() {
- this.initialSelection = new ArrayList<EditPartRepresentation>();
- this.elementsToSelect = new ArrayList<EditPartRepresentation>();
-
- EList<NamedElement> members = getSemanticElement().getMembers();
- for(NamedElement namedElement : members) {
- if(canContain(namedElement)) {
- // create the leaf representation
- OptionalEditPartRepresentation editPartRepresentation = new OptionalEditPartRepresentation(null, namedElement, this);
- this.elementsToSelect.add(editPartRepresentation);
- // build the initial selection
- EList<?> childrenView = getParentRepresentation().getRepresentedEditPart().getNotationView().getVisibleChildren();
- for(Object object : childrenView) {
- if(object instanceof View) {
- if(((View)object).getElement() == namedElement) {
- this.initialSelection.add(editPartRepresentation);
-
- // set the edit part in the optional edit part representation
- for(Object o : getParentRepresentation().getRepresentedEditPart().getChildren()) {
- if(o instanceof IGraphicalEditPart) {
- if(((View)object).equals(((IGraphicalEditPart)o).getNotationView())) {
- editPartRepresentation.setRepresentedEditPart((IGraphicalEditPart)o);
- break;
- }
- }
- }
- break;
- }
- }
- }
- }
- }
- }
-
-
-
- }
-
- /**
- * Class that manages an element that can not be displayed currently
- */
- protected class OptionalEditPartRepresentation extends EditPartRepresentation {
-
- /**
- * Creates a new {@link OptionalEditPartRepresentation}
- *
- * @param representedEditPart
- * the edit part managed by this representation, which can be <code>null</code> in this implementation
- * @param element
- * the semantic element managed by the represented edit part
- * @param parentRepresentation
- * parent representation for this edit part (should be a compartment edit part representation)
- */
- public OptionalEditPartRepresentation(IGraphicalEditPart representedEditPart, Element element, CompartmentEditPartRepresentation parentRepresentation) {
- super(representedEditPart, element, parentRepresentation);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public CompartmentEditPartRepresentation getParentRepresentation() {
- return (CompartmentEditPartRepresentation)super.getParentRepresentation();
- }
-
- }
-
- // /**
- // * The custom EditPartRepresentation for this action
- // */
- // protected class CustomEditPartRepresentation extends EditPartRepresentation {
- //
- // /**
- // * this list contains the representation of all classifiers which are
- // * superclass of the classifier represented by EditPartRepresentaiton
- // */
- // protected List<ClassifierRepresentation> superClasses;
- //
- // /**
- // *
- // * Constructor.
- // *
- // * @param representedEditPart
- // * the edit part managing the classifier
- // * @param classifier
- // * the classifier for which display is customized
- // */
- // public CustomEditPartRepresentation(EditPart representedEditPart, Classifier classifier) {
- // super(representedEditPart, classifier);
- // }
- //
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // protected void initRepresentation() {
- // super.initRepresentation();
- // this.superClasses = new ArrayList<ShowHideContentsAction.ClassifierRepresentation>();
- // if(this.UMLElement instanceof Classifier) {
- // EList<Classifier> parents = ((Classifier)UMLElement).allParents();
- // for(Classifier classifier : parents) {
- // superClasses.add(new ClassifierRepresentation(classifier, this));
- // }
- //
- // /*
- // * build the list of the elements to select we suggest only the
- // * elements which can be displayed in the shown compartments
- // */
- // EList<NamedElement> members = ((Classifier)UMLElement).getMembers();
- // for(NamedElement namedElement : members) {
- // View compartment = getCompartmentForCreation(this.representedEditPart, namedElement);
- // if(compartment != null) {
- // this.elementsToSelect.add(namedElement);
- //
- // // build the initial selection
- // EList<?> childrenView = compartment.getVisibleChildren();
- // for(Object object : childrenView) {
- // if(object instanceof View) {
- // if(((View)object).getElement() == namedElement) {
- // this.initialSelection.add(namedElement);
- // break;
- // }
- // }
- // }
- // }
- // }
- // }
- // }
- //
- // /**
- // *
- // * @return a list containing the {@link ClassifierRepresentation} for
- // * each superclass of the {@link #representedEditPart}
- // */
- // public List<ClassifierRepresentation> getSuperClasses() {
- // return this.superClasses;
- // }
- //
- // }
-
- // /**
- // * Extends the edit part representation only for compartments edit part
- // */
- // protected class CompartmentEditPartRepresentation extends EditPartRepresentation {
- //
- // /**
- // * Constructor.
- // *
- // * @param compartmentEditPart
- // * the compartment edit part represented
- // * @param umlElement
- // * the uml element for which the compartment is displayed
- // */
- // public CompartmentEditPartRepresentation(IResizableCompartmentEditPart compartmentEditPart, Classifier umlElement) {
- // super(compartmentEditPart, umlElement);
- // }
- //
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // public IResizableCompartmentEditPart getRepresentedEditPart() {
- // return (IResizableCompartmentEditPart)super.getRepresentedEditPart();
- // }
- //
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // public Classifier getUMLElement() {
- // return (Classifier)super.getUMLElement();
- // }
- //
- // /**
- // * {@inheritDoc}
- // */
- // @Override
- // protected void initRepresentation() {
- // // call super first
- // super.initRepresentation();
- //
- // EList<NamedElement> members = getUMLElement().getMembers();
- // for(NamedElement namedElement : members) {
- // if(canContain(namedElement)) {
- // this.elementsToSelect.add(namedElement);
- // // build the initial selection
- // EList<?> childrenView = getRepresentedEditPart().getNotationView().getVisibleChildren();
- // for(Object object : childrenView) {
- // if(object instanceof View) {
- // if(((View)object).getElement() == namedElement) {
- // this.initialSelection.add(namedElement);
- // break;
- // }
- // }
- // }
- // }
- // }
- //
- // }
- //
- // /**
- // * REturns <code>true</code> if the associated compartment edit part can contain the given element
- // *
- // * @param namedElement
- // * the named element to show/hide
- // * @return <code>true</code> if the compartment can display the element
- // */
- // protected boolean canContain(NamedElement namedElement) {
- // TransactionalEditingDomain domain = getRepresentedEditPart().getEditingDomain();
- // ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(namedElement), Node.class, null, ViewUtil.APPEND, false, getRepresentedEditPart().getDiagramPreferencesHint());
- //
- // CreateCommand cmd = new CreateCommand(domain, viewDescriptor, getRepresentedEditPart().getNotationView());
- // return (cmd.canExecute());
- // }
- // }
-
- // /**
- // *
- // * This class is used to do easily the difference between the nested
- // * classifiers and the superclass of the selected class in the Tree The
- // * superclass are represented with this class
- // */
- // protected class ClassifierRepresentation {
- //
- // /** the represented classifier */
- // protected Classifier representedClassifier;
- //
- // /** the CustomEditPartRepresentation owning this classifier */
- // protected EditPartRepresentation rep;
- //
- // /**
- // * Constructor.
- // *
- // * @param representedClassifier
- // * the represented classifier
- // * @param rep
- // * the representation containing this classifier
- // */
- // public ClassifierRepresentation(Classifier representedClassifier, CustomEditPartRepresentation rep) {
- // this.representedClassifier = representedClassifier;
- // this.rep = rep;
- // }
- //
- // public boolean ownsElement(Object element) {
- // if(representedClassifier.getOwnedMembers().contains(element)) {
- // return true;
- // }
- // return false;
- // }
- //
- // /**
- // * Getter for {@link #representedClassifier}
- // *
- // * @return {@link #representedClassifier}
- // */
- // public Classifier getRepresentedClassifier() {
- // return this.representedClassifier;
- // }
- //
- // /**
- // * Getter for {@link #rep}
- // *
- // * @return {@link #rep}
- // */
- // public EditPartRepresentation getEditPartRepresentation() {
- // return this.rep;
- // }
- //
- // }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.actions;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+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.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IResizableCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideElementsRequest;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AffixedNodeAlignmentEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideClassifierContentsEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.util.CompartmentUtils;
+import org.eclipse.papyrus.uml.diagram.common.util.Util;
+import org.eclipse.ui.IActionDelegate;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ *
+ * This class provides an action to show/hide the owned members and the
+ * inherited members for a Classifier
+ *
+ */
+public class ShowHideContentsAction extends AbstractShowHideAction implements IActionDelegate, IWorkbenchWindowActionDelegate {
+
+ /** INCREMENT for the location of the elements to show(ports and properties) */
+ private static int INCREMENT = 10;
+
+ /**
+ * Constructor.
+ */
+ public ShowHideContentsAction() {
+ this(Messages.ShowHideContentsAction_Title, Messages.ShowHideContentsAction_Message, ShowHideClassifierContentsEditPolicy.SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param title
+ * title for the dialog
+ * @param message
+ * message for the dialog
+ * @param editPolicyKey
+ * EditPolicy used for this action
+ */
+ public ShowHideContentsAction(String title, String message, String editPolicyKey) {
+ super(title, message, editPolicyKey);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection instanceof StructuredSelection) {
+ if(((StructuredSelection)selection).size() > 1) {
+ action.setEnabled(false);
+ return;
+ }
+ }
+ super.selectionChanged(action, selection);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initAction() {
+ super.initAction();
+ for(IGraphicalEditPart current : this.selectedElements) {
+ // the selected elements which aren't Classifier are ignored
+ if(((View)current.getModel()).getElement() instanceof Classifier) {
+ this.representations.add(new RootEditPartRepresentation(current, (Classifier)((View)current.getModel()).getElement()));
+ }
+ }
+ // this.setEditorLabelProvider(new CustomEditorLabelProvider());
+ this.setContentProvider(new ContentProvider());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected List<Object> getInput() {
+ List<Object> list = new ArrayList<Object>();
+ list.addAll(representations);
+ return list;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getActionCommand() {
+
+ ShowHideElementsRequest req = null;
+ CompoundCommand completeCmd = new CompoundCommand("Show/Hide Inherited Elements Command"); //$NON-NLS-1$
+
+ /*
+ * the command to hide elements we need the corresponding editpart
+ */
+ for(EditPartRepresentation current : this.viewsToDestroy) {
+ EditPart ep = current.getRepresentedEditPart(); // should not be null, because EP to destroy really exists
+ if(ep != null) {
+ req = new ShowHideElementsRequest(ep);
+ EditPart parent = ep.getParent();
+ if(parent instanceof CompartmentEditPart) {
+ parent = parent.getParent();
+ }
+ Command cmd = parent.getCommand(req);
+ if(cmd != null && cmd.canExecute()) {
+ completeCmd.add(cmd);
+ }
+ } else {
+ Activator.log.error("the edit part for this representation " + current + " should not be null", null);
+ }
+ }
+
+ // the command to show element
+ Point propertyLocation = new Point();
+ Point portLocation = new Point(-10, -2 * INCREMENT + 1);
+ for(EditPartRepresentation rep : this.viewsToCreate) {
+ if(!(rep instanceof OptionalEditPartRepresentation)) {
+ continue;
+ }
+ EditPart ep = ((OptionalEditPartRepresentation)rep).getParentRepresentation().getParentRepresentation().getRepresentedEditPart();
+ View compartmentView = ((OptionalEditPartRepresentation)rep).getParentRepresentation().getRepresentedEditPart().getNotationView();
+ if(compartmentView != null) {
+ req = new ShowHideElementsRequest(compartmentView, ((OptionalEditPartRepresentation)rep).getSemanticElement());
+ if(isXYLayout(compartmentView, ep)) {
+ propertyLocation.x += INCREMENT;
+ propertyLocation.y += INCREMENT;
+ req.setLocation(new Point(propertyLocation));
+
+ } else if(isAffixedChildNode(ep, ((OptionalEditPartRepresentation)rep).getSemanticElement())) {
+ portLocation.y += INCREMENT;
+ req.setLocation(new Point(portLocation));
+ }
+ Command cmd = ep.getCommand(req);
+ if(cmd != null && cmd.canExecute()) {
+ completeCmd.add(cmd);
+ }
+ }
+ }
+ return completeCmd;
+ }
+
+ /**
+ * Test if the child is represented by an affixed child node
+ * TODO This method will not work if we have an UML element E1 which inherits from
+ * another element E2 and if E2 is represented by an affixed child node and
+ * not E1!
+ *
+ * @param ep
+ * the parent EditPart
+ * @param child
+ * the child to show
+ * @return <ul>
+ * <li><code>true</code> if child is represented by an affixed child node</li>
+ * <li> <code>false</code> if not</li>
+ * </ul>
+ */
+ protected boolean isAffixedChildNode(EditPart ep, EObject child) {
+ TransactionalEditingDomain domain = ((IGraphicalEditPart)ep).getEditingDomain();
+ ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(child), Node.class, null, ViewUtil.APPEND, false, ((IGraphicalEditPart)ep).getDiagramPreferencesHint());
+ CreateCommand cmd = new CreateCommand(domain, viewDescriptor, (View)ep.getModel());
+ if(cmd.canExecute()) {
+ /*
+ * the EditPart can own the child -> it's maybe an affixed child
+ * node
+ */
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Test if the layout for this compartment is a XYLayout
+ *
+ * @param compartment
+ * the compartment to test
+ * @param ep
+ * the editpart owning this compartment
+ * @return <ul>
+ * <li><code>true</code> if the layout for this compartment is a XYLayout</li>
+ * <li> <code>false</code> if not</li>
+ * </ul>
+ */
+ protected boolean isXYLayout(View compartment, EditPart ep) {
+ List<?> children = ep.getChildren();
+ for(Object current : children) {
+ if(current instanceof EditPart) {
+ if(((EditPart)current).getModel() == compartment) {
+ EditPolicy editpolicy = ((EditPart)current).getEditPolicy(XYLayoutEditPolicy.LAYOUT_ROLE);
+ if(editpolicy != null) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Return the EditParts owned by this EditPart. When the owned EditPart is a
+ * CompartmentEditPart, we return its containing EditPart
+ *
+ *
+ * @param ep
+ * an editpart
+ * @return The EditParts owned by this EditPart. When the owned EditPart is
+ * a CompartmentEditPart, we return its containing EditPart
+ */
+ protected List<EditPart> getChildrenEditPart(EditPart ep) {
+ List<EditPart> children = new ArrayList<EditPart>();
+ List<?> tmp = ep.getChildren();
+ for(Object current : tmp) {
+ // we don't want the compartment used for the name
+ if(current instanceof ITextAwareEditPart) {
+ continue;
+ // if it's a compartment, we want it's children
+ } else if(current instanceof CompartmentEditPart) {
+ children.addAll(((CompartmentEditPart)current).getChildren());
+ // it's an affixed child node?!
+ } else {
+ children.add((EditPart)current);
+ }
+ }
+
+ return children;
+ }
+
+ /**
+ * Return the compartment which allows the creation of the EObject
+ *
+ * @param editPart
+ * an editpart
+ * @param child
+ * an object to create
+ * @return the compartment which allows the creation of this EObject or <code>null</code>
+ */
+ protected View getCompartmentForCreation(EditPart editPart, EObject child) {
+ if(isAffixedChildNode(editPart, child)) {
+ return (View)editPart.getModel();
+ }
+ TransactionalEditingDomain domain = ((IGraphicalEditPart)editPart).getEditingDomain();
+ ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(child), Node.class, null, ViewUtil.APPEND, false, ((IGraphicalEditPart)editPart).getDiagramPreferencesHint());
+
+ List<View> visibleCompartments = ((IGraphicalEditPart)editPart).getNotationView().getVisibleChildren();
+ for(View currentComp : visibleCompartments) {
+ CreateCommand cmd = new CreateCommand(domain, viewDescriptor, currentComp);
+ if(cmd.canExecute()) {
+ return currentComp;
+ }
+ }
+ return null;
+ }
+
+ // /**
+ // * Return the EditPart owning the Object or <code>null</code>
+ // *
+ // * @param obj
+ // * @return the EditPart owning the Object or <code>null</code>
+ // */
+ // protected EditPart findEditPart(EditPartRepresentation obj) {
+ // EditPart ep = null;
+ // EditPart parentEditPart = obj.getParentRepresentation().getRepresentedEditPart();
+ // for(Object child : parentEditPart.getChildren()) {
+ // EditPart child = (EditPart)child;
+ // }
+ //
+ // Iterator<EditPartRepresentation> it = representations.iterator();
+ //
+ // while(ep == null && it.hasNext()) {
+ // List<EditPart> children = getChildrenEditPart(it.next().getRepresentedEditPart());
+ // for(EditPart editPart : children) {
+ // if(((View)editPart.getModel()).getElement() == obj) {
+ // return editPart;
+ // }
+ // }
+ // }
+ // return null;
+ // }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void buildShowHideElementsList(Object[] results) {
+ super.buildShowHideElementsList(results);
+
+ List<Object> result = new ArrayList<Object>();
+
+ // we remove the EditPartRepresentation from the result
+ for(int i = 0; i < results.length; i++) {
+ if((results[i] instanceof RootEditPartRepresentation || results[i] instanceof CompartmentEditPartRepresentation)) {
+ continue;
+ } else {
+ result.add(results[i]);
+ }
+ }
+
+ // we are looking for the objects to show
+ for(Object element : result) {
+ if(initialSelection.contains(element)) {
+ // we do nothing
+ continue;
+ } else if(element instanceof EditPartRepresentation) {
+ viewsToCreate.add((EditPartRepresentation)element);
+ }
+ }
+
+ // we are looking for the view to destroy
+ for(Object current : this.initialSelection) {
+ if(!result.contains(current) && current instanceof EditPartRepresentation) {
+ viewsToDestroy.add((EditPartRepresentation)current);
+ }
+ }
+ }
+
+ /**
+ * Return the editpart representation owning the element
+ *
+ * @param element
+ * the element which we are looking for
+ * @return the editpart representation owning the element
+ */
+ protected EditPartRepresentation findEditPartRepresentation(Object element) {
+ for(EditPartRepresentation current : representations) {
+ if(current.getPossibleElement().contains(element)) {
+ return current;
+ } else {
+ EList<?> views = current.getRepresentedEditPart().getNotationView().getChildren();
+ if(views.contains(element)) {
+ return current;
+ }
+ }
+ }
+ return null;
+ }
+
+ public class CustomComparator implements Comparator<Object> {
+
+ /** this list contains the name of all the classes which want sort */
+ private List<String> classesList;
+
+ /**
+ * Constructor.
+ *
+ * @param members
+ * the elements to sort
+ */
+ public CustomComparator(List<NamedElement> elements) {
+ buildList(elements);
+ }
+
+ /**
+ * Fill {@link #classesList} with the class name of each element to sort
+ *
+ * @param elements
+ * the elements to sort
+ */
+ public void buildList(List<NamedElement> elements) {
+ this.classesList = new ArrayList<String>();
+ for(NamedElement namedElement : elements) {
+ this.classesList.add(new String(namedElement.getClass().getSimpleName()));
+ }
+ Collections.sort(classesList);
+ }
+
+ /**
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ */
+ public int compare(Object o1, Object o2) {
+
+ String name1 = o1.getClass().getSimpleName();
+ String name2 = o2.getClass().getSimpleName();
+ int index1 = classesList.indexOf(name1);
+ int index2 = classesList.indexOf(name2);
+ int classIndex = classesList.indexOf("ClassImpl"); //$NON-NLS-1$
+ if(index1 == index2 && index1 == classIndex) {
+ boolean metaclassO1 = Util.isMetaclass((Type)o1);
+ boolean metaclassO2 = Util.isMetaclass((Type)o2);
+ if(metaclassO1 && !metaclassO2) {
+ return 1;
+ } else if(!metaclassO1 && metaclassO2) {
+ return -1;
+ }
+ return 0;
+ }
+ if(index1 == -1) {
+ Activator.log.debug("The class " + name1 + " is unknown by " + this.getClass());//$NON-NLS-1$ //$NON-NLS-2$
+ return -1;
+ } else if(index1 == index2) {
+ return 0;
+ } else if(index1 > index2) {
+ return 1;
+ } else if(index1 < index2) {
+ return -1;
+ }
+ return 0;
+ }
+
+ }
+
+ /**
+ * Content provider for the {@link CheckedTreeSelectionDialog}
+ */
+ public class ContentProvider implements ITreeContentProvider {
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dispose() {
+ // nothing here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // nothing here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof List) {
+ return ((List<?>)inputElement).toArray();
+ }
+ return new Object[0];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object[] getChildren(Object parentElement) {
+ // if(parentElement instanceof RootEditPartRepresentation) {
+ // RootEditPartRepresentation parentRepresentation = (RootEditPartRepresentation)parentElement;
+ // return parentRepresentation.getPossibleElement().toArray();
+ // } else if(parentElement instanceof CompartmentEditPartRepresentation) {
+ // CompartmentEditPartRepresentation compartmentRepresentation = (CompartmentEditPartRepresentation)parentElement;
+ // return compartmentRepresentation.getPossibleElement().toArray();
+ // }
+ if(parentElement instanceof EditPartRepresentation) {
+ return ((EditPartRepresentation)parentElement).getPossibleElement().toArray();
+ }
+ return new Object[0];
+
+
+ // // in case of parent is the main edit part => returns all compartment
+ // // if this is a compartment, returns all members that can be displayed
+ // if(parentElement instanceof CompartmentEditPartRepresentation) {
+ // CompartmentEditPartRepresentation compartmentRepresentation = (CompartmentEditPartRepresentation)parentElement;
+ //
+ // // case parent is a compartment edit part
+ // EObject myClassifier = compartmentRepresentation.getUMLElement();
+ // if(myClassifier instanceof Classifier) {
+ // // returns all members that can be displayed in this compartment
+ // List<NamedElement> members = new ArrayList<NamedElement>();
+ // EList<NamedElement> localMembers = ((Classifier)myClassifier).getOwnedMembers();
+ // for(NamedElement namedElement : localMembers) {
+ // if(((EditPartRepresentation)parentElement).getPossibleElement().contains(namedElement)) {
+ // members.add(namedElement);
+ // }
+ // }
+ // Collections.sort(members, new CustomComparator(members));
+ // return members.toArray();
+ // }
+ // } else if(parentElement instanceof EditPartRepresentation) {// case parent is the main edit part
+ // EditPartRepresentation parentRepresentation = (EditPartRepresentation)parentElement;
+ // Element element = parentRepresentation.getUMLElement();
+ // if(element instanceof Classifier) {
+ // List<CompartmentEditPartRepresentation> compartmentRepresentations = new ArrayList<CompartmentEditPartRepresentation>();
+ // List<IResizableCompartmentEditPart> compartmentEditParts = CompartmentUtils.getAllCompartmentsEditPart(parentRepresentation.getRepresentedEditPart(), false);
+ // for(IResizableCompartmentEditPart currentEditPart : compartmentEditParts) {
+ // CompartmentEditPartRepresentation representation = new CompartmentEditPartRepresentation(currentEditPart, (Classifier)element);
+ // compartmentRepresentations.add(representation);
+ // }
+ // return compartmentRepresentations.toArray();
+ // }
+ // }
+ // return new Object[]{};
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getParent(Object element) {
+ if(element instanceof EditPartRepresentation) {
+ EditPartRepresentation editPartRepresentation = (EditPartRepresentation)element;
+ return editPartRepresentation.getParentRepresentation();
+ }
+
+ // if(!(element instanceof EditPartRepresentation)) {
+ // EditPartRepresentation rep = findEditPartRepresentation(element);
+ // if(rep != null) {
+ //
+ // Classifier classifier = (Classifier)(rep).getUMLElement();
+ // if(classifier.getOwnedMembers().contains(element)) {
+ // return rep;
+ // } else {
+ // // for(ClassifierRepresentation classRep : ((CustomEditPartRepresentation)rep).getSuperClasses()) {
+ // // if(classRep.ownsElement(element)) {
+ // // return classRep;
+ // // }
+ // // }
+ // }
+ // }
+ // }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasChildren(Object element) {
+ if(getChildren(element) != null && getChildren(element).length > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ }
+
+ /**
+ * Class that represents the root edit part taht contains the compartments
+ */
+ protected class RootEditPartRepresentation extends EditPartRepresentation {
+
+ /**
+ * Creates a new {@link RootEditPartRepresentation}
+ *
+ * @param representedEditPart
+ * the edit part managed by this representation
+ * @param classifier
+ * the classifier managed by the represented edit part
+ */
+ public RootEditPartRepresentation(IGraphicalEditPart representedEditPart, Classifier classifier) {
+ super(representedEditPart, classifier);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Classifier getSemanticElement() {
+ return (Classifier)super.getSemanticElement();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initRepresentation() {
+ super.initRepresentation();
+
+ List<IResizableCompartmentEditPart> compartmentEditParts = CompartmentUtils.getAllCompartmentsEditPart(getRepresentedEditPart(), false);
+ for(IResizableCompartmentEditPart currentEditPart : compartmentEditParts) {
+ CompartmentEditPartRepresentation representation = new CompartmentEditPartRepresentation(currentEditPart, getSemanticElement(), this);
+ elementsToSelect.add(representation);
+ }
+
+ // check if the element has a affixed child edit policy => will be treated as a compartment
+ EditPolicy policy = getRepresentedEditPart().getEditPolicy(AffixedNodeAlignmentEditPolicy.AFFIXED_CHILD_ALIGNMENT_ROLE);
+ if(policy != null) {
+ // there can be some affixed children, create a pseudo compartment edit part representation
+ AffixedChildrenEditPartRepresentation representation = new AffixedChildrenEditPartRepresentation(getSemanticElement(), this);
+ elementsToSelect.add(representation);
+ }
+ }
+ }
+
+ /**
+ * Class that represents the compartment edit parts.
+ */
+ protected class CompartmentEditPartRepresentation extends EditPartRepresentation {
+
+ /**
+ * Creates a new {@link CompartmentEditPartRepresentation}
+ *
+ * @param compartmentEditPart
+ * the compartment edit part managed by this representation
+ * @param classifier
+ * the classifier managed by the represented edit part
+ * @param parentRepresentation
+ * parent presentation of this parent
+ */
+ public CompartmentEditPartRepresentation(IResizableCompartmentEditPart compartmentEditPart, Classifier classifier, EditPartRepresentation parentRepresentation) {
+ super(compartmentEditPart, classifier, parentRepresentation);
+ }
+
+ // /**
+ // * Returns the title of the compartment
+ // *
+ // * @return the title of the compartment
+ // */
+ // public String getCompartmentName() {
+ // if(getRepresentedEditPart() instanceof IResizableCompartmentEditPart) {
+ // return ((IResizableCompartmentEditPart)getRepresentedEditPart()).getCompartmentName();
+ // }
+ // // this is not a compartment, but the virtual placeholder for border items
+ // return "Not a Compartment";
+ // }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getLabel() {
+ if(getRepresentedEditPart() instanceof IResizableCompartmentEditPart) {
+ return ((IResizableCompartmentEditPart)getRepresentedEditPart()).getCompartmentName();
+ }
+ return super.getLabel();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Classifier getSemanticElement() {
+ return (Classifier)super.getSemanticElement();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initRepresentation() {
+ // call super first
+ super.initRepresentation();
+
+ EList<NamedElement> members = getSemanticElement().getMembers();
+ for(NamedElement namedElement : members) {
+ if(canContain(namedElement)) {
+ // create the leaf representation
+ OptionalEditPartRepresentation editPartRepresentation = new OptionalEditPartRepresentation(null, namedElement, this);
+ this.elementsToSelect.add(editPartRepresentation);
+ // build the initial selection
+ EList<?> childrenView = getRepresentedEditPart().getNotationView().getVisibleChildren();
+ for(Object object : childrenView) {
+ if(object instanceof View) {
+ if(((View)object).getElement() == namedElement) {
+ this.initialSelection.add(editPartRepresentation);
+
+ // set the edit part in the optional edit part representation
+ for(Object o : getRepresentedEditPart().getChildren()) {
+ if(o instanceof IGraphicalEditPart) {
+ if(((View)object).equals(((IGraphicalEditPart)o).getNotationView())) {
+ editPartRepresentation.setRepresentedEditPart((IGraphicalEditPart)o);
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ /**
+ * REturns <code>true</code> if the associated compartment edit part can contain the given element
+ *
+ * @param namedElement
+ * the named element to show/hide
+ * @return <code>true</code> if the compartment can display the element
+ */
+ protected boolean canContain(NamedElement namedElement) {
+ TransactionalEditingDomain domain = getRepresentedEditPart().getEditingDomain();
+ ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(namedElement), Node.class, null, ViewUtil.APPEND, false, getRepresentedEditPart().getDiagramPreferencesHint());
+
+ CreateCommand cmd = new CreateCommand(domain, viewDescriptor, getRepresentedEditPart().getNotationView());
+ return (cmd.canExecute());
+ }
+ }
+
+ /**
+ * Specific edit part representation for edit part that can display affixed children. It extends {@link CompartmentEditPartRepresentation}, as
+ * this is displayed at the same level.
+ */
+ protected class AffixedChildrenEditPartRepresentation extends CompartmentEditPartRepresentation {
+
+ /**
+ * Constructor.
+ *
+ * @param classifier
+ * uml element linked to this representation
+ * @param parentRepresentation
+ * the main edit part against which show/hide content action is performed
+ */
+ public AffixedChildrenEditPartRepresentation(Classifier classifier, EditPartRepresentation parentRepresentation) {
+ super(null, classifier, parentRepresentation);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean canContain(NamedElement namedElement) {
+ TransactionalEditingDomain domain = getParentRepresentation().getRepresentedEditPart().getEditingDomain();
+ ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(namedElement), Node.class, null, ViewUtil.APPEND, false, getParentRepresentation().getRepresentedEditPart().getDiagramPreferencesHint());
+
+ CreateCommand cmd = new CreateCommand(domain, viewDescriptor, getParentRepresentation().getRepresentedEditPart().getNotationView());
+ return (cmd.canExecute());
+
+ //return super.canContain(namedElement);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IGraphicalEditPart getRepresentedEditPart() {
+ return getParentRepresentation().getRepresentedEditPart();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getLabel() {
+ return "Border Items";
+ }
+
+ @Override
+ protected void initRepresentation() {
+ this.initialSelection = new ArrayList<EditPartRepresentation>();
+ this.elementsToSelect = new ArrayList<EditPartRepresentation>();
+
+ EList<NamedElement> members = getSemanticElement().getMembers();
+ for(NamedElement namedElement : members) {
+ if(canContain(namedElement)) {
+ // create the leaf representation
+ OptionalEditPartRepresentation editPartRepresentation = new OptionalEditPartRepresentation(null, namedElement, this);
+ this.elementsToSelect.add(editPartRepresentation);
+ // build the initial selection
+ EList<?> childrenView = getParentRepresentation().getRepresentedEditPart().getNotationView().getVisibleChildren();
+ for(Object object : childrenView) {
+ if(object instanceof View) {
+ if(((View)object).getElement() == namedElement) {
+ this.initialSelection.add(editPartRepresentation);
+
+ // set the edit part in the optional edit part representation
+ for(Object o : getParentRepresentation().getRepresentedEditPart().getChildren()) {
+ if(o instanceof IGraphicalEditPart) {
+ if(((View)object).equals(((IGraphicalEditPart)o).getNotationView())) {
+ editPartRepresentation.setRepresentedEditPart((IGraphicalEditPart)o);
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+
+ }
+
+ /**
+ * Class that manages an element that can not be displayed currently
+ */
+ protected class OptionalEditPartRepresentation extends EditPartRepresentation {
+
+ /**
+ * Creates a new {@link OptionalEditPartRepresentation}
+ *
+ * @param representedEditPart
+ * the edit part managed by this representation, which can be <code>null</code> in this implementation
+ * @param element
+ * the semantic element managed by the represented edit part
+ * @param parentRepresentation
+ * parent representation for this edit part (should be a compartment edit part representation)
+ */
+ public OptionalEditPartRepresentation(IGraphicalEditPart representedEditPart, Element element, CompartmentEditPartRepresentation parentRepresentation) {
+ super(representedEditPart, element, parentRepresentation);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public CompartmentEditPartRepresentation getParentRepresentation() {
+ return (CompartmentEditPartRepresentation)super.getParentRepresentation();
+ }
+
+ }
+
+ // /**
+ // * The custom EditPartRepresentation for this action
+ // */
+ // protected class CustomEditPartRepresentation extends EditPartRepresentation {
+ //
+ // /**
+ // * this list contains the representation of all classifiers which are
+ // * superclass of the classifier represented by EditPartRepresentaiton
+ // */
+ // protected List<ClassifierRepresentation> superClasses;
+ //
+ // /**
+ // *
+ // * Constructor.
+ // *
+ // * @param representedEditPart
+ // * the edit part managing the classifier
+ // * @param classifier
+ // * the classifier for which display is customized
+ // */
+ // public CustomEditPartRepresentation(EditPart representedEditPart, Classifier classifier) {
+ // super(representedEditPart, classifier);
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // protected void initRepresentation() {
+ // super.initRepresentation();
+ // this.superClasses = new ArrayList<ShowHideContentsAction.ClassifierRepresentation>();
+ // if(this.UMLElement instanceof Classifier) {
+ // EList<Classifier> parents = ((Classifier)UMLElement).allParents();
+ // for(Classifier classifier : parents) {
+ // superClasses.add(new ClassifierRepresentation(classifier, this));
+ // }
+ //
+ // /*
+ // * build the list of the elements to select we suggest only the
+ // * elements which can be displayed in the shown compartments
+ // */
+ // EList<NamedElement> members = ((Classifier)UMLElement).getMembers();
+ // for(NamedElement namedElement : members) {
+ // View compartment = getCompartmentForCreation(this.representedEditPart, namedElement);
+ // if(compartment != null) {
+ // this.elementsToSelect.add(namedElement);
+ //
+ // // build the initial selection
+ // EList<?> childrenView = compartment.getVisibleChildren();
+ // for(Object object : childrenView) {
+ // if(object instanceof View) {
+ // if(((View)object).getElement() == namedElement) {
+ // this.initialSelection.add(namedElement);
+ // break;
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
+ // }
+ //
+ // /**
+ // *
+ // * @return a list containing the {@link ClassifierRepresentation} for
+ // * each superclass of the {@link #representedEditPart}
+ // */
+ // public List<ClassifierRepresentation> getSuperClasses() {
+ // return this.superClasses;
+ // }
+ //
+ // }
+
+ // /**
+ // * Extends the edit part representation only for compartments edit part
+ // */
+ // protected class CompartmentEditPartRepresentation extends EditPartRepresentation {
+ //
+ // /**
+ // * Constructor.
+ // *
+ // * @param compartmentEditPart
+ // * the compartment edit part represented
+ // * @param umlElement
+ // * the uml element for which the compartment is displayed
+ // */
+ // public CompartmentEditPartRepresentation(IResizableCompartmentEditPart compartmentEditPart, Classifier umlElement) {
+ // super(compartmentEditPart, umlElement);
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public IResizableCompartmentEditPart getRepresentedEditPart() {
+ // return (IResizableCompartmentEditPart)super.getRepresentedEditPart();
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // public Classifier getUMLElement() {
+ // return (Classifier)super.getUMLElement();
+ // }
+ //
+ // /**
+ // * {@inheritDoc}
+ // */
+ // @Override
+ // protected void initRepresentation() {
+ // // call super first
+ // super.initRepresentation();
+ //
+ // EList<NamedElement> members = getUMLElement().getMembers();
+ // for(NamedElement namedElement : members) {
+ // if(canContain(namedElement)) {
+ // this.elementsToSelect.add(namedElement);
+ // // build the initial selection
+ // EList<?> childrenView = getRepresentedEditPart().getNotationView().getVisibleChildren();
+ // for(Object object : childrenView) {
+ // if(object instanceof View) {
+ // if(((View)object).getElement() == namedElement) {
+ // this.initialSelection.add(namedElement);
+ // break;
+ // }
+ // }
+ // }
+ // }
+ // }
+ //
+ // }
+ //
+ // /**
+ // * REturns <code>true</code> if the associated compartment edit part can contain the given element
+ // *
+ // * @param namedElement
+ // * the named element to show/hide
+ // * @return <code>true</code> if the compartment can display the element
+ // */
+ // protected boolean canContain(NamedElement namedElement) {
+ // TransactionalEditingDomain domain = getRepresentedEditPart().getEditingDomain();
+ // ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(namedElement), Node.class, null, ViewUtil.APPEND, false, getRepresentedEditPart().getDiagramPreferencesHint());
+ //
+ // CreateCommand cmd = new CreateCommand(domain, viewDescriptor, getRepresentedEditPart().getNotationView());
+ // return (cmd.canExecute());
+ // }
+ // }
+
+ // /**
+ // *
+ // * This class is used to do easily the difference between the nested
+ // * classifiers and the superclass of the selected class in the Tree The
+ // * superclass are represented with this class
+ // */
+ // protected class ClassifierRepresentation {
+ //
+ // /** the represented classifier */
+ // protected Classifier representedClassifier;
+ //
+ // /** the CustomEditPartRepresentation owning this classifier */
+ // protected EditPartRepresentation rep;
+ //
+ // /**
+ // * Constructor.
+ // *
+ // * @param representedClassifier
+ // * the represented classifier
+ // * @param rep
+ // * the representation containing this classifier
+ // */
+ // public ClassifierRepresentation(Classifier representedClassifier, CustomEditPartRepresentation rep) {
+ // this.representedClassifier = representedClassifier;
+ // this.rep = rep;
+ // }
+ //
+ // public boolean ownsElement(Object element) {
+ // if(representedClassifier.getOwnedMembers().contains(element)) {
+ // return true;
+ // }
+ // return false;
+ // }
+ //
+ // /**
+ // * Getter for {@link #representedClassifier}
+ // *
+ // * @return {@link #representedClassifier}
+ // */
+ // public Classifier getRepresentedClassifier() {
+ // return this.representedClassifier;
+ // }
+ //
+ // /**
+ // * Getter for {@link #rep}
+ // *
+ // * @return {@link #rep}
+ // */
+ // public EditPartRepresentation getEditPartRepresentation() {
+ // return this.rep;
+ // }
+ //
+ // }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/AbstractShowHideHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/AbstractShowHideHandler.java
index 97aee5e9695..e6b554ad39c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/AbstractShowHideHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/AbstractShowHideHandler.java
@@ -1,113 +1,113 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.actions.handlers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.uml.diagram.common.actions.AbstractShowHideAction;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.PlatformUI;
-
-/**
- *
- * Abstract Handler for the ShowHideActions
- *
- */
-
-abstract public class AbstractShowHideHandler extends AbstractHandler {
-
- /** the current action */
- private AbstractShowHideAction action = null;
-
- /** the EditPolicy key for this action */
- private final String editpolicy;
-
- /** the current selection */
- private final List<IGraphicalEditPart> selection = new ArrayList<IGraphicalEditPart>();
-
- /**
- *
- * Constructor.
- *
- * @param action
- * to execute
- * @param key
- * the key representing the EditPolicy providing this action
- */
- public AbstractShowHideHandler(AbstractShowHideAction action, String key) {
- this.action = action;
- this.editpolicy = key;
- }
-
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return
- * @throws ExecutionException
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- // buildSelection();
- if(!selection.isEmpty()) {
- this.action.setSelection(selection);
- this.action.run(null);
- }
- return null;
- }
-
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
- */
- @Override
- public boolean isEnabled() {
- buildSelection();
- return !this.selection.isEmpty();
- }
-
- /**
- * Fill {@link #selection} with the EditPart owning the EditPolicy {@link #editpolicy}
- */
- protected void buildSelection() {
- this.selection.clear();
- ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
- ISelection selectionTmp = selectionService.getSelection();
- if((selectionTmp != null) && (!selectionTmp.isEmpty())) {
- if(selectionTmp instanceof StructuredSelection) {
- Iterator<?> it = ((StructuredSelection)selectionTmp).iterator();
- while(it.hasNext()) {
- Object current = it.next();
- if(current instanceof IGraphicalEditPart) {
- EditPolicy editpolicy = ((IGraphicalEditPart)current).getEditPolicy(this.editpolicy);
- if(editpolicy != null) {
- this.selection.add((IGraphicalEditPart)current);
- }
- }
- }
- }
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.actions.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.uml.diagram.common.actions.AbstractShowHideAction;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ *
+ * Abstract Handler for the ShowHideActions
+ *
+ */
+
+abstract public class AbstractShowHideHandler extends AbstractHandler {
+
+ /** the current action */
+ private AbstractShowHideAction action = null;
+
+ /** the EditPolicy key for this action */
+ private final String editpolicy;
+
+ /** the current selection */
+ private final List<IGraphicalEditPart> selection = new ArrayList<IGraphicalEditPart>();
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param action
+ * to execute
+ * @param key
+ * the key representing the EditPolicy providing this action
+ */
+ public AbstractShowHideHandler(AbstractShowHideAction action, String key) {
+ this.action = action;
+ this.editpolicy = key;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ // buildSelection();
+ if(!selection.isEmpty()) {
+ this.action.setSelection(selection);
+ this.action.run(null);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ buildSelection();
+ return !this.selection.isEmpty();
+ }
+
+ /**
+ * Fill {@link #selection} with the EditPart owning the EditPolicy {@link #editpolicy}
+ */
+ protected void buildSelection() {
+ this.selection.clear();
+ ISelectionService selectionService = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService();
+ ISelection selectionTmp = selectionService.getSelection();
+ if((selectionTmp != null) && (!selectionTmp.isEmpty())) {
+ if(selectionTmp instanceof StructuredSelection) {
+ Iterator<?> it = ((StructuredSelection)selectionTmp).iterator();
+ while(it.hasNext()) {
+ Object current = it.next();
+ if(current instanceof IGraphicalEditPart) {
+ EditPolicy editpolicy = ((IGraphicalEditPart)current).getEditPolicy(this.editpolicy);
+ if(editpolicy != null) {
+ this.selection.add((IGraphicalEditPart)current);
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandler.java
index eadc68a8f40..ae8af8a0f64 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandler.java
@@ -1,687 +1,687 @@
-/***************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Mario Cervera Ubeda (Integranova)
- * Marc Gil Sendra (Prodevelop)
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.actions.handlers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.command.CompoundCommand;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.CopyToClipboardCommand;
-import org.eclipse.emf.edit.command.PasteFromClipboardCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.action.global.GlobalActionId;
-import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionContext;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.common.commands.AbstractCommonTransactionalCommmand;
-import org.eclipse.papyrus.uml.diagram.common.commands.AddEObjectReferencesToDiagram;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ViewAndFeatureResolver;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.diagram.common.util.MDTUtil;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * The Class ClipboardActionHandler.
- */
-public/* abstract */class ClipboardActionHandler extends DiagramGlobalActionHandler {
-
- /*
- * Specifies whether the last executed action was a cut action or not. This
- * is needed because the paste action will vary depending on it
- */
- /** The is cut. */
- private static boolean isCut = false;
-
- /* Container of the objects in the clipboard */
- /** The container. */
- private static EObject container = null;
-
- /* Objects in the clipboard */
- /** The clipboard. */
- protected static List<EObject> clipboard = new ArrayList<EObject>();
-
- /* Edit parts of the objects in the clipboard */
- /** The edit parts in clipboard. */
- protected static List<EditPart> editPartsInClipboard = new ArrayList<EditPart>();
-
- // @unused
- protected static List<Object> clipboardElements = new ArrayList<Object>();
-
- // @unused
- public void setContainer(EObject container) {
- ClipboardActionHandler.container = container;
- }
-
- public EObject getContainer() {
- return ClipboardActionHandler.container;
- }
-
- // @unused
- public boolean getIsCut() {
- return isCut;
- }
-
- // @unused
- public void setIsCut(boolean isCut) {
- ClipboardActionHandler.isCut = isCut;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
- * #canCopy(org.eclipse.gmf.runtime.common.ui.services.action.global.
- * IGlobalActionContext)
- */
- @Override
- protected boolean canCopy(IGlobalActionContext cntxt) {
-
- if(cntxt.getSelection() instanceof StructuredSelection) {
- Object firstElement = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
- if(firstElement instanceof IGraphicalEditPart) {
- EObject eobject = ((IGraphicalEditPart)firstElement).resolveSemanticElement();
- if(eobject != null) {
- List elements = ((StructuredSelection)cntxt.getSelection()).toList();
- List<EObject> eobjects = new ArrayList<EObject>();
- for(Object o : elements) {
- EObject eobj = ((IGraphicalEditPart)o).resolveSemanticElement();
- eobjects.add(eobj);
- }
- if(!allElementsSameType(eobjects, eobject)) {
- return false;
- }
- IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- if(editorPart instanceof DiagramEditor) {
- if(((DiagramEditor)editorPart).getDiagram().getElement().equals(eobject)) {
- return false;
- }
- }
- return true;
- }
- }
- }
-
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
- * #canCut(org.eclipse.gmf.runtime.common.ui.services.action.global.
- * IGlobalActionContext)
- */
- @Override
- protected boolean canCut(IGlobalActionContext cntxt) {
-
- return canCopy(cntxt);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
- * #canPaste(org.eclipse.gmf.runtime.common.ui.services.action.global.
- * IGlobalActionContext)
- */
- @Override
- protected boolean canPaste(IGlobalActionContext cntxt) {
-
- if(cntxt.getSelection() instanceof StructuredSelection) {
- Object firstElement = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
- if(firstElement instanceof IGraphicalEditPart) {
- IGraphicalEditPart pasteDestination = ((IGraphicalEditPart)firstElement);
- if(pasteDestination != null && pasteDestination.resolveSemanticElement() != null && (!pasteDestination.resolveSemanticElement().equals(container) || !isCut)) {
- TransactionalEditingDomain domain = pasteDestination.getEditingDomain();
- if(domain.getClipboard() != null && domain.getClipboard().size() > 0) {
- // All the elements in the clipboard are of the same
- // type
- Object[] objects = domain.getClipboard().toArray();
- EObject firstObjectToBePasted = (EObject)objects[0];
- EStructuralFeature feature = getFeature(firstObjectToBePasted, pasteDestination);
- if(feature != null) {
- if(feature.getEType().getInstanceClass().isInstance(firstObjectToBePasted)) {
- return true;
- }
- }
- }
- }
- }
- }
-
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
- * #getCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.
- * IGlobalActionContext)
- */
- @Override
- public ICommand getCommand(IGlobalActionContext cntxt) {
-
- IWorkbenchPart part = cntxt.getActivePart();
- if(!(part instanceof IDiagramWorkbenchPart)) {
- return null;
- }
-
- /* Get the model operation context */
- IDiagramWorkbenchPart diagramPart = (IDiagramWorkbenchPart)part;
-
- String actionId = cntxt.getActionId();
-
- if(actionId.equals(GlobalActionId.COPY)) {
- isCut = false;
- return getCopyCommand(cntxt, diagramPart, false);
- } else if(actionId.equals(GlobalActionId.CUT)) {
- isCut = true;
- return getCutCommand(cntxt, diagramPart);
- } else if(actionId.equals(GlobalActionId.PASTE)) {
- if(isCut) {
- isCut = false;
- return getExecutePasteAfterCutCommand(cntxt);
- } else {
- isCut = false;
- return getExecutePasteAfterCopyCommand(cntxt);
- }
- }
-
- return super.getCommand(cntxt);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
- * #getCopyCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.
- * IGlobalActionContext,
- * org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart, boolean)
- */
- @Override
- protected ICommand getCopyCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart, boolean isUndoable) {
-
- if(cntxt.getSelection() instanceof StructuredSelection) {
- // All the elements in the selection are supposed to be of the same
- // time
- // We couldn't have got here otherwise
- Object firstElement = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
- EObject eobject = ((IGraphicalEditPart)firstElement).resolveSemanticElement();
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eobject);
- List elements = ((StructuredSelection)cntxt.getSelection()).toList();
- List<EObject> eobjects = new ArrayList<EObject>();
- editPartsInClipboard.clear();
- for(Object o : elements) {
- EObject eobj = ((IGraphicalEditPart)o).resolveSemanticElement();
- eobjects.add(eobj);
- container = eobj.eContainer();
-
- for(Object view : DiagramEditPartsUtil.getEObjectViews(eobj)) {
- if(view instanceof View) {
- EditPart editpart = DiagramEditPartsUtil.getEditPartFromView((View)view, (EditPart)firstElement);
- editPartsInClipboard.add(editpart);
- }
- }
- }
-
- clipboard.clear();
- clipboard.addAll(eobjects);
-
- final List<EObject> eobjects2 = eobjects;
- Command copyCommand = new CopyToClipboardCommand(domain, eobjects) {
-
- @Override
- public void doExecute() {
-
- /**
- * @author mgil : Don't use a different command to copy
- * every element, use the copy function from
- * EcoreUtil
- */
- ArrayList<Object> list = new ArrayList<Object>();
- for(EObject eobj : eobjects2) {
- EObject eo = EcoreUtil.copy(eobj);
- list.add(eo);
- }
-
- oldClipboard = domain.getClipboard();
- domain.setClipboard(list);
- }
- };
-
- if(copyCommand != null) {
- return new EMFtoGMFCommandWrapper(copyCommand);
- }
- }
-
- return super.getCopyCommand(cntxt, diagramPart, isUndoable);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
- * #getCutCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.
- * IGlobalActionContext,
- * org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart)
- */
- @Override
- protected ICommand getCutCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart) {
-
- if(cntxt.getSelection() instanceof StructuredSelection) {
- // All the elements in the selection are supposed to be of the same
- // type
- // We couldn't have got here otherwise
- Object firstElement = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
- EObject eobject = ((IGraphicalEditPart)firstElement).resolveSemanticElement();
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eobject);
- List elements = ((StructuredSelection)cntxt.getSelection()).toList();
- List<EObject> eobjects = new ArrayList<EObject>();
- editPartsInClipboard.clear();
- for(Object o : elements) {
- EObject eobj = ((IGraphicalEditPart)o).resolveSemanticElement();
- eobjects.add(eobj);
- container = eobj.eContainer();
-
- for(Object view : DiagramEditPartsUtil.getEObjectViews(eobj)) {
- if(view instanceof View) {
- EditPart editpart = DiagramEditPartsUtil.getEditPartFromView((View)view, (EditPart)firstElement);
- editPartsInClipboard.add(editpart);
- }
- }
- }
-
- clipboard.clear();
- clipboard.addAll(eobjects);
-
- final List<EObject> eobjects2 = eobjects;
- Command cutCommand = new CopyToClipboardCommand(domain, eobjects) {
-
- @Override
- public void doExecute() {
-
- /**
- * @author mgil : Don't use a different command to copy
- * every element, use the copy function from
- * EcoreUtil
- */
- ArrayList<Object> list = new ArrayList<Object>();
- for(EObject eobj : eobjects2) {
- list.add(eobj);
- }
-
- oldClipboard = domain.getClipboard();
- domain.setClipboard(list);
- }
- };
-
- if(cutCommand != null) {
- return new EMFtoGMFCommandWrapper(cutCommand);
- }
- }
-
- return super.getCutCommand(cntxt, diagramPart);
- }
-
- /**
- * Do something with the copied EObject
- *
- * @param eo
- */
- protected void prepareEObject(EObject eObject) {
- }
-
- /**
- * Execute paste after copy.
- *
- * @param cntxt
- * the cntxt
- */
- protected ICommand getExecutePasteAfterCopyCommand(IGlobalActionContext cntxt) {
-
- if(!(cntxt.getSelection() instanceof StructuredSelection)) {
- return null;
- }
-
- Object first = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
- if(!(first instanceof IGraphicalEditPart)) {
- return null;
- }
-
- IGraphicalEditPart pasteDestination = ((IGraphicalEditPart)first);
- TransactionalEditingDomain editingDomain = pasteDestination.getEditingDomain();
-
- final Object firstElement = first;
- final IGraphicalEditPart editPart = pasteDestination;
- final TransactionalEditingDomain domain = editingDomain;
- AbstractCommonTransactionalCommmand command = new AbstractCommonTransactionalCommmand(editingDomain, "Paste after copy", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- if(domain.getClipboard() != null && domain.getClipboard().size() > 0) {
- // All the objects in the clipboard are supposed to
- // be of the same type
- Object[] objects = domain.getClipboard().toArray();
- EObject firstObjectToBePasted = (EObject)objects[0];
- EStructuralFeature feature = getFeature(firstObjectToBePasted, editPart);
-
- // Execute paste
- Command pasteCommand = PasteFromClipboardCommand.create(domain, editPart.resolveSemanticElement(), feature);
-
- domain.getCommandStack().execute(pasteCommand);
-
- // The new elements must be shown on the diagram
- List<EObject> eobjects = new ArrayList<EObject>();
-
- for(Object o : pasteCommand.getAffectedObjects()) {
- if(o instanceof EObject) {
- prepareEObject((EObject)o);
- eobjects.add((EObject)o);
- }
- }
-
- ICommand command = new AddEObjectReferencesToDiagram(domain, DiagramEditPartsUtil.findDiagramFromEditPart((IGraphicalEditPart)firstElement), eobjects);
- domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
-
- // refresh the affected EditPart
- DiagramEditPartsUtil.updateEditPart(editPart);
-
- return CommandResult.newOKCommandResult();
- }
- return CommandResult.newCancelledCommandResult();
- }
- };
-
- return command.canExecute() ? command : null;
- }
-
- /**
- * Execute paste after cut.
- *
- * @param cntxt
- * the cntxt
- */
- protected ICommand getExecutePasteAfterCutCommand(IGlobalActionContext cntxt) {
-
- if(!(cntxt.getSelection() instanceof StructuredSelection)) {
- return null;
- }
-
- Object first = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
- if(!(first instanceof IGraphicalEditPart)) {
- return null;
- }
-
- IGraphicalEditPart pasteDestination = ((IGraphicalEditPart)first);
- TransactionalEditingDomain editingDomain = pasteDestination.getEditingDomain();
-
- final Object firstElement = first;
- final IGraphicalEditPart editPart = pasteDestination;
- final TransactionalEditingDomain domain = editingDomain;
- AbstractCommonTransactionalCommmand command = new AbstractCommonTransactionalCommmand(editingDomain, "Paste after cut", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- if(domain.getClipboard() != null && domain.getClipboard().size() > 0) {
-
- // All the objects in the clipboard are supposed to be of
- // the
- // same type
- Object[] objects = domain.getClipboard().toArray();
- EObject firstObjectToBePasted = (EObject)objects[0];
- EStructuralFeature feature = getFeature(firstObjectToBePasted, editPart);
-
- // Execute paste
- CompoundCommand cc = new CompoundCommand("Paste");
- Command removeCommand = RemoveCommand.create(domain, container, feature, clipboard);
- if(!removeCommand.canExecute()) {
- return CommandResult.newCancelledCommandResult();
- }
-
- cc.append(removeCommand);
-
- for(EditPart ep : editPartsInClipboard) {
- Command c = getDeleteViewCommand(ep);
- if(c != null && !c.canExecute()) {
- return CommandResult.newCancelledCommandResult();
- }
-
- cc.append(c);
- }
-
- for(Object obj : domain.getClipboard()) {
- Command addCommand = AddCommand.create(domain, editPart.resolveSemanticElement(), feature, obj);
- if(!addCommand.canExecute()) {
- return CommandResult.newCancelledCommandResult();
- }
-
- cc.append(addCommand);
- }
-
- // The new elements must be shown on the diagram
- List<EObject> eobjects = new ArrayList<EObject>();
-
- for(Object o : domain.getClipboard()) {
- if(o instanceof EObject) {
- eobjects.add((EObject)o);
- }
- }
-
- ICommand command = new AddEObjectReferencesToDiagram(domain, DiagramEditPartsUtil.findDiagramFromEditPart((IGraphicalEditPart)firstElement), eobjects);
- if(!command.canExecute()) {
- return CommandResult.newCancelledCommandResult();
- }
-
- cc.append(new GMFtoEMFCommandWrapper(command));
-
- if(!cc.canExecute()) {
- return CommandResult.newCancelledCommandResult();
- }
-
- domain.getCommandStack().execute(cc);
-
- // Empty the clipboard
- domain.setClipboard(new ArrayList<Object>());
- clipboard.clear();
- editPartsInClipboard.clear();
-
- // Refresh the diagram
- DiagramEditPartsUtil.updateEditPart(editPart);
-
- return CommandResult.newOKCommandResult();
- }
- return CommandResult.newCancelledCommandResult();
- }
- };
-
- return command.canExecute() ? command : null;
- }
-
- /**
- * Gets the diagram preferences hint.
- *
- * @param editPart
- * the edit part
- *
- * @return the diagram preferences hint
- */
- // @unused
- private PreferencesHint getDiagramPreferencesHint(IGraphicalEditPart editPart) {
- return editPart.getDiagramPreferencesHint();
- }
-
- /*
- * Checks if all the objects contained in the list are of the same type than
- * the eobject passed as parameter
- */
- /**
- * All elements same type.
- *
- * @param eobjects
- * the eobjects
- * @param eobject
- * the eobject
- *
- * @return true, if successful
- */
- private boolean allElementsSameType(List<EObject> eobjects, EObject eobject) {
-
- for(EObject o : eobjects) {
- if(o != null) {
- if(!o.eClass().equals(eobject.eClass())) {
- return false;
- }
- } else {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Gets the delete view command.
- *
- * @param editPart
- * the edit part
- *
- * @return the delete view command
- */
- protected Command getDeleteViewCommand(EditPart editPart) {
-
- if(editPart == null) {
- return null;
- }
-
- Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
- org.eclipse.gef.commands.Command command = editPart.getCommand(deleteViewRequest);
- return new GEFtoEMFCommandWrapper(command);
- }
-
- /**
- * Gets the edits the parts in clipboard.
- *
- * @param clipboard
- * the clipboard
- *
- * @return the edits the parts in clipboard
- */
- // @unused
- protected Collection<EditPart> getEditPartsInClipboard(Collection<Object> clipboard) {
- if(clipboard != null && clipboard.size() > 0) {
- Collection<EditPart> editParts = new ArrayList<EditPart>();
- for(Object object : clipboard) {
- if(object instanceof EditPart) {
- editParts.add((EditPart)object);
- }
- }
- return editParts;
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Gets the feature.
- *
- * @param objectToBePasted
- * the object to be pasted
- * @param pasteDestination
- * the paste destination
- *
- * @return the feature
- */
- public EStructuralFeature getFeature(EObject objectToBePasted, EditPart pasteDestination) {
- if(objectToBePasted == null || pasteDestination == null) {
- return null;
- }
- EObject element = MDTUtil.resolveSemantic(pasteDestination);
- return getFeature(element, objectToBePasted, pasteDestination);
- }
-
- /**
- * Gets the feature.
- *
- * @param element
- * the element
- * @param objectToBePasted
- * the object to be pasted
- * @param editPart
- * the edit part
- *
- * @return the feature
- */
- protected EStructuralFeature getFeature(EObject element, EObject objectToBePasted, EditPart editPart) {
-
- if(!(element == MDTUtil.resolveSemantic(editPart))) {
- return null;
- }
-
- EStructuralFeature feature = null;
-
- Object adapter = editPart.getAdapter(ViewAndFeatureResolver.class);
- ViewAndFeatureResolver resolver = null;
- if(adapter instanceof ViewAndFeatureResolver) {
- resolver = (ViewAndFeatureResolver)adapter;
- }
- if(resolver != null) {
- feature = resolver.getEStructuralFeatureForEClass(objectToBePasted.eClass());
- }
- if(feature == null) {
- for(Object child : editPart.getChildren()) {
- if(child instanceof EditPart) {
- feature = getFeature(element, objectToBePasted, (EditPart)child);
- }
- if(feature != null) {
- break;
- }
- }
- }
- return feature;
- }
-}
+/***************************************************************************
+ * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana . All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Mario Cervera Ubeda (Integranova)
+ * Marc Gil Sendra (Prodevelop)
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.actions.handlers;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.CopyToClipboardCommand;
+import org.eclipse.emf.edit.command.PasteFromClipboardCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.action.global.GlobalActionId;
+import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionContext;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.common.commands.AbstractCommonTransactionalCommmand;
+import org.eclipse.papyrus.uml.diagram.common.commands.AddEObjectReferencesToDiagram;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ViewAndFeatureResolver;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.papyrus.uml.diagram.common.util.MDTUtil;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * The Class ClipboardActionHandler.
+ */
+public/* abstract */class ClipboardActionHandler extends DiagramGlobalActionHandler {
+
+ /*
+ * Specifies whether the last executed action was a cut action or not. This
+ * is needed because the paste action will vary depending on it
+ */
+ /** The is cut. */
+ private static boolean isCut = false;
+
+ /* Container of the objects in the clipboard */
+ /** The container. */
+ private static EObject container = null;
+
+ /* Objects in the clipboard */
+ /** The clipboard. */
+ protected static List<EObject> clipboard = new ArrayList<EObject>();
+
+ /* Edit parts of the objects in the clipboard */
+ /** The edit parts in clipboard. */
+ protected static List<EditPart> editPartsInClipboard = new ArrayList<EditPart>();
+
+ // @unused
+ protected static List<Object> clipboardElements = new ArrayList<Object>();
+
+ // @unused
+ public void setContainer(EObject container) {
+ ClipboardActionHandler.container = container;
+ }
+
+ public EObject getContainer() {
+ return ClipboardActionHandler.container;
+ }
+
+ // @unused
+ public boolean getIsCut() {
+ return isCut;
+ }
+
+ // @unused
+ public void setIsCut(boolean isCut) {
+ ClipboardActionHandler.isCut = isCut;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
+ * #canCopy(org.eclipse.gmf.runtime.common.ui.services.action.global.
+ * IGlobalActionContext)
+ */
+ @Override
+ protected boolean canCopy(IGlobalActionContext cntxt) {
+
+ if(cntxt.getSelection() instanceof StructuredSelection) {
+ Object firstElement = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
+ if(firstElement instanceof IGraphicalEditPart) {
+ EObject eobject = ((IGraphicalEditPart)firstElement).resolveSemanticElement();
+ if(eobject != null) {
+ List elements = ((StructuredSelection)cntxt.getSelection()).toList();
+ List<EObject> eobjects = new ArrayList<EObject>();
+ for(Object o : elements) {
+ EObject eobj = ((IGraphicalEditPart)o).resolveSemanticElement();
+ eobjects.add(eobj);
+ }
+ if(!allElementsSameType(eobjects, eobject)) {
+ return false;
+ }
+ IEditorPart editorPart = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editorPart instanceof DiagramEditor) {
+ if(((DiagramEditor)editorPart).getDiagram().getElement().equals(eobject)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
+ * #canCut(org.eclipse.gmf.runtime.common.ui.services.action.global.
+ * IGlobalActionContext)
+ */
+ @Override
+ protected boolean canCut(IGlobalActionContext cntxt) {
+
+ return canCopy(cntxt);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
+ * #canPaste(org.eclipse.gmf.runtime.common.ui.services.action.global.
+ * IGlobalActionContext)
+ */
+ @Override
+ protected boolean canPaste(IGlobalActionContext cntxt) {
+
+ if(cntxt.getSelection() instanceof StructuredSelection) {
+ Object firstElement = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
+ if(firstElement instanceof IGraphicalEditPart) {
+ IGraphicalEditPart pasteDestination = ((IGraphicalEditPart)firstElement);
+ if(pasteDestination != null && pasteDestination.resolveSemanticElement() != null && (!pasteDestination.resolveSemanticElement().equals(container) || !isCut)) {
+ TransactionalEditingDomain domain = pasteDestination.getEditingDomain();
+ if(domain.getClipboard() != null && domain.getClipboard().size() > 0) {
+ // All the elements in the clipboard are of the same
+ // type
+ Object[] objects = domain.getClipboard().toArray();
+ EObject firstObjectToBePasted = (EObject)objects[0];
+ EStructuralFeature feature = getFeature(firstObjectToBePasted, pasteDestination);
+ if(feature != null) {
+ if(feature.getEType().getInstanceClass().isInstance(firstObjectToBePasted)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
+ * #getCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.
+ * IGlobalActionContext)
+ */
+ @Override
+ public ICommand getCommand(IGlobalActionContext cntxt) {
+
+ IWorkbenchPart part = cntxt.getActivePart();
+ if(!(part instanceof IDiagramWorkbenchPart)) {
+ return null;
+ }
+
+ /* Get the model operation context */
+ IDiagramWorkbenchPart diagramPart = (IDiagramWorkbenchPart)part;
+
+ String actionId = cntxt.getActionId();
+
+ if(actionId.equals(GlobalActionId.COPY)) {
+ isCut = false;
+ return getCopyCommand(cntxt, diagramPart, false);
+ } else if(actionId.equals(GlobalActionId.CUT)) {
+ isCut = true;
+ return getCutCommand(cntxt, diagramPart);
+ } else if(actionId.equals(GlobalActionId.PASTE)) {
+ if(isCut) {
+ isCut = false;
+ return getExecutePasteAfterCutCommand(cntxt);
+ } else {
+ isCut = false;
+ return getExecutePasteAfterCopyCommand(cntxt);
+ }
+ }
+
+ return super.getCommand(cntxt);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
+ * #getCopyCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.
+ * IGlobalActionContext,
+ * org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart, boolean)
+ */
+ @Override
+ protected ICommand getCopyCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart, boolean isUndoable) {
+
+ if(cntxt.getSelection() instanceof StructuredSelection) {
+ // All the elements in the selection are supposed to be of the same
+ // time
+ // We couldn't have got here otherwise
+ Object firstElement = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
+ EObject eobject = ((IGraphicalEditPart)firstElement).resolveSemanticElement();
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eobject);
+ List elements = ((StructuredSelection)cntxt.getSelection()).toList();
+ List<EObject> eobjects = new ArrayList<EObject>();
+ editPartsInClipboard.clear();
+ for(Object o : elements) {
+ EObject eobj = ((IGraphicalEditPart)o).resolveSemanticElement();
+ eobjects.add(eobj);
+ container = eobj.eContainer();
+
+ for(Object view : DiagramEditPartsUtil.getEObjectViews(eobj)) {
+ if(view instanceof View) {
+ EditPart editpart = DiagramEditPartsUtil.getEditPartFromView((View)view, (EditPart)firstElement);
+ editPartsInClipboard.add(editpart);
+ }
+ }
+ }
+
+ clipboard.clear();
+ clipboard.addAll(eobjects);
+
+ final List<EObject> eobjects2 = eobjects;
+ Command copyCommand = new CopyToClipboardCommand(domain, eobjects) {
+
+ @Override
+ public void doExecute() {
+
+ /**
+ * @author mgil : Don't use a different command to copy
+ * every element, use the copy function from
+ * EcoreUtil
+ */
+ ArrayList<Object> list = new ArrayList<Object>();
+ for(EObject eobj : eobjects2) {
+ EObject eo = EcoreUtil.copy(eobj);
+ list.add(eo);
+ }
+
+ oldClipboard = domain.getClipboard();
+ domain.setClipboard(list);
+ }
+ };
+
+ if(copyCommand != null) {
+ return new EMFtoGMFCommandWrapper(copyCommand);
+ }
+ }
+
+ return super.getCopyCommand(cntxt, diagramPart, isUndoable);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler
+ * #getCutCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.
+ * IGlobalActionContext,
+ * org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart)
+ */
+ @Override
+ protected ICommand getCutCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart) {
+
+ if(cntxt.getSelection() instanceof StructuredSelection) {
+ // All the elements in the selection are supposed to be of the same
+ // type
+ // We couldn't have got here otherwise
+ Object firstElement = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
+ EObject eobject = ((IGraphicalEditPart)firstElement).resolveSemanticElement();
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eobject);
+ List elements = ((StructuredSelection)cntxt.getSelection()).toList();
+ List<EObject> eobjects = new ArrayList<EObject>();
+ editPartsInClipboard.clear();
+ for(Object o : elements) {
+ EObject eobj = ((IGraphicalEditPart)o).resolveSemanticElement();
+ eobjects.add(eobj);
+ container = eobj.eContainer();
+
+ for(Object view : DiagramEditPartsUtil.getEObjectViews(eobj)) {
+ if(view instanceof View) {
+ EditPart editpart = DiagramEditPartsUtil.getEditPartFromView((View)view, (EditPart)firstElement);
+ editPartsInClipboard.add(editpart);
+ }
+ }
+ }
+
+ clipboard.clear();
+ clipboard.addAll(eobjects);
+
+ final List<EObject> eobjects2 = eobjects;
+ Command cutCommand = new CopyToClipboardCommand(domain, eobjects) {
+
+ @Override
+ public void doExecute() {
+
+ /**
+ * @author mgil : Don't use a different command to copy
+ * every element, use the copy function from
+ * EcoreUtil
+ */
+ ArrayList<Object> list = new ArrayList<Object>();
+ for(EObject eobj : eobjects2) {
+ list.add(eobj);
+ }
+
+ oldClipboard = domain.getClipboard();
+ domain.setClipboard(list);
+ }
+ };
+
+ if(cutCommand != null) {
+ return new EMFtoGMFCommandWrapper(cutCommand);
+ }
+ }
+
+ return super.getCutCommand(cntxt, diagramPart);
+ }
+
+ /**
+ * Do something with the copied EObject
+ *
+ * @param eo
+ */
+ protected void prepareEObject(EObject eObject) {
+ }
+
+ /**
+ * Execute paste after copy.
+ *
+ * @param cntxt
+ * the cntxt
+ */
+ protected ICommand getExecutePasteAfterCopyCommand(IGlobalActionContext cntxt) {
+
+ if(!(cntxt.getSelection() instanceof StructuredSelection)) {
+ return null;
+ }
+
+ Object first = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
+ if(!(first instanceof IGraphicalEditPart)) {
+ return null;
+ }
+
+ IGraphicalEditPart pasteDestination = ((IGraphicalEditPart)first);
+ TransactionalEditingDomain editingDomain = pasteDestination.getEditingDomain();
+
+ final Object firstElement = first;
+ final IGraphicalEditPart editPart = pasteDestination;
+ final TransactionalEditingDomain domain = editingDomain;
+ AbstractCommonTransactionalCommmand command = new AbstractCommonTransactionalCommmand(editingDomain, "Paste after copy", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ if(domain.getClipboard() != null && domain.getClipboard().size() > 0) {
+ // All the objects in the clipboard are supposed to
+ // be of the same type
+ Object[] objects = domain.getClipboard().toArray();
+ EObject firstObjectToBePasted = (EObject)objects[0];
+ EStructuralFeature feature = getFeature(firstObjectToBePasted, editPart);
+
+ // Execute paste
+ Command pasteCommand = PasteFromClipboardCommand.create(domain, editPart.resolveSemanticElement(), feature);
+
+ domain.getCommandStack().execute(pasteCommand);
+
+ // The new elements must be shown on the diagram
+ List<EObject> eobjects = new ArrayList<EObject>();
+
+ for(Object o : pasteCommand.getAffectedObjects()) {
+ if(o instanceof EObject) {
+ prepareEObject((EObject)o);
+ eobjects.add((EObject)o);
+ }
+ }
+
+ ICommand command = new AddEObjectReferencesToDiagram(domain, DiagramEditPartsUtil.findDiagramFromEditPart((IGraphicalEditPart)firstElement), eobjects);
+ domain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
+
+ // refresh the affected EditPart
+ DiagramEditPartsUtil.updateEditPart(editPart);
+
+ return CommandResult.newOKCommandResult();
+ }
+ return CommandResult.newCancelledCommandResult();
+ }
+ };
+
+ return command.canExecute() ? command : null;
+ }
+
+ /**
+ * Execute paste after cut.
+ *
+ * @param cntxt
+ * the cntxt
+ */
+ protected ICommand getExecutePasteAfterCutCommand(IGlobalActionContext cntxt) {
+
+ if(!(cntxt.getSelection() instanceof StructuredSelection)) {
+ return null;
+ }
+
+ Object first = ((StructuredSelection)cntxt.getSelection()).getFirstElement();
+ if(!(first instanceof IGraphicalEditPart)) {
+ return null;
+ }
+
+ IGraphicalEditPart pasteDestination = ((IGraphicalEditPart)first);
+ TransactionalEditingDomain editingDomain = pasteDestination.getEditingDomain();
+
+ final Object firstElement = first;
+ final IGraphicalEditPart editPart = pasteDestination;
+ final TransactionalEditingDomain domain = editingDomain;
+ AbstractCommonTransactionalCommmand command = new AbstractCommonTransactionalCommmand(editingDomain, "Paste after cut", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ if(domain.getClipboard() != null && domain.getClipboard().size() > 0) {
+
+ // All the objects in the clipboard are supposed to be of
+ // the
+ // same type
+ Object[] objects = domain.getClipboard().toArray();
+ EObject firstObjectToBePasted = (EObject)objects[0];
+ EStructuralFeature feature = getFeature(firstObjectToBePasted, editPart);
+
+ // Execute paste
+ CompoundCommand cc = new CompoundCommand("Paste");
+ Command removeCommand = RemoveCommand.create(domain, container, feature, clipboard);
+ if(!removeCommand.canExecute()) {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ cc.append(removeCommand);
+
+ for(EditPart ep : editPartsInClipboard) {
+ Command c = getDeleteViewCommand(ep);
+ if(c != null && !c.canExecute()) {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ cc.append(c);
+ }
+
+ for(Object obj : domain.getClipboard()) {
+ Command addCommand = AddCommand.create(domain, editPart.resolveSemanticElement(), feature, obj);
+ if(!addCommand.canExecute()) {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ cc.append(addCommand);
+ }
+
+ // The new elements must be shown on the diagram
+ List<EObject> eobjects = new ArrayList<EObject>();
+
+ for(Object o : domain.getClipboard()) {
+ if(o instanceof EObject) {
+ eobjects.add((EObject)o);
+ }
+ }
+
+ ICommand command = new AddEObjectReferencesToDiagram(domain, DiagramEditPartsUtil.findDiagramFromEditPart((IGraphicalEditPart)firstElement), eobjects);
+ if(!command.canExecute()) {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ cc.append(new GMFtoEMFCommandWrapper(command));
+
+ if(!cc.canExecute()) {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ domain.getCommandStack().execute(cc);
+
+ // Empty the clipboard
+ domain.setClipboard(new ArrayList<Object>());
+ clipboard.clear();
+ editPartsInClipboard.clear();
+
+ // Refresh the diagram
+ DiagramEditPartsUtil.updateEditPart(editPart);
+
+ return CommandResult.newOKCommandResult();
+ }
+ return CommandResult.newCancelledCommandResult();
+ }
+ };
+
+ return command.canExecute() ? command : null;
+ }
+
+ /**
+ * Gets the diagram preferences hint.
+ *
+ * @param editPart
+ * the edit part
+ *
+ * @return the diagram preferences hint
+ */
+ // @unused
+ private PreferencesHint getDiagramPreferencesHint(IGraphicalEditPart editPart) {
+ return editPart.getDiagramPreferencesHint();
+ }
+
+ /*
+ * Checks if all the objects contained in the list are of the same type than
+ * the eobject passed as parameter
+ */
+ /**
+ * All elements same type.
+ *
+ * @param eobjects
+ * the eobjects
+ * @param eobject
+ * the eobject
+ *
+ * @return true, if successful
+ */
+ private boolean allElementsSameType(List<EObject> eobjects, EObject eobject) {
+
+ for(EObject o : eobjects) {
+ if(o != null) {
+ if(!o.eClass().equals(eobject.eClass())) {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Gets the delete view command.
+ *
+ * @param editPart
+ * the edit part
+ *
+ * @return the delete view command
+ */
+ protected Command getDeleteViewCommand(EditPart editPart) {
+
+ if(editPart == null) {
+ return null;
+ }
+
+ Request deleteViewRequest = new GroupRequest(RequestConstants.REQ_DELETE);
+ org.eclipse.gef.commands.Command command = editPart.getCommand(deleteViewRequest);
+ return new GEFtoEMFCommandWrapper(command);
+ }
+
+ /**
+ * Gets the edits the parts in clipboard.
+ *
+ * @param clipboard
+ * the clipboard
+ *
+ * @return the edits the parts in clipboard
+ */
+ // @unused
+ protected Collection<EditPart> getEditPartsInClipboard(Collection<Object> clipboard) {
+ if(clipboard != null && clipboard.size() > 0) {
+ Collection<EditPart> editParts = new ArrayList<EditPart>();
+ for(Object object : clipboard) {
+ if(object instanceof EditPart) {
+ editParts.add((EditPart)object);
+ }
+ }
+ return editParts;
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * Gets the feature.
+ *
+ * @param objectToBePasted
+ * the object to be pasted
+ * @param pasteDestination
+ * the paste destination
+ *
+ * @return the feature
+ */
+ public EStructuralFeature getFeature(EObject objectToBePasted, EditPart pasteDestination) {
+ if(objectToBePasted == null || pasteDestination == null) {
+ return null;
+ }
+ EObject element = MDTUtil.resolveSemantic(pasteDestination);
+ return getFeature(element, objectToBePasted, pasteDestination);
+ }
+
+ /**
+ * Gets the feature.
+ *
+ * @param element
+ * the element
+ * @param objectToBePasted
+ * the object to be pasted
+ * @param editPart
+ * the edit part
+ *
+ * @return the feature
+ */
+ protected EStructuralFeature getFeature(EObject element, EObject objectToBePasted, EditPart editPart) {
+
+ if(!(element == MDTUtil.resolveSemantic(editPart))) {
+ return null;
+ }
+
+ EStructuralFeature feature = null;
+
+ Object adapter = editPart.getAdapter(ViewAndFeatureResolver.class);
+ ViewAndFeatureResolver resolver = null;
+ if(adapter instanceof ViewAndFeatureResolver) {
+ resolver = (ViewAndFeatureResolver)adapter;
+ }
+ if(resolver != null) {
+ feature = resolver.getEStructuralFeatureForEClass(objectToBePasted.eClass());
+ }
+ if(feature == null) {
+ for(Object child : editPart.getChildren()) {
+ if(child instanceof EditPart) {
+ feature = getFeature(element, objectToBePasted, (EditPart)child);
+ }
+ if(feature != null) {
+ break;
+ }
+ }
+ }
+ return feature;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandlerProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandlerProvider.java
index 99d419ac4b1..9722b19aed4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandlerProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/actions/handlers/ClipboardActionHandlerProvider.java
@@ -1,114 +1,114 @@
-/***************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Mario Cervera Ubeda (Integranova)
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.actions.handlers;
-
-import java.util.Hashtable;
-
-import org.eclipse.gmf.runtime.common.ui.services.action.global.AbstractGlobalActionHandlerProvider;
-import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandler;
-import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandlerContext;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class ClipboardActionHandlerProvider.
- */
-public class ClipboardActionHandlerProvider extends AbstractGlobalActionHandlerProvider {
-
- /** List for handlers. */
- private Hashtable handlerList = new Hashtable();
-
- /**
- * Returns a global action handler that supports operations (cut, copy, and
- * paste).
- *
- * @param context
- * the context
- *
- * @return the global action handler
- */
- @Override
- public IGlobalActionHandler getGlobalActionHandler(final IGlobalActionHandlerContext context) {
-
- /* Create the handler */
-
- if(!getHandlerList().containsKey(context.getActivePart())) {
-
- getHandlerList().put(context.getActivePart(), getClipboardActionHandler());
-
- /*
- * Register as a part listener so that the cache can be cleared when
- * the part is disposed
- */
- context.getActivePart().getSite().getPage().addPartListener(new IPartListener() {
-
- private IWorkbenchPart localPart = context.getActivePart();
-
- /**
- * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- // Do nothing
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- // Do nothing
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- /* Remove the cache associated with the part */
- if(part != null && part == localPart && getHandlerList().containsKey(part)) {
- getHandlerList().remove(part);
- localPart.getSite().getPage().removePartListener(this);
- localPart = null;
- }
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- // Do nothing
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- // Do nothing
- }
- });
- }
-
- return (ClipboardActionHandler)getHandlerList().get(context.getActivePart());
- }
-
- /**
- * Returns the handlerList.
- *
- * @return Hashtable
- */
- private Hashtable getHandlerList() {
- return handlerList;
- }
-
- protected ClipboardActionHandler getClipboardActionHandler() {
- return new ClipboardActionHandler();
- }
-
-}
+/***************************************************************************
+ * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana . All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Mario Cervera Ubeda (Integranova)
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.actions.handlers;
+
+import java.util.Hashtable;
+
+import org.eclipse.gmf.runtime.common.ui.services.action.global.AbstractGlobalActionHandlerProvider;
+import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandler;
+import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandlerContext;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ClipboardActionHandlerProvider.
+ */
+public class ClipboardActionHandlerProvider extends AbstractGlobalActionHandlerProvider {
+
+ /** List for handlers. */
+ private Hashtable handlerList = new Hashtable();
+
+ /**
+ * Returns a global action handler that supports operations (cut, copy, and
+ * paste).
+ *
+ * @param context
+ * the context
+ *
+ * @return the global action handler
+ */
+ @Override
+ public IGlobalActionHandler getGlobalActionHandler(final IGlobalActionHandlerContext context) {
+
+ /* Create the handler */
+
+ if(!getHandlerList().containsKey(context.getActivePart())) {
+
+ getHandlerList().put(context.getActivePart(), getClipboardActionHandler());
+
+ /*
+ * Register as a part listener so that the cache can be cleared when
+ * the part is disposed
+ */
+ context.getActivePart().getSite().getPage().addPartListener(new IPartListener() {
+
+ private IWorkbenchPart localPart = context.getActivePart();
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart)
+ */
+ public void partActivated(IWorkbenchPart part) {
+ // Do nothing
+ }
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart)
+ */
+ public void partBroughtToTop(IWorkbenchPart part) {
+ // Do nothing
+ }
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart)
+ */
+ public void partClosed(IWorkbenchPart part) {
+ /* Remove the cache associated with the part */
+ if(part != null && part == localPart && getHandlerList().containsKey(part)) {
+ getHandlerList().remove(part);
+ localPart.getSite().getPage().removePartListener(this);
+ localPart = null;
+ }
+ }
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart)
+ */
+ public void partDeactivated(IWorkbenchPart part) {
+ // Do nothing
+ }
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart)
+ */
+ public void partOpened(IWorkbenchPart part) {
+ // Do nothing
+ }
+ });
+ }
+
+ return (ClipboardActionHandler)getHandlerList().get(context.getActivePart());
+ }
+
+ /**
+ * Returns the handlerList.
+ *
+ * @return Hashtable
+ */
+ private Hashtable getHandlerList() {
+ return handlerList;
+ }
+
+ protected ClipboardActionHandler getClipboardActionHandler() {
+ return new ClipboardActionHandler();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/CommandProxyWithResult.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/CommandProxyWithResult.java
index 91f4c15de7c..d09c3a66770 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/CommandProxyWithResult.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/CommandProxyWithResult.java
@@ -1,31 +1,31 @@
-/*****************************************************************************
- * 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:
- * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.command.wrappers;
-
-import org.eclipse.gef.commands.Command;
-
-/**
- * This command proxy wraps a GEF command into a GMF one, with result stored in
- * the CommandResult.
- * @author mvelten
- *
- * @deprecated use {@link org.eclipse.papyrus.commands.wrappers.CommandProxyWithResult} instead
- *
- */
-public class CommandProxyWithResult extends org.eclipse.papyrus.commands.wrappers.CommandProxyWithResult {
-
- public CommandProxyWithResult(Command command, Object result) {
- super(command, result);
- }
-}
+/*****************************************************************************
+ * 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:
+ * Mathieu Velten (Atos Origin) mathieu.velten@atosorigin.com - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.command.wrappers;
+
+import org.eclipse.gef.commands.Command;
+
+/**
+ * This command proxy wraps a GEF command into a GMF one, with result stored in
+ * the CommandResult.
+ * @author mvelten
+ *
+ * @deprecated use {@link org.eclipse.papyrus.commands.wrappers.CommandProxyWithResult} instead
+ *
+ */
+public class CommandProxyWithResult extends org.eclipse.papyrus.commands.wrappers.CommandProxyWithResult {
+
+ public CommandProxyWithResult(Command command, Object result) {
+ super(command, result);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/EMFtoGMFCommandWrapper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/EMFtoGMFCommandWrapper.java
index b967fc5b89c..ebdf286d616 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/EMFtoGMFCommandWrapper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/EMFtoGMFCommandWrapper.java
@@ -1,33 +1,33 @@
-/***************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Mario Cervera Ubeda (Prodevelop)
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.command.wrappers;
-
-import org.eclipse.emf.common.command.Command;
-
-// TODO: Auto-generated Javadoc
-/**
- * A GMF Command that wraps an EMF command. Each method is redirected to the EMF
- * one.
- *
- * @deprecated use {@link org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper} instead
- */
-public class EMFtoGMFCommandWrapper extends org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper {
-
- /**
- * Constructor.
- *
- * @param emfCommand
- * the emf command
- */
- public EMFtoGMFCommandWrapper(Command emfCommand) {
- super(emfCommand);
- }
-}
+/***************************************************************************
+ * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana . All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Mario Cervera Ubeda (Prodevelop)
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.command.wrappers;
+
+import org.eclipse.emf.common.command.Command;
+
+// TODO: Auto-generated Javadoc
+/**
+ * A GMF Command that wraps an EMF command. Each method is redirected to the EMF
+ * one.
+ *
+ * @deprecated use {@link org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper} instead
+ */
+public class EMFtoGMFCommandWrapper extends org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper {
+
+ /**
+ * Constructor.
+ *
+ * @param emfCommand
+ * the emf command
+ */
+ public EMFtoGMFCommandWrapper(Command emfCommand) {
+ super(emfCommand);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GEFtoEMFCommandWrapper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GEFtoEMFCommandWrapper.java
index bbcfd0d9890..44957a1700b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GEFtoEMFCommandWrapper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GEFtoEMFCommandWrapper.java
@@ -1,33 +1,33 @@
-/***************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Mario Cervera Ubeda (Prodevelop)
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.command.wrappers;
-
-import org.eclipse.gef.commands.Command;
-
-// TODO: Auto-generated Javadoc
-/**
- * A EMF Command that wraps a GEF command. Each method is redirected to the GEF
- * one.
- *
- * @deprecated use {@link org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper} instead
- */
-public class GEFtoEMFCommandWrapper extends org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper {
-
- /**
- * Constructor.
- *
- * @param gefCommand
- * the gef command
- */
- public GEFtoEMFCommandWrapper(Command gefCommand) {
- super(gefCommand);
- }
-}
+/***************************************************************************
+ * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana . All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Mario Cervera Ubeda (Prodevelop)
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.command.wrappers;
+
+import org.eclipse.gef.commands.Command;
+
+// TODO: Auto-generated Javadoc
+/**
+ * A EMF Command that wraps a GEF command. Each method is redirected to the GEF
+ * one.
+ *
+ * @deprecated use {@link org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper} instead
+ */
+public class GEFtoEMFCommandWrapper extends org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper {
+
+ /**
+ * Constructor.
+ *
+ * @param gefCommand
+ * the gef command
+ */
+ public GEFtoEMFCommandWrapper(Command gefCommand) {
+ super(gefCommand);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GMFtoEMFCommandWrapper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GMFtoEMFCommandWrapper.java
index e040e8cbddb..b3a5ae4ac63 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GMFtoEMFCommandWrapper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/command/wrappers/GMFtoEMFCommandWrapper.java
@@ -1,33 +1,33 @@
-/***************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Mario Cervera Ubeda (Prodevelop)
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.command.wrappers;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-
-// TODO: Auto-generated Javadoc
-/**
- * A EMF Command that wraps a GMF command. Each method is redirected to the GMF
- * one.
- *
- * @deprecated use {@link org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper} instead
- */
-public class GMFtoEMFCommandWrapper extends org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper {
-
- /**
- * Constructor.
- *
- * @param gmfCommand
- * the gmf command
- */
- public GMFtoEMFCommandWrapper(ICommand gmfCommand) {
- super(gmfCommand);
- }
-}
+/***************************************************************************
+ * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana . All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Mario Cervera Ubeda (Prodevelop)
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.command.wrappers;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+
+// TODO: Auto-generated Javadoc
+/**
+ * A EMF Command that wraps a GMF command. Each method is redirected to the GMF
+ * one.
+ *
+ * @deprecated use {@link org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper} instead
+ */
+public class GMFtoEMFCommandWrapper extends org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper {
+
+ /**
+ * Constructor.
+ *
+ * @param gmfCommand
+ * the gmf command
+ */
+ public GMFtoEMFCommandWrapper(ICommand gmfCommand) {
+ super(gmfCommand);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ApplyStereotypeCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ApplyStereotypeCommand.java
index 75436df26dd..1fd19cce2b1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ApplyStereotypeCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ApplyStereotypeCommand.java
@@ -1,77 +1,77 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.helper.NamedElementHelper;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Stereotype;
-
-
-public class ApplyStereotypeCommand extends AbstractTransactionalCommand {
-
- protected ApplyStereotypeRequest req;
-
- public ApplyStereotypeCommand(TransactionalEditingDomain domain, ApplyStereotypeRequest req) {
- super(domain, "Apply stereotype", null);
- this.req = req;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // retrieves the list of stereotypes to be applied
- List<String> stereotypeQNames = req.getStereotypesToApply();
- Element element = req.getElement();
- List<EObject> result = new ArrayList<EObject>();
- for(String stereotypeQName : stereotypeQNames) {
- // retrieve the stereotype to apply
- Stereotype stereotype = element.getApplicableStereotype(stereotypeQName);
- if(stereotype == null) {
- // stereotype has no been found. should ask for
- // profile application ?
- Activator.log.warn("impossible to retrieve the stereotype " + stereotypeQName);
- } else {
- result.add(element.applyStereotype(stereotype));
- }
- }
-
- if (req.renameWithFirstStereotype() && element instanceof NamedElement && !stereotypeQNames.isEmpty()) {
- String stereotypeName = NamedElementUtil.getNameFromQualifiedName(stereotypeQNames.get(0));
- // find a new name for the element
- String name = NamedElementHelper.EINSTANCE.getNewUMLElementName(element.getOwner(), stereotypeName);
- ((NamedElement)element).setName(name);
- }
-
-
- if (result.size() > 1) {
- return CommandResult.newOKCommandResult(result);
- } else if (result.size() == 1) {
- return CommandResult.newOKCommandResult(result.get(0));
- }
- return CommandResult.newOKCommandResult();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.helper.NamedElementHelper;
+import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Stereotype;
+
+
+public class ApplyStereotypeCommand extends AbstractTransactionalCommand {
+
+ protected ApplyStereotypeRequest req;
+
+ public ApplyStereotypeCommand(TransactionalEditingDomain domain, ApplyStereotypeRequest req) {
+ super(domain, "Apply stereotype", null);
+ this.req = req;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // retrieves the list of stereotypes to be applied
+ List<String> stereotypeQNames = req.getStereotypesToApply();
+ Element element = req.getElement();
+ List<EObject> result = new ArrayList<EObject>();
+ for(String stereotypeQName : stereotypeQNames) {
+ // retrieve the stereotype to apply
+ Stereotype stereotype = element.getApplicableStereotype(stereotypeQName);
+ if(stereotype == null) {
+ // stereotype has no been found. should ask for
+ // profile application ?
+ Activator.log.warn("impossible to retrieve the stereotype " + stereotypeQName);
+ } else {
+ result.add(element.applyStereotype(stereotype));
+ }
+ }
+
+ if (req.renameWithFirstStereotype() && element instanceof NamedElement && !stereotypeQNames.isEmpty()) {
+ String stereotypeName = NamedElementUtil.getNameFromQualifiedName(stereotypeQNames.get(0));
+ // find a new name for the element
+ String name = NamedElementHelper.EINSTANCE.getNewUMLElementName(element.getOwner(), stereotypeName);
+ ((NamedElement)element).setName(name);
+ }
+
+
+ if (result.size() > 1) {
+ return CommandResult.newOKCommandResult(result);
+ } else if (result.size() == 1) {
+ return CommandResult.newOKCommandResult(result.get(0));
+ }
+ return CommandResult.newOKCommandResult();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java
index 9da6eabc84a..c7f4c9fd707 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CommonDeferredCreateConnectionViewCommand.java
@@ -1,189 +1,189 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredCreateConnectionViewCommand;
-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.LabelEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-
-/**
- * This class is used to create a connection view
- *
- * @author Patrick Tessier
- */
-public class CommonDeferredCreateConnectionViewCommand extends DeferredCreateConnectionViewCommand implements ICommand {
-
- protected ICommand command;
-
- /** the command saved for undo and redo */
- protected Command createConnectionCmd;
-
- protected ConnectionViewDescriptor viewDescriptor;
-
- /**
- * Constructor
- *
- * @param editingDomain
- * the editing domain
- * @param element
- * the semantic element (may be null)
- * @param sourceViewAdapter
- * the source of the link
- * @param targetViewAdapter
- * the target of the link (may be null if the command is filled)
- * @param viewer
- * the viewer
- * @param preferencesHint
- * the preferencehint of the diagram
- * @param command
- * the command in which we look for the result for the target
- * (may be null)
- */
- public CommonDeferredCreateConnectionViewCommand(TransactionalEditingDomain editingDomain, EObject element, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter, EditPartViewer viewer, PreferencesHint preferencesHint, ICommand command) {
- super(editingDomain, element, sourceViewAdapter, targetViewAdapter, viewer, preferencesHint);
- this.command = command;
- setResult(CommandResult.newOKCommandResult(viewDescriptor));
- }
-
- /**
- * Constructor
- *
- * @param editingDomain
- * the editing domain
- * @param semanticHint
- * the semantic of the graphical element
- * @param sourceViewAdapter
- * the source of the link
- * @param targetViewAdapter
- * the target of the link (may be null if the command is filled)
- * @param viewer
- * the viewer
- * @param preferencesHint
- * the preferencehint of the diagram
- * @param viewDescriptor
- * the view descriptor
- * @param command
- * the command in which we look for the result for the target
- * (may be null)
- */
- public CommonDeferredCreateConnectionViewCommand(TransactionalEditingDomain editingDomain, String semanticHint, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter, EditPartViewer viewer, PreferencesHint preferencesHint, ConnectionViewDescriptor viewDescriptor, ICommand command) {
- super(editingDomain, semanticHint, sourceViewAdapter, targetViewAdapter, viewer, preferencesHint);
- this.viewDescriptor = viewDescriptor;
- this.command = command;
- setResult(CommandResult.newOKCommandResult(viewDescriptor));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- Map<?, ?> epRegistry = viewer.getEditPartRegistry();
- IGraphicalEditPart sourceEP = (IGraphicalEditPart)epRegistry.get(sourceViewAdapter.getAdapter(View.class));
- IGraphicalEditPart targetEP = (IGraphicalEditPart)epRegistry.get(targetViewAdapter.getAdapter(View.class));
-
- /*
- * when the source or the target of a link is an other link, the
- * previous method returns something like ElementNameEditPart A such
- * EditPart does not allow to get a Command for the creation of the link
- */
- if(sourceEP instanceof LabelEditPart) {
- sourceEP = findEditPartForCreation((View)sourceViewAdapter.getAdapter(View.class));
- }
-
- if(targetEP instanceof LabelEditPart) {
- targetEP = findEditPartForCreation((View)targetViewAdapter.getAdapter(View.class));
- }
-
- return doExecuteWithResult(progressMonitor, info, sourceEP, targetEP);
- }
-
- /**
- * Returns the EditPart for the creation
- *
- * @param adapter
- * the view of the element for which we are looking for a valid
- * EditPart
- * @return the EditPart for the creation
- */
- protected IGraphicalEditPart findEditPartForCreation(View view) {
- Iterator<?> editPartIterator = viewer.getEditPartRegistry().values().iterator();
- EObject semanticElement = view.getElement();
- while(editPartIterator.hasNext()) {
- EditPart currentEditPart = (EditPart)editPartIterator.next();
- if((!(currentEditPart instanceof CompartmentEditPart)) && currentEditPart instanceof IGraphicalEditPart && semanticElement == (((IGraphicalEditPart)currentEditPart).resolveSemanticElement())) {
- if(!(currentEditPart instanceof LabelEditPart)) {
- return (IGraphicalEditPart)currentEditPart;
- }
- }
- }
- return null;
- }
-
- /**
- * Creates a connection view between the source and target.
- *
- * @throws ExecutionException
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info, IGraphicalEditPart sourceEditPart, IGraphicalEditPart targetEditPart) throws ExecutionException {
-
- // If these are null, then the diagram's editparts may not
- // have been refreshed yet.
- Assert.isNotNull(sourceEditPart);
- Assert.isNotNull(targetEditPart);
-
- // use the String semanticHint to create a view
- // modification in order to fix the bug
- CreateConnectionViewRequest createRequest = new CreateConnectionViewRequest(viewDescriptor);
- createConnectionCmd = CreateConnectionViewRequest.getCreateCommand(createRequest, sourceEditPart, targetEditPart);
-
- if (createConnectionCmd == null) {
- throw new ExecutionException(Messages.CommonDeferredCreateConnectionViewCommand_NullConnectionCommand);
- }
-
- if(createConnectionCmd.canExecute()) {
- createConnectionCmd.execute();
- }
-
- if(element != null) {
- ((View)(createRequest.getConnectionViewDescriptor().getAdapter(View.class))).setElement(element);
- }
- viewer = null;// for garbage collection
- return CommandResult.newOKCommandResult();
- }
-
- public void setElement(EObject element) {
- this.element = element;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredCreateConnectionViewCommand;
+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.LabelEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+
+/**
+ * This class is used to create a connection view
+ *
+ * @author Patrick Tessier
+ */
+public class CommonDeferredCreateConnectionViewCommand extends DeferredCreateConnectionViewCommand implements ICommand {
+
+ protected ICommand command;
+
+ /** the command saved for undo and redo */
+ protected Command createConnectionCmd;
+
+ protected ConnectionViewDescriptor viewDescriptor;
+
+ /**
+ * Constructor
+ *
+ * @param editingDomain
+ * the editing domain
+ * @param element
+ * the semantic element (may be null)
+ * @param sourceViewAdapter
+ * the source of the link
+ * @param targetViewAdapter
+ * the target of the link (may be null if the command is filled)
+ * @param viewer
+ * the viewer
+ * @param preferencesHint
+ * the preferencehint of the diagram
+ * @param command
+ * the command in which we look for the result for the target
+ * (may be null)
+ */
+ public CommonDeferredCreateConnectionViewCommand(TransactionalEditingDomain editingDomain, EObject element, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter, EditPartViewer viewer, PreferencesHint preferencesHint, ICommand command) {
+ super(editingDomain, element, sourceViewAdapter, targetViewAdapter, viewer, preferencesHint);
+ this.command = command;
+ setResult(CommandResult.newOKCommandResult(viewDescriptor));
+ }
+
+ /**
+ * Constructor
+ *
+ * @param editingDomain
+ * the editing domain
+ * @param semanticHint
+ * the semantic of the graphical element
+ * @param sourceViewAdapter
+ * the source of the link
+ * @param targetViewAdapter
+ * the target of the link (may be null if the command is filled)
+ * @param viewer
+ * the viewer
+ * @param preferencesHint
+ * the preferencehint of the diagram
+ * @param viewDescriptor
+ * the view descriptor
+ * @param command
+ * the command in which we look for the result for the target
+ * (may be null)
+ */
+ public CommonDeferredCreateConnectionViewCommand(TransactionalEditingDomain editingDomain, String semanticHint, IAdaptable sourceViewAdapter, IAdaptable targetViewAdapter, EditPartViewer viewer, PreferencesHint preferencesHint, ConnectionViewDescriptor viewDescriptor, ICommand command) {
+ super(editingDomain, semanticHint, sourceViewAdapter, targetViewAdapter, viewer, preferencesHint);
+ this.viewDescriptor = viewDescriptor;
+ this.command = command;
+ setResult(CommandResult.newOKCommandResult(viewDescriptor));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ Map<?, ?> epRegistry = viewer.getEditPartRegistry();
+ IGraphicalEditPart sourceEP = (IGraphicalEditPart)epRegistry.get(sourceViewAdapter.getAdapter(View.class));
+ IGraphicalEditPart targetEP = (IGraphicalEditPart)epRegistry.get(targetViewAdapter.getAdapter(View.class));
+
+ /*
+ * when the source or the target of a link is an other link, the
+ * previous method returns something like ElementNameEditPart A such
+ * EditPart does not allow to get a Command for the creation of the link
+ */
+ if(sourceEP instanceof LabelEditPart) {
+ sourceEP = findEditPartForCreation((View)sourceViewAdapter.getAdapter(View.class));
+ }
+
+ if(targetEP instanceof LabelEditPart) {
+ targetEP = findEditPartForCreation((View)targetViewAdapter.getAdapter(View.class));
+ }
+
+ return doExecuteWithResult(progressMonitor, info, sourceEP, targetEP);
+ }
+
+ /**
+ * Returns the EditPart for the creation
+ *
+ * @param adapter
+ * the view of the element for which we are looking for a valid
+ * EditPart
+ * @return the EditPart for the creation
+ */
+ protected IGraphicalEditPart findEditPartForCreation(View view) {
+ Iterator<?> editPartIterator = viewer.getEditPartRegistry().values().iterator();
+ EObject semanticElement = view.getElement();
+ while(editPartIterator.hasNext()) {
+ EditPart currentEditPart = (EditPart)editPartIterator.next();
+ if((!(currentEditPart instanceof CompartmentEditPart)) && currentEditPart instanceof IGraphicalEditPart && semanticElement == (((IGraphicalEditPart)currentEditPart).resolveSemanticElement())) {
+ if(!(currentEditPart instanceof LabelEditPart)) {
+ return (IGraphicalEditPart)currentEditPart;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Creates a connection view between the source and target.
+ *
+ * @throws ExecutionException
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info, IGraphicalEditPart sourceEditPart, IGraphicalEditPart targetEditPart) throws ExecutionException {
+
+ // If these are null, then the diagram's editparts may not
+ // have been refreshed yet.
+ Assert.isNotNull(sourceEditPart);
+ Assert.isNotNull(targetEditPart);
+
+ // use the String semanticHint to create a view
+ // modification in order to fix the bug
+ CreateConnectionViewRequest createRequest = new CreateConnectionViewRequest(viewDescriptor);
+ createConnectionCmd = CreateConnectionViewRequest.getCreateCommand(createRequest, sourceEditPart, targetEditPart);
+
+ if (createConnectionCmd == null) {
+ throw new ExecutionException(Messages.CommonDeferredCreateConnectionViewCommand_NullConnectionCommand);
+ }
+
+ if(createConnectionCmd.canExecute()) {
+ createConnectionCmd.execute();
+ }
+
+ if(element != null) {
+ ((View)(createRequest.getConnectionViewDescriptor().getAdapter(View.class))).setElement(element);
+ }
+ viewer = null;// for garbage collection
+ return CommandResult.newOKCommandResult();
+ }
+
+ public void setElement(EObject element) {
+ this.element = element;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateBehavioredClassifierDiagramCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateBehavioredClassifierDiagramCommand.java
index b7515968126..892c01f65c7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateBehavioredClassifierDiagramCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateBehavioredClassifierDiagramCommand.java
@@ -1,168 +1,168 @@
-/*******************************************************************************
- * Copyright (c) 2010 AtosOrigin.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * AtosOrigin - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.uml2.uml.Behavior;
-import org.eclipse.uml2.uml.BehavioredClassifier;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * Define a command to create a new Behavioral Diagram. This command is used by
- * all UI (toolbar, outline, creation wizards) to create a new Behavioral
- * Diagram. This class should be extended by behavioral diagram only.
- */
-public abstract class CreateBehavioredClassifierDiagramCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler {
-
- private Behavior behavior = null;
-
- private String name = ""; //$NON-NLS-1$
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeDiagram(EObject diagram) {
- if(diagram instanceof Diagram) {
- Diagram diag = (Diagram)diagram;
- if(behavior != null) {
- diag.setElement(behavior);
- createBehaviorView(diag);
- }
- diag.setName(getName());
- }
-
- }
-
- /**
- * Create the associated behavior
- *
- * @return
- */
- protected Behavior createBehavior() {
- Behavior newBehavior = (Behavior)UMLFactory.eINSTANCE.create(getBehaviorEClass());
-
- return newBehavior;
- }
-
- /**
- * Get the kind of behavior associated to the diagram
- *
- * @return the EClass of the behavior supposed to own the diagram.
- */
- protected abstract EClass getBehaviorEClass();
-
- /**
- * {@inheritDoc}
- */
- protected void initializeModel(EObject owner) {
-
- if(owner.eClass() == getBehaviorEClass()) {
- behavior = (Behavior)owner;
-
- } else {
- behavior = (Behavior)UMLFactory.eINSTANCE.create(getBehaviorEClass());
-
- if(owner instanceof BehavioredClassifier) {
- BehavioredClassifier behaviorClassifier = (BehavioredClassifier)owner;
- behaviorClassifier.getOwnedBehaviors().add(behavior);
-
- } else if(owner instanceof Package) {
- org.eclipse.uml2.uml.Package pack = (org.eclipse.uml2.uml.Package)owner;
- pack.getPackagedElements().add(behavior);
-
- }
- behavior.setName(NamedElementUtil.getName(behavior));
- }
- }
-
- private void createBehaviorView(Diagram diagram) {
- ViewService.getInstance().createView(Node.class, new EObjectAdapter(behavior), diagram, null, ViewUtil.APPEND, true, getPreferenceHint());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Diagram createDiagram(Resource diagramResource, EObject owner, String name) {
- Diagram diagram = null;
- if(owner instanceof org.eclipse.uml2.uml.Package) {
- diagram = ViewService.createDiagram(owner, getDiagramNotationID(), getPreferenceHint());
- } else if(owner instanceof BehavioredClassifier) {
- diagram = ViewService.createDiagram(((BehavioredClassifier)owner).getNearestPackage(), getDiagramNotationID(), getPreferenceHint());
- }
- // create diagram
- if(diagram != null) {
- setName(name);
-
- initializeModel(owner);
- initializeDiagram(diagram);
- diagramResource.getContents().add(diagram);
- }
- return diagram;
- }
-
- /**
- * Set the name of the diagram and its containing element
- *
- * @param newName
- */
- protected void setName(String newName) {
- if(newName == null || newName.equals(name)) {
- return;
- }
- name = newName;
- }
-
- protected String getName() {
- return name;
- }
-
- // @Override
- // protected void runAsTransaction(DiResourceSet diResourceSet, EObject
- // container, String name) {
- // if(name == null && container instanceof NamedElement) {
- // setName(((NamedElement)container).getName());
- // if(!"".equals(getName())) {
- // // initialize name with activity's name
- // name = openDiagramNameDialog(getName());
- // if(name == null) {
- // // operation canceled
- // return;
- // }
- // }
- // }
- // super.runAsTransaction(diResourceSet, container,
- // getDefaultDiagramName());
- // }
-
- /**
- * Check if the creation of this diagram is strongly attached to its parent
- * or if it can be reassigned after creation.
- *
- * @return true if parent can be reassigned
- */
- public boolean isParentReassignable() {
- // Behavioral diagrams describe their parent behavior and only this one.
- // They can not be moved to another parent.
- return false;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2010 AtosOrigin.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * AtosOrigin - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.papyrus.infra.gmfdiag.common.AbstractPapyrusGmfCreateDiagramCommandHandler;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+import org.eclipse.uml2.uml.Behavior;
+import org.eclipse.uml2.uml.BehavioredClassifier;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * Define a command to create a new Behavioral Diagram. This command is used by
+ * all UI (toolbar, outline, creation wizards) to create a new Behavioral
+ * Diagram. This class should be extended by behavioral diagram only.
+ */
+public abstract class CreateBehavioredClassifierDiagramCommand extends AbstractPapyrusGmfCreateDiagramCommandHandler {
+
+ private Behavior behavior = null;
+
+ private String name = ""; //$NON-NLS-1$
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void initializeDiagram(EObject diagram) {
+ if(diagram instanceof Diagram) {
+ Diagram diag = (Diagram)diagram;
+ if(behavior != null) {
+ diag.setElement(behavior);
+ createBehaviorView(diag);
+ }
+ diag.setName(getName());
+ }
+
+ }
+
+ /**
+ * Create the associated behavior
+ *
+ * @return
+ */
+ protected Behavior createBehavior() {
+ Behavior newBehavior = (Behavior)UMLFactory.eINSTANCE.create(getBehaviorEClass());
+
+ return newBehavior;
+ }
+
+ /**
+ * Get the kind of behavior associated to the diagram
+ *
+ * @return the EClass of the behavior supposed to own the diagram.
+ */
+ protected abstract EClass getBehaviorEClass();
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void initializeModel(EObject owner) {
+
+ if(owner.eClass() == getBehaviorEClass()) {
+ behavior = (Behavior)owner;
+
+ } else {
+ behavior = (Behavior)UMLFactory.eINSTANCE.create(getBehaviorEClass());
+
+ if(owner instanceof BehavioredClassifier) {
+ BehavioredClassifier behaviorClassifier = (BehavioredClassifier)owner;
+ behaviorClassifier.getOwnedBehaviors().add(behavior);
+
+ } else if(owner instanceof Package) {
+ org.eclipse.uml2.uml.Package pack = (org.eclipse.uml2.uml.Package)owner;
+ pack.getPackagedElements().add(behavior);
+
+ }
+ behavior.setName(NamedElementUtil.getName(behavior));
+ }
+ }
+
+ private void createBehaviorView(Diagram diagram) {
+ ViewService.getInstance().createView(Node.class, new EObjectAdapter(behavior), diagram, null, ViewUtil.APPEND, true, getPreferenceHint());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Diagram createDiagram(Resource diagramResource, EObject owner, String name) {
+ Diagram diagram = null;
+ if(owner instanceof org.eclipse.uml2.uml.Package) {
+ diagram = ViewService.createDiagram(owner, getDiagramNotationID(), getPreferenceHint());
+ } else if(owner instanceof BehavioredClassifier) {
+ diagram = ViewService.createDiagram(((BehavioredClassifier)owner).getNearestPackage(), getDiagramNotationID(), getPreferenceHint());
+ }
+ // create diagram
+ if(diagram != null) {
+ setName(name);
+
+ initializeModel(owner);
+ initializeDiagram(diagram);
+ diagramResource.getContents().add(diagram);
+ }
+ return diagram;
+ }
+
+ /**
+ * Set the name of the diagram and its containing element
+ *
+ * @param newName
+ */
+ protected void setName(String newName) {
+ if(newName == null || newName.equals(name)) {
+ return;
+ }
+ name = newName;
+ }
+
+ protected String getName() {
+ return name;
+ }
+
+ // @Override
+ // protected void runAsTransaction(DiResourceSet diResourceSet, EObject
+ // container, String name) {
+ // if(name == null && container instanceof NamedElement) {
+ // setName(((NamedElement)container).getName());
+ // if(!"".equals(getName())) {
+ // // initialize name with activity's name
+ // name = openDiagramNameDialog(getName());
+ // if(name == null) {
+ // // operation canceled
+ // return;
+ // }
+ // }
+ // }
+ // super.runAsTransaction(diResourceSet, container,
+ // getDefaultDiagramName());
+ // }
+
+ /**
+ * Check if the creation of this diagram is strongly attached to its parent
+ * or if it can be reassigned after creation.
+ *
+ * @return true if parent can be reassigned
+ */
+ public boolean isParentReassignable() {
+ // Behavioral diagrams describe their parent behavior and only this one.
+ // They can not be moved to another parent.
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateUMLModelCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateUMLModelCommand.java
index a576228985f..bc2fefca8f6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateUMLModelCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/CreateUMLModelCommand.java
@@ -1,57 +1,57 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tatiana Fesenko (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.uml2.uml.UMLFactory;
-
-/**
- * The Class CreateUMLModelCommand.
- */
-public class CreateUMLModelCommand extends ModelCreationCommandBase {
-
- public static final String COMMAND_ID = "uml";
-
- /**
- * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#createRootElement()
- *
- * @return
- */
-
- @Override
- protected EObject createRootElement() {
- return UMLFactory.eINSTANCE.createModel();
- }
-
- /**
- * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#initializeModel(org.eclipse.emf.ecore.EObject)
- *
- * @param owner
- */
-
- @Override
- protected void initializeModel(EObject owner) {
- super.initializeModel(owner);
- ((org.eclipse.uml2.uml.Package)owner).setName(getModelName());
- }
-
- /**
- * Gets the model name.
- *
- * @return the model name
- */
- protected String getModelName() {
- return "model";
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tatiana Fesenko (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.uml2.uml.UMLFactory;
+
+/**
+ * The Class CreateUMLModelCommand.
+ */
+public class CreateUMLModelCommand extends ModelCreationCommandBase {
+
+ public static final String COMMAND_ID = "uml";
+
+ /**
+ * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#createRootElement()
+ *
+ * @return
+ */
+
+ @Override
+ protected EObject createRootElement() {
+ return UMLFactory.eINSTANCE.createModel();
+ }
+
+ /**
+ * @see org.eclipse.papyrus.infra.core.extension.commands.ModelCreationCommandBase#initializeModel(org.eclipse.emf.ecore.EObject)
+ *
+ * @param owner
+ */
+
+ @Override
+ protected void initializeModel(EObject owner) {
+ super.initializeModel(owner);
+ ((org.eclipse.uml2.uml.Package)owner).setName(getModelName());
+ }
+
+ /**
+ * Gets the model name.
+ *
+ * @return the model name
+ */
+ protected String getModelName() {
+ return "model";
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeferredCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeferredCreateCommand.java
index 362d4915f69..62220cc45fc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeferredCreateCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeferredCreateCommand.java
@@ -1,127 +1,127 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener;
-import org.eclipse.swt.dnd.DND;
-
-/**
- * This command drag and drop the content of the element which just be dropped
- *
- */
-public class DeferredCreateCommand extends AbstractTransactionalCommand {
-
- private IAdaptable adapter;
-
- private EditPartViewer editPartViewer;
-
- private EObject parent;
-
- public DeferredCreateCommand(TransactionalEditingDomain domain, EObject parentEObject, IAdaptable parentAdapter, EditPartViewer editPartViewer) {
-
- super(domain, DiagramUIMessages.CreateCommand_Label, getWorkspaceFiles(parentEObject));
- this.editPartViewer = editPartViewer;
-
- Assert.isNotNull(parentAdapter);
-
- this.adapter = parentAdapter;
- this.parent = parentEObject;
-
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- View view = (View)adapter.getAdapter(View.class);
- if(view != null) {
- // Get the parent edit part
- EditPart parentEditPart = (EditPart)editPartViewer.getEditPartRegistry().get(view.eContainer());
- parentEditPart.refresh();
- Object editPart = editPartViewer.getEditPartRegistry().get(view);
- List<IGraphicalEditPart> graphicalEditParts = new ArrayList<IGraphicalEditPart>();
- if(editPart != null && editPart instanceof IGraphicalEditPart) {
- IGraphicalEditPart graphicalParentEditPart = (IGraphicalEditPart)editPart;
- graphicalEditParts.add(graphicalParentEditPart);
- // Get all the graphical editparts
- for(Object child : graphicalParentEditPart.getChildren()) {
- if(child instanceof IGraphicalEditPart) {
- graphicalEditParts.add((IGraphicalEditPart)child);
- }
- }
- // for all child check if it can be add for all graphical editparts
- for(EObject child : parent.eContents()) {
- boolean alreadyDisplay = false;
- for(IGraphicalEditPart gep : graphicalEditParts) {
- DropObjectsRequest request = new DropObjectsRequest();
- request.setObjects(Collections.singletonList(child));
- request.setLocation(new Point(10, 10));
- if(request.getExtendedData() != null) {
- request.getExtendedData().put(DropTargetListener.EVENT_DETAIL, DND.DROP_COPY);
- }
- final Command command = gep.getCommand(request);
- // If possible do the drop
- if(command != null && command.canExecute() && !alreadyDisplay) {
- command.execute();
- parentEditPart.refresh();
- alreadyDisplay = true;
- // Arrange all
- if(gep.getChildren() != null && !gep.getChildren().isEmpty()) {
- ArrangeRequest r = new ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL);
- r.setPartsToArrange(gep.getChildren());
- Command d = gep.getCommand(r);
- if(d != null && d.canExecute()) {
- d.execute();
- }
- //TODO : auto-resize
- }
- }
- }
- }
- }
- }
- return CommandResult.newOKCommandResult();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean canExecute() {
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener;
+import org.eclipse.swt.dnd.DND;
+
+/**
+ * This command drag and drop the content of the element which just be dropped
+ *
+ */
+public class DeferredCreateCommand extends AbstractTransactionalCommand {
+
+ private IAdaptable adapter;
+
+ private EditPartViewer editPartViewer;
+
+ private EObject parent;
+
+ public DeferredCreateCommand(TransactionalEditingDomain domain, EObject parentEObject, IAdaptable parentAdapter, EditPartViewer editPartViewer) {
+
+ super(domain, DiagramUIMessages.CreateCommand_Label, getWorkspaceFiles(parentEObject));
+ this.editPartViewer = editPartViewer;
+
+ Assert.isNotNull(parentAdapter);
+
+ this.adapter = parentAdapter;
+ this.parent = parentEObject;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ View view = (View)adapter.getAdapter(View.class);
+ if(view != null) {
+ // Get the parent edit part
+ EditPart parentEditPart = (EditPart)editPartViewer.getEditPartRegistry().get(view.eContainer());
+ parentEditPart.refresh();
+ Object editPart = editPartViewer.getEditPartRegistry().get(view);
+ List<IGraphicalEditPart> graphicalEditParts = new ArrayList<IGraphicalEditPart>();
+ if(editPart != null && editPart instanceof IGraphicalEditPart) {
+ IGraphicalEditPart graphicalParentEditPart = (IGraphicalEditPart)editPart;
+ graphicalEditParts.add(graphicalParentEditPart);
+ // Get all the graphical editparts
+ for(Object child : graphicalParentEditPart.getChildren()) {
+ if(child instanceof IGraphicalEditPart) {
+ graphicalEditParts.add((IGraphicalEditPart)child);
+ }
+ }
+ // for all child check if it can be add for all graphical editparts
+ for(EObject child : parent.eContents()) {
+ boolean alreadyDisplay = false;
+ for(IGraphicalEditPart gep : graphicalEditParts) {
+ DropObjectsRequest request = new DropObjectsRequest();
+ request.setObjects(Collections.singletonList(child));
+ request.setLocation(new Point(10, 10));
+ if(request.getExtendedData() != null) {
+ request.getExtendedData().put(DropTargetListener.EVENT_DETAIL, DND.DROP_COPY);
+ }
+ final Command command = gep.getCommand(request);
+ // If possible do the drop
+ if(command != null && command.canExecute() && !alreadyDisplay) {
+ command.execute();
+ parentEditPart.refresh();
+ alreadyDisplay = true;
+ // Arrange all
+ if(gep.getChildren() != null && !gep.getChildren().isEmpty()) {
+ ArrangeRequest r = new ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL);
+ r.setPartsToArrange(gep.getChildren());
+ Command d = gep.getCommand(r);
+ if(d != null && d.canExecute()) {
+ d.execute();
+ }
+ //TODO : auto-resize
+ }
+ }
+ }
+ }
+ }
+ }
+ return CommandResult.newOKCommandResult();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean canExecute() {
+ return true;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DefferedAppliedStereotypeToDisplayCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DefferedAppliedStereotypeToDisplayCommand.java
index 33045403115..5de9ad67efe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DefferedAppliedStereotypeToDisplayCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DefferedAppliedStereotypeToDisplayCommand.java
@@ -1,96 +1,96 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.Collection;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.commands.CreateEAnnotationCommand;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Collections2;
-
-/**
- * The Class AddAppliedStereotypeToDisplayCommand used to set the list of
- * applied stereotype to display
- */
-public class DefferedAppliedStereotypeToDisplayCommand extends CreateEAnnotationCommand {
-
- /** The qualified names' stereotypes list . */
- protected String stereotypeList;
-
- /** adapter on which to apply stereotypes */
- protected IAdaptable adapter;
-
- /**
- * Instantiates a new sets the applied stereotype to display command.
- *
- * @param domain
- * the domain
- * @param object
- * the object
- * @param stereotypeList
- * the stereotype list
- */
- public DefferedAppliedStereotypeToDisplayCommand(TransactionalEditingDomain domain, IAdaptable adapter, String stereotypeList) {
- super(domain, null, UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION);
- this.adapter = adapter;
- this.stereotypeList = stereotypeList;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void doExecute() {
- View view = (View)adapter.getAdapter(View.class);
- EObject view_element = view.getElement();
- Element element = (Element)view_element;
- Collection<String> strStereotypes = Collections2.transform(element.getAppliedStereotypes(), new Function<Stereotype, String>() {
-
- public String apply(Stereotype st) {
- return st.getQualifiedName();
- }
- });
- stereotypeList = PaletteUtil.getSerializedStereotypeList(strStereotypes);
-
- String stereoList = AppliedStereotypeHelper.getStereotypesToDisplay(view);
- if(!"".equals(stereoList)) {
- stereoList = stereoList + ",";
- }
- stereoList = stereoList + stereotypeList;
- EAnnotation oldAnnotation = view.getEAnnotation(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION);
- if(oldAnnotation == null) {
- oldAnnotation = createEAnnotation();
- attachEannotation(oldAnnotation, view);
- }
- replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.STEREOTYPE_WITHQN_LIST, AppliedStereotypeHelper.getStereotypesQNToDisplay(view));
- replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.STEREOTYPE_LIST, stereoList);
- replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.STEREOTYPE_PRESENTATION_KIND, AppliedStereotypeHelper.getAppliedStereotypePresentationKind(view));
- replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.PROPERTY_STEREOTYPE_DISPLAY, AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay(view));
- replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.STEREOTYPE_PROPERTY_LOCATION, AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization(view));
- replaceEannotation(view.getEAnnotation(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION), view);
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.Collection;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.commands.CreateEAnnotationCommand;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+
+/**
+ * The Class AddAppliedStereotypeToDisplayCommand used to set the list of
+ * applied stereotype to display
+ */
+public class DefferedAppliedStereotypeToDisplayCommand extends CreateEAnnotationCommand {
+
+ /** The qualified names' stereotypes list . */
+ protected String stereotypeList;
+
+ /** adapter on which to apply stereotypes */
+ protected IAdaptable adapter;
+
+ /**
+ * Instantiates a new sets the applied stereotype to display command.
+ *
+ * @param domain
+ * the domain
+ * @param object
+ * the object
+ * @param stereotypeList
+ * the stereotype list
+ */
+ public DefferedAppliedStereotypeToDisplayCommand(TransactionalEditingDomain domain, IAdaptable adapter, String stereotypeList) {
+ super(domain, null, UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION);
+ this.adapter = adapter;
+ this.stereotypeList = stereotypeList;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void doExecute() {
+ View view = (View)adapter.getAdapter(View.class);
+ EObject view_element = view.getElement();
+ Element element = (Element)view_element;
+ Collection<String> strStereotypes = Collections2.transform(element.getAppliedStereotypes(), new Function<Stereotype, String>() {
+
+ public String apply(Stereotype st) {
+ return st.getQualifiedName();
+ }
+ });
+ stereotypeList = PaletteUtil.getSerializedStereotypeList(strStereotypes);
+
+ String stereoList = AppliedStereotypeHelper.getStereotypesToDisplay(view);
+ if(!"".equals(stereoList)) {
+ stereoList = stereoList + ",";
+ }
+ stereoList = stereoList + stereotypeList;
+ EAnnotation oldAnnotation = view.getEAnnotation(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION);
+ if(oldAnnotation == null) {
+ oldAnnotation = createEAnnotation();
+ attachEannotation(oldAnnotation, view);
+ }
+ replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.STEREOTYPE_WITHQN_LIST, AppliedStereotypeHelper.getStereotypesQNToDisplay(view));
+ replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.STEREOTYPE_LIST, stereoList);
+ replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.STEREOTYPE_PRESENTATION_KIND, AppliedStereotypeHelper.getAppliedStereotypePresentationKind(view));
+ replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.PROPERTY_STEREOTYPE_DISPLAY, AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay(view));
+ replaceEntry(oldAnnotation, UMLVisualInformationPapyrusConstant.STEREOTYPE_PROPERTY_LOCATION, AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization(view));
+ replaceEannotation(view.getEAnnotation(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION), view);
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeleteLinkDuringCreationCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeleteLinkDuringCreationCommand.java
index 64ad2e155d4..0207c2b6a4d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeleteLinkDuringCreationCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DeleteLinkDuringCreationCommand.java
@@ -1,116 +1,116 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.Iterator;
-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.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPartListener;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.tools.AbstractConnectionCreationTool;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.papyrus.uml.diagram.common.editparts.IEditpartListenerAccess;
-import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart;
-
-/**
- * this class has to be used at very specific situation: During the
- * transformation of a binary link to multi -nary links, you need to remove the
- * link that is the source or the target of the new link. during the delete,
- * several listener has trigger (a cycle is created) and finally the active tool
- * close the transaction
- *
- * In order to avoid the raise of the listener, one of editpartlisteners is
- * removed in the connectioneditpart before doing the deletion This listener is
- * created by the active tool. In this class, the listener editpart of
- * AbstractConnectionCreationTool is removed. in order to remove the editpart
- * listener the editpart must implements IEditpartListenerAccess
- *
- *
- */
-
-public class DeleteLinkDuringCreationCommand extends DeleteCommand {
-
- /** the view that will suppressed **/
- protected Edge edge = null;
-
- /** the editpart viewer **/
- protected EditPartViewer viewer = null;
-
- /**
- *
- * Constructor
- *
- * @param editingDomain
- * in order to run this command
- * @param view
- * has not to be null
- * @param viewer
- * has not to be null
- */
- public DeleteLinkDuringCreationCommand(TransactionalEditingDomain editingDomain, Edge view, EditPartViewer viewer) {
- super(editingDomain, view);
-
- assert (view != null);
- assert (viewer != null);
-
- this.edge = view;
- this.viewer = viewer;
-
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- // find editpartlistener to remove
- Map epRegistry = viewer.getEditPartRegistry();
- // the listener to remove
- EditPartListener listenerToRemove = null;
- // the graphical editpart to delete
- IGraphicalEditPart editPart = (IGraphicalEditPart)epRegistry.get(edge);
-
- if(editPart instanceof IEditpartListenerAccess) {
- Iterator iterlistener = ((UMLConnectionNodeEditPart)editPart).getEventListenerIterator(EditPartListener.class);
- while(iterlistener.hasNext()) {
- Object currentObject = iterlistener.next();
-
- Class classobject = currentObject.getClass();
- Class activeToolClass = AbstractConnectionCreationTool.class;
- String activeToolClassName = activeToolClass.getName();
-
- // compare the name of the listener.
- // because it was a inner class private we cannot test the type
- // or access to it
- if(classobject.getName().contains(activeToolClassName)) {
- listenerToRemove = (EditPartListener)currentObject;
- }
- }
- }
- if(listenerToRemove!=null){
- // Finally we remove the listener
- editPart.removeEditPartListener(listenerToRemove);
- }
-
- // we can do now the job
- CommandResult commandResult = super.doExecuteWithResult(progressMonitor, info);
-
- return commandResult;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.Iterator;
+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.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPartListener;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.tools.AbstractConnectionCreationTool;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.papyrus.uml.diagram.common.editparts.IEditpartListenerAccess;
+import org.eclipse.papyrus.uml.diagram.common.editparts.UMLConnectionNodeEditPart;
+
+/**
+ * this class has to be used at very specific situation: During the
+ * transformation of a binary link to multi -nary links, you need to remove the
+ * link that is the source or the target of the new link. during the delete,
+ * several listener has trigger (a cycle is created) and finally the active tool
+ * close the transaction
+ *
+ * In order to avoid the raise of the listener, one of editpartlisteners is
+ * removed in the connectioneditpart before doing the deletion This listener is
+ * created by the active tool. In this class, the listener editpart of
+ * AbstractConnectionCreationTool is removed. in order to remove the editpart
+ * listener the editpart must implements IEditpartListenerAccess
+ *
+ *
+ */
+
+public class DeleteLinkDuringCreationCommand extends DeleteCommand {
+
+ /** the view that will suppressed **/
+ protected Edge edge = null;
+
+ /** the editpart viewer **/
+ protected EditPartViewer viewer = null;
+
+ /**
+ *
+ * Constructor
+ *
+ * @param editingDomain
+ * in order to run this command
+ * @param view
+ * has not to be null
+ * @param viewer
+ * has not to be null
+ */
+ public DeleteLinkDuringCreationCommand(TransactionalEditingDomain editingDomain, Edge view, EditPartViewer viewer) {
+ super(editingDomain, view);
+
+ assert (view != null);
+ assert (viewer != null);
+
+ this.edge = view;
+ this.viewer = viewer;
+
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ // find editpartlistener to remove
+ Map epRegistry = viewer.getEditPartRegistry();
+ // the listener to remove
+ EditPartListener listenerToRemove = null;
+ // the graphical editpart to delete
+ IGraphicalEditPart editPart = (IGraphicalEditPart)epRegistry.get(edge);
+
+ if(editPart instanceof IEditpartListenerAccess) {
+ Iterator iterlistener = ((UMLConnectionNodeEditPart)editPart).getEventListenerIterator(EditPartListener.class);
+ while(iterlistener.hasNext()) {
+ Object currentObject = iterlistener.next();
+
+ Class classobject = currentObject.getClass();
+ Class activeToolClass = AbstractConnectionCreationTool.class;
+ String activeToolClassName = activeToolClass.getName();
+
+ // compare the name of the listener.
+ // because it was a inner class private we cannot test the type
+ // or access to it
+ if(classobject.getName().contains(activeToolClassName)) {
+ listenerToRemove = (EditPartListener)currentObject;
+ }
+ }
+ }
+ if(listenerToRemove!=null){
+ // Finally we remove the listener
+ editPart.removeEditPartListener(listenerToRemove);
+ }
+
+ // we can do now the job
+ CommandResult commandResult = super.doExecuteWithResult(progressMonitor, info);
+
+ return commandResult;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateAnythingCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateAnythingCommand.java
index da998500744..71389dd5539 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateAnythingCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateAnythingCommand.java
@@ -1,52 +1,52 @@
-/*******************************************************************************
- * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat
- * de la Comunitat Valenciana. All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Mario Cervera Ubeda (Prodevelop) - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.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.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.uml.diagram.common.util.MultiDiagramUtil;
-
-// @unused
-public class DuplicateAnythingCommand extends DuplicateEObjectsCommand {
-
- private final Diagram diagram;
-
- public DuplicateAnythingCommand(TransactionalEditingDomain editingDomain, DuplicateElementsRequest req, Diagram currentDiagram) {
-
- super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap());
-
- this.diagram = currentDiagram;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
-
- CommandResult result = super.doExecuteWithResult(progressMonitor, info);
-
- for(Object duplicatedObject : this.getAllDuplicatedObjectsMap().keySet()) {
- if(duplicatedObject instanceof EObject) {
- if(MultiDiagramUtil.findEObjectReferencedInEAnnotation(diagram, (EObject)duplicatedObject)) {
- MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, (EObject)this.getAllDuplicatedObjectsMap().get(duplicatedObject));
- }
- }
- }
-
- return result;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte, Generalitat
+ * de la Comunitat Valenciana. All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Mario Cervera Ubeda (Prodevelop) - initial API and implementation
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.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.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.uml.diagram.common.util.MultiDiagramUtil;
+
+// @unused
+public class DuplicateAnythingCommand extends DuplicateEObjectsCommand {
+
+ private final Diagram diagram;
+
+ public DuplicateAnythingCommand(TransactionalEditingDomain editingDomain, DuplicateElementsRequest req, Diagram currentDiagram) {
+
+ super(editingDomain, req.getLabel(), req.getElementsToBeDuplicated(), req.getAllDuplicatedElementsMap());
+
+ this.diagram = currentDiagram;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+
+ for(Object duplicatedObject : this.getAllDuplicatedObjectsMap().keySet()) {
+ if(duplicatedObject instanceof EObject) {
+ if(MultiDiagramUtil.findEObjectReferencedInEAnnotation(diagram, (EObject)duplicatedObject)) {
+ MultiDiagramUtil.AddEAnnotationReferenceToDiagram(diagram, (EObject)this.getAllDuplicatedObjectsMap().get(duplicatedObject));
+ }
+ }
+ }
+
+ return result;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateNamedElementCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateNamedElementCommand.java
index fa219de7251..86e22244864 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateNamedElementCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/DuplicateNamedElementCommand.java
@@ -1,92 +1,92 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-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.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * this command is used to prefix element by "Copy_Of" during the duplication
- *
- */
-public class DuplicateNamedElementCommand extends DuplicateEObjectsCommand {
-
- protected static final String COPY_OF = "Copy_Of_";
-
- protected Object diagram;
-
- @SuppressWarnings("rawtypes")
- public DuplicateNamedElementCommand(TransactionalEditingDomain editingDomain, String label, List eObjectsToBeDuplicated, Map allDuplicatedObjectsMap, Diagram currentDiagram) {
- super(editingDomain, label, eObjectsToBeDuplicated, allDuplicatedObjectsMap);
- this.diagram = currentDiagram;
- }
-
- /**
- * Executes this command by duplicating the orignal eobjects, adding the
- * duplicates to the original's container, and populating the map of
- * duplicates to be returned.
- *
- */
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- super.doExecuteWithResult(progressMonitor, info);
- ArrayList<EObject> processedData= new ArrayList<EObject>();
- Iterator iterator = getAllDuplicatedObjectsMap().values().iterator();
- NamedElement namedElement=null;
- while(iterator.hasNext()) {
- Object currentObject = iterator.next();
- if(currentObject instanceof View) {
- if(((View)currentObject).getElement() != null && ((View)currentObject).getElement() instanceof NamedElement) {
- namedElement = ((NamedElement)((View)currentObject).getElement());
- if(namedElement.getName() != null && !namedElement.getName().startsWith(COPY_OF)) {
- namedElement.setName(COPY_OF + namedElement.getName());
- }
- }
-
- }
-
- if(currentObject instanceof NamedElement) {
- namedElement = ((NamedElement)currentObject);
- // some literal has not name
- if(namedElement.getName() != null && !namedElement.getName().startsWith(COPY_OF)) {
- namedElement.setName(COPY_OF + namedElement.getName());
- }
- }
-
- }
-
- iterator = getAllDuplicatedObjectsMap().values().iterator();
- while(iterator.hasNext()) {
- Object currentObject = iterator.next();
- if((currentObject instanceof EObject) &&(((EObject) currentObject).eContainer()== null)&&(((EObject) currentObject).eResource()== null)) {
- namedElement.eResource().getContents().add((EObject)currentObject);
- }
- }
-
- return CommandResult.newOKCommandResult(getAllDuplicatedObjectsMap());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+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.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.commands.DuplicateEObjectsCommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * this command is used to prefix element by "Copy_Of" during the duplication
+ *
+ */
+public class DuplicateNamedElementCommand extends DuplicateEObjectsCommand {
+
+ protected static final String COPY_OF = "Copy_Of_";
+
+ protected Object diagram;
+
+ @SuppressWarnings("rawtypes")
+ public DuplicateNamedElementCommand(TransactionalEditingDomain editingDomain, String label, List eObjectsToBeDuplicated, Map allDuplicatedObjectsMap, Diagram currentDiagram) {
+ super(editingDomain, label, eObjectsToBeDuplicated, allDuplicatedObjectsMap);
+ this.diagram = currentDiagram;
+ }
+
+ /**
+ * Executes this command by duplicating the orignal eobjects, adding the
+ * duplicates to the original's container, and populating the map of
+ * duplicates to be returned.
+ *
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ super.doExecuteWithResult(progressMonitor, info);
+ ArrayList<EObject> processedData= new ArrayList<EObject>();
+ Iterator iterator = getAllDuplicatedObjectsMap().values().iterator();
+ NamedElement namedElement=null;
+ while(iterator.hasNext()) {
+ Object currentObject = iterator.next();
+ if(currentObject instanceof View) {
+ if(((View)currentObject).getElement() != null && ((View)currentObject).getElement() instanceof NamedElement) {
+ namedElement = ((NamedElement)((View)currentObject).getElement());
+ if(namedElement.getName() != null && !namedElement.getName().startsWith(COPY_OF)) {
+ namedElement.setName(COPY_OF + namedElement.getName());
+ }
+ }
+
+ }
+
+ if(currentObject instanceof NamedElement) {
+ namedElement = ((NamedElement)currentObject);
+ // some literal has not name
+ if(namedElement.getName() != null && !namedElement.getName().startsWith(COPY_OF)) {
+ namedElement.setName(COPY_OF + namedElement.getName());
+ }
+ }
+
+ }
+
+ iterator = getAllDuplicatedObjectsMap().values().iterator();
+ while(iterator.hasNext()) {
+ Object currentObject = iterator.next();
+ if((currentObject instanceof EObject) &&(((EObject) currentObject).eContainer()== null)&&(((EObject) currentObject).eResource()== null)) {
+ namedElement.eResource().getContents().add((EObject)currentObject);
+ }
+ }
+
+ return CommandResult.newOKCommandResult(getAllDuplicatedObjectsMap());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/EObjectInheritanceCopyCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/EObjectInheritanceCopyCommand.java
index 8e0ace21dd0..cbc88e0ffbe 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/EObjectInheritanceCopyCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/EObjectInheritanceCopyCommand.java
@@ -1,394 +1,394 @@
-/***************************************************
- * Copyright (c) 2010 Atos Origin.
-
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- ****************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-
-/**
- * The Class EObjectInheritanceCopyCommand. it takes an eobject in parameter and
- * copy all the elements contained in the source to the target and adds the
- * target to the container of the source
- */
-public class EObjectInheritanceCopyCommand extends CompositeCommand {
-
- private final EObject sourceEObject;
-
- private final EObject targetEObject;
-
- private final TransactionalEditingDomain editingDomain;
-
- private Collection<Object> alreadyManaged = new LinkedList<Object>();
-
- public EObjectInheritanceCopyCommand(EObject source, EClass target, TransactionalEditingDomain adapterFactoryEditingDomain) {
- super("Inheritance copy");
- this.sourceEObject = source;
- this.targetEObject = target.getEPackage().getEFactoryInstance().create(target);
- this.editingDomain = adapterFactoryEditingDomain;
- if(sourceEObject == null || targetEObject == null || editingDomain == null) {
- throw new IllegalArgumentException("Please provide non null arguments");
- }
- init();
- if(sourceEObject.eContainingFeature().isMany()) {
- replace(sourceEObject.eContainer(), sourceEObject, targetEObject, sourceEObject.eContainingFeature());
- } else {
- add(new CustomSetCommand(editingDomain, sourceEObject.eContainer(), sourceEObject.eContainingFeature(), targetEObject, sourceEObject, sourceEObject.eContainingFeature()));
- add(new DestroyElementPapyrusCommand(new DestroyElementRequest(editingDomain, sourceEObject, false)));
- }
- }
-
- private void init() {
- modelCopy(sourceEObject, targetEObject);
- crossReference(sourceEObject, targetEObject);
- }
-
- /**
- * Model copy, copy the eobject source attributes to target's
- *
- * @param mixedDomain
- * the mixed domain
- * @param source
- * the source
- * @param target
- * the target
- */
- private void modelCopy(EObject source, EObject target) {
- EClass eclass = source.eClass();
- if(eclass != null) {
- EList<EStructuralFeature> eAllStructuralFeatures = eclass.getEAllStructuralFeatures();
- for(EStructuralFeature e : eAllStructuralFeatures) {
- if(contains(target.eClass(), e) && isCompatible(e.getEType(), target.eClass().getEStructuralFeature(e.getName()).getEType())) {
- manageFeature(source, target, e);
- }
- }
- }
- }
-
- /**
- * Contains. check if the target eclass contains a estructuralfeature with
- * the same name less rigorous can work for many cases
- *
- * @param target
- * the target
- * @param e
- * the e
- *
- * @return true, if successful
- */
- private boolean contains(EClass target, EStructuralFeature e) {
- EList<EStructuralFeature> features = target.getEAllStructuralFeatures();
- for(EStructuralFeature f : features) {
- if(f.getName().equals(e.getName())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Manage feature for cross.
- *
- * @param mixedDomain
- * the mixed domain
- * @param theObjectWithCross
- * the the object with cross
- * @param source
- * the source
- * @param target
- * the target
- * @param structuralFeature
- * the structural feature
- */
- private void manageFeatureForCross(EObject theObjectWithCross, EObject source, EObject target, EStructuralFeature structuralFeature) {
- boolean compatible = isCompatible(structuralFeature.getEType(), target.eClass());
-
- if(compatible && structuralFeature.isChangeable() && !structuralFeature.isDerived()) {
- if(structuralFeature.isMany()) {
- replace(theObjectWithCross, source, target, structuralFeature);
- } else {
- add(new SetValueCommand(new SetRequest(editingDomain, theObjectWithCross, structuralFeature, target)));
- }
- } else if(!compatible) {
- if(structuralFeature.isMany()) {
- remove(theObjectWithCross, source, structuralFeature);
- } else {
- add(new SetValueCommand(new SetRequest(editingDomain, theObjectWithCross, structuralFeature, null)));
- }
- }
-
- }
-
- private void remove(EObject owner, Object source, EStructuralFeature structuralFeature) {
- if(!alreadyManaged.contains(source)) {
-
- if(owner == null && structuralFeature == null) {
- if(source instanceof EObject) {
- add(new DestroyElementPapyrusCommand(new DestroyElementRequest(editingDomain, (EObject)source, false)));
- }
- } else {
- Object value = owner.eGet(structuralFeature);
- if(value instanceof Collection<?>) {
- List<Object> newList = new ArrayList<Object>((Collection<?>)value);
- newList.remove(source);
- add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, newList)));
- } else if(source.equals(value)) {
- add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, null)));
- } else {
- add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, null)));
- }
- }
- alreadyManaged.add(source);
- }
- }
-
- private void replace(EObject owner, Object source, Object target, EStructuralFeature structuralFeature) {
- if(!alreadyManaged.contains(source)) {
-
- if(owner == null && structuralFeature == null) {
- if(source instanceof EObject) {
- add(new DestroyElementPapyrusCommand(new DestroyElementRequest(editingDomain, (EObject)source, false)));
- }
- } else {
- Object value = owner.eGet(structuralFeature);
- if(value instanceof Collection<?>) {
- List<Object> newList = new ArrayList<Object>((Collection<?>)value);
- int index = newList.indexOf(source);
- if(index >= 0) {
- newList.remove(index);
- newList.add(index, target);
- add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, newList)));
- }
- } else if(source.equals(value)) {
- add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, target)));
- } else {
- add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, target)));
- }
- }
- alreadyManaged.add(source);
- }
- }
-
- @Override
- public IStatus undo(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- return super.undo(progressMonitor, info);
- }
-
- /**
- * Cross reference. Manage eobjects referencing the source eobject
- *
- * @param mixedDomain
- * the mixed domain
- * @param source
- * the source eobject
- * @param target
- * the target eobject
- */
- private void crossReference(EObject source, EObject target) {
- Collection<EStructuralFeature.Setting> collection = EMFHelper.getUsages(source);
- if(collection != null) {
- for(EStructuralFeature.Setting nonNavigableInverseReference : collection) {
- EStructuralFeature structuralFeature = nonNavigableInverseReference.getEStructuralFeature();
- if(!(nonNavigableInverseReference.getEObject() instanceof View)) {
- manageFeatureForCross(nonNavigableInverseReference.getEObject(), source, target, structuralFeature);
- } else if(nonNavigableInverseReference.getEObject() instanceof Diagram) {
- Diagram di = (Diagram)nonNavigableInverseReference.getEObject();
- remove(null, di, null);
- }
- }
- }
- }
-
- /**
- * Checks if a type is compatible to another.
- *
- * @param type
- * the type
- * @param target
- * the target
- *
- * @return true, if is compatible
- */
- public static boolean isCompatible(EClassifier type, EClassifier target) {
- Collection<EClassifier> types = new LinkedList<EClassifier>();
- if(target instanceof EClass) {
- EClass eclass = (EClass)target;
- types.addAll(eclass.getEAllSuperTypes());
- }
- if(!types.contains(target)) {
- types.add(target);
- }
- return types.contains(type);
- }
-
- /**
- * Manage a feature for the attribute's copy.
- *
- * @param mixedDomain
- * the mixed domain
- * @param source
- * the source
- * @param target
- * the target
- * @param feature
- * the e
- */
- @SuppressWarnings("unchecked")
- private void manageFeature(EObject source, EObject target, EStructuralFeature feature) {
- EStructuralFeature targetFeature = getFeature(target, feature.getName());
-
- if(feature.getUpperBound() <= targetFeature.getUpperBound() && feature.getLowerBound() >= targetFeature.getLowerBound()) {
- if(feature.isChangeable() && !feature.isDerived()) {
- Object value = source.eGet(feature);
- if(feature.isMany() && targetFeature.isMany()) {
- Collection<EObject> list = (Collection<EObject>)value;
- if(list != null && !list.isEmpty()) {
- Collection<EObject> newList = new LinkedList<EObject>();
- newList.addAll(list);
- if(feature instanceof EReference && !((EReference)feature).isContainment()) {
- add(new SetValueCommand(new SetRequest(editingDomain, target, targetFeature, newList)));
- } else if(feature instanceof EReference && ((EReference)feature).isContainment()) {
- Collection<Object> toTreat = new LinkedList<Object>();
- for(Object o : newList) {
- if(!alreadyManaged.contains(o)) {
- toTreat.add(o);
- alreadyManaged.add(o);
- }
- }
- add(new CustomAddCommand(editingDomain, target, targetFeature, newList, source, feature));
- }
- }
- } else if(!feature.isMany() && !targetFeature.isMany()) {
- if(value != null) {
- if(!alreadyManaged.contains(value)) {
- alreadyManaged.add(value);
- add(new CustomSetCommand(editingDomain, target, targetFeature, value, source, feature));
- }
- }
- }
- }
- }
-
- }
-
- /**
- * Gets a feature from a name
- *
- * @param eobject
- * the eobject
- * @param name
- * the name
- *
- * @return the feature
- */
- private EStructuralFeature getFeature(EObject eobject, String name) {
- return eobject.eClass().getEStructuralFeature(name);
- }
-
- /**
- * Gets the result eobject.
- *
- * @return the result eobject
- */
- public EObject getResultEobject() {
- return targetEObject;
- }
-
- /**
- * The Class CustomSetCommand. permits to change a value from an eobject to
- * eanother
- */
- private class CustomSetCommand extends SetValueCommand {
-
- private EObject oldObject = null;
-
- private EStructuralFeature oldFeature = null;
-
- private Object oldValue = null;
-
- public CustomSetCommand(TransactionalEditingDomain domain, EObject owner, EStructuralFeature feature, Object value, EObject old, EStructuralFeature structuralFeature) {
- super(new SetRequest(domain, owner, feature, value));
- oldObject = old;
- oldFeature = structuralFeature;
- oldValue = value;
- }
-
- @Override
- protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IStatus result = super.doUndo(monitor, info);
- oldObject.eSet(oldFeature, oldValue);
- return result;
- }
-
- }
-
- /**
- * The Class CustomSetCommand. permits to change a value from an eobject to
- * eanother
- */
- private class CustomAddCommand extends SetValueCommand {
-
- private EObject oldObject = null;
-
- private EStructuralFeature oldFeature;
-
- private EStructuralFeature newFeature;
-
- public CustomAddCommand(TransactionalEditingDomain editingDomain, EObject target, EStructuralFeature targetFeature, Collection<EObject> newList, EObject source, EStructuralFeature e) {
- super(new SetRequest(editingDomain, target, targetFeature, newList));
- oldObject = source;
- oldFeature = e;
- newFeature = targetFeature;
- }
-
- @Override
- protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Object values = getElementToEdit().eGet(newFeature);
- IStatus result = super.doUndo(monitor, info);
- // this test permit to avoid modification from other command
- // if getOwner list is empty it will perform error we avoid it
- if(values instanceof Collection<?> && !((Collection<?>)values).isEmpty()) {
- Collection<?> collection = (Collection<?>)values;
- Collection<Object> collecOldObject = (Collection)oldObject.eGet(oldFeature);
- for(Object o : collection) {
- if(!collecOldObject.contains(o)) {
- collecOldObject.add(o);
- }
- }
- }
- return result;
- }
- }
-}
+/***************************************************
+ * Copyright (c) 2010 Atos Origin.
+
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ ****************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+
+/**
+ * The Class EObjectInheritanceCopyCommand. it takes an eobject in parameter and
+ * copy all the elements contained in the source to the target and adds the
+ * target to the container of the source
+ */
+public class EObjectInheritanceCopyCommand extends CompositeCommand {
+
+ private final EObject sourceEObject;
+
+ private final EObject targetEObject;
+
+ private final TransactionalEditingDomain editingDomain;
+
+ private Collection<Object> alreadyManaged = new LinkedList<Object>();
+
+ public EObjectInheritanceCopyCommand(EObject source, EClass target, TransactionalEditingDomain adapterFactoryEditingDomain) {
+ super("Inheritance copy");
+ this.sourceEObject = source;
+ this.targetEObject = target.getEPackage().getEFactoryInstance().create(target);
+ this.editingDomain = adapterFactoryEditingDomain;
+ if(sourceEObject == null || targetEObject == null || editingDomain == null) {
+ throw new IllegalArgumentException("Please provide non null arguments");
+ }
+ init();
+ if(sourceEObject.eContainingFeature().isMany()) {
+ replace(sourceEObject.eContainer(), sourceEObject, targetEObject, sourceEObject.eContainingFeature());
+ } else {
+ add(new CustomSetCommand(editingDomain, sourceEObject.eContainer(), sourceEObject.eContainingFeature(), targetEObject, sourceEObject, sourceEObject.eContainingFeature()));
+ add(new DestroyElementPapyrusCommand(new DestroyElementRequest(editingDomain, sourceEObject, false)));
+ }
+ }
+
+ private void init() {
+ modelCopy(sourceEObject, targetEObject);
+ crossReference(sourceEObject, targetEObject);
+ }
+
+ /**
+ * Model copy, copy the eobject source attributes to target's
+ *
+ * @param mixedDomain
+ * the mixed domain
+ * @param source
+ * the source
+ * @param target
+ * the target
+ */
+ private void modelCopy(EObject source, EObject target) {
+ EClass eclass = source.eClass();
+ if(eclass != null) {
+ EList<EStructuralFeature> eAllStructuralFeatures = eclass.getEAllStructuralFeatures();
+ for(EStructuralFeature e : eAllStructuralFeatures) {
+ if(contains(target.eClass(), e) && isCompatible(e.getEType(), target.eClass().getEStructuralFeature(e.getName()).getEType())) {
+ manageFeature(source, target, e);
+ }
+ }
+ }
+ }
+
+ /**
+ * Contains. check if the target eclass contains a estructuralfeature with
+ * the same name less rigorous can work for many cases
+ *
+ * @param target
+ * the target
+ * @param e
+ * the e
+ *
+ * @return true, if successful
+ */
+ private boolean contains(EClass target, EStructuralFeature e) {
+ EList<EStructuralFeature> features = target.getEAllStructuralFeatures();
+ for(EStructuralFeature f : features) {
+ if(f.getName().equals(e.getName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Manage feature for cross.
+ *
+ * @param mixedDomain
+ * the mixed domain
+ * @param theObjectWithCross
+ * the the object with cross
+ * @param source
+ * the source
+ * @param target
+ * the target
+ * @param structuralFeature
+ * the structural feature
+ */
+ private void manageFeatureForCross(EObject theObjectWithCross, EObject source, EObject target, EStructuralFeature structuralFeature) {
+ boolean compatible = isCompatible(structuralFeature.getEType(), target.eClass());
+
+ if(compatible && structuralFeature.isChangeable() && !structuralFeature.isDerived()) {
+ if(structuralFeature.isMany()) {
+ replace(theObjectWithCross, source, target, structuralFeature);
+ } else {
+ add(new SetValueCommand(new SetRequest(editingDomain, theObjectWithCross, structuralFeature, target)));
+ }
+ } else if(!compatible) {
+ if(structuralFeature.isMany()) {
+ remove(theObjectWithCross, source, structuralFeature);
+ } else {
+ add(new SetValueCommand(new SetRequest(editingDomain, theObjectWithCross, structuralFeature, null)));
+ }
+ }
+
+ }
+
+ private void remove(EObject owner, Object source, EStructuralFeature structuralFeature) {
+ if(!alreadyManaged.contains(source)) {
+
+ if(owner == null && structuralFeature == null) {
+ if(source instanceof EObject) {
+ add(new DestroyElementPapyrusCommand(new DestroyElementRequest(editingDomain, (EObject)source, false)));
+ }
+ } else {
+ Object value = owner.eGet(structuralFeature);
+ if(value instanceof Collection<?>) {
+ List<Object> newList = new ArrayList<Object>((Collection<?>)value);
+ newList.remove(source);
+ add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, newList)));
+ } else if(source.equals(value)) {
+ add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, null)));
+ } else {
+ add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, null)));
+ }
+ }
+ alreadyManaged.add(source);
+ }
+ }
+
+ private void replace(EObject owner, Object source, Object target, EStructuralFeature structuralFeature) {
+ if(!alreadyManaged.contains(source)) {
+
+ if(owner == null && structuralFeature == null) {
+ if(source instanceof EObject) {
+ add(new DestroyElementPapyrusCommand(new DestroyElementRequest(editingDomain, (EObject)source, false)));
+ }
+ } else {
+ Object value = owner.eGet(structuralFeature);
+ if(value instanceof Collection<?>) {
+ List<Object> newList = new ArrayList<Object>((Collection<?>)value);
+ int index = newList.indexOf(source);
+ if(index >= 0) {
+ newList.remove(index);
+ newList.add(index, target);
+ add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, newList)));
+ }
+ } else if(source.equals(value)) {
+ add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, target)));
+ } else {
+ add(new SetValueCommand(new SetRequest(editingDomain, owner, structuralFeature, target)));
+ }
+ }
+ alreadyManaged.add(source);
+ }
+ }
+
+ @Override
+ public IStatus undo(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ return super.undo(progressMonitor, info);
+ }
+
+ /**
+ * Cross reference. Manage eobjects referencing the source eobject
+ *
+ * @param mixedDomain
+ * the mixed domain
+ * @param source
+ * the source eobject
+ * @param target
+ * the target eobject
+ */
+ private void crossReference(EObject source, EObject target) {
+ Collection<EStructuralFeature.Setting> collection = EMFHelper.getUsages(source);
+ if(collection != null) {
+ for(EStructuralFeature.Setting nonNavigableInverseReference : collection) {
+ EStructuralFeature structuralFeature = nonNavigableInverseReference.getEStructuralFeature();
+ if(!(nonNavigableInverseReference.getEObject() instanceof View)) {
+ manageFeatureForCross(nonNavigableInverseReference.getEObject(), source, target, structuralFeature);
+ } else if(nonNavigableInverseReference.getEObject() instanceof Diagram) {
+ Diagram di = (Diagram)nonNavigableInverseReference.getEObject();
+ remove(null, di, null);
+ }
+ }
+ }
+ }
+
+ /**
+ * Checks if a type is compatible to another.
+ *
+ * @param type
+ * the type
+ * @param target
+ * the target
+ *
+ * @return true, if is compatible
+ */
+ public static boolean isCompatible(EClassifier type, EClassifier target) {
+ Collection<EClassifier> types = new LinkedList<EClassifier>();
+ if(target instanceof EClass) {
+ EClass eclass = (EClass)target;
+ types.addAll(eclass.getEAllSuperTypes());
+ }
+ if(!types.contains(target)) {
+ types.add(target);
+ }
+ return types.contains(type);
+ }
+
+ /**
+ * Manage a feature for the attribute's copy.
+ *
+ * @param mixedDomain
+ * the mixed domain
+ * @param source
+ * the source
+ * @param target
+ * the target
+ * @param feature
+ * the e
+ */
+ @SuppressWarnings("unchecked")
+ private void manageFeature(EObject source, EObject target, EStructuralFeature feature) {
+ EStructuralFeature targetFeature = getFeature(target, feature.getName());
+
+ if(feature.getUpperBound() <= targetFeature.getUpperBound() && feature.getLowerBound() >= targetFeature.getLowerBound()) {
+ if(feature.isChangeable() && !feature.isDerived()) {
+ Object value = source.eGet(feature);
+ if(feature.isMany() && targetFeature.isMany()) {
+ Collection<EObject> list = (Collection<EObject>)value;
+ if(list != null && !list.isEmpty()) {
+ Collection<EObject> newList = new LinkedList<EObject>();
+ newList.addAll(list);
+ if(feature instanceof EReference && !((EReference)feature).isContainment()) {
+ add(new SetValueCommand(new SetRequest(editingDomain, target, targetFeature, newList)));
+ } else if(feature instanceof EReference && ((EReference)feature).isContainment()) {
+ Collection<Object> toTreat = new LinkedList<Object>();
+ for(Object o : newList) {
+ if(!alreadyManaged.contains(o)) {
+ toTreat.add(o);
+ alreadyManaged.add(o);
+ }
+ }
+ add(new CustomAddCommand(editingDomain, target, targetFeature, newList, source, feature));
+ }
+ }
+ } else if(!feature.isMany() && !targetFeature.isMany()) {
+ if(value != null) {
+ if(!alreadyManaged.contains(value)) {
+ alreadyManaged.add(value);
+ add(new CustomSetCommand(editingDomain, target, targetFeature, value, source, feature));
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Gets a feature from a name
+ *
+ * @param eobject
+ * the eobject
+ * @param name
+ * the name
+ *
+ * @return the feature
+ */
+ private EStructuralFeature getFeature(EObject eobject, String name) {
+ return eobject.eClass().getEStructuralFeature(name);
+ }
+
+ /**
+ * Gets the result eobject.
+ *
+ * @return the result eobject
+ */
+ public EObject getResultEobject() {
+ return targetEObject;
+ }
+
+ /**
+ * The Class CustomSetCommand. permits to change a value from an eobject to
+ * eanother
+ */
+ private class CustomSetCommand extends SetValueCommand {
+
+ private EObject oldObject = null;
+
+ private EStructuralFeature oldFeature = null;
+
+ private Object oldValue = null;
+
+ public CustomSetCommand(TransactionalEditingDomain domain, EObject owner, EStructuralFeature feature, Object value, EObject old, EStructuralFeature structuralFeature) {
+ super(new SetRequest(domain, owner, feature, value));
+ oldObject = old;
+ oldFeature = structuralFeature;
+ oldValue = value;
+ }
+
+ @Override
+ protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IStatus result = super.doUndo(monitor, info);
+ oldObject.eSet(oldFeature, oldValue);
+ return result;
+ }
+
+ }
+
+ /**
+ * The Class CustomSetCommand. permits to change a value from an eobject to
+ * eanother
+ */
+ private class CustomAddCommand extends SetValueCommand {
+
+ private EObject oldObject = null;
+
+ private EStructuralFeature oldFeature;
+
+ private EStructuralFeature newFeature;
+
+ public CustomAddCommand(TransactionalEditingDomain editingDomain, EObject target, EStructuralFeature targetFeature, Collection<EObject> newList, EObject source, EStructuralFeature e) {
+ super(new SetRequest(editingDomain, target, targetFeature, newList));
+ oldObject = source;
+ oldFeature = e;
+ newFeature = targetFeature;
+ }
+
+ @Override
+ protected IStatus doUndo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Object values = getElementToEdit().eGet(newFeature);
+ IStatus result = super.doUndo(monitor, info);
+ // this test permit to avoid modification from other command
+ // if getOwner list is empty it will perform error we avoid it
+ if(values instanceof Collection<?> && !((Collection<?>)values).isEmpty()) {
+ Collection<?> collection = (Collection<?>)values;
+ Collection<Object> collecOldObject = (Collection)oldObject.eGet(oldFeature);
+ for(Object o : collection) {
+ if(!collecOldObject.contains(o)) {
+ collecOldObject.add(o);
+ }
+ }
+ }
+ return result;
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/FixPortLocationCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/FixPortLocationCommand.java
index 312b628088f..8749bd119c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/FixPortLocationCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/FixPortLocationCommand.java
@@ -1,93 +1,93 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Bounds;
-import org.eclipse.gmf.runtime.notation.Shape;
-import org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocatorUtils;
-
-/**
- * <pre>
- * This class is a command supposed to fixed the location of a Port.
- * It verifies if the current location (in the notation model) is correct,
- * and correct if if needed.
- * </pre>
- */
-public class FixPortLocationCommand extends AbstractTransactionalCommand {
-
- /** The proposed (or current) location */
- private final Rectangle proposedLocation;
-
- /** The most adapted valid location */
- private final Rectangle validLocation;
-
- /** The shape of the borderItem */
- private Shape borderItemShape;
-
- /** The border item bounds */
- private Bounds borderItemBounds;
-
- /**
- * Constructor for the command.
- *
- * @param domain
- * the editing domain.
- * @param borderItemEP
- * assumed to be a Port due to the use of {@link PortPositionLocatorUtils} to calculate the correct
- * location.
- * @param parentEP
- * the edit part of the graphical parent of borderItemEP.
- */
- public FixPortLocationCommand(TransactionalEditingDomain domain, IBorderItemEditPart borderItemEditPart, GraphicalEditPart parentEditPart) {
- super(domain, "Fix port location command", null);
-
- borderItemShape = (Shape) borderItemEditPart.getNotationView();
- borderItemBounds = (Bounds)borderItemShape.getLayoutConstraint();
-
- proposedLocation = new Rectangle(borderItemBounds.getX(), borderItemBounds.getY(), borderItemBounds.getWidth(), borderItemBounds.getHeight());
-
- validLocation = PortPositionLocatorUtils.getBorderLocation(parentEditPart.getFigure().getBounds().getCopy(), proposedLocation, 10);
- }
-
- /**
- * Only allow fix action when there is something to fix...
- */
- @Override
- public boolean canExecute() {
- return (proposedLocation.equals(validLocation)) ? false : true;
- }
-
- /**
- * Set the IBorderItemEditPart view bounds with a corrected location.
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
- IAdaptable info) throws ExecutionException {
-
- borderItemBounds.setX(validLocation.x);
- borderItemBounds.setY(validLocation.y);
-
- return CommandResult.newOKCommandResult();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Bounds;
+import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.papyrus.uml.diagram.common.locator.PortPositionLocatorUtils;
+
+/**
+ * <pre>
+ * This class is a command supposed to fixed the location of a Port.
+ * It verifies if the current location (in the notation model) is correct,
+ * and correct if if needed.
+ * </pre>
+ */
+public class FixPortLocationCommand extends AbstractTransactionalCommand {
+
+ /** The proposed (or current) location */
+ private final Rectangle proposedLocation;
+
+ /** The most adapted valid location */
+ private final Rectangle validLocation;
+
+ /** The shape of the borderItem */
+ private Shape borderItemShape;
+
+ /** The border item bounds */
+ private Bounds borderItemBounds;
+
+ /**
+ * Constructor for the command.
+ *
+ * @param domain
+ * the editing domain.
+ * @param borderItemEP
+ * assumed to be a Port due to the use of {@link PortPositionLocatorUtils} to calculate the correct
+ * location.
+ * @param parentEP
+ * the edit part of the graphical parent of borderItemEP.
+ */
+ public FixPortLocationCommand(TransactionalEditingDomain domain, IBorderItemEditPart borderItemEditPart, GraphicalEditPart parentEditPart) {
+ super(domain, "Fix port location command", null);
+
+ borderItemShape = (Shape) borderItemEditPart.getNotationView();
+ borderItemBounds = (Bounds)borderItemShape.getLayoutConstraint();
+
+ proposedLocation = new Rectangle(borderItemBounds.getX(), borderItemBounds.getY(), borderItemBounds.getWidth(), borderItemBounds.getHeight());
+
+ validLocation = PortPositionLocatorUtils.getBorderLocation(parentEditPart.getFigure().getBounds().getCopy(), proposedLocation, 10);
+ }
+
+ /**
+ * Only allow fix action when there is something to fix...
+ */
+ @Override
+ public boolean canExecute() {
+ return (proposedLocation.equals(validLocation)) ? false : true;
+ }
+
+ /**
+ * Set the IBorderItemEditPart view bounds with a corrected location.
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
+ IAdaptable info) throws ExecutionException {
+
+ borderItemBounds.setX(validLocation.x);
+ borderItemBounds.setY(validLocation.y);
+
+ return CommandResult.newOKCommandResult();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ModelCreationCommandBase.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ModelCreationCommandBase.java
index a7edf2e9841..4dc91f3642c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ModelCreationCommandBase.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ModelCreationCommandBase.java
@@ -1,117 +1,117 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tatiana Fesenko (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.Collections;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.extension.commands.IModelCreationCommand;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.uml.tools.model.UmlUtils;
-
-/**
- * The Class ModelCreationCommandBase.
- */
-public abstract class ModelCreationCommandBase implements IModelCreationCommand {
-
- /**
- * @see org.eclipse.papyrus.infra.core.extension.commands.IModelCreationCommand#createModel(org.eclipse.papyrus.infra.core.utils.DiResourceSet)
- *
- * @param diResourceSet
- */
- public void createModel(final ModelSet modelSet) {
- runAsTransaction(modelSet);
- }
-
- /**
- * Run as transaction.
- *
- * @param diResourceSet
- * the di resource set
- */
- protected void runAsTransaction(final ModelSet modelSet) {
- // Get the uml element to which the newly created diagram will be
- // attached.
- // Create the diagram
- final Resource modelResource = UmlUtils.getUmlResource(modelSet);
- TransactionalEditingDomain editingDomain = modelSet.getTransactionalEditingDomain();
-
- AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, "Initialize model", Collections.EMPTY_LIST) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- EObject model = getRootElement(modelResource);
- attachModelToResource(model, modelResource);
-
- initializeModel(model);
- return CommandResult.newOKCommandResult();
-
- }
- };
- editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
- }
-
- /**
- * Initialize model.
- *
- * @param owner
- * the owner
- */
- protected void initializeModel(EObject owner) {
-
- }
-
- /**
- * Get the root element associated with canvas.
- *
- * @param modelResource
- * the model resource
- * @return the root element
- */
- protected EObject getRootElement(Resource modelResource) {
- EObject rootElement = null;
- if(modelResource != null && modelResource.getContents() != null && modelResource.getContents().size() > 0) {
- Object root = modelResource.getContents().get(0);
- if(root instanceof EObject) {
- rootElement = (EObject)root;
- }
- } else {
- rootElement = createRootElement();
- }
- return rootElement;
- }
-
- /**
- * Store model element in the resource.
- */
- protected void attachModelToResource(EObject root, Resource resource) {
- resource.getContents().add(root);
- }
-
- /**
- * Create the root element of an EMF model
- *
- * @return the root element
- */
- protected abstract EObject createRootElement();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tatiana Fesenko (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.Collections;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.extension.commands.IModelCreationCommand;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.uml.tools.model.UmlUtils;
+
+/**
+ * The Class ModelCreationCommandBase.
+ */
+public abstract class ModelCreationCommandBase implements IModelCreationCommand {
+
+ /**
+ * @see org.eclipse.papyrus.infra.core.extension.commands.IModelCreationCommand#createModel(org.eclipse.papyrus.infra.core.utils.DiResourceSet)
+ *
+ * @param diResourceSet
+ */
+ public void createModel(final ModelSet modelSet) {
+ runAsTransaction(modelSet);
+ }
+
+ /**
+ * Run as transaction.
+ *
+ * @param diResourceSet
+ * the di resource set
+ */
+ protected void runAsTransaction(final ModelSet modelSet) {
+ // Get the uml element to which the newly created diagram will be
+ // attached.
+ // Create the diagram
+ final Resource modelResource = UmlUtils.getUmlResource(modelSet);
+ TransactionalEditingDomain editingDomain = modelSet.getTransactionalEditingDomain();
+
+ AbstractTransactionalCommand command = new AbstractTransactionalCommand(editingDomain, "Initialize model", Collections.EMPTY_LIST) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ EObject model = getRootElement(modelResource);
+ attachModelToResource(model, modelResource);
+
+ initializeModel(model);
+ return CommandResult.newOKCommandResult();
+
+ }
+ };
+ editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
+ }
+
+ /**
+ * Initialize model.
+ *
+ * @param owner
+ * the owner
+ */
+ protected void initializeModel(EObject owner) {
+
+ }
+
+ /**
+ * Get the root element associated with canvas.
+ *
+ * @param modelResource
+ * the model resource
+ * @return the root element
+ */
+ protected EObject getRootElement(Resource modelResource) {
+ EObject rootElement = null;
+ if(modelResource != null && modelResource.getContents() != null && modelResource.getContents().size() > 0) {
+ Object root = modelResource.getContents().get(0);
+ if(root instanceof EObject) {
+ rootElement = (EObject)root;
+ }
+ } else {
+ rootElement = createRootElement();
+ }
+ return rootElement;
+ }
+
+ /**
+ * Store model element in the resource.
+ */
+ protected void attachModelToResource(EObject root, Resource resource) {
+ resource.getContents().add(root);
+ }
+
+ /**
+ * Create the root element of an EMF model
+ *
+ * @return the root element
+ */
+ protected abstract EObject createRootElement();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/PapyrusDuplicateViewsCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/PapyrusDuplicateViewsCommand.java
index 115a9d97178..01f1cd5f8bd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/PapyrusDuplicateViewsCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/PapyrusDuplicateViewsCommand.java
@@ -1,105 +1,105 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.Iterator;
-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.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.util.FeatureMapUtil;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.internal.commands.DuplicateViewsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DuplicateRequest;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * this command is used to copy view and to reassociate to a new container
- */
-@SuppressWarnings("restriction")
-public class PapyrusDuplicateViewsCommand extends DuplicateViewsCommand implements ICommand {
-
- // the new container
- protected View container = null;
-
- @SuppressWarnings("rawtypes")
- public PapyrusDuplicateViewsCommand(TransactionalEditingDomain editingDomain, String label, DuplicateRequest request, List viewsToDuplicate, Map duplicatedElements, Point offset, View container) {
- super(editingDomain, label, request, viewsToDuplicate, duplicatedElements, offset);
- this.container = container;
- }
-
- /**
- * Verifies that the container of all the original objects can contain
- * multiple objects.
- *
- */
- @SuppressWarnings("rawtypes")
- public boolean canExecute() {
- for(Iterator iter = getObjectsToBeDuplicated().iterator(); iter.hasNext();) {
- EObject original = (EObject)iter.next();
- // In the case of cut the owner does not exist
- if(original.eContainer() == null) {
- return true;
-
- } else {
- EReference reference = original.eContainmentFeature();
- if(reference == null || !FeatureMapUtil.isMany(original.eContainer(), reference)) {
- return false;
- }
- }
- }
- return true;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.internal.commands.DuplicateViewsCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param progressMonitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @SuppressWarnings("rawtypes")
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- CommandResult result = super.doExecuteWithResult(progressMonitor, info);
- // reassociation to the new container
- if(result.getReturnValue() instanceof List) {
- List duplicatedObject = (List)result.getReturnValue();
- Iterator iterator = duplicatedObject.iterator();
- while(iterator.hasNext()) {
- Object object = (Object)iterator.next();
- if(object instanceof View) {
- View duplicatedView = (View)object;
- if(duplicatedView.eContainer() == null && container != null) {
-
- ViewUtil.insertChildView(container, duplicatedView, -1, true);
-
- }
- }
-
- }
- }
- return result;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.Iterator;
+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.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.internal.commands.DuplicateViewsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DuplicateRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * this command is used to copy view and to reassociate to a new container
+ */
+@SuppressWarnings("restriction")
+public class PapyrusDuplicateViewsCommand extends DuplicateViewsCommand implements ICommand {
+
+ // the new container
+ protected View container = null;
+
+ @SuppressWarnings("rawtypes")
+ public PapyrusDuplicateViewsCommand(TransactionalEditingDomain editingDomain, String label, DuplicateRequest request, List viewsToDuplicate, Map duplicatedElements, Point offset, View container) {
+ super(editingDomain, label, request, viewsToDuplicate, duplicatedElements, offset);
+ this.container = container;
+ }
+
+ /**
+ * Verifies that the container of all the original objects can contain
+ * multiple objects.
+ *
+ */
+ @SuppressWarnings("rawtypes")
+ public boolean canExecute() {
+ for(Iterator iter = getObjectsToBeDuplicated().iterator(); iter.hasNext();) {
+ EObject original = (EObject)iter.next();
+ // In the case of cut the owner does not exist
+ if(original.eContainer() == null) {
+ return true;
+
+ } else {
+ EReference reference = original.eContainmentFeature();
+ if(reference == null || !FeatureMapUtil.isMany(original.eContainer(), reference)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.internal.commands.DuplicateViewsCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ *
+ * @param progressMonitor
+ * @param info
+ * @return
+ * @throws ExecutionException
+ */
+ @SuppressWarnings("rawtypes")
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ // reassociation to the new container
+ if(result.getReturnValue() instanceof List) {
+ List duplicatedObject = (List)result.getReturnValue();
+ Iterator iterator = duplicatedObject.iterator();
+ while(iterator.hasNext()) {
+ Object object = (Object)iterator.next();
+ if(object instanceof View) {
+ View duplicatedView = (View)object;
+ if(duplicatedView.eContainer() == null && container != null) {
+
+ ViewUtil.insertChildView(container, duplicatedView, -1, true);
+
+ }
+ }
+
+ }
+ }
+ return result;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SemanticAdapter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SemanticAdapter.java
index d133182ceed..1e6b0c85926 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SemanticAdapter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SemanticAdapter.java
@@ -1,96 +1,96 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.emf.core.util.IProxyEObject;
-import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * The Class SemanticAdapter used to package semantic or view element in a
- * deferred command
- */
-public class SemanticAdapter implements IAdaptable, IProxyEObject {
-
- /** The element. */
- private Object element;
-
- /** The view. */
- private Object view;
-
- /**
- * Instantiates a new semantic adapter.
- *
- * @param element
- * the element
- * @param view
- * the view
- */
- public SemanticAdapter(EObject element, Object view) {
- this.element = element;
- this.view = view;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public Object getAdapter(Class adapter) {
- if(adapter.equals(EObject.class)) {
- return element;
- }
- if(adapter.equals(View.class)) {
- return view;
- }
- return null;
- }
-
- /**
- * Sets the element.
- *
- * @param element
- * the new element
- */
- // @unused
- public void setElement(Object element) {
- this.element = element;
- }
-
- /**
- * Sets the view.
- *
- * @param view
- * the new view
- */
- public void setView(Object view) {
- this.view = view;
- }
-
- /**
- * {@inheritDoc}
- */
- public Object getProxyClassID() {
- return (element != null) ? PackageUtil.getID(EMFCoreUtil.getProxyClass((EObject)element)) : null;
- }
-
- /**
- * {@inheritDoc}
- */
- public EObject resolve() {
- return (element != null) ? (EObject)element : null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
+import org.eclipse.gmf.runtime.emf.core.util.IProxyEObject;
+import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * The Class SemanticAdapter used to package semantic or view element in a
+ * deferred command
+ */
+public class SemanticAdapter implements IAdaptable, IProxyEObject {
+
+ /** The element. */
+ private Object element;
+
+ /** The view. */
+ private Object view;
+
+ /**
+ * Instantiates a new semantic adapter.
+ *
+ * @param element
+ * the element
+ * @param view
+ * the view
+ */
+ public SemanticAdapter(EObject element, Object view) {
+ this.element = element;
+ this.view = view;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public Object getAdapter(Class adapter) {
+ if(adapter.equals(EObject.class)) {
+ return element;
+ }
+ if(adapter.equals(View.class)) {
+ return view;
+ }
+ return null;
+ }
+
+ /**
+ * Sets the element.
+ *
+ * @param element
+ * the new element
+ */
+ // @unused
+ public void setElement(Object element) {
+ this.element = element;
+ }
+
+ /**
+ * Sets the view.
+ *
+ * @param view
+ * the new view
+ */
+ public void setView(Object view) {
+ this.view = view;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getProxyClassID() {
+ return (element != null) ? PackageUtil.getID(EMFCoreUtil.getProxyClass((EObject)element)) : null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public EObject resolve() {
+ return (element != null) ? (EObject)element : null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetNodeVisibilityCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetNodeVisibilityCommand.java
index 2c7119d4eb4..d75f9a83af4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetNodeVisibilityCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetNodeVisibilityCommand.java
@@ -1,41 +1,41 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.notation.View;
-
-
-public class SetNodeVisibilityCommand extends RecordingCommand {
-
- protected View view;
- protected Boolean isVisible;
-
- public SetNodeVisibilityCommand(TransactionalEditingDomain domain, View view,Boolean isVisible ) {
- super(domain);
- this.view=view;
- this.isVisible=isVisible;
- }
-
- @Override
- protected void doExecute() {
- if(view.isVisible()!=isVisible){
- view.setVisible(isVisible);
- }
-
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.notation.View;
+
+
+public class SetNodeVisibilityCommand extends RecordingCommand {
+
+ protected View view;
+ protected Boolean isVisible;
+
+ public SetNodeVisibilityCommand(TransactionalEditingDomain domain, View view,Boolean isVisible ) {
+ super(domain);
+ this.view=view;
+ this.isVisible=isVisible;
+ }
+
+ @Override
+ protected void doExecute() {
+ if(view.isVisible()!=isVisible){
+ view.setVisible(isVisible);
+ }
+
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetValueSpecificationValueCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetValueSpecificationValueCommand.java
index d2d1c980083..f0469989f7a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetValueSpecificationValueCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SetValueSpecificationValueCommand.java
@@ -1,50 +1,50 @@
-/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.papyrus.uml.tools.utils.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);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.gef.commands.Command;
+import org.eclipse.papyrus.uml.tools.utils.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/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideCompartmentRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideCompartmentRequest.java
index 4e3d7e48a70..4dd8d7b3f1c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideCompartmentRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideCompartmentRequest.java
@@ -1,71 +1,71 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyValueRequest;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- *
- * This request is used to show/hide a compartment.
- *
- */
-public class ShowHideCompartmentRequest extends ChangePropertyValueRequest {
-
- /** value to hide the compartment */
- public static final boolean HIDE = false;
-
- /** value to show the compartment */
- public static final boolean SHOW = true;
-
- /** type of this request */
- public static final String SHOW_HIDE_COMPARTMENT = "Show/Hide Compartment"; //$NON-NLS-1$
-
- /** thethe view to show */
- protected View compartmentType;
-
- /** the property ID */
- private static final String propertyID = "notation.View.visible"; //$NON-NLS-1$
-
- /** the property name */
- private static final String propertyName = "Visibility"; //$NON-NLS-1$
-
- /**
- *
- * Constructor.
- *
- * @param value
- * This parameter can be :
- * <ul>
- * <li> {@link ShowHideCompartmentRequest#SHOW}</li>
- * <li> {@link ShowHideCompartmentRequest#HIDE}</li>
- * </ul>
- * @param semanticHint
- * the semanticHint for the compartment
- */
- public ShowHideCompartmentRequest(Object value, View compartmentView) {
- super(propertyName, propertyID, value);
- this.compartmentType = compartmentView;
- }
-
- /**
- * Return {@link #compartmentType}
- *
- * @return {@link #compartmentType}
- */
- public View getCompartment() {
- return this.compartmentType;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.gmf.runtime.diagram.ui.requests.ChangePropertyValueRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ *
+ * This request is used to show/hide a compartment.
+ *
+ */
+public class ShowHideCompartmentRequest extends ChangePropertyValueRequest {
+
+ /** value to hide the compartment */
+ public static final boolean HIDE = false;
+
+ /** value to show the compartment */
+ public static final boolean SHOW = true;
+
+ /** type of this request */
+ public static final String SHOW_HIDE_COMPARTMENT = "Show/Hide Compartment"; //$NON-NLS-1$
+
+ /** thethe view to show */
+ protected View compartmentType;
+
+ /** the property ID */
+ private static final String propertyID = "notation.View.visible"; //$NON-NLS-1$
+
+ /** the property name */
+ private static final String propertyName = "Visibility"; //$NON-NLS-1$
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param value
+ * This parameter can be :
+ * <ul>
+ * <li> {@link ShowHideCompartmentRequest#SHOW}</li>
+ * <li> {@link ShowHideCompartmentRequest#HIDE}</li>
+ * </ul>
+ * @param semanticHint
+ * the semanticHint for the compartment
+ */
+ public ShowHideCompartmentRequest(Object value, View compartmentView) {
+ super(propertyName, propertyID, value);
+ this.compartmentType = compartmentView;
+ }
+
+ /**
+ * Return {@link #compartmentType}
+ *
+ * @return {@link #compartmentType}
+ */
+ public View getCompartment() {
+ return this.compartmentType;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideConnectionLabelsRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideConnectionLabelsRequest.java
index 691720e84b0..b28017c5c98 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideConnectionLabelsRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideConnectionLabelsRequest.java
@@ -1,62 +1,62 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.gmf.runtime.diagram.ui.requests.ToggleConnectionLabelsRequest;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * This request is used to manage the display (or not) of ONE label for the
- * connection
- *
- *
- *
- */
-public class ShowHideConnectionLabelsRequest extends ToggleConnectionLabelsRequest {
-
- /**
- * the request type
- */
- public static final String SHOW_HIDE_LABELS_REQUEST_TYPE = "ShowHideLabelsRequest"; //$NON-NLS-1$
-
- /**
- * the view to show/hide
- */
- private View view;
-
- /**
- *
- * Constructor.
- *
- * @param showConnectionLabel
- * the value for the action : <code>true</code> means show and <code>false</code> means hdie
- * @param view
- * the view to manage
- */
- public ShowHideConnectionLabelsRequest(boolean showConnectionLabel, View view) {
- super(showConnectionLabel);
- this.view = view;
- setType(SHOW_HIDE_LABELS_REQUEST_TYPE);
- }
-
- /**
- * Returns the view to show/hide
- *
- * @return the view to show/hide
- */
- public View getView() {
- return this.view;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.gmf.runtime.diagram.ui.requests.ToggleConnectionLabelsRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * This request is used to manage the display (or not) of ONE label for the
+ * connection
+ *
+ *
+ *
+ */
+public class ShowHideConnectionLabelsRequest extends ToggleConnectionLabelsRequest {
+
+ /**
+ * the request type
+ */
+ public static final String SHOW_HIDE_LABELS_REQUEST_TYPE = "ShowHideLabelsRequest"; //$NON-NLS-1$
+
+ /**
+ * the view to show/hide
+ */
+ private View view;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param showConnectionLabel
+ * the value for the action : <code>true</code> means show and <code>false</code> means hdie
+ * @param view
+ * the view to manage
+ */
+ public ShowHideConnectionLabelsRequest(boolean showConnectionLabel, View view) {
+ super(showConnectionLabel);
+ this.view = view;
+ setType(SHOW_HIDE_LABELS_REQUEST_TYPE);
+ }
+
+ /**
+ * Returns the view to show/hide
+ *
+ * @return the view to show/hide
+ */
+ public View getView() {
+ return this.view;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideElementsRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideElementsRequest.java
index 42ed970e0ab..e708465bc11 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideElementsRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideElementsRequest.java
@@ -1,122 +1,122 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- *
- * This request is used to show/hide element in the diagram
- *
- */
-public class ShowHideElementsRequest extends Request {
-
- /** type of this request */
- public static final String SHOW_HIDE_ELEMENTS = "Show/Hide elements";
-
- /** value to hide the object */
- public static final boolean HIDE = false;
-
- /** value to show the object */
- public static final boolean SHOW = true;
-
- /** EditPart to hide */
- protected EditPart hidedEditPart = null;
-
- /** the container which the view will be created */
- protected View container = null;
-
- /** the semantic element to create */
- protected EObject semanticElement = null;
-
- /** the location for the element to show */
- protected Point location = null;
-
- /**
- *
- * Constructor used when we want destroy an EditPart
- *
- * @param ep
- * the EditPart to destroy
- */
- public ShowHideElementsRequest(EditPart ep) {
- super(SHOW_HIDE_ELEMENTS);
- this.hidedEditPart = ep;
- }
-
- /**
- *
- * Constructor used when we want create a View for an Element
- *
- * @param container
- * the container for the view of the element
- * @param semanticElement
- * the element to create
- */
- public ShowHideElementsRequest(View container, EObject semanticElement) {
- super(SHOW_HIDE_ELEMENTS);
- this.container = container;
- this.semanticElement = semanticElement;
- }
-
- /**
- * Getter for {@link #hidedEditPart}
- *
- * @return {@link #hidedEditPart}
- */
- public EditPart getHidedEditPart() {
- return this.hidedEditPart;
- }
-
- /**
- * Getter for {@link #container}
- *
- * @return {@link #container}
- */
- public View getContainer() {
- return this.container;
- }
-
- /**
- * Getter for {@link #semanticElement}
- *
- * @return {@link #semanticElement}
- */
- public EObject getSemanticElement() {
- return this.semanticElement;
- }
-
- /**
- * Setter for {@link #location}
- *
- * @param location
- * the location for the EditPart to show
- */
- public void setLocation(Point location) {
- this.location = location;
- }
-
- /**
- * Getter for {@link #location}
- *
- * @return The location for the EditPart to show
- */
- public Point getLocation() {
- return this.location;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ *
+ * This request is used to show/hide element in the diagram
+ *
+ */
+public class ShowHideElementsRequest extends Request {
+
+ /** type of this request */
+ public static final String SHOW_HIDE_ELEMENTS = "Show/Hide elements";
+
+ /** value to hide the object */
+ public static final boolean HIDE = false;
+
+ /** value to show the object */
+ public static final boolean SHOW = true;
+
+ /** EditPart to hide */
+ protected EditPart hidedEditPart = null;
+
+ /** the container which the view will be created */
+ protected View container = null;
+
+ /** the semantic element to create */
+ protected EObject semanticElement = null;
+
+ /** the location for the element to show */
+ protected Point location = null;
+
+ /**
+ *
+ * Constructor used when we want destroy an EditPart
+ *
+ * @param ep
+ * the EditPart to destroy
+ */
+ public ShowHideElementsRequest(EditPart ep) {
+ super(SHOW_HIDE_ELEMENTS);
+ this.hidedEditPart = ep;
+ }
+
+ /**
+ *
+ * Constructor used when we want create a View for an Element
+ *
+ * @param container
+ * the container for the view of the element
+ * @param semanticElement
+ * the element to create
+ */
+ public ShowHideElementsRequest(View container, EObject semanticElement) {
+ super(SHOW_HIDE_ELEMENTS);
+ this.container = container;
+ this.semanticElement = semanticElement;
+ }
+
+ /**
+ * Getter for {@link #hidedEditPart}
+ *
+ * @return {@link #hidedEditPart}
+ */
+ public EditPart getHidedEditPart() {
+ return this.hidedEditPart;
+ }
+
+ /**
+ * Getter for {@link #container}
+ *
+ * @return {@link #container}
+ */
+ public View getContainer() {
+ return this.container;
+ }
+
+ /**
+ * Getter for {@link #semanticElement}
+ *
+ * @return {@link #semanticElement}
+ */
+ public EObject getSemanticElement() {
+ return this.semanticElement;
+ }
+
+ /**
+ * Setter for {@link #location}
+ *
+ * @param location
+ * the location for the EditPart to show
+ */
+ public void setLocation(Point location) {
+ this.location = location;
+ }
+
+ /**
+ * Getter for {@link #location}
+ *
+ * @return The location for the EditPart to show
+ */
+ public Point getLocation() {
+ return this.location;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideLabelsRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideLabelsRequest.java
index d6e397145a6..94177887e04 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideLabelsRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideLabelsRequest.java
@@ -1,62 +1,62 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.gmf.runtime.diagram.ui.requests.ToggleConnectionLabelsRequest;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * This request is used to manage the display (or not) of ONE label for the
- * connection
- *
- *
- *
- */
-public class ShowHideLabelsRequest extends ToggleConnectionLabelsRequest {
-
- /**
- * the request type
- */
- public static final String SHOW_HIDE_LABELS_REQUEST_TYPE = "ShowHideLabelsRequest"; //$NON-NLS-1$
-
- /**
- * the view to show/hide
- */
- private View view;
-
- /**
- *
- * Constructor.
- *
- * @param showConnectionLabel
- * the value for the action : <code>true</code> means show and <code>false</code> means hdie
- * @param view
- * the view to manage
- */
- public ShowHideLabelsRequest(boolean showConnectionLabel, View view) {
- super(showConnectionLabel);
- this.view = view;
- setType(SHOW_HIDE_LABELS_REQUEST_TYPE);
- }
-
- /**
- * Returns the view to show/hide
- *
- * @return the view to show/hide
- */
- public View getView() {
- return this.view;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.gmf.runtime.diagram.ui.requests.ToggleConnectionLabelsRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * This request is used to manage the display (or not) of ONE label for the
+ * connection
+ *
+ *
+ *
+ */
+public class ShowHideLabelsRequest extends ToggleConnectionLabelsRequest {
+
+ /**
+ * the request type
+ */
+ public static final String SHOW_HIDE_LABELS_REQUEST_TYPE = "ShowHideLabelsRequest"; //$NON-NLS-1$
+
+ /**
+ * the view to show/hide
+ */
+ private View view;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param showConnectionLabel
+ * the value for the action : <code>true</code> means show and <code>false</code> means hdie
+ * @param view
+ * the view to manage
+ */
+ public ShowHideLabelsRequest(boolean showConnectionLabel, View view) {
+ super(showConnectionLabel);
+ this.view = view;
+ setType(SHOW_HIDE_LABELS_REQUEST_TYPE);
+ }
+
+ /**
+ * Returns the view to show/hide
+ *
+ * @return the view to show/hide
+ */
+ public View getView() {
+ return this.view;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideTitleOfCompartmentCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideTitleOfCompartmentCommand.java
index f6389cbddf3..cead1efad9b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideTitleOfCompartmentCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/ShowHideTitleOfCompartmentCommand.java
@@ -1,60 +1,60 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.core.commands.SetPropertyCommand;
-import org.eclipse.gmf.runtime.diagram.ui.internal.properties.Properties;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * This command allows to show/hide the compartment title
- *
- *
- */
-public class ShowHideTitleOfCompartmentCommand extends SetPropertyCommand {
-
- /**
- *
- * Constructor.
- *
- * @param view
- * the compartment view
- * @param visibility
- * the visibility of the title
- */
- public ShowHideTitleOfCompartmentCommand(TransactionalEditingDomain domain, View view, boolean visibility) {
- super(domain, new EObjectAdapter(view), Properties.ID_SHOWCOMPARTMENTTITLE, "Show/Hide Compartment Title", Boolean.valueOf(visibility)); //$NON-NLS-1$
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.core.commands.SetPropertyCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
- * org.eclipse.core.runtime.IAdaptable)
- *
- * @param progressMonitor
- * @param info
- * @return
- * @throws ExecutionException
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- return super.doExecuteWithResult(progressMonitor, info);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.core.commands.SetPropertyCommand;
+import org.eclipse.gmf.runtime.diagram.ui.internal.properties.Properties;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * This command allows to show/hide the compartment title
+ *
+ *
+ */
+public class ShowHideTitleOfCompartmentCommand extends SetPropertyCommand {
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param view
+ * the compartment view
+ * @param visibility
+ * the visibility of the title
+ */
+ public ShowHideTitleOfCompartmentCommand(TransactionalEditingDomain domain, View view, boolean visibility) {
+ super(domain, new EObjectAdapter(view), Properties.ID_SHOWCOMPARTMENTTITLE, "Show/Hide Compartment Title", Boolean.valueOf(visibility)); //$NON-NLS-1$
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.core.commands.SetPropertyCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ *
+ * @param progressMonitor
+ * @param info
+ * @return
+ * @throws ExecutionException
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ return super.doExecuteWithResult(progressMonitor, info);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SupplementCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SupplementCommand.java
index a23ab15a0b7..475d61a2eb0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SupplementCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/SupplementCommand.java
@@ -1,112 +1,112 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-
-/**
- * This class is used to supplement a gmf connection command.
- *
- * @author Patrick Tessier
- */
-public abstract class SupplementCommand {
-
- private EObject container;
-
- private final EObject source;
-
- private final EObject target;
-
- /**
- * the supplement command has the same parameter as connection create
- * command of gmf command
- *
- * @param container
- * the container of the link
- * @param source
- * the source of the link
- *
- * @param target
- * the target of the link
- */
- public SupplementCommand(EObject container, EObject source, EObject target) {
- super();
- this.container = container;
- this.source = source;
- this.target = target;
- }
-
- /**
- * this is the same fucntionnality as {@link IUndoableOperation}
- *
- * @return true if the command ca be executed
- */
- // @unused
- public abstract boolean canExecute();
-
- /**
- * Creates the request to configure the new element.
- *
- * @see EditElementCommand
- * @return the request
- */
- // @unused
- protected abstract ConfigureRequest createConfigureRequest(ConfigureRequest request);
-
- /**
- * this is the method tat realize the execution of the command
- *
- * @param newElement
- * the new element ro configure
- * @return the new element
- */
- public abstract EObject doDefaultElementCreation(TransactionalEditingDomain domain, EObject newElement);
-
- /**
- * use to obtain the container of the link
- *
- * @return the container of the link
- */
- public EObject getContainer() {
- return container;
- }
-
- /**
- * use to obtain the source of the link
- *
- * @return the source of the link
- */
- public EObject getSource() {
- return source;
- }
-
- /**
- * use to obtain the target of the link
- *
- * @return the target of the link
- */
- public EObject getTarget() {
- return target;
- }
-
- /**
- * use to set the container of the link
- */
- // @unused
- public void setContainer(EObject container) {
- this.container = container;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
+
+/**
+ * This class is used to supplement a gmf connection command.
+ *
+ * @author Patrick Tessier
+ */
+public abstract class SupplementCommand {
+
+ private EObject container;
+
+ private final EObject source;
+
+ private final EObject target;
+
+ /**
+ * the supplement command has the same parameter as connection create
+ * command of gmf command
+ *
+ * @param container
+ * the container of the link
+ * @param source
+ * the source of the link
+ *
+ * @param target
+ * the target of the link
+ */
+ public SupplementCommand(EObject container, EObject source, EObject target) {
+ super();
+ this.container = container;
+ this.source = source;
+ this.target = target;
+ }
+
+ /**
+ * this is the same fucntionnality as {@link IUndoableOperation}
+ *
+ * @return true if the command ca be executed
+ */
+ // @unused
+ public abstract boolean canExecute();
+
+ /**
+ * Creates the request to configure the new element.
+ *
+ * @see EditElementCommand
+ * @return the request
+ */
+ // @unused
+ protected abstract ConfigureRequest createConfigureRequest(ConfigureRequest request);
+
+ /**
+ * this is the method tat realize the execution of the command
+ *
+ * @param newElement
+ * the new element ro configure
+ * @return the new element
+ */
+ public abstract EObject doDefaultElementCreation(TransactionalEditingDomain domain, EObject newElement);
+
+ /**
+ * use to obtain the container of the link
+ *
+ * @return the container of the link
+ */
+ public EObject getContainer() {
+ return container;
+ }
+
+ /**
+ * use to obtain the source of the link
+ *
+ * @return the source of the link
+ */
+ public EObject getSource() {
+ return source;
+ }
+
+ /**
+ * use to obtain the target of the link
+ *
+ * @return the target of the link
+ */
+ public EObject getTarget() {
+ return target;
+ }
+
+ /**
+ * use to set the container of the link
+ */
+ // @unused
+ public void setContainer(EObject container) {
+ this.container = container;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java
index 2622936e7d3..bd1392803bd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UnapplyAllStereotypesCommand.java
@@ -1,35 +1,35 @@
-/*******************************************************************************
- * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana .
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
- * Mathieu Velten (Atos Origin) - rewrite using transactional command
- *
- ******************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * Unapplies all stereotypes from an Element.
- */
-public class UnapplyAllStereotypesCommand extends CompositeCommand {
-
- public UnapplyAllStereotypesCommand(TransactionalEditingDomain domain, String label, Element element) {
- super(label);
- for(EObject stereotypeApplication : element.getStereotypeApplications()) {
- DestroyElementRequest stereoReq = new DestroyElementRequest(domain, stereotypeApplication, false);
- add(new DestroyElementCommand(stereoReq));
- }
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana .
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
+ * Mathieu Velten (Atos Origin) - rewrite using transactional command
+ *
+ ******************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Unapplies all stereotypes from an Element.
+ */
+public class UnapplyAllStereotypesCommand extends CompositeCommand {
+
+ public UnapplyAllStereotypesCommand(TransactionalEditingDomain domain, String label, Element element) {
+ super(label);
+ for(EObject stereotypeApplication : element.getStereotypeApplications()) {
+ DestroyElementRequest stereoReq = new DestroyElementRequest(domain, stereotypeApplication, false);
+ add(new DestroyElementCommand(stereoReq));
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdateLifelineRepresentsCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdateLifelineRepresentsCommand.java
index 104772b29a1..28e5865c64c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdateLifelineRepresentsCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdateLifelineRepresentsCommand.java
@@ -1,231 +1,231 @@
-/*******************************************************************************
- * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana .
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
- *
- ******************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import java.util.Iterator;
-
-import org.eclipse.emf.common.command.AbstractCommand;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.ConnectableElement;
-import org.eclipse.uml2.uml.Connector;
-import org.eclipse.uml2.uml.ConnectorEnd;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.StructuredClassifier;
-
-/**
- * Command for updating the represents property associated with a Lifeline
- *
- * Creation 13 juin 06
- *
- * @author jlescot
- */
-public class UpdateLifelineRepresentsCommand extends AbstractCommand {
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.emf.common.command.AbstractCommand#canExecute()
- */
- @Override
- public boolean canExecute() {
-
- return true;
- }
-
- /** The Lifeline to update */
- private final Lifeline lifeline;
-
- /** The Classifier to associate */
- private final Classifier classifier;
-
- private boolean createProperty;
-
- private boolean createConnectorEnd;
-
- /**
- * The Property used to link the Classifier with the Lifeline through the
- * Represents property
- */
- private ConnectableElement newProperty;
-
- private ConnectorEnd connectorend;
-
- private ConnectableElement oldProperty;
-
- private final EditingDomain editingDomain;
-
- /**
- * Create a command for updating InstanceSpecification values
- *
- * @param lifeline
- * the current lifeline object
- * @param classifier
- * the new classifier that represents the lifeline
- * @param domain
- * the edit domain
- */
- // @unused
- public UpdateLifelineRepresentsCommand(Lifeline lifeline, Classifier classifier, EditingDomain domain) {
- this.lifeline = lifeline;
- this.classifier = classifier;
- this.editingDomain = domain;
-
- this.label = "Updates the Classifier that represents and Lifeline";
- this.isExecutable = true;
- this.isPrepared = true;
- }
-
- /**
- * Return the connector end which has the correct property as role, owned by
- * a connector in the interaction
- *
- * @param interaction
- * the owning interaction
- * @param prop
- * the property
- *
- * @return the ConnectorEnd
- */
- protected ConnectorEnd getConnectorEnd(Interaction interaction, ConnectableElement prop) {
- EList connectors = interaction.getOwnedConnectors();
- Connector connector;
- if(connectors.isEmpty()) {
- connector = interaction.createOwnedConnector(null);
- // LabelHelper.INSTANCE.initName(editDomain, interaction,
- // connector);
- return null;
- }
-
- Iterator itconnectors = connectors.iterator();
- ConnectorEnd end = null;
- while(end == null && itconnectors.hasNext()) {
- Iterator itends = ((Connector)itconnectors.next()).getEnds().iterator();
- while(end == null && itends.hasNext()) {
- ConnectorEnd e = (ConnectorEnd)itends.next();
- if(e.getRole() == prop) {
- end = e;
- }
- }
- }
- return end;
- }
-
- /**
- * Store the old Property associated with the represents property of the
- * Lifeline and then make the redo
- *
- * @see org.eclipse.gef.commands.Command#execute()
- */
- public void execute() {
- oldProperty = lifeline.getRepresents();
-
- redo();
- }
-
- /**
- * Update the lifeline parameters
- *
- * @see org.eclipse.gef.commands.Command#redo()
- */
- public void redo() {
- if(classifier == null) {
- deleteAuxElements();
-
- createProperty = false;
- createConnectorEnd = false;
- return;
- }
-
- if(lifeline.getRepresents() != null) { // Clean and begin from scratch
- deleteAuxElements();
- }
-
- // Retrieve the interaction from the Lifeline
- Interaction interaction = lifeline.getInteraction();
-
- // Try to get the first Property of the given type
- newProperty = interaction.getOwnedAttribute(null, classifier);
- createProperty = newProperty == null;
-
- // If a such property doesn't exist, create it
- if(createProperty) {
- newProperty = interaction.createOwnedAttribute(null, classifier);
- // LabelHelper.INSTANCE.initName(editDomain, interaction,
- // newProperty);
- }
-
- // Search a ConnectorEnd with the role set to the found property
- connectorend = getConnectorEnd(interaction, newProperty);
-
- createConnectorEnd = connectorend == null;
-
- // if a such property doesn't exist, create it
- if(createConnectorEnd) {
- connectorend = (interaction.getOwnedConnectors().get(0)).createEnd();
- connectorend.setRole(newProperty);
- }
-
- lifeline.setRepresents(newProperty);
- }
-
- private void deleteAuxElements() {
- ConnectableElement connectElem = lifeline.getRepresents();
- lifeline.setRepresents(null);
- removeIfNotReferenced(connectElem);
-
- }
-
- private void removeIfNotReferenced(ConnectableElement connectElem) {
- // Retrieve the interaction from the Lifeline
- Interaction interaction = lifeline.getInteraction();
-
- if(interaction.getOwnedConnectors().size() > 0) {
- Connector connector = interaction.getOwnedConnectors().get(0);
- if(connector != null) {
- for(ConnectorEnd cEnd : connector.getEnds()) {
- if(cEnd.getRole().equals(connectElem)) {
-
- connectElem.destroy();
-
- cEnd.destroy();
-
- return;
- }
- }
- }
- }
-
- }
-
- /**
- * Undo the update
- *
- * @see org.eclipse.gef.commands.Command#undo()
- */
- @Override
- public void undo() {
- if(createConnectorEnd) {
- connectorend.setRole(null);
- ((Connector)connectorend.getOwner()).getEnds().remove(connectorend);
- }
-
- if(createProperty) {
- ((StructuredClassifier)newProperty.getOwner()).getOwnedAttributes().remove(newProperty);
- }
-
- lifeline.setRepresents(oldProperty);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana .
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
+ *
+ ******************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.ConnectableElement;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.ConnectorEnd;
+import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.Lifeline;
+import org.eclipse.uml2.uml.StructuredClassifier;
+
+/**
+ * Command for updating the represents property associated with a Lifeline
+ *
+ * Creation 13 juin 06
+ *
+ * @author jlescot
+ */
+public class UpdateLifelineRepresentsCommand extends AbstractCommand {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.emf.common.command.AbstractCommand#canExecute()
+ */
+ @Override
+ public boolean canExecute() {
+
+ return true;
+ }
+
+ /** The Lifeline to update */
+ private final Lifeline lifeline;
+
+ /** The Classifier to associate */
+ private final Classifier classifier;
+
+ private boolean createProperty;
+
+ private boolean createConnectorEnd;
+
+ /**
+ * The Property used to link the Classifier with the Lifeline through the
+ * Represents property
+ */
+ private ConnectableElement newProperty;
+
+ private ConnectorEnd connectorend;
+
+ private ConnectableElement oldProperty;
+
+ private final EditingDomain editingDomain;
+
+ /**
+ * Create a command for updating InstanceSpecification values
+ *
+ * @param lifeline
+ * the current lifeline object
+ * @param classifier
+ * the new classifier that represents the lifeline
+ * @param domain
+ * the edit domain
+ */
+ // @unused
+ public UpdateLifelineRepresentsCommand(Lifeline lifeline, Classifier classifier, EditingDomain domain) {
+ this.lifeline = lifeline;
+ this.classifier = classifier;
+ this.editingDomain = domain;
+
+ this.label = "Updates the Classifier that represents and Lifeline";
+ this.isExecutable = true;
+ this.isPrepared = true;
+ }
+
+ /**
+ * Return the connector end which has the correct property as role, owned by
+ * a connector in the interaction
+ *
+ * @param interaction
+ * the owning interaction
+ * @param prop
+ * the property
+ *
+ * @return the ConnectorEnd
+ */
+ protected ConnectorEnd getConnectorEnd(Interaction interaction, ConnectableElement prop) {
+ EList connectors = interaction.getOwnedConnectors();
+ Connector connector;
+ if(connectors.isEmpty()) {
+ connector = interaction.createOwnedConnector(null);
+ // LabelHelper.INSTANCE.initName(editDomain, interaction,
+ // connector);
+ return null;
+ }
+
+ Iterator itconnectors = connectors.iterator();
+ ConnectorEnd end = null;
+ while(end == null && itconnectors.hasNext()) {
+ Iterator itends = ((Connector)itconnectors.next()).getEnds().iterator();
+ while(end == null && itends.hasNext()) {
+ ConnectorEnd e = (ConnectorEnd)itends.next();
+ if(e.getRole() == prop) {
+ end = e;
+ }
+ }
+ }
+ return end;
+ }
+
+ /**
+ * Store the old Property associated with the represents property of the
+ * Lifeline and then make the redo
+ *
+ * @see org.eclipse.gef.commands.Command#execute()
+ */
+ public void execute() {
+ oldProperty = lifeline.getRepresents();
+
+ redo();
+ }
+
+ /**
+ * Update the lifeline parameters
+ *
+ * @see org.eclipse.gef.commands.Command#redo()
+ */
+ public void redo() {
+ if(classifier == null) {
+ deleteAuxElements();
+
+ createProperty = false;
+ createConnectorEnd = false;
+ return;
+ }
+
+ if(lifeline.getRepresents() != null) { // Clean and begin from scratch
+ deleteAuxElements();
+ }
+
+ // Retrieve the interaction from the Lifeline
+ Interaction interaction = lifeline.getInteraction();
+
+ // Try to get the first Property of the given type
+ newProperty = interaction.getOwnedAttribute(null, classifier);
+ createProperty = newProperty == null;
+
+ // If a such property doesn't exist, create it
+ if(createProperty) {
+ newProperty = interaction.createOwnedAttribute(null, classifier);
+ // LabelHelper.INSTANCE.initName(editDomain, interaction,
+ // newProperty);
+ }
+
+ // Search a ConnectorEnd with the role set to the found property
+ connectorend = getConnectorEnd(interaction, newProperty);
+
+ createConnectorEnd = connectorend == null;
+
+ // if a such property doesn't exist, create it
+ if(createConnectorEnd) {
+ connectorend = (interaction.getOwnedConnectors().get(0)).createEnd();
+ connectorend.setRole(newProperty);
+ }
+
+ lifeline.setRepresents(newProperty);
+ }
+
+ private void deleteAuxElements() {
+ ConnectableElement connectElem = lifeline.getRepresents();
+ lifeline.setRepresents(null);
+ removeIfNotReferenced(connectElem);
+
+ }
+
+ private void removeIfNotReferenced(ConnectableElement connectElem) {
+ // Retrieve the interaction from the Lifeline
+ Interaction interaction = lifeline.getInteraction();
+
+ if(interaction.getOwnedConnectors().size() > 0) {
+ Connector connector = interaction.getOwnedConnectors().get(0);
+ if(connector != null) {
+ for(ConnectorEnd cEnd : connector.getEnds()) {
+ if(cEnd.getRole().equals(connectElem)) {
+
+ connectElem.destroy();
+
+ cEnd.destroy();
+
+ return;
+ }
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Undo the update
+ *
+ * @see org.eclipse.gef.commands.Command#undo()
+ */
+ @Override
+ public void undo() {
+ if(createConnectorEnd) {
+ connectorend.setRole(null);
+ ((Connector)connectorend.getOwner()).getEnds().remove(connectorend);
+ }
+
+ if(createProperty) {
+ ((StructuredClassifier)newProperty.getOwner()).getOwnedAttributes().remove(newProperty);
+ }
+
+ lifeline.setRepresents(oldProperty);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java
index 851ed664bdd..4eb98c0e2cd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/commands/UpdatePortLocationCommand.java
@@ -1,119 +1,119 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Bounds;
-import org.eclipse.gmf.runtime.notation.Shape;
-
-/**
- * <pre>
- * This class is a command that updates the location of Port border items,
- * when the parent is resized.
- * This command is not generic (meaning valid for any IBorderItem) in the sense that
- * the calculation of the new location is totally based on the way {@link PortPositionLocator}
- * behaves.
- * </pre>
- */
-public class UpdatePortLocationCommand extends AbstractTransactionalCommand {
-
- /** The border item edit part (assumed to be a Port) */
- private IBorderItemEditPart borderItemEditPart;
-
- /** The parent edit part */
- private GraphicalEditPart parentEditPart;
-
- /** The Port side before parent resize */
- private final int borderItemSide;
-
- /**
- * Constructor.
- * @param domain the editing domain
- * @param parentEditPart the parent edit part
- * @param borderItemEditPart the Port edit part
- * @param borderItemSide the side of Port on parent before resize
- */
- public UpdatePortLocationCommand(TransactionalEditingDomain domain, GraphicalEditPart parentEditPart, IBorderItemEditPart borderItemEditPart, int borderItemSide) {
- super(domain, "Update port location command", null);
- this.borderItemEditPart = borderItemEditPart;
- this.parentEditPart = parentEditPart;
- this.borderItemSide = borderItemSide;
- }
-
- /**
- * Set the new IBorderItemEditPart view bounds after a resize of its parent.
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
- IAdaptable info) throws ExecutionException {
-
- // At this step the resized bounds of the parent should have been set.
- // Get the parent bounds.
- Shape parentShape = (Shape) parentEditPart.getNotationView();
- Bounds parentBounds = (Bounds) parentShape.getLayoutConstraint();
-
- // Retrieve borderItemBounds
- int borderItemOffset = 10; // see PortPositionLocator.
-
- Shape borderItemShape = (Shape)borderItemEditPart.getNotationView();
- Bounds borderItemBounds = (Bounds)borderItemShape.getLayoutConstraint();
-
- switch(borderItemSide) { // The borderItemSide is not supposed to
- // change during a parent resize.
- case PositionConstants.NORTH:
- borderItemBounds.setY(-borderItemOffset);
- break;
- case PositionConstants.NORTH_EAST:
- borderItemBounds.setX(parentBounds.getWidth() - borderItemOffset);
- borderItemBounds.setY(-borderItemOffset);
- break;
- case PositionConstants.EAST:
- borderItemBounds.setX(parentBounds.getWidth() - borderItemOffset);
- break;
- case PositionConstants.SOUTH_EAST:
- borderItemBounds.setX(parentBounds.getWidth() - borderItemOffset);
- borderItemBounds.setY(parentBounds.getHeight() - borderItemOffset);
- break;
- case PositionConstants.SOUTH:
- borderItemBounds.setY(parentBounds.getHeight() - borderItemOffset);
- break;
- case PositionConstants.SOUTH_WEST:
- borderItemBounds.setX(-borderItemOffset);
- borderItemBounds.setY(parentBounds.getHeight() - borderItemOffset);
- break;
- case PositionConstants.WEST:
- borderItemBounds.setX(-borderItemOffset);
- break;
- case PositionConstants.NORTH_WEST:
- borderItemBounds.setX(-borderItemOffset);
- borderItemBounds.setY(-borderItemOffset);
- break;
-
- default:
- // TODO : Add log here, this case should not be possible anymore.
- break;
- }
-
- return CommandResult.newOKCommandResult();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.commands;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Bounds;
+import org.eclipse.gmf.runtime.notation.Shape;
+
+/**
+ * <pre>
+ * This class is a command that updates the location of Port border items,
+ * when the parent is resized.
+ * This command is not generic (meaning valid for any IBorderItem) in the sense that
+ * the calculation of the new location is totally based on the way {@link PortPositionLocator}
+ * behaves.
+ * </pre>
+ */
+public class UpdatePortLocationCommand extends AbstractTransactionalCommand {
+
+ /** The border item edit part (assumed to be a Port) */
+ private IBorderItemEditPart borderItemEditPart;
+
+ /** The parent edit part */
+ private GraphicalEditPart parentEditPart;
+
+ /** The Port side before parent resize */
+ private final int borderItemSide;
+
+ /**
+ * Constructor.
+ * @param domain the editing domain
+ * @param parentEditPart the parent edit part
+ * @param borderItemEditPart the Port edit part
+ * @param borderItemSide the side of Port on parent before resize
+ */
+ public UpdatePortLocationCommand(TransactionalEditingDomain domain, GraphicalEditPart parentEditPart, IBorderItemEditPart borderItemEditPart, int borderItemSide) {
+ super(domain, "Update port location command", null);
+ this.borderItemEditPart = borderItemEditPart;
+ this.parentEditPart = parentEditPart;
+ this.borderItemSide = borderItemSide;
+ }
+
+ /**
+ * Set the new IBorderItemEditPart view bounds after a resize of its parent.
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor,
+ IAdaptable info) throws ExecutionException {
+
+ // At this step the resized bounds of the parent should have been set.
+ // Get the parent bounds.
+ Shape parentShape = (Shape) parentEditPart.getNotationView();
+ Bounds parentBounds = (Bounds) parentShape.getLayoutConstraint();
+
+ // Retrieve borderItemBounds
+ int borderItemOffset = 10; // see PortPositionLocator.
+
+ Shape borderItemShape = (Shape)borderItemEditPart.getNotationView();
+ Bounds borderItemBounds = (Bounds)borderItemShape.getLayoutConstraint();
+
+ switch(borderItemSide) { // The borderItemSide is not supposed to
+ // change during a parent resize.
+ case PositionConstants.NORTH:
+ borderItemBounds.setY(-borderItemOffset);
+ break;
+ case PositionConstants.NORTH_EAST:
+ borderItemBounds.setX(parentBounds.getWidth() - borderItemOffset);
+ borderItemBounds.setY(-borderItemOffset);
+ break;
+ case PositionConstants.EAST:
+ borderItemBounds.setX(parentBounds.getWidth() - borderItemOffset);
+ break;
+ case PositionConstants.SOUTH_EAST:
+ borderItemBounds.setX(parentBounds.getWidth() - borderItemOffset);
+ borderItemBounds.setY(parentBounds.getHeight() - borderItemOffset);
+ break;
+ case PositionConstants.SOUTH:
+ borderItemBounds.setY(parentBounds.getHeight() - borderItemOffset);
+ break;
+ case PositionConstants.SOUTH_WEST:
+ borderItemBounds.setX(-borderItemOffset);
+ borderItemBounds.setY(parentBounds.getHeight() - borderItemOffset);
+ break;
+ case PositionConstants.WEST:
+ borderItemBounds.setX(-borderItemOffset);
+ break;
+ case PositionConstants.NORTH_WEST:
+ borderItemBounds.setX(-borderItemOffset);
+ borderItemBounds.setY(-borderItemOffset);
+ break;
+
+ default:
+ // TODO : Add log here, this case should not be possible anymore.
+ break;
+ }
+
+ return CommandResult.newOKCommandResult();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/AbstractCheckedTreeColumnViewerSelectionDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/AbstractCheckedTreeColumnViewerSelectionDialog.java
index 216f2190f78..511db86e695 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/AbstractCheckedTreeColumnViewerSelectionDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/AbstractCheckedTreeColumnViewerSelectionDialog.java
@@ -1,182 +1,182 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.dialogs;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.viewers.CellLabelProvider;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewerColumn;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-
-/**
- * This abstract class allows to create columns with a tree viewer. A double
- * Click on an element of the tree allows to expand/collapse the node!
- *
- *
- */
-public abstract class AbstractCheckedTreeColumnViewerSelectionDialog extends CustomCheckedTreeSelectionDialog {
-
- /** the number of columns */
- private int nbColumns = 0;
-
- /** the title of the columns */
- private String[] columnTitles = null;
-
- /** the width of the columns */
- private int[] columnWidths = null;
-
- /** the label provider for the columns */
- private CellLabelProvider[] columnCellLabelProvider;
-
- /**
- *
- * Constructor.
- *
- * @param parent
- * the parent shell
- * @param labelProvider
- * the label provider for the tree
- * @param contentProvider
- * the content provider for the tree
- * @param style
- * the style for the viewer
- * @param nbColumns
- * the nomber of columns
- */
- public AbstractCheckedTreeColumnViewerSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider, int style, int nbColumns) {
- super(parent, labelProvider, contentProvider, style);
- this.nbColumns = nbColumns;
- setSize(100, 20);
-
- }
-
- /**
- * Setter for {@link #columnWidths}
- *
- * @param widths
- * The array owning the widths of the columns
- */
- public void setColumnWidths(int[] widths) {
- Assert.isTrue(widths.length == nbColumns);
- this.columnWidths = widths;
- }
-
- /**
- * Setter for {@link #columnTitles}
- *
- * @param titles
- * the titles of the columns
- */
- public void setColumnTitles(String[] titles) {
- Assert.isTrue(titles.length == nbColumns);
- this.columnTitles = titles;
- }
-
- /**
- * Setter for {@link #columnCellLabelProvider}
- *
- * @param providers
- * the labels providers for the columns
- */
- public void setColumnCellLabelProvider(CellLabelProvider[] providers) {
- Assert.isTrue(providers.length == nbColumns);
- this.columnCellLabelProvider = providers;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.dialogs.CustomCheckedTreeSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- *
- * @param parent
- * @return
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- Control ctrl = super.createDialogArea(parent);
- for(int i = 0; i < nbColumns; i++) {
- TreeViewerColumn column = new TreeViewerColumn(getTreeViewer(), SWT.NONE);
- column.getColumn().setText(columnTitles[i]);
- column.getColumn().setWidth(columnWidths[i]);
- column.setLabelProvider(columnCellLabelProvider[i]);
- EditingSupport support = getEditingSupport(i);
- if(support != null) {
- column.setEditingSupport(support);
- }
- }
-
- getTreeViewer().getTree().setLinesVisible(true);
- getTreeViewer().getTree().setHeaderVisible(true);
- getTreeViewer().getTree().addMouseListener(new MouseListener() {
-
- /**
- *
- * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
- *
- * @param e
- */
- public void mouseUp(MouseEvent e) {
- // nothing to do
- }
-
- /**
- *
- * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
- *
- * @param e
- */
- public void mouseDown(MouseEvent e) {
- // nothing to do
-
- }
-
- /**
- *
- * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
- *
- * @param e
- */
- public void mouseDoubleClick(MouseEvent e) {
- // we expand the selected element
- Tree source = (Tree)e.getSource();
- TreeItem[] item = source.getSelection();
- List<?> expandedElements = Arrays.asList(getTreeViewer().getExpandedElements());
- if(getTreeViewer().isExpandable(item[0].getData())) {
- boolean isExpanded = expandedElements.contains(item[0].getData());
- item[0].setExpanded(!isExpanded);
- }
- }
- });
- return ctrl;
- }
-
- /**
- * Returns the {@link EditingSupport} for the column.
- *
- * @param columnIndex
- * @return the {@link EditingSupport} for the column or <code>null</code>
- */
- abstract protected EditingSupport getEditingSupport(int columnIndex);
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dialogs;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.jface.viewers.CellLabelProvider;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewerColumn;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * This abstract class allows to create columns with a tree viewer. A double
+ * Click on an element of the tree allows to expand/collapse the node!
+ *
+ *
+ */
+public abstract class AbstractCheckedTreeColumnViewerSelectionDialog extends CustomCheckedTreeSelectionDialog {
+
+ /** the number of columns */
+ private int nbColumns = 0;
+
+ /** the title of the columns */
+ private String[] columnTitles = null;
+
+ /** the width of the columns */
+ private int[] columnWidths = null;
+
+ /** the label provider for the columns */
+ private CellLabelProvider[] columnCellLabelProvider;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * the parent shell
+ * @param labelProvider
+ * the label provider for the tree
+ * @param contentProvider
+ * the content provider for the tree
+ * @param style
+ * the style for the viewer
+ * @param nbColumns
+ * the nomber of columns
+ */
+ public AbstractCheckedTreeColumnViewerSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider, int style, int nbColumns) {
+ super(parent, labelProvider, contentProvider, style);
+ this.nbColumns = nbColumns;
+ setSize(100, 20);
+
+ }
+
+ /**
+ * Setter for {@link #columnWidths}
+ *
+ * @param widths
+ * The array owning the widths of the columns
+ */
+ public void setColumnWidths(int[] widths) {
+ Assert.isTrue(widths.length == nbColumns);
+ this.columnWidths = widths;
+ }
+
+ /**
+ * Setter for {@link #columnTitles}
+ *
+ * @param titles
+ * the titles of the columns
+ */
+ public void setColumnTitles(String[] titles) {
+ Assert.isTrue(titles.length == nbColumns);
+ this.columnTitles = titles;
+ }
+
+ /**
+ * Setter for {@link #columnCellLabelProvider}
+ *
+ * @param providers
+ * the labels providers for the columns
+ */
+ public void setColumnCellLabelProvider(CellLabelProvider[] providers) {
+ Assert.isTrue(providers.length == nbColumns);
+ this.columnCellLabelProvider = providers;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.dialogs.CustomCheckedTreeSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * @return
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Control ctrl = super.createDialogArea(parent);
+ for(int i = 0; i < nbColumns; i++) {
+ TreeViewerColumn column = new TreeViewerColumn(getTreeViewer(), SWT.NONE);
+ column.getColumn().setText(columnTitles[i]);
+ column.getColumn().setWidth(columnWidths[i]);
+ column.setLabelProvider(columnCellLabelProvider[i]);
+ EditingSupport support = getEditingSupport(i);
+ if(support != null) {
+ column.setEditingSupport(support);
+ }
+ }
+
+ getTreeViewer().getTree().setLinesVisible(true);
+ getTreeViewer().getTree().setHeaderVisible(true);
+ getTreeViewer().getTree().addMouseListener(new MouseListener() {
+
+ /**
+ *
+ * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
+ *
+ * @param e
+ */
+ public void mouseUp(MouseEvent e) {
+ // nothing to do
+ }
+
+ /**
+ *
+ * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
+ *
+ * @param e
+ */
+ public void mouseDown(MouseEvent e) {
+ // nothing to do
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
+ *
+ * @param e
+ */
+ public void mouseDoubleClick(MouseEvent e) {
+ // we expand the selected element
+ Tree source = (Tree)e.getSource();
+ TreeItem[] item = source.getSelection();
+ List<?> expandedElements = Arrays.asList(getTreeViewer().getExpandedElements());
+ if(getTreeViewer().isExpandable(item[0].getData())) {
+ boolean isExpanded = expandedElements.contains(item[0].getData());
+ item[0].setExpanded(!isExpanded);
+ }
+ }
+ });
+ return ctrl;
+ }
+
+ /**
+ * Returns the {@link EditingSupport} for the column.
+ *
+ * @param columnIndex
+ * @return the {@link EditingSupport} for the column or <code>null</code>
+ */
+ abstract protected EditingSupport getEditingSupport(int columnIndex);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/CustomCheckedTreeSelectionDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/CustomCheckedTreeSelectionDialog.java
index 0c182074224..a8b4486b0a2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/CustomCheckedTreeSelectionDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dialogs/CustomCheckedTreeSelectionDialog.java
@@ -1,436 +1,436 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- * Adapted code from org.eclipse.ui.dialogs.CheckedTreeSelectionDialog
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.dialogs;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.dialogs.SelectionStatusDialog;
-import org.eclipse.ui.internal.WorkbenchMessages;
-
-/**
- *
- * This class is copied from {@link org.eclipse.ui.dialogs.CheckedTreeSelectionDialog} We add it the
- * possibility to change the style of the TreeViewer! (we want use
- * SWT.FULL_SELECTION)
- *
- * A patch has been provided to the Platform/SWT project (bug 341923)
- *
- * A class to select elements out of a tree structure.
- *
- * @since 2.0
- */
-public class CustomCheckedTreeSelectionDialog extends SelectionStatusDialog {
-
- private CheckboxTreeViewer fViewer;
-
- final private ILabelProvider fLabelProvider;
-
- protected ITreeContentProvider fContentProvider;
-
- private ISelectionStatusValidator fValidator = null;
-
- private ViewerComparator fComparator;
-
- private String fEmptyListMessage = WorkbenchMessages.CheckedTreeSelectionDialog_nothing_available;
-
- private IStatus fCurrStatus = new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
-
- private List fFilters;
-
- protected Object fInput;
-
- private boolean fIsEmpty;
-
- private int fWidth = 60;
-
- private int fHeight = 18;
-
- private boolean fContainerMode;
-
- private Object[] fExpandedElements;
-
- /**
- * the style of the viewer
- */
- private final int fStyle;
-
- /**
- * Constructs an instance of <code>ElementTreeSelectionDialog</code>.
- *
- * @param parent
- * The shell to parent from.
- * @param labelProvider
- * the label provider to render the entries
- * @param contentProvider
- * the content provider to evaluate the tree structure
- */
- public CustomCheckedTreeSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider, int style) {
- super(parent);
- fLabelProvider = labelProvider;
- fContentProvider = contentProvider;
- setResult(new ArrayList(0));
- setStatusLineAboveButtons(true);
- fContainerMode = false;
- fExpandedElements = null;
- this.fStyle = style;
- }
-
- /**
- * If set, the checked /gray state of containers (inner nodes) is derived
- * from the checked state of its leaf nodes.
- *
- * @param containerMode
- * The containerMode to set
- */
- public void setContainerMode(boolean containerMode) {
- fContainerMode = containerMode;
- }
-
- /**
- * Sets the initial selection. Convenience method.
- *
- * @param selection
- * the initial selection.
- */
- public void setInitialSelection(Object selection) {
- setInitialSelections(new Object[]{ selection });
- }
-
- /**
- * Sets the message to be displayed if the list is empty.
- *
- * @param message
- * the message to be displayed.
- */
- public void setEmptyListMessage(String message) {
- fEmptyListMessage = message;
- }
-
- /**
- * Sets the sorter used by the tree viewer.
- *
- * @param sorter
- * @deprecated since 3.3, use {@link CustomCheckedTreeSelectionDialog#setComparator(ViewerComparator)} instead
- */
- @Deprecated
- public void setSorter(ViewerSorter sorter) {
- fComparator = sorter;
- }
-
- /**
- * Sets the comparator used by the tree viewer.
- *
- * @param comparator
- * @since 3.3
- */
- public void setComparator(ViewerComparator comparator) {
- fComparator = comparator;
- }
-
- /**
- * Adds a filter to the tree viewer.
- *
- * @param filter
- * a filter.
- */
- public void addFilter(ViewerFilter filter) {
- if(fFilters == null) {
- fFilters = new ArrayList(4);
- }
- fFilters.add(filter);
- }
-
- /**
- * Sets an optional validator to check if the selection is valid. The
- * validator is invoked whenever the selection changes.
- *
- * @param validator
- * the validator to validate the selection.
- */
- public void setValidator(ISelectionStatusValidator validator) {
- fValidator = validator;
- }
-
- /**
- * Sets the tree input.
- *
- * @param input
- * the tree input.
- */
- public void setInput(Object input) {
- fInput = input;
- }
-
- /**
- * Expands elements in the tree.
- *
- * @param elements
- * The elements that will be expanded.
- */
- public void setExpandedElements(Object[] elements) {
- fExpandedElements = elements;
- }
-
- /**
- * Sets the size of the tree in unit of characters.
- *
- * @param width
- * the width of the tree.
- * @param height
- * the height of the tree.
- */
- public void setSize(int width, int height) {
- fWidth = width;
- fHeight = height;
- }
-
- /**
- * Validate the receiver and update the status with the result.
- *
- */
- protected void updateOKStatus() {
- if(!fIsEmpty) {
- if(fValidator != null) {
- fCurrStatus = fValidator.validate(fViewer.getCheckedElements());
- updateStatus(fCurrStatus);
- } else if(!fCurrStatus.isOK()) {
- fCurrStatus = new Status(IStatus.OK, PlatformUI.PLUGIN_ID, IStatus.OK, "", //$NON-NLS-1$
- null);
- }
- } else {
- fCurrStatus = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, fEmptyListMessage, null);
- }
- updateStatus(fCurrStatus);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#open()
- */
- @Override
- public int open() {
- fIsEmpty = evaluateIfTreeEmpty(fInput);
- super.open();
- return getReturnCode();
- }
-
- private void access$superCreate() {
- super.create();
- }
-
- /**
- * Handles cancel button pressed event.
- */
- @Override
- protected void cancelPressed() {
- setResult(null);
- super.cancelPressed();
- }
-
- /*
- * @see SelectionStatusDialog#computeResult()
- */
- @Override
- protected void computeResult() {
- setResult(Arrays.asList(fViewer.getCheckedElements()));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.window.Window#create()
- */
- @Override
- public void create() {
- BusyIndicator.showWhile(null, new Runnable() {
-
- public void run() {
- access$superCreate();
- fViewer.setCheckedElements(getInitialElementSelections().toArray());
- if(fExpandedElements != null) {
- fViewer.setExpandedElements(fExpandedElements);
- }
- updateOKStatus();
- }
- });
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
- * .Composite)
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite)super.createDialogArea(parent);
- Label messageLabel = createMessageArea(composite);
- CheckboxTreeViewer treeViewer = createTreeViewer(composite);
- Control buttonComposite = createSelectionButtons(composite);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = convertWidthInCharsToPixels(fWidth);
- data.heightHint = convertHeightInCharsToPixels(fHeight);
- Tree treeWidget = treeViewer.getTree();
- treeWidget.setLayoutData(data);
- treeWidget.setFont(parent.getFont());
- if(fIsEmpty) {
- messageLabel.setEnabled(false);
- treeWidget.setEnabled(false);
- buttonComposite.setEnabled(false);
- }
- return composite;
- }
-
- /**
- * Creates the tree viewer.
- *
- * @param parent
- * the parent composite
- * @return the tree viewer
- */
- protected CheckboxTreeViewer createTreeViewer(Composite parent) {
- if(fContainerMode) {
- fViewer = new ContainerCheckedTreeViewer(parent, this.fStyle);
- } else {
- fViewer = new CheckboxTreeViewer(parent, this.fStyle);
- }
- fViewer.setContentProvider(fContentProvider);
- fViewer.setLabelProvider(fLabelProvider);
- fViewer.addCheckStateListener(new ICheckStateListener() {
-
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateOKStatus();
- }
- });
- fViewer.setComparator(fComparator);
- if(fFilters != null) {
- for(int i = 0; i != fFilters.size(); i++) {
- fViewer.addFilter((ViewerFilter)fFilters.get(i));
- }
- }
- fViewer.setInput(fInput);
- return fViewer;
- }
-
- /**
- * Returns the tree viewer.
- *
- * @return the tree viewer
- */
- protected CheckboxTreeViewer getTreeViewer() {
- return fViewer;
- }
-
- /**
- * Adds the selection and deselection buttons to the dialog.
- *
- * @param composite
- * the parent composite
- * @return Composite the composite the buttons were created in.
- */
- protected Composite createSelectionButtons(Composite composite) {
- Composite buttonComposite = new Composite(composite, SWT.RIGHT);
- GridLayout layout = new GridLayout();
- layout.numColumns = 0;
- layout.marginWidth = 0;
- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- buttonComposite.setLayout(layout);
- buttonComposite.setFont(composite.getFont());
- GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
- data.grabExcessHorizontalSpace = true;
- buttonComposite.setLayoutData(data);
- Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, WorkbenchMessages.CheckedTreeSelectionDialog_select_all, false);
- SelectionListener listener = new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- Object[] viewerElements = fContentProvider.getElements(fInput);
- if(fContainerMode) {
- fViewer.setCheckedElements(viewerElements);
- } else {
- for(int i = 0; i < viewerElements.length; i++) {
- fViewer.setSubtreeChecked(viewerElements[i], true);
- }
- }
- updateOKStatus();
- }
- };
- selectButton.addSelectionListener(listener);
- Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, WorkbenchMessages.CheckedTreeSelectionDialog_deselect_all, false);
- listener = new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- fViewer.setCheckedElements(new Object[0]);
- updateOKStatus();
- }
- };
- deselectButton.addSelectionListener(listener);
- return buttonComposite;
- }
-
- protected boolean evaluateIfTreeEmpty(Object input) {
- Object[] elements = fContentProvider.getElements(input);
- if(elements.length > 0) {
- if(fFilters != null) {
- for(int i = 0; i < fFilters.size(); i++) {
- ViewerFilter curr = (ViewerFilter)fFilters.get(i);
- elements = curr.filter(fViewer, input, elements);
- }
- }
- }
- return elements.length == 0;
- }
-
- /**
- * Returns the label provider used by this dialog
- *
- * @return the label provider used by this dialog
- */
- public ILabelProvider getLabelProvider() {
- return fLabelProvider;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Adapted code from org.eclipse.ui.dialogs.CheckedTreeSelectionDialog
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.dialogs;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
+import org.eclipse.ui.dialogs.ISelectionStatusValidator;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+import org.eclipse.ui.internal.WorkbenchMessages;
+
+/**
+ *
+ * This class is copied from {@link org.eclipse.ui.dialogs.CheckedTreeSelectionDialog} We add it the
+ * possibility to change the style of the TreeViewer! (we want use
+ * SWT.FULL_SELECTION)
+ *
+ * A patch has been provided to the Platform/SWT project (bug 341923)
+ *
+ * A class to select elements out of a tree structure.
+ *
+ * @since 2.0
+ */
+public class CustomCheckedTreeSelectionDialog extends SelectionStatusDialog {
+
+ private CheckboxTreeViewer fViewer;
+
+ final private ILabelProvider fLabelProvider;
+
+ protected ITreeContentProvider fContentProvider;
+
+ private ISelectionStatusValidator fValidator = null;
+
+ private ViewerComparator fComparator;
+
+ private String fEmptyListMessage = WorkbenchMessages.CheckedTreeSelectionDialog_nothing_available;
+
+ private IStatus fCurrStatus = new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
+
+ private List fFilters;
+
+ protected Object fInput;
+
+ private boolean fIsEmpty;
+
+ private int fWidth = 60;
+
+ private int fHeight = 18;
+
+ private boolean fContainerMode;
+
+ private Object[] fExpandedElements;
+
+ /**
+ * the style of the viewer
+ */
+ private final int fStyle;
+
+ /**
+ * Constructs an instance of <code>ElementTreeSelectionDialog</code>.
+ *
+ * @param parent
+ * The shell to parent from.
+ * @param labelProvider
+ * the label provider to render the entries
+ * @param contentProvider
+ * the content provider to evaluate the tree structure
+ */
+ public CustomCheckedTreeSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider, int style) {
+ super(parent);
+ fLabelProvider = labelProvider;
+ fContentProvider = contentProvider;
+ setResult(new ArrayList(0));
+ setStatusLineAboveButtons(true);
+ fContainerMode = false;
+ fExpandedElements = null;
+ this.fStyle = style;
+ }
+
+ /**
+ * If set, the checked /gray state of containers (inner nodes) is derived
+ * from the checked state of its leaf nodes.
+ *
+ * @param containerMode
+ * The containerMode to set
+ */
+ public void setContainerMode(boolean containerMode) {
+ fContainerMode = containerMode;
+ }
+
+ /**
+ * Sets the initial selection. Convenience method.
+ *
+ * @param selection
+ * the initial selection.
+ */
+ public void setInitialSelection(Object selection) {
+ setInitialSelections(new Object[]{ selection });
+ }
+
+ /**
+ * Sets the message to be displayed if the list is empty.
+ *
+ * @param message
+ * the message to be displayed.
+ */
+ public void setEmptyListMessage(String message) {
+ fEmptyListMessage = message;
+ }
+
+ /**
+ * Sets the sorter used by the tree viewer.
+ *
+ * @param sorter
+ * @deprecated since 3.3, use {@link CustomCheckedTreeSelectionDialog#setComparator(ViewerComparator)} instead
+ */
+ @Deprecated
+ public void setSorter(ViewerSorter sorter) {
+ fComparator = sorter;
+ }
+
+ /**
+ * Sets the comparator used by the tree viewer.
+ *
+ * @param comparator
+ * @since 3.3
+ */
+ public void setComparator(ViewerComparator comparator) {
+ fComparator = comparator;
+ }
+
+ /**
+ * Adds a filter to the tree viewer.
+ *
+ * @param filter
+ * a filter.
+ */
+ public void addFilter(ViewerFilter filter) {
+ if(fFilters == null) {
+ fFilters = new ArrayList(4);
+ }
+ fFilters.add(filter);
+ }
+
+ /**
+ * Sets an optional validator to check if the selection is valid. The
+ * validator is invoked whenever the selection changes.
+ *
+ * @param validator
+ * the validator to validate the selection.
+ */
+ public void setValidator(ISelectionStatusValidator validator) {
+ fValidator = validator;
+ }
+
+ /**
+ * Sets the tree input.
+ *
+ * @param input
+ * the tree input.
+ */
+ public void setInput(Object input) {
+ fInput = input;
+ }
+
+ /**
+ * Expands elements in the tree.
+ *
+ * @param elements
+ * The elements that will be expanded.
+ */
+ public void setExpandedElements(Object[] elements) {
+ fExpandedElements = elements;
+ }
+
+ /**
+ * Sets the size of the tree in unit of characters.
+ *
+ * @param width
+ * the width of the tree.
+ * @param height
+ * the height of the tree.
+ */
+ public void setSize(int width, int height) {
+ fWidth = width;
+ fHeight = height;
+ }
+
+ /**
+ * Validate the receiver and update the status with the result.
+ *
+ */
+ protected void updateOKStatus() {
+ if(!fIsEmpty) {
+ if(fValidator != null) {
+ fCurrStatus = fValidator.validate(fViewer.getCheckedElements());
+ updateStatus(fCurrStatus);
+ } else if(!fCurrStatus.isOK()) {
+ fCurrStatus = new Status(IStatus.OK, PlatformUI.PLUGIN_ID, IStatus.OK, "", //$NON-NLS-1$
+ null);
+ }
+ } else {
+ fCurrStatus = new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, IStatus.OK, fEmptyListMessage, null);
+ }
+ updateStatus(fCurrStatus);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.window.Window#open()
+ */
+ @Override
+ public int open() {
+ fIsEmpty = evaluateIfTreeEmpty(fInput);
+ super.open();
+ return getReturnCode();
+ }
+
+ private void access$superCreate() {
+ super.create();
+ }
+
+ /**
+ * Handles cancel button pressed event.
+ */
+ @Override
+ protected void cancelPressed() {
+ setResult(null);
+ super.cancelPressed();
+ }
+
+ /*
+ * @see SelectionStatusDialog#computeResult()
+ */
+ @Override
+ protected void computeResult() {
+ setResult(Arrays.asList(fViewer.getCheckedElements()));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.window.Window#create()
+ */
+ @Override
+ public void create() {
+ BusyIndicator.showWhile(null, new Runnable() {
+
+ public void run() {
+ access$superCreate();
+ fViewer.setCheckedElements(getInitialElementSelections().toArray());
+ if(fExpandedElements != null) {
+ fViewer.setExpandedElements(fExpandedElements);
+ }
+ updateOKStatus();
+ }
+ });
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
+ * .Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = (Composite)super.createDialogArea(parent);
+ Label messageLabel = createMessageArea(composite);
+ CheckboxTreeViewer treeViewer = createTreeViewer(composite);
+ Control buttonComposite = createSelectionButtons(composite);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = convertWidthInCharsToPixels(fWidth);
+ data.heightHint = convertHeightInCharsToPixels(fHeight);
+ Tree treeWidget = treeViewer.getTree();
+ treeWidget.setLayoutData(data);
+ treeWidget.setFont(parent.getFont());
+ if(fIsEmpty) {
+ messageLabel.setEnabled(false);
+ treeWidget.setEnabled(false);
+ buttonComposite.setEnabled(false);
+ }
+ return composite;
+ }
+
+ /**
+ * Creates the tree viewer.
+ *
+ * @param parent
+ * the parent composite
+ * @return the tree viewer
+ */
+ protected CheckboxTreeViewer createTreeViewer(Composite parent) {
+ if(fContainerMode) {
+ fViewer = new ContainerCheckedTreeViewer(parent, this.fStyle);
+ } else {
+ fViewer = new CheckboxTreeViewer(parent, this.fStyle);
+ }
+ fViewer.setContentProvider(fContentProvider);
+ fViewer.setLabelProvider(fLabelProvider);
+ fViewer.addCheckStateListener(new ICheckStateListener() {
+
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ updateOKStatus();
+ }
+ });
+ fViewer.setComparator(fComparator);
+ if(fFilters != null) {
+ for(int i = 0; i != fFilters.size(); i++) {
+ fViewer.addFilter((ViewerFilter)fFilters.get(i));
+ }
+ }
+ fViewer.setInput(fInput);
+ return fViewer;
+ }
+
+ /**
+ * Returns the tree viewer.
+ *
+ * @return the tree viewer
+ */
+ protected CheckboxTreeViewer getTreeViewer() {
+ return fViewer;
+ }
+
+ /**
+ * Adds the selection and deselection buttons to the dialog.
+ *
+ * @param composite
+ * the parent composite
+ * @return Composite the composite the buttons were created in.
+ */
+ protected Composite createSelectionButtons(Composite composite) {
+ Composite buttonComposite = new Composite(composite, SWT.RIGHT);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 0;
+ layout.marginWidth = 0;
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+ buttonComposite.setLayout(layout);
+ buttonComposite.setFont(composite.getFont());
+ GridData data = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL);
+ data.grabExcessHorizontalSpace = true;
+ buttonComposite.setLayoutData(data);
+ Button selectButton = createButton(buttonComposite, IDialogConstants.SELECT_ALL_ID, WorkbenchMessages.CheckedTreeSelectionDialog_select_all, false);
+ SelectionListener listener = new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Object[] viewerElements = fContentProvider.getElements(fInput);
+ if(fContainerMode) {
+ fViewer.setCheckedElements(viewerElements);
+ } else {
+ for(int i = 0; i < viewerElements.length; i++) {
+ fViewer.setSubtreeChecked(viewerElements[i], true);
+ }
+ }
+ updateOKStatus();
+ }
+ };
+ selectButton.addSelectionListener(listener);
+ Button deselectButton = createButton(buttonComposite, IDialogConstants.DESELECT_ALL_ID, WorkbenchMessages.CheckedTreeSelectionDialog_deselect_all, false);
+ listener = new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ fViewer.setCheckedElements(new Object[0]);
+ updateOKStatus();
+ }
+ };
+ deselectButton.addSelectionListener(listener);
+ return buttonComposite;
+ }
+
+ protected boolean evaluateIfTreeEmpty(Object input) {
+ Object[] elements = fContentProvider.getElements(input);
+ if(elements.length > 0) {
+ if(fFilters != null) {
+ for(int i = 0; i < fFilters.size(); i++) {
+ ViewerFilter curr = (ViewerFilter)fFilters.get(i);
+ elements = curr.filter(fViewer, input, elements);
+ }
+ }
+ }
+ return elements.length == 0;
+ }
+
+ /**
+ * Returns the label provider used by this dialog
+ *
+ * @return the label provider used by this dialog
+ */
+ public ILabelProvider getLabelProvider() {
+ return fLabelProvider;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/FigureControler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/FigureControler.java
index b84d24dcea4..1f2af7815db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/FigureControler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/FigureControler.java
@@ -1,65 +1,65 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.directedit;
-
-import org.eclipse.draw2d.IFigure;
-
-/**
- * A figure controler is used to associate a IFigure to model properties in a
- * lightweight way.
- */
-public class FigureControler implements ILabelControler {
-
- /**
- *
- */
- private IFigure figure;
-
- /**
- *
- */
- private PropertyAccessor propertyAccessor;
-
- /**
- * Creates a new FigureControler.
- *
- * @param figure
- * the figure to be associated
- * @param propertyAccessor
- * the accessor for the properties associated to the figure.
- */
- public FigureControler(IFigure figure, PropertyAccessor propertyAccessor) {
- this.figure = figure;
- this.propertyAccessor = propertyAccessor;
- }
-
- /**
- *
- *
- * @return
- */
- public IFigure getLabel() {
- return figure;
- }
-
- /**
- *
- *
- * @return
- */
- public PropertyAccessor getPropertyAccessor() {
- return propertyAccessor;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.directedit;
+
+import org.eclipse.draw2d.IFigure;
+
+/**
+ * A figure controler is used to associate a IFigure to model properties in a
+ * lightweight way.
+ */
+public class FigureControler implements ILabelControler {
+
+ /**
+ *
+ */
+ private IFigure figure;
+
+ /**
+ *
+ */
+ private PropertyAccessor propertyAccessor;
+
+ /**
+ * Creates a new FigureControler.
+ *
+ * @param figure
+ * the figure to be associated
+ * @param propertyAccessor
+ * the accessor for the properties associated to the figure.
+ */
+ public FigureControler(IFigure figure, PropertyAccessor propertyAccessor) {
+ this.figure = figure;
+ this.propertyAccessor = propertyAccessor;
+ }
+
+ /**
+ *
+ *
+ * @return
+ */
+ public IFigure getLabel() {
+ return figure;
+ }
+
+ /**
+ *
+ *
+ * @return
+ */
+ public PropertyAccessor getPropertyAccessor() {
+ return propertyAccessor;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/ILabelControler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/ILabelControler.java
index 3bf467827c6..8cb911747b5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/ILabelControler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/ILabelControler.java
@@ -1,38 +1,38 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.directedit;
-
-import org.eclipse.draw2d.IFigure;
-
-/**
- * Interface for a controler that is used to associate a IFigure to model
- * properties in a lightweight way.
- */
-public interface ILabelControler {
-
- /**
- * Returns the figure associated to this FigureControler.
- *
- * @return the figure associated to this FigureControler
- */
- public abstract IFigure getLabel();
-
- /**
- * Returns the accessors associated to this FigureControler.
- *
- * @return the accessors associated to this FigureControler
- */
- public abstract PropertyAccessor getPropertyAccessor();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.directedit;
+
+import org.eclipse.draw2d.IFigure;
+
+/**
+ * Interface for a controler that is used to associate a IFigure to model
+ * properties in a lightweight way.
+ */
+public interface ILabelControler {
+
+ /**
+ * Returns the figure associated to this FigureControler.
+ *
+ * @return the figure associated to this FigureControler
+ */
+ public abstract IFigure getLabel();
+
+ /**
+ * Returns the accessors associated to this FigureControler.
+ *
+ * @return the accessors associated to this FigureControler
+ */
+ public abstract PropertyAccessor getPropertyAccessor();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/IPropertyAccessor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/IPropertyAccessor.java
index 5a2200407e8..e4edb3c6f4d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/IPropertyAccessor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/IPropertyAccessor.java
@@ -1,44 +1,44 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.directedit;
-
-/**
- * Interface used to encapsulate access to a property of the model.
- */
-public interface IPropertyAccessor {
-
- /**
- * Returns the name of the accessed property.
- *
- * @return the name of the accessed property
- */
- // @unused
- public abstract String getPropertyName();
-
- /**
- * Set the new value opf the property.
- *
- * @param value
- * the new value of the property
- */
- // @unused
- public abstract void setValue(String value);
-
- /**
- * Returns the current value of the accessed property.
- *
- * @return the current value of the accessed property
- */
- public abstract String getValue();
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.directedit;
+
+/**
+ * Interface used to encapsulate access to a property of the model.
+ */
+public interface IPropertyAccessor {
+
+ /**
+ * Returns the name of the accessed property.
+ *
+ * @return the name of the accessed property
+ */
+ // @unused
+ public abstract String getPropertyName();
+
+ /**
+ * Set the new value opf the property.
+ *
+ * @param value
+ * the new value of the property
+ */
+ // @unused
+ public abstract void setValue(String value);
+
+ /**
+ * Returns the current value of the accessed property.
+ *
+ * @return the current value of the accessed property
+ */
+ public abstract String getValue();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/LabelDirectEditManager.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/LabelDirectEditManager.java
index e48d642e653..ca0b0dd9d3c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/LabelDirectEditManager.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/LabelDirectEditManager.java
@@ -1,183 +1,183 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.directedit;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.part.CellEditorActionHandler;
-
-/**
- * DirectEdit manager for label managed by a LabelControlerManager. It is
- * intended to be used in conjunction with LabelDirectEditPolicy and
- * LabelControler.
- */
-public class LabelDirectEditManager extends DirectEditManager {
-
- /**
- *
- */
- protected IActionBars actionBars;
-
- /**
- *
- */
- protected CellEditorActionHandler actionHandler;
-
- /**
- *
- */
- protected IAction copy, cut, paste, undo, redo, find, selectAll, delete;
-
- /**
- * The label to be edited.
- */
- protected ILabelControler labelCtrl;
-
- /**
- * Constructor.
- *
- * @param locator
- * @param labelCtrl
- * The label to edit
- * @param source
- * The EditPart owning the label.
- */
- public LabelDirectEditManager(GraphicalEditPart source, CellEditorLocator locator, ILabelControler labelCtrl) {
- super(source, null, locator);
- this.labelCtrl = labelCtrl;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.DirectEditManager#bringDown()
- */
- /**
- *
- */
- @Override
- protected void bringDown() {
- if(actionHandler != null) {
- actionHandler.dispose();
- actionHandler = null;
- }
- if(actionBars != null) {
- restoreSavedActions(actionBars);
- actionBars.updateActionBars();
- actionBars = null;
- }
- super.bringDown();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gef.tools.DirectEditManager#createCellEditorOn(org.eclipse
- * .swt.widgets.Composite)
- */
- /**
- *
- *
- * @param composite
- *
- * @return
- */
- @Override
- protected CellEditor createCellEditorOn(Composite composite) {
- return new TextCellEditor(composite, SWT.CENTER);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.tools.DirectEditManager#createDirectEditRequest()
- */
- /**
- *
- *
- * @return
- */
- @Override
- protected DirectEditRequest createDirectEditRequest() {
- DirectEditRequest req = new DirectEditRequest();
- req.setCellEditor(getCellEditor());
- // Register the concerned label in the request.
- req.setDirectEditFeature(labelCtrl);
- return req;
- }
-
- /**
- * Init the cell editor with the current value of the edited label.
- */
- @Override
- protected void initCellEditor() {
-
- // set initial value for the cell editor
- getCellEditor().setValue(labelCtrl.getPropertyAccessor().getValue());
- getCellEditor().getControl().setFont(labelCtrl.getLabel().getFont());
-
- // Hook the cell editor's copy/paste actions to the actionBars so that
- // they can
- // be invoked via keyboard shortcuts.
- actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars();
- saveCurrentActions(actionBars);
- actionHandler = new CellEditorActionHandler(actionBars);
- actionHandler.addCellEditor(getCellEditor());
- actionBars.updateActionBars();
- }
-
- /**
- *
- *
- * @param actionBars
- */
- private void restoreSavedActions(IActionBars actionBars) {
- actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
- actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
- actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
- actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
- actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
- actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
- actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
- actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
- }
-
- /**
- *
- *
- * @param actionBars
- */
- private void saveCurrentActions(IActionBars actionBars) {
- copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
- paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
- delete = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
- selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
- cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
- find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
- undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
- redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.directedit;
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.part.CellEditorActionHandler;
+
+/**
+ * DirectEdit manager for label managed by a LabelControlerManager. It is
+ * intended to be used in conjunction with LabelDirectEditPolicy and
+ * LabelControler.
+ */
+public class LabelDirectEditManager extends DirectEditManager {
+
+ /**
+ *
+ */
+ protected IActionBars actionBars;
+
+ /**
+ *
+ */
+ protected CellEditorActionHandler actionHandler;
+
+ /**
+ *
+ */
+ protected IAction copy, cut, paste, undo, redo, find, selectAll, delete;
+
+ /**
+ * The label to be edited.
+ */
+ protected ILabelControler labelCtrl;
+
+ /**
+ * Constructor.
+ *
+ * @param locator
+ * @param labelCtrl
+ * The label to edit
+ * @param source
+ * The EditPart owning the label.
+ */
+ public LabelDirectEditManager(GraphicalEditPart source, CellEditorLocator locator, ILabelControler labelCtrl) {
+ super(source, null, locator);
+ this.labelCtrl = labelCtrl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.tools.DirectEditManager#bringDown()
+ */
+ /**
+ *
+ */
+ @Override
+ protected void bringDown() {
+ if(actionHandler != null) {
+ actionHandler.dispose();
+ actionHandler = null;
+ }
+ if(actionBars != null) {
+ restoreSavedActions(actionBars);
+ actionBars.updateActionBars();
+ actionBars = null;
+ }
+ super.bringDown();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gef.tools.DirectEditManager#createCellEditorOn(org.eclipse
+ * .swt.widgets.Composite)
+ */
+ /**
+ *
+ *
+ * @param composite
+ *
+ * @return
+ */
+ @Override
+ protected CellEditor createCellEditorOn(Composite composite) {
+ return new TextCellEditor(composite, SWT.CENTER);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gef.tools.DirectEditManager#createDirectEditRequest()
+ */
+ /**
+ *
+ *
+ * @return
+ */
+ @Override
+ protected DirectEditRequest createDirectEditRequest() {
+ DirectEditRequest req = new DirectEditRequest();
+ req.setCellEditor(getCellEditor());
+ // Register the concerned label in the request.
+ req.setDirectEditFeature(labelCtrl);
+ return req;
+ }
+
+ /**
+ * Init the cell editor with the current value of the edited label.
+ */
+ @Override
+ protected void initCellEditor() {
+
+ // set initial value for the cell editor
+ getCellEditor().setValue(labelCtrl.getPropertyAccessor().getValue());
+ getCellEditor().getControl().setFont(labelCtrl.getLabel().getFont());
+
+ // Hook the cell editor's copy/paste actions to the actionBars so that
+ // they can
+ // be invoked via keyboard shortcuts.
+ actionBars = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor().getEditorSite().getActionBars();
+ saveCurrentActions(actionBars);
+ actionHandler = new CellEditorActionHandler(actionBars);
+ actionHandler.addCellEditor(getCellEditor());
+ actionBars.updateActionBars();
+ }
+
+ /**
+ *
+ *
+ * @param actionBars
+ */
+ private void restoreSavedActions(IActionBars actionBars) {
+ actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
+ actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
+ actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
+ actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
+ actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
+ actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
+ actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
+ actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
+ }
+
+ /**
+ *
+ *
+ * @param actionBars
+ */
+ private void saveCurrentActions(IActionBars actionBars) {
+ copy = actionBars.getGlobalActionHandler(ActionFactory.COPY.getId());
+ paste = actionBars.getGlobalActionHandler(ActionFactory.PASTE.getId());
+ delete = actionBars.getGlobalActionHandler(ActionFactory.DELETE.getId());
+ selectAll = actionBars.getGlobalActionHandler(ActionFactory.SELECT_ALL.getId());
+ cut = actionBars.getGlobalActionHandler(ActionFactory.CUT.getId());
+ find = actionBars.getGlobalActionHandler(ActionFactory.FIND.getId());
+ undo = actionBars.getGlobalActionHandler(ActionFactory.UNDO.getId());
+ redo = actionBars.getGlobalActionHandler(ActionFactory.REDO.getId());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultiLineCellEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultiLineCellEditor.java
index 97a03b9de1f..e3d2c42507a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultiLineCellEditor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultiLineCellEditor.java
@@ -1,21 +1,21 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.directedit;
-
-import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
-
-/**
- * Specific cell editor for multiline figures.
- */
-public class MultiLineCellEditor extends TextCellEditorEx {
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.directedit;
+
+import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
+
+/**
+ * Specific cell editor for multiline figures.
+ */
+public class MultiLineCellEditor extends TextCellEditorEx {
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultilineLabelDirectEditManager.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultilineLabelDirectEditManager.java
index 502ce87c1bc..20723e2a44a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultilineLabelDirectEditManager.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/MultilineLabelDirectEditManager.java
@@ -1,84 +1,84 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.directedit;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DirectEdit manager for multi lines label managed by a LabelControlerManager.
- * It is intended to be used in conjunction with LabelDirectEditPolicy and
- * LabelControler.
- */
-public class MultilineLabelDirectEditManager extends TextDirectEditManager {
-
- protected boolean multiLine = false;
-
- /**
- * Constructor.
- *
- * @param source
- * @param editorType
- * @param locator
- */
- @SuppressWarnings("unchecked")
- public MultilineLabelDirectEditManager(GraphicalEditPart source, Class editorType, CellEditorLocator locator) {
- super(source, editorType, locator);
- if(editorType != null && MultiLineCellEditor.class.isAssignableFrom(editorType)) {
- multiLine = true;
- }
-
- }
-
- /**
- * @param source
- * the <code>GraphicalEditPart</code> that is used to determine
- * which <code>CellEditor</code> class to use.
- * @return the <code>Class</code> of the <code>CellEditor</code> to use for
- * the text editing.
- */
- public static Class getTextCellEditorClass(GraphicalEditPart source) {
- IFigure figure = source.getFigure();
-
- if(figure instanceof IMultilineEditableFigure) {
- return MultiLineCellEditor.class;
- } else {
- return TextDirectEditManager.getTextCellEditorClass(source);
- }
- }
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager#createCellEditorOn(org.eclipse.swt.widgets.Composite)
- *
- * @param composite
- * the editor on which to create the direct editor
- * @return the cell editor
- */
- @Override
- protected CellEditor createCellEditorOn(Composite composite) {
- if(multiLine) {
- // creates a new TextCell Editor, but with multiline support
- return new TextCellEditor(composite, SWT.MULTI | SWT.WRAP);
- }
- return super.createCellEditorOn(composite);
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.directedit;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * DirectEdit manager for multi lines label managed by a LabelControlerManager.
+ * It is intended to be used in conjunction with LabelDirectEditPolicy and
+ * LabelControler.
+ */
+public class MultilineLabelDirectEditManager extends TextDirectEditManager {
+
+ protected boolean multiLine = false;
+
+ /**
+ * Constructor.
+ *
+ * @param source
+ * @param editorType
+ * @param locator
+ */
+ @SuppressWarnings("unchecked")
+ public MultilineLabelDirectEditManager(GraphicalEditPart source, Class editorType, CellEditorLocator locator) {
+ super(source, editorType, locator);
+ if(editorType != null && MultiLineCellEditor.class.isAssignableFrom(editorType)) {
+ multiLine = true;
+ }
+
+ }
+
+ /**
+ * @param source
+ * the <code>GraphicalEditPart</code> that is used to determine
+ * which <code>CellEditor</code> class to use.
+ * @return the <code>Class</code> of the <code>CellEditor</code> to use for
+ * the text editing.
+ */
+ public static Class getTextCellEditorClass(GraphicalEditPart source) {
+ IFigure figure = source.getFigure();
+
+ if(figure instanceof IMultilineEditableFigure) {
+ return MultiLineCellEditor.class;
+ } else {
+ return TextDirectEditManager.getTextCellEditorClass(source);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager#createCellEditorOn(org.eclipse.swt.widgets.Composite)
+ *
+ * @param composite
+ * the editor on which to create the direct editor
+ * @return the cell editor
+ */
+ @Override
+ protected CellEditor createCellEditorOn(Composite composite) {
+ if(multiLine) {
+ // creates a new TextCell Editor, but with multiline support
+ return new TextCellEditor(composite, SWT.MULTI | SWT.WRAP);
+ }
+ return super.createCellEditorOn(composite);
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/PropertyAccessor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/PropertyAccessor.java
index 0705f568dda..07cecdf6036 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/PropertyAccessor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/PropertyAccessor.java
@@ -1,63 +1,63 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.directedit;
-
-
-/**
- * Default implementation for the interface IPropertyAccessor.
- */
-public abstract class PropertyAccessor implements IPropertyAccessor {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.core.common.directedit.IPropertyAccessor#getPropertyName
- * ()
- */
- /**
- *
- *
- * @return
- */
- public String getPropertyName() {
- return "";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.cea.papyrus.core.common.directedit.IPropertyAccessor#getValue()
- */
- /**
- *
- *
- * @return
- */
- public abstract String getValue();
-
- /*
- * (non-Javadoc)
- *
- * @see
- * com.cea.papyrus.core.common.directedit.IPropertyAccessor#setValue(java
- * .lang.String)
- */
- /**
- *
- *
- * @param value
- */
- public abstract void setValue(String value);
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.directedit;
+
+
+/**
+ * Default implementation for the interface IPropertyAccessor.
+ */
+public abstract class PropertyAccessor implements IPropertyAccessor {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.cea.papyrus.core.common.directedit.IPropertyAccessor#getPropertyName
+ * ()
+ */
+ /**
+ *
+ *
+ * @return
+ */
+ public String getPropertyName() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.cea.papyrus.core.common.directedit.IPropertyAccessor#getValue()
+ */
+ /**
+ *
+ *
+ * @return
+ */
+ public abstract String getValue();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.cea.papyrus.core.common.directedit.IPropertyAccessor#setValue(java
+ * .lang.String)
+ */
+ /**
+ *
+ *
+ * @param value
+ */
+ public abstract void setValue(String value);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/TextFlowCellEditorLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/TextFlowCellEditorLocator.java
index b36e3088b8a..ae7b6a0fbef 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/TextFlowCellEditorLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/directedit/TextFlowCellEditorLocator.java
@@ -1,71 +1,71 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.directedit;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.draw2d.text.TextFlow;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Locator of a cell editor for a Text Flow.
- */
-final public class TextFlowCellEditorLocator implements CellEditorLocator {
-
- /**
- * textflow to be edited.
- */
- private final TextFlow figureToEdit;
-
- /**
- * Creates a new TextFlowCellEditorLocator.
- *
- * @param figureToEdit
- * The textflow to be edited.
- */
- // @unused
- public TextFlowCellEditorLocator(TextFlow figureToEdit) {
- this.figureToEdit = figureToEdit;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gef.tools.CellEditorLocator#relocate(org.eclipse.jface.viewers
- * .CellEditor)
- */
- /**
- *
- *
- * @param celleditor
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Point pref = text.computeSize(-1, -1);
- Rectangle rect = figureToEdit.getClientArea();
- figureToEdit.translateToAbsolute(rect);
-
- // add one more line to the bounds, so carriage return is taken into
- // account.
- // if the line is not added, pressing enter with nothing after the
- // cursor
- // makes the text scrolling, as a carriage return is not taken into the
- // original bounds.
- text.setBounds(rect.x - 4, rect.y - 1, pref.x + 1, pref.y + 1 + text.getLineHeight());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.directedit;
+
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.draw2d.text.TextFlow;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Locator of a cell editor for a Text Flow.
+ */
+final public class TextFlowCellEditorLocator implements CellEditorLocator {
+
+ /**
+ * textflow to be edited.
+ */
+ private final TextFlow figureToEdit;
+
+ /**
+ * Creates a new TextFlowCellEditorLocator.
+ *
+ * @param figureToEdit
+ * The textflow to be edited.
+ */
+ // @unused
+ public TextFlowCellEditorLocator(TextFlow figureToEdit) {
+ this.figureToEdit = figureToEdit;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gef.tools.CellEditorLocator#relocate(org.eclipse.jface.viewers
+ * .CellEditor)
+ */
+ /**
+ *
+ *
+ * @param celleditor
+ */
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Point pref = text.computeSize(-1, -1);
+ Rectangle rect = figureToEdit.getClientArea();
+ figureToEdit.translateToAbsolute(rect);
+
+ // add one more line to the bounds, so carriage return is taken into
+ // account.
+ // if the line is not added, pressing enter with nothing after the
+ // cursor
+ // makes the text scrolling, as a carriage return is not taken into the
+ // original bounds.
+ text.setBounds(rect.x - 4, rect.y - 1, pref.x + 1, pref.y + 1 + text.getLineHeight());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollDragEditPartsTrackerEx.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollDragEditPartsTrackerEx.java
index 0473e78f2b1..8e75483fbcd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollDragEditPartsTrackerEx.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollDragEditPartsTrackerEx.java
@@ -1,101 +1,101 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.dragtracker;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-/**
- * this tracker is used to prevent the move of a figure outdoor of its container
- *
- */
-public class NoScrollDragEditPartsTrackerEx extends DragEditPartsTrackerEx{
-
- /** border size */
- private int border = 15; // default size : 10
-
- public NoScrollDragEditPartsTrackerEx(EditPart sourceEditPart) {
- super(sourceEditPart);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void updateTargetRequest() {
-
- super.updateTargetRequest();
- Dimension delta = getDragMoveDelta();
-
- if( getSourceEditPart() instanceof GraphicalEditPart){
- Rectangle childRect=((GraphicalEditPart)getSourceEditPart()).getFigure().getBounds();
- if( getSourceEditPart().getParent() instanceof GraphicalEditPart){
- Rectangle parentRect= ((GraphicalEditPart) getSourceEditPart().getParent()).getFigure().getBounds();
- IFigure fig=((GraphicalEditPart) getSourceEditPart().getParent()).getFigure();
-
- IFigure contentPane=((GraphicalEditPart) getSourceEditPart().getParent()).getContentPane();
-
- //calculate the virtual position
- Rectangle virtualPosition= childRect.getCopy();
- virtualPosition.x=virtualPosition.x+delta.width;
- virtualPosition.y=virtualPosition.y+delta.height;
-
- if( virtualPosition.x<0){
- delta.width=0-childRect.x;
- }
- if( virtualPosition.y<0){
- delta.height=0-childRect.y;
- }
-
- if( virtualPosition.x+virtualPosition.width+getBorder()>parentRect.width){
- delta.width=parentRect.width-childRect.width-childRect.x-getBorder();
- }
-
- if( virtualPosition.y+virtualPosition.height+2*getBorder()>parentRect.height){
- delta.height=parentRect.height-childRect.height-childRect.y-2*getBorder();
- }
- ChangeBoundsRequest request = (ChangeBoundsRequest) getTargetRequest();
- Point moveDelta = new Point(delta.width, delta.height);
- request.setMoveDelta(moveDelta);
-
- //Very important the child element to block inside the container
- //if not test first the target editPart.
- // let the default algorithm if the target is not its parent.
- setTargetEditPart(getSourceEditPart().getParent());
- }
- }
- }
-
- /**
- * Returns the border size
- * @return the border size
- */
- protected int getBorder() {
- return this.border;
- }
-
- /**
- * Sets the border size
- * @param border the new border size
- */
- protected void setBorder(int border) {
- this.border = border;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dragtracker;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+/**
+ * this tracker is used to prevent the move of a figure outdoor of its container
+ *
+ */
+public class NoScrollDragEditPartsTrackerEx extends DragEditPartsTrackerEx{
+
+ /** border size */
+ private int border = 15; // default size : 10
+
+ public NoScrollDragEditPartsTrackerEx(EditPart sourceEditPart) {
+ super(sourceEditPart);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void updateTargetRequest() {
+
+ super.updateTargetRequest();
+ Dimension delta = getDragMoveDelta();
+
+ if( getSourceEditPart() instanceof GraphicalEditPart){
+ Rectangle childRect=((GraphicalEditPart)getSourceEditPart()).getFigure().getBounds();
+ if( getSourceEditPart().getParent() instanceof GraphicalEditPart){
+ Rectangle parentRect= ((GraphicalEditPart) getSourceEditPart().getParent()).getFigure().getBounds();
+ IFigure fig=((GraphicalEditPart) getSourceEditPart().getParent()).getFigure();
+
+ IFigure contentPane=((GraphicalEditPart) getSourceEditPart().getParent()).getContentPane();
+
+ //calculate the virtual position
+ Rectangle virtualPosition= childRect.getCopy();
+ virtualPosition.x=virtualPosition.x+delta.width;
+ virtualPosition.y=virtualPosition.y+delta.height;
+
+ if( virtualPosition.x<0){
+ delta.width=0-childRect.x;
+ }
+ if( virtualPosition.y<0){
+ delta.height=0-childRect.y;
+ }
+
+ if( virtualPosition.x+virtualPosition.width+getBorder()>parentRect.width){
+ delta.width=parentRect.width-childRect.width-childRect.x-getBorder();
+ }
+
+ if( virtualPosition.y+virtualPosition.height+2*getBorder()>parentRect.height){
+ delta.height=parentRect.height-childRect.height-childRect.y-2*getBorder();
+ }
+ ChangeBoundsRequest request = (ChangeBoundsRequest) getTargetRequest();
+ Point moveDelta = new Point(delta.width, delta.height);
+ request.setMoveDelta(moveDelta);
+
+ //Very important the child element to block inside the container
+ //if not test first the target editPart.
+ // let the default algorithm if the target is not its parent.
+ setTargetEditPart(getSourceEditPart().getParent());
+ }
+ }
+ }
+
+ /**
+ * Returns the border size
+ * @return the border size
+ */
+ protected int getBorder() {
+ return this.border;
+ }
+
+ /**
+ * Sets the border size
+ * @param border the new border size
+ */
+ protected void setBorder(int border) {
+ this.border = border;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollResizeTracker.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollResizeTracker.java
index ae1ffe559c1..94005c19864 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollResizeTracker.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/dragtracker/NoScrollResizeTracker.java
@@ -1,75 +1,75 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.dragtracker;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.tools.ResizeTracker;
-
-/**
- * this tracker is used to prevent the resize of a figure outdoor of its container
- *
- */
-public class NoScrollResizeTracker extends ResizeTracker {
-
- public NoScrollResizeTracker(GraphicalEditPart owner, int direction) {
- super(owner, direction);
- }
- @Override
- protected void updateSourceRequest() {
- int BORDER=10;
- super.updateSourceRequest();
- ChangeBoundsRequest request = (ChangeBoundsRequest) getSourceRequest();
- Dimension deltaResize= request.getSizeDelta();
- Point delta= request.getMoveDelta();
-
- if( getOwner() instanceof GraphicalEditPart){
- Rectangle childRect=((GraphicalEditPart)getOwner()).getFigure().getBounds();
- if( getOwner().getParent() instanceof GraphicalEditPart){
- Rectangle parentRect= ((GraphicalEditPart) getOwner().getParent()).getFigure().getBounds();
-
- //calculus the virtual position
- Rectangle virtualPosition= childRect.getCopy();
- virtualPosition.x=virtualPosition.x+delta.x;
- virtualPosition.y=virtualPosition.y+delta.y;
- virtualPosition.width=virtualPosition.width+deltaResize.width;
- virtualPosition.height=virtualPosition.height+deltaResize.height;
-
-
- if( virtualPosition.x<0){
- delta.x=0-childRect.x;
- deltaResize.width=Math.abs(delta.x);
-
- }
- if( virtualPosition.y<0){
- delta.y=0-childRect.y;
- deltaResize.height=Math.abs(delta.y);
-
- }
- if( virtualPosition.getBottomRight().x>parentRect.width-BORDER){
- deltaResize.width=parentRect.width-childRect.getBottomRight().x-BORDER;
- }
- if(virtualPosition.getBottomRight().y>parentRect.height-2*BORDER){
- deltaResize.height=parentRect.height-childRect.getBottomRight().y-2*BORDER;
- }
-
- request.setMoveDelta(delta);
- }
- }
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.dragtracker;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.tools.ResizeTracker;
+
+/**
+ * this tracker is used to prevent the resize of a figure outdoor of its container
+ *
+ */
+public class NoScrollResizeTracker extends ResizeTracker {
+
+ public NoScrollResizeTracker(GraphicalEditPart owner, int direction) {
+ super(owner, direction);
+ }
+ @Override
+ protected void updateSourceRequest() {
+ int BORDER=10;
+ super.updateSourceRequest();
+ ChangeBoundsRequest request = (ChangeBoundsRequest) getSourceRequest();
+ Dimension deltaResize= request.getSizeDelta();
+ Point delta= request.getMoveDelta();
+
+ if( getOwner() instanceof GraphicalEditPart){
+ Rectangle childRect=((GraphicalEditPart)getOwner()).getFigure().getBounds();
+ if( getOwner().getParent() instanceof GraphicalEditPart){
+ Rectangle parentRect= ((GraphicalEditPart) getOwner().getParent()).getFigure().getBounds();
+
+ //calculus the virtual position
+ Rectangle virtualPosition= childRect.getCopy();
+ virtualPosition.x=virtualPosition.x+delta.x;
+ virtualPosition.y=virtualPosition.y+delta.y;
+ virtualPosition.width=virtualPosition.width+deltaResize.width;
+ virtualPosition.height=virtualPosition.height+deltaResize.height;
+
+
+ if( virtualPosition.x<0){
+ delta.x=0-childRect.x;
+ deltaResize.width=Math.abs(delta.x);
+
+ }
+ if( virtualPosition.y<0){
+ delta.y=0-childRect.y;
+ deltaResize.height=Math.abs(delta.y);
+
+ }
+ if( virtualPosition.getBottomRight().x>parentRect.width-BORDER){
+ deltaResize.width=parentRect.width-childRect.getBottomRight().x-BORDER;
+ }
+ if(virtualPosition.getBottomRight().y>parentRect.height-2*BORDER){
+ deltaResize.height=parentRect.height-childRect.getBottomRight().y-2*BORDER;
+ }
+
+ request.setMoveDelta(delta);
+ }
+ }
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/InteractionFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/InteractionFigure.java
index 854a1c6e53d..dce8dda006b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/InteractionFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/InteractionFigure.java
@@ -1,103 +1,103 @@
-/*******************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat
- * de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram Implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.draw2d;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class InteractionFigure.
- *
- * @author <a href="mailto:gmerin@prodevelop.es">Gabriel Merin</a>
- */
-public class InteractionFigure extends Shape {
-
- /**
- * Fill shape.
- *
- * @param graphics
- * the graphics
- *
- * @see Shape#fillShape(Graphics)
- */
- @Override
- protected void fillShape(Graphics graphics) {
- }
-
- /**
- * Outline shape.
- *
- * @param graphics
- * the graphics
- *
- * @see Shape#outlineShape(Graphics)
- */
- @Override
- protected void outlineShape(Graphics graphics) {
-
- Rectangle r = getBounds();
-
- int labelWidth = -1;
-
- for(Object obj : getChildren()) {
- if(obj instanceof WrappingLabel || obj instanceof WrapLabel) {
- WrappingLabel wLabel = (WrappingLabel)obj;
- labelWidth = wLabel.getPreferredSize().width;
- }
- }
-
- // case the size of the label is 0 or -1 (no label)
- if(labelWidth <= 0)
- labelWidth = r.width / 4;
-
- PointList points = new PointList();
-
- Point verticalStart = new Point();
- Point verticalEnd = new Point();
- Point diagonalStart = new Point();
- Point diagonalEnd = new Point();
- Point horizontalStart = new Point();
- Point horizontalEnd = new Point();
-
- verticalStart.x = r.x + labelWidth + 4;
- verticalStart.y = r.y;
- points.addPoint(verticalStart);
-
- verticalEnd.x = verticalStart.x;
- verticalEnd.y = verticalStart.y + r.height / 2 + 3;
- points.addPoint(verticalEnd);
-
- diagonalStart.x = verticalEnd.x;
- diagonalStart.y = verticalEnd.y;
- points.addPoint(diagonalStart);
-
- diagonalEnd.x = diagonalStart.x - r.height / 2 + 3;
- diagonalEnd.y = r.y + r.height - 1;
- points.addPoint(diagonalEnd);
-
- horizontalStart.x = diagonalEnd.x;
- horizontalStart.y = diagonalEnd.y;
- points.addPoint(horizontalStart);
-
- horizontalEnd.x = r.x;
- horizontalEnd.y = horizontalStart.y;
- points.addPoint(horizontalEnd);
-
- graphics.drawPolyline(points);
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat
+ * de la Comunitat Valenciana . All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram Implementation
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.draw2d;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class InteractionFigure.
+ *
+ * @author <a href="mailto:gmerin@prodevelop.es">Gabriel Merin</a>
+ */
+public class InteractionFigure extends Shape {
+
+ /**
+ * Fill shape.
+ *
+ * @param graphics
+ * the graphics
+ *
+ * @see Shape#fillShape(Graphics)
+ */
+ @Override
+ protected void fillShape(Graphics graphics) {
+ }
+
+ /**
+ * Outline shape.
+ *
+ * @param graphics
+ * the graphics
+ *
+ * @see Shape#outlineShape(Graphics)
+ */
+ @Override
+ protected void outlineShape(Graphics graphics) {
+
+ Rectangle r = getBounds();
+
+ int labelWidth = -1;
+
+ for(Object obj : getChildren()) {
+ if(obj instanceof WrappingLabel || obj instanceof WrapLabel) {
+ WrappingLabel wLabel = (WrappingLabel)obj;
+ labelWidth = wLabel.getPreferredSize().width;
+ }
+ }
+
+ // case the size of the label is 0 or -1 (no label)
+ if(labelWidth <= 0)
+ labelWidth = r.width / 4;
+
+ PointList points = new PointList();
+
+ Point verticalStart = new Point();
+ Point verticalEnd = new Point();
+ Point diagonalStart = new Point();
+ Point diagonalEnd = new Point();
+ Point horizontalStart = new Point();
+ Point horizontalEnd = new Point();
+
+ verticalStart.x = r.x + labelWidth + 4;
+ verticalStart.y = r.y;
+ points.addPoint(verticalStart);
+
+ verticalEnd.x = verticalStart.x;
+ verticalEnd.y = verticalStart.y + r.height / 2 + 3;
+ points.addPoint(verticalEnd);
+
+ diagonalStart.x = verticalEnd.x;
+ diagonalStart.y = verticalEnd.y;
+ points.addPoint(diagonalStart);
+
+ diagonalEnd.x = diagonalStart.x - r.height / 2 + 3;
+ diagonalEnd.y = r.y + r.height - 1;
+ points.addPoint(diagonalEnd);
+
+ horizontalStart.x = diagonalEnd.x;
+ horizontalStart.y = diagonalEnd.y;
+ points.addPoint(horizontalStart);
+
+ horizontalEnd.x = r.x;
+ horizontalEnd.y = horizontalStart.y;
+ points.addPoint(horizontalEnd);
+
+ graphics.drawPolyline(points);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LeftToolbarLayout.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LeftToolbarLayout.java
index 28c02005b1e..75f9465c317 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LeftToolbarLayout.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LeftToolbarLayout.java
@@ -1,497 +1,497 @@
-/*
- *
- */
-package org.eclipse.papyrus.uml.diagram.common.draw2d;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractHintLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.draw2d.geometry.Transposer;
-
-// TODO: Auto-generated Javadoc
-/**
- * Arranges figures in a single row or column. Orientation can be set to produce
- * either a row or column layout. This layout tries to fit all children within
- * the parent's client area. To do this, it compresses the children by some
- * amount, but will not compress them smaller than their minimum size. If a
- * child's preferred size is smaller than the row's or column's minor dimension,
- * the layout can be configured to stretch the child.
- */
-public class LeftToolbarLayout extends AbstractHintLayout {
-
- /** Space in pixels between Figures *. */
- protected int spacing;
-
- /** Sets whether children should "stretch" with their container *. */
- protected boolean matchWidth;
-
- /** Orientation of layout *. */
- protected boolean horizontal = false;
-
- /** Alignment of layout *. */
- protected int minorAlignment;
-
- /** Constant for center alignment *. */
- public static final int ALIGN_CENTER = 0;
-
- /** Constant for top-left alignment *. */
- public static final int ALIGN_TOPLEFT = 1;
-
- /** Constant for bottom-right alignment *. */
- public static final int ALIGN_BOTTOMRIGHT = 2;
-
- /** Constant for horizontal alignment *. */
- // @unused
- public static final boolean HORIZONTAL = true;
-
- /** Constant for vertical alignment *. */
- // @unused
- public static final boolean VERTICAL = false;
-
- /** Transposer object used in layout calculations *. */
- protected Transposer transposer;
- {
- transposer = new Transposer();
- transposer.setEnabled(horizontal);
- }
-
- /**
- * Constructs a vertically oriented ToolbarLayout with child spacing of 0
- * pixels, matchWidth <code>true</code>, and {@link #ALIGN_TOPLEFT} alignment.
- *
- * @since 2.0
- */
- public LeftToolbarLayout() {
- spacing = 0;
- matchWidth = true;
- minorAlignment = ALIGN_TOPLEFT;
- horizontal = false;
- }
-
- /**
- * Constructs a ToolbarLayout with a specified orientation. Default values
- * are: child spacing 0 pixels, matchWidth <code>false</code>, and {@link #ALIGN_TOPLEFT} alignment.
- *
- * @param isHorizontal
- * whether the children are oriented horizontally
- *
- * @since 2.0
- */
- // @unused
- public LeftToolbarLayout(boolean isHorizontal) {
- horizontal = isHorizontal;
- transposer.setEnabled(horizontal);
- spacing = 0;
- matchWidth = false;
- minorAlignment = ALIGN_TOPLEFT;
- }
-
- /**
- * Calculate children size.
- *
- * @param children
- * the children
- * @param wHint
- * the w hint
- * @param hHint
- * the h hint
- * @param preferred
- * the preferred
- *
- * @return the dimension
- */
- private Dimension calculateChildrenSize(List children, int wHint, int hHint, boolean preferred) {
- Dimension childSize;
- IFigure child;
- int height = 0, width = 0;
- for(int i = 0; i < children.size(); i++) {
- child = (IFigure)children.get(i);
- childSize = transposer.t(preferred ? child.getPreferredSize(wHint, hHint) : child.getMinimumSize(wHint, hHint));
- height += childSize.height;
- width = Math.max(width, childSize.width);
- }
- return new Dimension(width, height);
- }
-
- /**
- * Calculates the minimum size of the container based on the given hints. If
- * this is a vertically-oriented Toolbar Layout, then only the widthHint is
- * respected (which means that the children can be as tall as they desire).
- * In this case, the minimum width is that of the widest child, and the
- * minimum height is the sum of the minimum heights of all children, plus
- * the spacing between them. The border and insets of the container figure
- * are also accounted for.
- *
- * @param container
- * the figure whose minimum size has to be calculated
- * @param wHint
- * the width hint (the desired width of the container)
- * @param hHint
- * the height hint (the desired height of the container)
- *
- * @return the minimum size of the container
- *
- * @see #getMinimumSize(IFigure, int, int)
- * @since 2.1
- */
- @Override
- protected Dimension calculateMinimumSize(IFigure container, int wHint, int hHint) {
- Insets insets = container.getInsets();
- if(isHorizontal()) {
- wHint = -1;
- if(hHint >= 0) {
- hHint = Math.max(0, hHint - insets.getHeight());
- }
- } else {
- hHint = -1;
- if(wHint >= 0) {
- wHint = Math.max(0, wHint - insets.getWidth());
- }
- }
-
- List children = container.getChildren();
- Dimension minSize = calculateChildrenSize(children, wHint, hHint, false);
- // Do a second pass, if necessary
- if(wHint >= 0 && minSize.width > wHint) {
- minSize = calculateChildrenSize(children, minSize.width, hHint, false);
- } else if(hHint >= 0 && minSize.width > hHint) {
- minSize = calculateChildrenSize(children, wHint, minSize.width, false);
- }
-
- minSize.height += Math.max(0, children.size() - 1) * spacing;
- return transposer.t(minSize).expand(insets.getWidth(), insets.getHeight()).union(getBorderPreferredSize(container));
- }
-
- /**
- * Calculates the preferred size of the container based on the given hints.
- * If this is a vertically-oriented Toolbar Layout, then only the widthHint
- * is respected (which means that the children can be as tall as they
- * desire). In this case, the preferred width is that of the widest child,
- * and the preferred height is the sum of the preferred heights of all
- * children, plus the spacing between them. The border and insets of the
- * container figure are also accounted for.
- *
- * @param container
- * the figure whose preferred size has to be calculated
- * @param wHint
- * the width hint (the desired width of the container)
- * @param hHint
- * the height hint (the desired height of the container)
- *
- * @return the preferred size of the container
- *
- * @see #getPreferredSize(IFigure, int, int)
- * @since 2.0
- */
- @Override
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
- Insets insets = container.getInsets();
- if(isHorizontal()) {
- wHint = -1;
- if(hHint >= 0) {
- hHint = Math.max(0, hHint - insets.getHeight());
- }
- } else {
- hHint = -1;
- if(wHint >= 0) {
- wHint = Math.max(0, wHint - insets.getWidth());
- }
- }
-
- List children = container.getChildren();
- Dimension prefSize = calculateChildrenSize(children, wHint, hHint, true);
- // Do a second pass, if necessary
- if(wHint >= 0 && prefSize.width > wHint) {
- prefSize = calculateChildrenSize(children, prefSize.width, hHint, true);
- } else if(hHint >= 0 && prefSize.width > hHint) {
- prefSize = calculateChildrenSize(children, wHint, prefSize.width, true);
- }
-
- prefSize.height += Math.max(0, children.size() - 1) * spacing;
- return transposer.t(prefSize).expand(insets.getWidth(), insets.getHeight()).union(getBorderPreferredSize(container));
- }
-
- /**
- * Returns the minor aligment of the layout. Minor minor axis is the axis
- * perpindicular to the overall orientation set in the contructor.
- *
- * @return the minor aligment
- */
- // @unused
- public int getMinorAlignment() {
- return minorAlignment;
- }
-
- /**
- * Gets the spacing.
- *
- * @return the spacing between children
- */
- // @unused
- public int getSpacing() {
- return spacing;
- }
-
- /**
- * Returns <code>true</code> if stretch minor axis has been enabled. The
- * default value is false.
- *
- * @return <code>true</code> if stretch minor axis is enabled
- */
- // @unused
- public boolean getStretchMinorAxis() {
- return matchWidth;
- }
-
- /**
- * Checks if is horizontal.
- *
- * @return whether the orientation of the layout is horizontal
- *
- * @since 2.0
- */
- public boolean isHorizontal() {
- return horizontal;
- }
-
- /**
- * Checks if is sensitive horizontally.
- *
- * @param parent
- * the parent
- *
- * @return true, if checks if is sensitive horizontally
- *
- * @see org.eclipse.draw2d.AbstractHintLayout#isSensitiveHorizontally(IFigure)
- */
- @Override
- protected boolean isSensitiveHorizontally(IFigure parent) {
- return !isHorizontal();
- }
-
- /**
- * Checks if is sensitive vertically.
- *
- * @param parent
- * the parent
- *
- * @return true, if checks if is sensitive vertically
- *
- * @see org.eclipse.draw2d.AbstractHintLayout#isSensitiveVertically(IFigure)
- */
- @Override
- protected boolean isSensitiveVertically(IFigure parent) {
- return isHorizontal();
- }
-
- /**
- * Layout.
- *
- * @param parent
- * the parent
- *
- * @see org.eclipse.draw2d.LayoutManager#layout(IFigure)
- */
- public void layout(IFigure parent) {
- List children = parent.getChildren();
- int numChildren = children.size();
- Rectangle clientArea = transposer.t(parent.getClientArea());
- int x = clientArea.x;
- int y = clientArea.y;
- int availableHeight = clientArea.height;
-
- // parent.setBorder(null);
-
- Dimension prefSizes[] = new Dimension[numChildren];
- Dimension minSizes[] = new Dimension[numChildren];
-
- // Calculate the width and height hints. If it's a vertical
- // ToolBarLayout,
- // then ignore the height hint (set it to -1); otherwise, ignore the
- // width hint. These hints will be passed to the children of the parent
- // figure when getting their preferred size.
- int wHint = -1;
- int hHint = -1;
- if(isHorizontal()) {
- hHint = parent.getClientArea(Rectangle.SINGLETON).height;
- } else {
- wHint = parent.getClientArea(Rectangle.SINGLETON).width;
- }
-
- /*
- * Calculate sum of preferred heights of all children(totalHeight).
- * Calculate sum of minimum heights of all children(minHeight). Cache
- * Preferred Sizes and Minimum Sizes of all children.
- *
- * totalHeight is the sum of the preferred heights of all children
- * totalMinHeight is the sum of the minimum heights of all children
- * prefMinSumHeight is the sum of the difference between all children's
- * preferred heights and minimum heights. (This is used as a ratio to
- * calculate how much each child will shrink).
- */
- IFigure child;
- int totalHeight = 0;
- int totalMinHeight = 0;
- int prefMinSumHeight = 0;
-
- for(int i = 0; i < numChildren; i++) {
- child = (IFigure)children.get(i);
-
- prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint));
- minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint));
-
- totalHeight += prefSizes[i].height;
- totalMinHeight += minSizes[i].height;
- }
- totalHeight += (numChildren - 1) * spacing;
- totalMinHeight += (numChildren - 1) * spacing;
- prefMinSumHeight = totalHeight - totalMinHeight;
- /*
- * The total amount that the children must be shrunk is the sum of the
- * preferred Heights of the children minus Max(the available area and
- * the sum of the minimum heights of the children).
- *
- * amntShrinkHeight is the combined amount that the children must shrink
- * amntShrinkCurrentHeight is the amount each child will shrink
- * respectively
- */
- int amntShrinkHeight = totalHeight - Math.max(availableHeight, totalMinHeight);
-
- if(amntShrinkHeight < 0) {
- amntShrinkHeight = 0;
- }
-
- for(int i = 0; i < numChildren; i++) {
- int amntShrinkCurrentHeight = 0;
- int prefHeight = prefSizes[i].height;
- int minHeight = minSizes[i].height;
- int prefWidth = prefSizes[i].width;
- int minWidth = minSizes[i].width;
- Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight);
-
- child = (IFigure)children.get(i);
- if(prefMinSumHeight != 0) {
- amntShrinkCurrentHeight = (prefHeight - minHeight) * amntShrinkHeight / (prefMinSumHeight);
- }
-
- int width = Math.min(prefWidth, transposer.t(child.getMaximumSize()).width);
- if(matchWidth) {
- width = transposer.t(child.getMaximumSize()).width;
- }
- width = Math.max(minWidth, Math.min(clientArea.width, width));
- newBounds.width = width;
-
- int adjust = clientArea.width - width;
- switch(minorAlignment) {
- case ALIGN_TOPLEFT:
- adjust = 0;
- break;
- case ALIGN_CENTER:
- adjust /= 2;
- break;
- case ALIGN_BOTTOMRIGHT:
- break;
- }
- newBounds.x += adjust;
- newBounds.height -= amntShrinkCurrentHeight;
- child.setBounds(transposer.t(newBounds));
-
- amntShrinkHeight -= amntShrinkCurrentHeight;
- prefMinSumHeight -= (prefHeight - minHeight);
- y += newBounds.height + spacing;
- }
- }
-
- /**
- * Sets the alignment of the children contained in the layout. Possible
- * values are {@link #ALIGN_CENTER}, {@link #ALIGN_BOTTOMRIGHT} and {@link #ALIGN_TOPLEFT}.
- *
- * @param align
- * the minor alignment
- *
- * @since 2.0
- */
- // @unused
- public void setMinorAlignment(int align) {
- minorAlignment = align;
- }
-
- /**
- * Sets the amount of space between children.
- *
- * @param space
- * the amount of space between children
- *
- * @since 2.0
- */
- // @unused
- public void setSpacing(int space) {
- spacing = space;
- }
-
- /**
- * Sets children's width (if vertically oriented) or height (if horizontally
- * oriented) to stretch with their container.
- *
- * @param match
- * whether to stretch children
- *
- * @deprecated use {@link #setStretchMinorAxis(boolean)}
- * @since 2.0
- */
- @Deprecated
- public void setMatchWidth(boolean match) {
- matchWidth = match;
- }
-
- /**
- * Causes children that are smaller in the dimension of the minor axis to be
- * stretched to fill the minor axis. The minor axis is the opposite of the
- * orientation.
- *
- * @param stretch
- * whether to stretch children
- *
- * @since 2.0
- */
- public void setStretchMinorAxis(boolean stretch) {
- matchWidth = stretch;
- }
-
- /**
- * Sets the orientation of the children in the ToolbarLayout.
- *
- * @param flag
- * whether the orientation should be vertical
- *
- * @since 2.0
- */
- // @unused
- public void setVertical(boolean flag) {
- if(horizontal != flag) {
- return;
- }
- invalidate();
- horizontal = !flag;
- transposer.setEnabled(horizontal);
- }
-
- /**
- * Sets the constraint for the given figure.
- *
- * @param child
- * the child
- * @param constraint
- * the child's new constraint
- */
- @Override
- public void setConstraint(IFigure child, Object constraint) {
- invalidate(child);
- child.setBorder(null);
- }
-
-}
+/*
+ *
+ */
+package org.eclipse.papyrus.uml.diagram.common.draw2d;
+
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractHintLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.draw2d.geometry.Transposer;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Arranges figures in a single row or column. Orientation can be set to produce
+ * either a row or column layout. This layout tries to fit all children within
+ * the parent's client area. To do this, it compresses the children by some
+ * amount, but will not compress them smaller than their minimum size. If a
+ * child's preferred size is smaller than the row's or column's minor dimension,
+ * the layout can be configured to stretch the child.
+ */
+public class LeftToolbarLayout extends AbstractHintLayout {
+
+ /** Space in pixels between Figures *. */
+ protected int spacing;
+
+ /** Sets whether children should "stretch" with their container *. */
+ protected boolean matchWidth;
+
+ /** Orientation of layout *. */
+ protected boolean horizontal = false;
+
+ /** Alignment of layout *. */
+ protected int minorAlignment;
+
+ /** Constant for center alignment *. */
+ public static final int ALIGN_CENTER = 0;
+
+ /** Constant for top-left alignment *. */
+ public static final int ALIGN_TOPLEFT = 1;
+
+ /** Constant for bottom-right alignment *. */
+ public static final int ALIGN_BOTTOMRIGHT = 2;
+
+ /** Constant for horizontal alignment *. */
+ // @unused
+ public static final boolean HORIZONTAL = true;
+
+ /** Constant for vertical alignment *. */
+ // @unused
+ public static final boolean VERTICAL = false;
+
+ /** Transposer object used in layout calculations *. */
+ protected Transposer transposer;
+ {
+ transposer = new Transposer();
+ transposer.setEnabled(horizontal);
+ }
+
+ /**
+ * Constructs a vertically oriented ToolbarLayout with child spacing of 0
+ * pixels, matchWidth <code>true</code>, and {@link #ALIGN_TOPLEFT} alignment.
+ *
+ * @since 2.0
+ */
+ public LeftToolbarLayout() {
+ spacing = 0;
+ matchWidth = true;
+ minorAlignment = ALIGN_TOPLEFT;
+ horizontal = false;
+ }
+
+ /**
+ * Constructs a ToolbarLayout with a specified orientation. Default values
+ * are: child spacing 0 pixels, matchWidth <code>false</code>, and {@link #ALIGN_TOPLEFT} alignment.
+ *
+ * @param isHorizontal
+ * whether the children are oriented horizontally
+ *
+ * @since 2.0
+ */
+ // @unused
+ public LeftToolbarLayout(boolean isHorizontal) {
+ horizontal = isHorizontal;
+ transposer.setEnabled(horizontal);
+ spacing = 0;
+ matchWidth = false;
+ minorAlignment = ALIGN_TOPLEFT;
+ }
+
+ /**
+ * Calculate children size.
+ *
+ * @param children
+ * the children
+ * @param wHint
+ * the w hint
+ * @param hHint
+ * the h hint
+ * @param preferred
+ * the preferred
+ *
+ * @return the dimension
+ */
+ private Dimension calculateChildrenSize(List children, int wHint, int hHint, boolean preferred) {
+ Dimension childSize;
+ IFigure child;
+ int height = 0, width = 0;
+ for(int i = 0; i < children.size(); i++) {
+ child = (IFigure)children.get(i);
+ childSize = transposer.t(preferred ? child.getPreferredSize(wHint, hHint) : child.getMinimumSize(wHint, hHint));
+ height += childSize.height;
+ width = Math.max(width, childSize.width);
+ }
+ return new Dimension(width, height);
+ }
+
+ /**
+ * Calculates the minimum size of the container based on the given hints. If
+ * this is a vertically-oriented Toolbar Layout, then only the widthHint is
+ * respected (which means that the children can be as tall as they desire).
+ * In this case, the minimum width is that of the widest child, and the
+ * minimum height is the sum of the minimum heights of all children, plus
+ * the spacing between them. The border and insets of the container figure
+ * are also accounted for.
+ *
+ * @param container
+ * the figure whose minimum size has to be calculated
+ * @param wHint
+ * the width hint (the desired width of the container)
+ * @param hHint
+ * the height hint (the desired height of the container)
+ *
+ * @return the minimum size of the container
+ *
+ * @see #getMinimumSize(IFigure, int, int)
+ * @since 2.1
+ */
+ @Override
+ protected Dimension calculateMinimumSize(IFigure container, int wHint, int hHint) {
+ Insets insets = container.getInsets();
+ if(isHorizontal()) {
+ wHint = -1;
+ if(hHint >= 0) {
+ hHint = Math.max(0, hHint - insets.getHeight());
+ }
+ } else {
+ hHint = -1;
+ if(wHint >= 0) {
+ wHint = Math.max(0, wHint - insets.getWidth());
+ }
+ }
+
+ List children = container.getChildren();
+ Dimension minSize = calculateChildrenSize(children, wHint, hHint, false);
+ // Do a second pass, if necessary
+ if(wHint >= 0 && minSize.width > wHint) {
+ minSize = calculateChildrenSize(children, minSize.width, hHint, false);
+ } else if(hHint >= 0 && minSize.width > hHint) {
+ minSize = calculateChildrenSize(children, wHint, minSize.width, false);
+ }
+
+ minSize.height += Math.max(0, children.size() - 1) * spacing;
+ return transposer.t(minSize).expand(insets.getWidth(), insets.getHeight()).union(getBorderPreferredSize(container));
+ }
+
+ /**
+ * Calculates the preferred size of the container based on the given hints.
+ * If this is a vertically-oriented Toolbar Layout, then only the widthHint
+ * is respected (which means that the children can be as tall as they
+ * desire). In this case, the preferred width is that of the widest child,
+ * and the preferred height is the sum of the preferred heights of all
+ * children, plus the spacing between them. The border and insets of the
+ * container figure are also accounted for.
+ *
+ * @param container
+ * the figure whose preferred size has to be calculated
+ * @param wHint
+ * the width hint (the desired width of the container)
+ * @param hHint
+ * the height hint (the desired height of the container)
+ *
+ * @return the preferred size of the container
+ *
+ * @see #getPreferredSize(IFigure, int, int)
+ * @since 2.0
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
+ Insets insets = container.getInsets();
+ if(isHorizontal()) {
+ wHint = -1;
+ if(hHint >= 0) {
+ hHint = Math.max(0, hHint - insets.getHeight());
+ }
+ } else {
+ hHint = -1;
+ if(wHint >= 0) {
+ wHint = Math.max(0, wHint - insets.getWidth());
+ }
+ }
+
+ List children = container.getChildren();
+ Dimension prefSize = calculateChildrenSize(children, wHint, hHint, true);
+ // Do a second pass, if necessary
+ if(wHint >= 0 && prefSize.width > wHint) {
+ prefSize = calculateChildrenSize(children, prefSize.width, hHint, true);
+ } else if(hHint >= 0 && prefSize.width > hHint) {
+ prefSize = calculateChildrenSize(children, wHint, prefSize.width, true);
+ }
+
+ prefSize.height += Math.max(0, children.size() - 1) * spacing;
+ return transposer.t(prefSize).expand(insets.getWidth(), insets.getHeight()).union(getBorderPreferredSize(container));
+ }
+
+ /**
+ * Returns the minor aligment of the layout. Minor minor axis is the axis
+ * perpindicular to the overall orientation set in the contructor.
+ *
+ * @return the minor aligment
+ */
+ // @unused
+ public int getMinorAlignment() {
+ return minorAlignment;
+ }
+
+ /**
+ * Gets the spacing.
+ *
+ * @return the spacing between children
+ */
+ // @unused
+ public int getSpacing() {
+ return spacing;
+ }
+
+ /**
+ * Returns <code>true</code> if stretch minor axis has been enabled. The
+ * default value is false.
+ *
+ * @return <code>true</code> if stretch minor axis is enabled
+ */
+ // @unused
+ public boolean getStretchMinorAxis() {
+ return matchWidth;
+ }
+
+ /**
+ * Checks if is horizontal.
+ *
+ * @return whether the orientation of the layout is horizontal
+ *
+ * @since 2.0
+ */
+ public boolean isHorizontal() {
+ return horizontal;
+ }
+
+ /**
+ * Checks if is sensitive horizontally.
+ *
+ * @param parent
+ * the parent
+ *
+ * @return true, if checks if is sensitive horizontally
+ *
+ * @see org.eclipse.draw2d.AbstractHintLayout#isSensitiveHorizontally(IFigure)
+ */
+ @Override
+ protected boolean isSensitiveHorizontally(IFigure parent) {
+ return !isHorizontal();
+ }
+
+ /**
+ * Checks if is sensitive vertically.
+ *
+ * @param parent
+ * the parent
+ *
+ * @return true, if checks if is sensitive vertically
+ *
+ * @see org.eclipse.draw2d.AbstractHintLayout#isSensitiveVertically(IFigure)
+ */
+ @Override
+ protected boolean isSensitiveVertically(IFigure parent) {
+ return isHorizontal();
+ }
+
+ /**
+ * Layout.
+ *
+ * @param parent
+ * the parent
+ *
+ * @see org.eclipse.draw2d.LayoutManager#layout(IFigure)
+ */
+ public void layout(IFigure parent) {
+ List children = parent.getChildren();
+ int numChildren = children.size();
+ Rectangle clientArea = transposer.t(parent.getClientArea());
+ int x = clientArea.x;
+ int y = clientArea.y;
+ int availableHeight = clientArea.height;
+
+ // parent.setBorder(null);
+
+ Dimension prefSizes[] = new Dimension[numChildren];
+ Dimension minSizes[] = new Dimension[numChildren];
+
+ // Calculate the width and height hints. If it's a vertical
+ // ToolBarLayout,
+ // then ignore the height hint (set it to -1); otherwise, ignore the
+ // width hint. These hints will be passed to the children of the parent
+ // figure when getting their preferred size.
+ int wHint = -1;
+ int hHint = -1;
+ if(isHorizontal()) {
+ hHint = parent.getClientArea(Rectangle.SINGLETON).height;
+ } else {
+ wHint = parent.getClientArea(Rectangle.SINGLETON).width;
+ }
+
+ /*
+ * Calculate sum of preferred heights of all children(totalHeight).
+ * Calculate sum of minimum heights of all children(minHeight). Cache
+ * Preferred Sizes and Minimum Sizes of all children.
+ *
+ * totalHeight is the sum of the preferred heights of all children
+ * totalMinHeight is the sum of the minimum heights of all children
+ * prefMinSumHeight is the sum of the difference between all children's
+ * preferred heights and minimum heights. (This is used as a ratio to
+ * calculate how much each child will shrink).
+ */
+ IFigure child;
+ int totalHeight = 0;
+ int totalMinHeight = 0;
+ int prefMinSumHeight = 0;
+
+ for(int i = 0; i < numChildren; i++) {
+ child = (IFigure)children.get(i);
+
+ prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint));
+ minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint));
+
+ totalHeight += prefSizes[i].height;
+ totalMinHeight += minSizes[i].height;
+ }
+ totalHeight += (numChildren - 1) * spacing;
+ totalMinHeight += (numChildren - 1) * spacing;
+ prefMinSumHeight = totalHeight - totalMinHeight;
+ /*
+ * The total amount that the children must be shrunk is the sum of the
+ * preferred Heights of the children minus Max(the available area and
+ * the sum of the minimum heights of the children).
+ *
+ * amntShrinkHeight is the combined amount that the children must shrink
+ * amntShrinkCurrentHeight is the amount each child will shrink
+ * respectively
+ */
+ int amntShrinkHeight = totalHeight - Math.max(availableHeight, totalMinHeight);
+
+ if(amntShrinkHeight < 0) {
+ amntShrinkHeight = 0;
+ }
+
+ for(int i = 0; i < numChildren; i++) {
+ int amntShrinkCurrentHeight = 0;
+ int prefHeight = prefSizes[i].height;
+ int minHeight = minSizes[i].height;
+ int prefWidth = prefSizes[i].width;
+ int minWidth = minSizes[i].width;
+ Rectangle newBounds = new Rectangle(x, y, prefWidth, prefHeight);
+
+ child = (IFigure)children.get(i);
+ if(prefMinSumHeight != 0) {
+ amntShrinkCurrentHeight = (prefHeight - minHeight) * amntShrinkHeight / (prefMinSumHeight);
+ }
+
+ int width = Math.min(prefWidth, transposer.t(child.getMaximumSize()).width);
+ if(matchWidth) {
+ width = transposer.t(child.getMaximumSize()).width;
+ }
+ width = Math.max(minWidth, Math.min(clientArea.width, width));
+ newBounds.width = width;
+
+ int adjust = clientArea.width - width;
+ switch(minorAlignment) {
+ case ALIGN_TOPLEFT:
+ adjust = 0;
+ break;
+ case ALIGN_CENTER:
+ adjust /= 2;
+ break;
+ case ALIGN_BOTTOMRIGHT:
+ break;
+ }
+ newBounds.x += adjust;
+ newBounds.height -= amntShrinkCurrentHeight;
+ child.setBounds(transposer.t(newBounds));
+
+ amntShrinkHeight -= amntShrinkCurrentHeight;
+ prefMinSumHeight -= (prefHeight - minHeight);
+ y += newBounds.height + spacing;
+ }
+ }
+
+ /**
+ * Sets the alignment of the children contained in the layout. Possible
+ * values are {@link #ALIGN_CENTER}, {@link #ALIGN_BOTTOMRIGHT} and {@link #ALIGN_TOPLEFT}.
+ *
+ * @param align
+ * the minor alignment
+ *
+ * @since 2.0
+ */
+ // @unused
+ public void setMinorAlignment(int align) {
+ minorAlignment = align;
+ }
+
+ /**
+ * Sets the amount of space between children.
+ *
+ * @param space
+ * the amount of space between children
+ *
+ * @since 2.0
+ */
+ // @unused
+ public void setSpacing(int space) {
+ spacing = space;
+ }
+
+ /**
+ * Sets children's width (if vertically oriented) or height (if horizontally
+ * oriented) to stretch with their container.
+ *
+ * @param match
+ * whether to stretch children
+ *
+ * @deprecated use {@link #setStretchMinorAxis(boolean)}
+ * @since 2.0
+ */
+ @Deprecated
+ public void setMatchWidth(boolean match) {
+ matchWidth = match;
+ }
+
+ /**
+ * Causes children that are smaller in the dimension of the minor axis to be
+ * stretched to fill the minor axis. The minor axis is the opposite of the
+ * orientation.
+ *
+ * @param stretch
+ * whether to stretch children
+ *
+ * @since 2.0
+ */
+ public void setStretchMinorAxis(boolean stretch) {
+ matchWidth = stretch;
+ }
+
+ /**
+ * Sets the orientation of the children in the ToolbarLayout.
+ *
+ * @param flag
+ * whether the orientation should be vertical
+ *
+ * @since 2.0
+ */
+ // @unused
+ public void setVertical(boolean flag) {
+ if(horizontal != flag) {
+ return;
+ }
+ invalidate();
+ horizontal = !flag;
+ transposer.setEnabled(horizontal);
+ }
+
+ /**
+ * Sets the constraint for the given figure.
+ *
+ * @param child
+ * the child
+ * @param constraint
+ * the child's new constraint
+ */
+ @Override
+ public void setConstraint(IFigure child, Object constraint) {
+ invalidate(child);
+ child.setBorder(null);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LifelineDotLineFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LifelineDotLineFigure.java
index 8a7c6eecd27..922bd6de0cd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LifelineDotLineFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LifelineDotLineFigure.java
@@ -1,178 +1,178 @@
-/*******************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat
- * de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram Implementation
- * Thibault Landré (Atos Origin) - Add crossAtEnd and dashLine figure
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.draw2d;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Shape;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-
-/**
- * The Class LifelineDotLineFigure.
- *
- * @author <a href="mailto:gmerin@prodevelop.es">Gabriel Merin</a>
- */
-public class LifelineDotLineFigure extends Shape {
-
- // Attributes
-
- /** The SOLI d_ size. */
- private final int SOLID_SIZE = 6;
-
- /** The DASHE d_ size. */
- private final int DASHED_SIZE = 10;
-
- /** The DashLine figure where elements will be attached */
- private NodeFigure dashLineRectangle;
-
- // Methods
-
- /**
- * Instantiates a new lifeline dot line figure.
- */
- public LifelineDotLineFigure() {
- super();
-
- // Init dashLineRectangle
- dashLineRectangle = new NodeFigure();
- dashLineRectangle.setParent(this);
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Shape#fillShape(org.eclipse.draw2d.Graphics)
- */
- @Override
- protected void fillShape(Graphics graphics) {
-
- // Filling area
- // Rectangle r = getBounds();
- // graphics.drawRectangle(r);
-
- // outlineShape(graphics);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Shape#outlineShape(org.eclipse.draw2d.Graphics)
- */
- @Override
- protected void outlineShape(Graphics graphics) {
- Rectangle r = getBounds();
-
- Point pStart = new Point();
- Point pEnd = new Point();
- Point pAux = new Point();
-
- pStart.x = r.x + r.width / 2;
- pStart.y = r.y + 1;
-
- pEnd.x = pStart.x;
- pEnd.y = pStart.y + r.height - 1;
-
- // Create the dash line
- pAux = pStart.getCopy();
-
- while(pAux.y <= pEnd.y) {
- // The drawing limit is pEnd.y
- int yEnd = pAux.y + SOLID_SIZE;
- if(yEnd > pEnd.y) {
- yEnd = pEnd.y;
- }
- graphics.drawLine(pAux, new Point(pAux.x, yEnd));
- pAux.y = pAux.y + DASHED_SIZE;
- }
-
- // int pixels = 10;
-
- // Update the size and the location of the rectangle representing the
- // dash line
- dashLineRectangle.setSize(1, pEnd.y - pStart.y);
- dashLineRectangle.setLocation(pStart);
-
- }
-
- /**
- * Set the bounds on the figure and fix bounds for child dash line
- *
- * @param rect
- * the new bounds
- */
- @Override
- public void setBounds(Rectangle rect) {
- super.setBounds(rect);
- // set bounds for child dash line to avoid problems during connected
- // edges drawing
- Point pStart = new Point();
- Point pEnd = new Point();
-
- pStart.x = rect.x + rect.width / 2;
- pStart.y = rect.y + 1;
-
- pEnd.x = pStart.x;
- pEnd.y = pStart.y + rect.height - 1;
-
- // Update the size and the location of the rectangle representing the
- // dash line
- dashLineRectangle.setSize(1, pEnd.y - pStart.y);
- dashLineRectangle.setLocation(pStart);
- }
-
- /**
- * Create a cross at the end of the figure. The cross will be drawn at the
- * pEnd - pixels position
- *
- * @param graphics
- * the graphics
- * @param pEnd
- * the point used to position the cross
- * @param pixels
- * the height which will be deduce from the pEnd to position the
- * cross
- */
- private void drawCrossAtEnd(Graphics graphics, Point pEnd, int pixels) {
- Point p1Start = new Point();
- Point p1End = new Point();
-
- Point p2Start = new Point();
- Point p2End = new Point();
-
- p1Start.x = pEnd.x - pixels;
- p1Start.y = pEnd.y;
-
- p1End.x = pEnd.x + pixels;
- p1End.y = pEnd.y - 2 * pixels;
-
- p2Start.x = pEnd.x + pixels;
- p2Start.y = pEnd.y;
-
- p2End.x = pEnd.x - pixels;
- p2End.y = pEnd.y - 2 * pixels;
-
- graphics.setLineStyle(Graphics.LINE_SOLID);
-
- graphics.drawLine(p1Start, p1End);
- graphics.drawLine(p2Start, p2End);
- }
-
- /**
- * Get a rectangleFigure representing the dashLine
- */
- public NodeFigure getDashLineRectangle() {
- return dashLineRectangle;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat
+ * de la Comunitat Valenciana . All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Gabriel Merin Cubero (Prodevelop) – Sequence Diagram Implementation
+ * Thibault Landré (Atos Origin) - Add crossAtEnd and dashLine figure
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.draw2d;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Shape;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+
+/**
+ * The Class LifelineDotLineFigure.
+ *
+ * @author <a href="mailto:gmerin@prodevelop.es">Gabriel Merin</a>
+ */
+public class LifelineDotLineFigure extends Shape {
+
+ // Attributes
+
+ /** The SOLI d_ size. */
+ private final int SOLID_SIZE = 6;
+
+ /** The DASHE d_ size. */
+ private final int DASHED_SIZE = 10;
+
+ /** The DashLine figure where elements will be attached */
+ private NodeFigure dashLineRectangle;
+
+ // Methods
+
+ /**
+ * Instantiates a new lifeline dot line figure.
+ */
+ public LifelineDotLineFigure() {
+ super();
+
+ // Init dashLineRectangle
+ dashLineRectangle = new NodeFigure();
+ dashLineRectangle.setParent(this);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.draw2d.Shape#fillShape(org.eclipse.draw2d.Graphics)
+ */
+ @Override
+ protected void fillShape(Graphics graphics) {
+
+ // Filling area
+ // Rectangle r = getBounds();
+ // graphics.drawRectangle(r);
+
+ // outlineShape(graphics);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.draw2d.Shape#outlineShape(org.eclipse.draw2d.Graphics)
+ */
+ @Override
+ protected void outlineShape(Graphics graphics) {
+ Rectangle r = getBounds();
+
+ Point pStart = new Point();
+ Point pEnd = new Point();
+ Point pAux = new Point();
+
+ pStart.x = r.x + r.width / 2;
+ pStart.y = r.y + 1;
+
+ pEnd.x = pStart.x;
+ pEnd.y = pStart.y + r.height - 1;
+
+ // Create the dash line
+ pAux = pStart.getCopy();
+
+ while(pAux.y <= pEnd.y) {
+ // The drawing limit is pEnd.y
+ int yEnd = pAux.y + SOLID_SIZE;
+ if(yEnd > pEnd.y) {
+ yEnd = pEnd.y;
+ }
+ graphics.drawLine(pAux, new Point(pAux.x, yEnd));
+ pAux.y = pAux.y + DASHED_SIZE;
+ }
+
+ // int pixels = 10;
+
+ // Update the size and the location of the rectangle representing the
+ // dash line
+ dashLineRectangle.setSize(1, pEnd.y - pStart.y);
+ dashLineRectangle.setLocation(pStart);
+
+ }
+
+ /**
+ * Set the bounds on the figure and fix bounds for child dash line
+ *
+ * @param rect
+ * the new bounds
+ */
+ @Override
+ public void setBounds(Rectangle rect) {
+ super.setBounds(rect);
+ // set bounds for child dash line to avoid problems during connected
+ // edges drawing
+ Point pStart = new Point();
+ Point pEnd = new Point();
+
+ pStart.x = rect.x + rect.width / 2;
+ pStart.y = rect.y + 1;
+
+ pEnd.x = pStart.x;
+ pEnd.y = pStart.y + rect.height - 1;
+
+ // Update the size and the location of the rectangle representing the
+ // dash line
+ dashLineRectangle.setSize(1, pEnd.y - pStart.y);
+ dashLineRectangle.setLocation(pStart);
+ }
+
+ /**
+ * Create a cross at the end of the figure. The cross will be drawn at the
+ * pEnd - pixels position
+ *
+ * @param graphics
+ * the graphics
+ * @param pEnd
+ * the point used to position the cross
+ * @param pixels
+ * the height which will be deduce from the pEnd to position the
+ * cross
+ */
+ private void drawCrossAtEnd(Graphics graphics, Point pEnd, int pixels) {
+ Point p1Start = new Point();
+ Point p1End = new Point();
+
+ Point p2Start = new Point();
+ Point p2End = new Point();
+
+ p1Start.x = pEnd.x - pixels;
+ p1Start.y = pEnd.y;
+
+ p1End.x = pEnd.x + pixels;
+ p1End.y = pEnd.y - 2 * pixels;
+
+ p2Start.x = pEnd.x + pixels;
+ p2Start.y = pEnd.y;
+
+ p2End.x = pEnd.x - pixels;
+ p2End.y = pEnd.y - 2 * pixels;
+
+ graphics.setLineStyle(Graphics.LINE_SOLID);
+
+ graphics.drawLine(p1Start, p1End);
+ graphics.drawLine(p2Start, p2End);
+ }
+
+ /**
+ * Get a rectangleFigure representing the dashLine
+ */
+ public NodeFigure getDashLineRectangle() {
+ return dashLineRectangle;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LinesBorder.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LinesBorder.java
index 6aa9eefdf86..4acd7313a65 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LinesBorder.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/LinesBorder.java
@@ -1,192 +1,192 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.draw2d;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
-
-/**
- * This is a border that draws lines at the given border positions around the
- * shape.
- */
-public class LinesBorder extends LineBorder {
-
- /** The positions where the borders are drawn */
- private int positions = PositionConstants.NONE;
-
- private int leftInset = 0;
- private int rightInset = 0;
- private int topInset = 0;
- private int bottomInset = 0;
-
- /**
- * Constructor.
- */
- public LinesBorder() {
- this(1, PositionConstants.NONE);
- }
-
- /**
- * Constructor.
- *
- * @param sides
- */
- public LinesBorder(int sides) {
- this(1, sides);
- }
-
- /**
- * Constructor
- *
- * @param width
- * the width of the line in relative coordinates
- * @param sides
- * the sides to draw. The value should be a bitwise composition
- * of PositionConstants.NONE, PositionConstants.TOP,
- * PositionConstants.BOTTOM, PositionConstants.LEFT,
- * PositionConstants.RIGHT
- */
- public LinesBorder(int width, int sides) {
- super(width);
- this.positions = sides;
- }
-
- /**
- * Get drawn sides
- *
- * @return Returns the side positions.
- */
- public int getSides() {
- return positions;
- }
-
- /**
- * Change drawn sides
- *
- * @param sides
- * the sides to draw. The value should be a bitwise composition
- * of PositionConstants.NONE, PositionConstants.TOP,
- * PositionConstants.BOTTOM, PositionConstants.LEFT,
- * PositionConstants.RIGHT
- */
- public void setSides(int sides) {
- this.positions = sides;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.draw2d.Border#getInsets(org.eclipse.draw2d.IFigure)
- */
- public Insets getInsets(IFigure figure) {
- return new Insets(getTopInset(), getLeftInset(), getBottomInset(), getRightInset());
- }
-
- /**
- * Paints the border based on the inputs given.
- *
- * @param figure
- * <code>IFigure</code> for which this is the border.
- * @param graphics
- * <code>Graphics</code> handle for drawing the border.
- * @param insets
- * Space to be taken up by this border.
- */
- @Override
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- tempRect.setBounds(getPaintRectangle(figure, insets));
-
- int one = MapModeUtil.getMapMode(figure).DPtoLP(1);
- int widthInDP = getWidth() / one;
-
- int halfWidthInLP = MapModeUtil.getMapMode(figure).DPtoLP(widthInDP / 2);
-
- graphics.setLineWidth(getWidth());
- graphics.setLineStyle(getStyle());
- // adapt tempRect so that borders do not overflow the initial bounds
- tempRect.x += halfWidthInLP;
- tempRect.width -= getWidth();
- tempRect.y += halfWidthInLP;
- tempRect.height -= getWidth();
-
- if((positions & PositionConstants.TOP) > 0) {
- graphics.drawLine(tempRect.getTopLeft(), tempRect.getTopRight());
- }
- if((positions & PositionConstants.LEFT) > 0) {
- graphics.drawLine(tempRect.getTopLeft(), tempRect.getBottomLeft());
- }
- if((positions & PositionConstants.BOTTOM) > 0) {
- graphics.drawLine(tempRect.getBottomLeft(), tempRect.getBottomRight());
- }
- if((positions & PositionConstants.RIGHT) > 0) {
- graphics.drawLine(tempRect.getTopRight(), tempRect.getBottomRight());
- }
- }
-
- public int getPositions() {
- return positions;
- }
-
- public void setPositions(int positions) {
- this.positions = positions;
- }
-
- public int getLeftInset() {
- if (leftInset < getWidth() && (positions & PositionConstants.LEFT) > 0){
- return getWidth();
- }
- return leftInset;
- }
-
- public void setLeftInset(int leftInset) {
- this.leftInset = leftInset;
- }
-
- public int getRightInset() {
- if (rightInset < getWidth() && (positions & PositionConstants.RIGHT) > 0){
- return getWidth();
- }
- return rightInset;
- }
-
- public void setRightInset(int rightInset) {
- this.rightInset = rightInset;
- }
-
- public int getTopInset() {
- if (topInset < getWidth() && (positions & PositionConstants.TOP) > 0){
- return getWidth();
- }
- return topInset;
- }
-
- public void setTopInset(int topInset) {
- this.topInset = topInset;
- }
-
- public int getBottomInset() {
- if (bottomInset < getWidth() && (positions & PositionConstants.TOP) > 0){
- return getWidth();
- }
- return bottomInset;
- }
-
- public void setBottomInset(int bottomInset) {
- this.bottomInset = bottomInset;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.draw2d;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
+
+/**
+ * This is a border that draws lines at the given border positions around the
+ * shape.
+ */
+public class LinesBorder extends LineBorder {
+
+ /** The positions where the borders are drawn */
+ private int positions = PositionConstants.NONE;
+
+ private int leftInset = 0;
+ private int rightInset = 0;
+ private int topInset = 0;
+ private int bottomInset = 0;
+
+ /**
+ * Constructor.
+ */
+ public LinesBorder() {
+ this(1, PositionConstants.NONE);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param sides
+ */
+ public LinesBorder(int sides) {
+ this(1, sides);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param width
+ * the width of the line in relative coordinates
+ * @param sides
+ * the sides to draw. The value should be a bitwise composition
+ * of PositionConstants.NONE, PositionConstants.TOP,
+ * PositionConstants.BOTTOM, PositionConstants.LEFT,
+ * PositionConstants.RIGHT
+ */
+ public LinesBorder(int width, int sides) {
+ super(width);
+ this.positions = sides;
+ }
+
+ /**
+ * Get drawn sides
+ *
+ * @return Returns the side positions.
+ */
+ public int getSides() {
+ return positions;
+ }
+
+ /**
+ * Change drawn sides
+ *
+ * @param sides
+ * the sides to draw. The value should be a bitwise composition
+ * of PositionConstants.NONE, PositionConstants.TOP,
+ * PositionConstants.BOTTOM, PositionConstants.LEFT,
+ * PositionConstants.RIGHT
+ */
+ public void setSides(int sides) {
+ this.positions = sides;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.draw2d.Border#getInsets(org.eclipse.draw2d.IFigure)
+ */
+ public Insets getInsets(IFigure figure) {
+ return new Insets(getTopInset(), getLeftInset(), getBottomInset(), getRightInset());
+ }
+
+ /**
+ * Paints the border based on the inputs given.
+ *
+ * @param figure
+ * <code>IFigure</code> for which this is the border.
+ * @param graphics
+ * <code>Graphics</code> handle for drawing the border.
+ * @param insets
+ * Space to be taken up by this border.
+ */
+ @Override
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ tempRect.setBounds(getPaintRectangle(figure, insets));
+
+ int one = MapModeUtil.getMapMode(figure).DPtoLP(1);
+ int widthInDP = getWidth() / one;
+
+ int halfWidthInLP = MapModeUtil.getMapMode(figure).DPtoLP(widthInDP / 2);
+
+ graphics.setLineWidth(getWidth());
+ graphics.setLineStyle(getStyle());
+ // adapt tempRect so that borders do not overflow the initial bounds
+ tempRect.x += halfWidthInLP;
+ tempRect.width -= getWidth();
+ tempRect.y += halfWidthInLP;
+ tempRect.height -= getWidth();
+
+ if((positions & PositionConstants.TOP) > 0) {
+ graphics.drawLine(tempRect.getTopLeft(), tempRect.getTopRight());
+ }
+ if((positions & PositionConstants.LEFT) > 0) {
+ graphics.drawLine(tempRect.getTopLeft(), tempRect.getBottomLeft());
+ }
+ if((positions & PositionConstants.BOTTOM) > 0) {
+ graphics.drawLine(tempRect.getBottomLeft(), tempRect.getBottomRight());
+ }
+ if((positions & PositionConstants.RIGHT) > 0) {
+ graphics.drawLine(tempRect.getTopRight(), tempRect.getBottomRight());
+ }
+ }
+
+ public int getPositions() {
+ return positions;
+ }
+
+ public void setPositions(int positions) {
+ this.positions = positions;
+ }
+
+ public int getLeftInset() {
+ if (leftInset < getWidth() && (positions & PositionConstants.LEFT) > 0){
+ return getWidth();
+ }
+ return leftInset;
+ }
+
+ public void setLeftInset(int leftInset) {
+ this.leftInset = leftInset;
+ }
+
+ public int getRightInset() {
+ if (rightInset < getWidth() && (positions & PositionConstants.RIGHT) > 0){
+ return getWidth();
+ }
+ return rightInset;
+ }
+
+ public void setRightInset(int rightInset) {
+ this.rightInset = rightInset;
+ }
+
+ public int getTopInset() {
+ if (topInset < getWidth() && (positions & PositionConstants.TOP) > 0){
+ return getWidth();
+ }
+ return topInset;
+ }
+
+ public void setTopInset(int topInset) {
+ this.topInset = topInset;
+ }
+
+ public int getBottomInset() {
+ if (bottomInset < getWidth() && (positions & PositionConstants.TOP) > 0){
+ return getWidth();
+ }
+ return bottomInset;
+ }
+
+ public void setBottomInset(int bottomInset) {
+ this.bottomInset = bottomInset;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/PileLayout.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/PileLayout.java
index 630146eb903..b36a49f6fb4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/PileLayout.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/PileLayout.java
@@ -1,219 +1,219 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.draw2d;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.AbstractHintLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * All children are placed on top of each other. Gap may be set between
- * children.
- *
- * @author dstadnik
- */
-public class PileLayout extends AbstractHintLayout {
-
- /**
- * Vertical gap between figures.
- */
- public final int getGap() {
- return myGap;
- }
-
- public void setGap(int gap) {
- myGap = gap > 0 ? gap : 0;
- }
-
- public void setNegativeGap(int gap) {
- myGap = gap;
- }
-
- /**
- * The last (bottom) figure should be stretched to cover the rest of the
- * container client area.
- */
- public final boolean isStretchBottom() {
- return myStretchBottom;
- }
-
- public void setStretchBottom(boolean stretchBottom) {
- myStretchBottom = stretchBottom;
- }
-
- public void remove(IFigure figure) {
- myConstraints.remove(figure);
- }
-
- public void setConstraint(IFigure figure, Object constraint) {
- if(constraint == null) {
- remove(figure);
- } else {
- myConstraints.put(figure, constraint);
- }
- }
-
- public Object getConstraint(IFigure figure) {
- return myConstraints.get(figure);
- }
-
- /**
- * Returns list constraint for specified figure. If constraint is null or
- * not list constraint returns FILL list constraint by default.
- */
- protected PileConstraint getPileConstraint(IFigure figure) {
- Object constraint = getConstraint(figure);
- return constraint instanceof PileConstraint ? (PileConstraint)constraint : FILL;
- }
-
- protected Dimension calculateSize(IFigure container, int wHint, int hHint, SizeExtractor sizeExtractor) {
- int totalWidth = 0; // Width of all components
- int totalHeight = 0; // Height of all components
-
- List<?> children = container.getChildren();
- for(int i = 0; i < children.size(); i++) {
- IFigure child = (IFigure)children.get(i);
- Dimension size = sizeExtractor.getSize(child, wHint, hHint);
- if(totalWidth < size.width) {
- totalWidth = size.width;
- }
- totalHeight += size.height + getGap();
- }
- // Subtract extra gap
- totalHeight -= getGap();
-
- // Add insets to preferred size (include border)
- Insets insets = container.getInsets();
- totalWidth += insets.getWidth();
- totalHeight += insets.getHeight();
-
- return new Dimension(totalWidth, totalHeight);
- }
-
- protected Dimension calculateMinimumSize(IFigure container, int wHint, int hHint) {
- return calculateSize(container, wHint, hHint, MIN_SIZE_EXTRACTOR);
- }
-
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
- return calculateSize(container, wHint, hHint, PREF_SIZE_EXTRACTOR);
- }
-
- public void layout(IFigure container) {
- Rectangle clientArea = container.getClientArea();
- int y = clientArea.y;
- final int maxY = clientArea.y + clientArea.height;
- List<?> children = container.getChildren();
- for(int i = 0; i < children.size(); i++) {
- IFigure child = (IFigure)children.get(i);
- Dimension preferred = child.getPreferredSize(clientArea.width, clientArea.height);
- int height = preferred.height;
- if(y >= maxY) {
- Rectangle bounds = new Rectangle(clientArea.x, maxY, clientArea.width, 0);
- child.setBounds(bounds);
- continue;
- } else if(y + height > maxY || (isStretchBottom() && i == children.size() - 1)) {
- height = maxY - y;
- }
- Rectangle bounds = new Rectangle(clientArea.x, y, clientArea.width, height);
- getPileConstraint(child).setChildBounds(preferred, bounds);
- child.setBounds(bounds);
- y += bounds.height + getGap();
- }
- }
-
- private int myGap;
-
- private Map<IFigure, Object> myConstraints = new HashMap<IFigure, Object>(2);
-
- private boolean myStretchBottom;
-
- private static final SizeExtractor MIN_SIZE_EXTRACTOR = new SizeExtractor() {
-
- public Dimension getSize(IFigure figure, int wHint, int hHint) {
- return figure.getMinimumSize(wHint, hHint);
- }
- };
-
- private static final SizeExtractor PREF_SIZE_EXTRACTOR = new SizeExtractor() {
-
- public Dimension getSize(IFigure figure, int wHint, int hHint) {
- return figure.getPreferredSize(wHint, hHint);
- }
- };
-
- private interface SizeExtractor {
-
- public Dimension getSize(IFigure figure, int wHint, int hHint);
- }
-
- /**
- * Constraint that is recognizable by this layout.
- */
- public interface PileConstraint {
-
- /**
- * Changes bounds of child with specified preferred size. New bounds
- * should fit in specified bounds.
- *
- * @param preferred
- * Prefferred size of a child.
- * @param bounds
- * Max child bounds.
- */
- public void setChildBounds(Dimension preferred, Rectangle bounds);
- }
-
- /**
- * Default constraint.
- */
- public static final PileConstraint FILL = new PileConstraint() {
-
- public void setChildBounds(Dimension preferred, Rectangle bounds) {
- }
- };
-
- public static final PileConstraint ALIGN_LEFT = new PileConstraint() {
-
- public void setChildBounds(Dimension preferred, Rectangle bounds) {
- bounds.width = Math.min(preferred.width, bounds.width);
- }
- };
-
- public static final PileConstraint ALIGN_CENTER = new PileConstraint() {
-
- public void setChildBounds(Dimension preferred, Rectangle bounds) {
- if(bounds.width > preferred.width) {
- final int offset = (bounds.width - preferred.width) / 2;
- bounds.x += offset;
- bounds.width = preferred.width;
- }
- }
- };
-
- public static final PileConstraint ALIGN_RIGHT = new PileConstraint() {
-
- public void setChildBounds(Dimension preferred, Rectangle bounds) {
- if(bounds.width > preferred.width) {
- bounds.x += bounds.width - preferred.width;
- bounds.width = preferred.width;
- }
- }
- };
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.draw2d;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.draw2d.AbstractHintLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * All children are placed on top of each other. Gap may be set between
+ * children.
+ *
+ * @author dstadnik
+ */
+public class PileLayout extends AbstractHintLayout {
+
+ /**
+ * Vertical gap between figures.
+ */
+ public final int getGap() {
+ return myGap;
+ }
+
+ public void setGap(int gap) {
+ myGap = gap > 0 ? gap : 0;
+ }
+
+ public void setNegativeGap(int gap) {
+ myGap = gap;
+ }
+
+ /**
+ * The last (bottom) figure should be stretched to cover the rest of the
+ * container client area.
+ */
+ public final boolean isStretchBottom() {
+ return myStretchBottom;
+ }
+
+ public void setStretchBottom(boolean stretchBottom) {
+ myStretchBottom = stretchBottom;
+ }
+
+ public void remove(IFigure figure) {
+ myConstraints.remove(figure);
+ }
+
+ public void setConstraint(IFigure figure, Object constraint) {
+ if(constraint == null) {
+ remove(figure);
+ } else {
+ myConstraints.put(figure, constraint);
+ }
+ }
+
+ public Object getConstraint(IFigure figure) {
+ return myConstraints.get(figure);
+ }
+
+ /**
+ * Returns list constraint for specified figure. If constraint is null or
+ * not list constraint returns FILL list constraint by default.
+ */
+ protected PileConstraint getPileConstraint(IFigure figure) {
+ Object constraint = getConstraint(figure);
+ return constraint instanceof PileConstraint ? (PileConstraint)constraint : FILL;
+ }
+
+ protected Dimension calculateSize(IFigure container, int wHint, int hHint, SizeExtractor sizeExtractor) {
+ int totalWidth = 0; // Width of all components
+ int totalHeight = 0; // Height of all components
+
+ List<?> children = container.getChildren();
+ for(int i = 0; i < children.size(); i++) {
+ IFigure child = (IFigure)children.get(i);
+ Dimension size = sizeExtractor.getSize(child, wHint, hHint);
+ if(totalWidth < size.width) {
+ totalWidth = size.width;
+ }
+ totalHeight += size.height + getGap();
+ }
+ // Subtract extra gap
+ totalHeight -= getGap();
+
+ // Add insets to preferred size (include border)
+ Insets insets = container.getInsets();
+ totalWidth += insets.getWidth();
+ totalHeight += insets.getHeight();
+
+ return new Dimension(totalWidth, totalHeight);
+ }
+
+ protected Dimension calculateMinimumSize(IFigure container, int wHint, int hHint) {
+ return calculateSize(container, wHint, hHint, MIN_SIZE_EXTRACTOR);
+ }
+
+ protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
+ return calculateSize(container, wHint, hHint, PREF_SIZE_EXTRACTOR);
+ }
+
+ public void layout(IFigure container) {
+ Rectangle clientArea = container.getClientArea();
+ int y = clientArea.y;
+ final int maxY = clientArea.y + clientArea.height;
+ List<?> children = container.getChildren();
+ for(int i = 0; i < children.size(); i++) {
+ IFigure child = (IFigure)children.get(i);
+ Dimension preferred = child.getPreferredSize(clientArea.width, clientArea.height);
+ int height = preferred.height;
+ if(y >= maxY) {
+ Rectangle bounds = new Rectangle(clientArea.x, maxY, clientArea.width, 0);
+ child.setBounds(bounds);
+ continue;
+ } else if(y + height > maxY || (isStretchBottom() && i == children.size() - 1)) {
+ height = maxY - y;
+ }
+ Rectangle bounds = new Rectangle(clientArea.x, y, clientArea.width, height);
+ getPileConstraint(child).setChildBounds(preferred, bounds);
+ child.setBounds(bounds);
+ y += bounds.height + getGap();
+ }
+ }
+
+ private int myGap;
+
+ private Map<IFigure, Object> myConstraints = new HashMap<IFigure, Object>(2);
+
+ private boolean myStretchBottom;
+
+ private static final SizeExtractor MIN_SIZE_EXTRACTOR = new SizeExtractor() {
+
+ public Dimension getSize(IFigure figure, int wHint, int hHint) {
+ return figure.getMinimumSize(wHint, hHint);
+ }
+ };
+
+ private static final SizeExtractor PREF_SIZE_EXTRACTOR = new SizeExtractor() {
+
+ public Dimension getSize(IFigure figure, int wHint, int hHint) {
+ return figure.getPreferredSize(wHint, hHint);
+ }
+ };
+
+ private interface SizeExtractor {
+
+ public Dimension getSize(IFigure figure, int wHint, int hHint);
+ }
+
+ /**
+ * Constraint that is recognizable by this layout.
+ */
+ public interface PileConstraint {
+
+ /**
+ * Changes bounds of child with specified preferred size. New bounds
+ * should fit in specified bounds.
+ *
+ * @param preferred
+ * Prefferred size of a child.
+ * @param bounds
+ * Max child bounds.
+ */
+ public void setChildBounds(Dimension preferred, Rectangle bounds);
+ }
+
+ /**
+ * Default constraint.
+ */
+ public static final PileConstraint FILL = new PileConstraint() {
+
+ public void setChildBounds(Dimension preferred, Rectangle bounds) {
+ }
+ };
+
+ public static final PileConstraint ALIGN_LEFT = new PileConstraint() {
+
+ public void setChildBounds(Dimension preferred, Rectangle bounds) {
+ bounds.width = Math.min(preferred.width, bounds.width);
+ }
+ };
+
+ public static final PileConstraint ALIGN_CENTER = new PileConstraint() {
+
+ public void setChildBounds(Dimension preferred, Rectangle bounds) {
+ if(bounds.width > preferred.width) {
+ final int offset = (bounds.width - preferred.width) / 2;
+ bounds.x += offset;
+ bounds.width = preferred.width;
+ }
+ }
+ };
+
+ public static final PileConstraint ALIGN_RIGHT = new PileConstraint() {
+
+ public void setChildBounds(Dimension preferred, Rectangle bounds) {
+ if(bounds.width > preferred.width) {
+ bounds.x += bounds.width - preferred.width;
+ bounds.width = preferred.width;
+ }
+ }
+ };
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/RoundedRectangleDashedBorder.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/RoundedRectangleDashedBorder.java
index a0e5c5e61f6..e68f7cfabd3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/RoundedRectangleDashedBorder.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/RoundedRectangleDashedBorder.java
@@ -1,72 +1,72 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.draw2d;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.RoundedRectangleBorder;
-import org.eclipse.swt.SWT;
-
-/**
- * This class provides a border drawn as a dashed rounded rectangle.
- *
- * @author vhemery
- */
-public class RoundedRectangleDashedBorder extends RoundedRectangleBorder {
-
- /**
- * Creates an instance of this class with the given arc width and arc height
- * in pixels
- *
- * @param arcWidth
- * The width of the corner arc
- * @param arcHeight
- * The height of the corner arc
- */
- public RoundedRectangleDashedBorder(int arcWidth, int arcHeight) {
- super(arcWidth, arcHeight);
- }
-
- /**
- * Get the dashed style
- *
- * @see org.eclipse.draw2d.LineBorder#getStyle()
- * @return dashed style
- */
- @Override
- public int getStyle() {
- return SWT.LINE_DASH;
- }
-
- /**
- * Paints rounded rectangular dashed border taking into account arcWidth,
- * arcHeight, line width and line style
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.RoundedRectangleBorder#paint(org.eclipse.draw2d.IFigure, org.eclipse.draw2d.Graphics,
- * org.eclipse.draw2d.geometry.Insets)
- *
- * @param figure
- * Figure for which the paintable rectangle is needed
- * @param graphics
- * the graphics
- * @param insets
- * the insets
- */
- @Override
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- graphics.setLineStyle(SWT.LINE_DASH);
- super.paint(figure, graphics, insets);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.draw2d;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.RoundedRectangleBorder;
+import org.eclipse.swt.SWT;
+
+/**
+ * This class provides a border drawn as a dashed rounded rectangle.
+ *
+ * @author vhemery
+ */
+public class RoundedRectangleDashedBorder extends RoundedRectangleBorder {
+
+ /**
+ * Creates an instance of this class with the given arc width and arc height
+ * in pixels
+ *
+ * @param arcWidth
+ * The width of the corner arc
+ * @param arcHeight
+ * The height of the corner arc
+ */
+ public RoundedRectangleDashedBorder(int arcWidth, int arcHeight) {
+ super(arcWidth, arcHeight);
+ }
+
+ /**
+ * Get the dashed style
+ *
+ * @see org.eclipse.draw2d.LineBorder#getStyle()
+ * @return dashed style
+ */
+ @Override
+ public int getStyle() {
+ return SWT.LINE_DASH;
+ }
+
+ /**
+ * Paints rounded rectangular dashed border taking into account arcWidth,
+ * arcHeight, line width and line style
+ *
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.RoundedRectangleBorder#paint(org.eclipse.draw2d.IFigure, org.eclipse.draw2d.Graphics,
+ * org.eclipse.draw2d.geometry.Insets)
+ *
+ * @param figure
+ * Figure for which the paintable rectangle is needed
+ * @param graphics
+ * the graphics
+ * @param insets
+ * the insets
+ */
+ @Override
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ graphics.setLineStyle(SWT.LINE_DASH);
+ super.paint(figure, graphics, insets);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/CenterAnchor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/CenterAnchor.java
index 0cc329aba99..f0e3a8e27ac 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/CenterAnchor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/CenterAnchor.java
@@ -1,60 +1,60 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
-// * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.draw2d.anchors;
-
-import org.eclipse.draw2d.AbstractConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * An anchor at the center of the figure.
- */
-public class CenterAnchor extends AbstractConnectionAnchor {
-
- public CenterAnchor(IFigure owner) {
- super(owner);
- }
-
- /**
- * @see org.eclipse.draw2d.ConnectionAnchor#getLocation(org.eclipse.draw2d.geometry.Point)
- */
- public Point getLocation(Point reference) {
-
- if(getOwner() == null) {
- return null;
- }
- // Get the rectangle
- Rectangle r = getOwner().getBounds();
-
- // Get the center point
- Point p = r.getCenter();
-
- // Translate the point to absolute
- getOwner().translateToAbsolute(p);
-
- return p;
- }
-
- /**
- * Overrides to disable the reference point
- *
- * @see org.eclipse.draw2d.AbstractConnectionAnchor#getReferencePoint()
- */
- @Override
- public Point getReferencePoint() {
- return getLocation(null);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+// * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.draw2d.anchors;
+
+import org.eclipse.draw2d.AbstractConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * An anchor at the center of the figure.
+ */
+public class CenterAnchor extends AbstractConnectionAnchor {
+
+ public CenterAnchor(IFigure owner) {
+ super(owner);
+ }
+
+ /**
+ * @see org.eclipse.draw2d.ConnectionAnchor#getLocation(org.eclipse.draw2d.geometry.Point)
+ */
+ public Point getLocation(Point reference) {
+
+ if(getOwner() == null) {
+ return null;
+ }
+ // Get the rectangle
+ Rectangle r = getOwner().getBounds();
+
+ // Get the center point
+ Point p = r.getCenter();
+
+ // Translate the point to absolute
+ getOwner().translateToAbsolute(p);
+
+ return p;
+ }
+
+ /**
+ * Overrides to disable the reference point
+ *
+ * @see org.eclipse.draw2d.AbstractConnectionAnchor#getReferencePoint()
+ */
+ @Override
+ public Point getReferencePoint() {
+ return getLocation(null);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/FixedAnchor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/FixedAnchor.java
index 53fd95a43e9..75c97ef764d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/FixedAnchor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/FixedAnchor.java
@@ -1,67 +1,67 @@
-/*****************************************************************************
- * 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:
- * <a href="mailto:thomas.szadel@atosorigin.com">Thomas Szadel</a> - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.draw2d.anchors;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.PrecisionPoint;
-import org.eclipse.gmf.runtime.gef.ui.figures.SlidableAnchor;
-
-/**
- * An anchor that is attached to the top or the bottom of a figure.
- *
- * @author tszadel
- *
- */
-public class FixedAnchor extends SlidableAnchor {
-
- /** Anchor is at the top of the figure. */
- public static final int TOP = 0;
-
- /** Anchor is at the bottom of the figure. */
- public static final int BOTTOM = 1;
-
- /**
- * Constructor.
- *
- * @param f
- * The figure.
- * @param location
- * The location of the anchor ({@link FixedAnchor#TOP} or {@link FixedAnchor#BOTTOM}).
- */
- public FixedAnchor(IFigure f, int location) {
- super(f, location == TOP ? new PrecisionPoint(0.5, 0.0) : new PrecisionPoint(0.5, 1.0));
- }
-
- /**
- * Constructor.
- *
- * @param f
- * The figure.
- */
- public FixedAnchor(IFigure f) {
- super(f);
- }
-
- /**
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor#isDefaultAnchor()
- *
- * @return
- */
-
- @Override
- public boolean isDefaultAnchor() {
- return false;
- }
-
-}
+/*****************************************************************************
+ * 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:
+ * <a href="mailto:thomas.szadel@atosorigin.com">Thomas Szadel</a> - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.draw2d.anchors;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
+import org.eclipse.gmf.runtime.gef.ui.figures.SlidableAnchor;
+
+/**
+ * An anchor that is attached to the top or the bottom of a figure.
+ *
+ * @author tszadel
+ *
+ */
+public class FixedAnchor extends SlidableAnchor {
+
+ /** Anchor is at the top of the figure. */
+ public static final int TOP = 0;
+
+ /** Anchor is at the bottom of the figure. */
+ public static final int BOTTOM = 1;
+
+ /**
+ * Constructor.
+ *
+ * @param f
+ * The figure.
+ * @param location
+ * The location of the anchor ({@link FixedAnchor#TOP} or {@link FixedAnchor#BOTTOM}).
+ */
+ public FixedAnchor(IFigure f, int location) {
+ super(f, location == TOP ? new PrecisionPoint(0.5, 0.0) : new PrecisionPoint(0.5, 1.0));
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param f
+ * The figure.
+ */
+ public FixedAnchor(IFigure f) {
+ super(f);
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.BaseSlidableAnchor#isDefaultAnchor()
+ *
+ * @return
+ */
+
+ @Override
+ public boolean isDefaultAnchor() {
+ return false;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/LifelineAnchor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/LifelineAnchor.java
index 34357272ffa..35c8eae7090 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/LifelineAnchor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/draw2d/anchors/LifelineAnchor.java
@@ -1,73 +1,73 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.draw2d.anchors;
-
-import org.eclipse.draw2d.AbstractConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * A specific anchor to attach "create message" to the middle of the rectangle
- * representing the header of the lifeline
- *
- */
-public class LifelineAnchor extends AbstractConnectionAnchor {
-
- public LifelineAnchor(IFigure owner) {
- super(owner);
- }
-
- /**
- * @see org.eclipse.draw2d.ConnectionAnchor#getLocation(org.eclipse.draw2d.geometry.Point)
- */
- public Point getLocation(Point reference) {
-
- if(getOwner() == null) {
- return null;
- }
-
- Rectangle r = getOwner().getBounds();
-
- Point p = new Point();
-
- p.y = r.y + r.getSize().height / 2;
- // By default x is set to the left side of the figure
- p.x = r.getLeft().x;
-
- if(reference != null) {
- // If the reference point is located at the right of the figure
- // means the point should be attached to the right side.
- if(reference.x > r.x) {
- p.x = r.getRight().x;
- }
- }
-
- // Translate the point to absolute
- getOwner().translateToAbsolute(p);
-
- return p;
- }
-
- /**
- * Overrides to disable the reference point
- *
- * @see org.eclipse.draw2d.AbstractConnectionAnchor#getReferencePoint()
- */
- @Override
- public Point getReferencePoint() {
- return getLocation(null);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.draw2d.anchors;
+
+import org.eclipse.draw2d.AbstractConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * A specific anchor to attach "create message" to the middle of the rectangle
+ * representing the header of the lifeline
+ *
+ */
+public class LifelineAnchor extends AbstractConnectionAnchor {
+
+ public LifelineAnchor(IFigure owner) {
+ super(owner);
+ }
+
+ /**
+ * @see org.eclipse.draw2d.ConnectionAnchor#getLocation(org.eclipse.draw2d.geometry.Point)
+ */
+ public Point getLocation(Point reference) {
+
+ if(getOwner() == null) {
+ return null;
+ }
+
+ Rectangle r = getOwner().getBounds();
+
+ Point p = new Point();
+
+ p.y = r.y + r.getSize().height / 2;
+ // By default x is set to the left side of the figure
+ p.x = r.getLeft().x;
+
+ if(reference != null) {
+ // If the reference point is located at the right of the figure
+ // means the point should be attached to the right side.
+ if(reference.x > r.x) {
+ p.x = r.getRight().x;
+ }
+ }
+
+ // Translate the point to absolute
+ getOwner().translateToAbsolute(p);
+
+ return p;
+ }
+
+ /**
+ * Overrides to disable the reference point
+ *
+ * @see org.eclipse.draw2d.AbstractConnectionAnchor#getReferencePoint()
+ */
+ @Override
+ public Point getReferencePoint() {
+ return getLocation(null);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractBorderEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractBorderEditPart.java
index 14608512b82..bc47e45806d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractBorderEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractBorderEditPart.java
@@ -1,46 +1,46 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Abstract EditPart for Border elements like Port
- */
-public abstract class AbstractBorderEditPart extends BorderNamedElementEditPart implements IUMLNamedElementEditPart {
-
- /** Constructor */
- public AbstractBorderEditPart(View view) {
- super(view);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.editparts.BorderNamedElementEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
- *
- * @param event
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- // set the figure active when the feature of the of a class is true
- if(resolveSemanticElement() != null) {
- refreshFontColor();
- }
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Abstract EditPart for Border elements like Port
+ */
+public abstract class AbstractBorderEditPart extends BorderNamedElementEditPart implements IUMLNamedElementEditPart {
+
+ /** Constructor */
+ public AbstractBorderEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.editparts.BorderNamedElementEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param event
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ // set the figure active when the feature of the of a class is true
+ if(resolveSemanticElement() != null) {
+ refreshFontColor();
+ }
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractCommentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractCommentEditPart.java
index 776e47899ec..d2a8aba4197 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractCommentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractCommentEditPart.java
@@ -1,112 +1,112 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * this is a abstract editpart to display a comment
- */
-public class AbstractCommentEditPart extends NodeEditPart {
-
- public AbstractCommentEditPart(View view) {
- super(view);
- }
-
- @Override
- public IPapyrusNodeFigure getPrimaryShape() {
- return new HTMLCornerBentFigure();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- // set the figure active when the feature of the of a class is true
- if(resolveSemanticElement() != null) {
- refreshFontColor();
-
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- // adds the stereotype application edit policy
- installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
- }
-
- /**
- * Refresh figure's background transparency.
- *
- * @since 1.2
- */
- @Override
- protected void refreshTransparency() {
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(style.getGradient() != null) {
- setTransparency(style.getTransparency());
- } else {
- setTransparency(0);
- }
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshFontColor();
-
- }
-
- /** Refresh the editpart's figure font color. */
- @Override
- protected void refreshFontColor() {
- FontStyle style = (FontStyle)getPrimaryView().getStyle(NotationPackage.Literals.FONT_STYLE);
- if(style != null) {
- setFontColor(DiagramColorRegistry.getInstance().getColor(new Integer(style.getFontColor())));
- }
- }
-
- /**
- * @generated
- */
- @Override
- protected void setFontColor(Color color) {
- getFigure().setForegroundColor(color);
- }
-
- @Override
- protected void setForegroundColor(Color color) {
- getPrimaryShape().setBorderColor(color);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.notation.FillStyle;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.HTMLCornerBentFigure;
+import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * this is a abstract editpart to display a comment
+ */
+public class AbstractCommentEditPart extends NodeEditPart {
+
+ public AbstractCommentEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ public IPapyrusNodeFigure getPrimaryShape() {
+ return new HTMLCornerBentFigure();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ // set the figure active when the feature of the of a class is true
+ if(resolveSemanticElement() != null) {
+ refreshFontColor();
+
+ }
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ // adds the stereotype application edit policy
+ installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
+ }
+
+ /**
+ * Refresh figure's background transparency.
+ *
+ * @since 1.2
+ */
+ @Override
+ protected void refreshTransparency() {
+ FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if(style.getGradient() != null) {
+ setTransparency(style.getTransparency());
+ } else {
+ setTransparency(0);
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshFontColor();
+
+ }
+
+ /** Refresh the editpart's figure font color. */
+ @Override
+ protected void refreshFontColor() {
+ FontStyle style = (FontStyle)getPrimaryView().getStyle(NotationPackage.Literals.FONT_STYLE);
+ if(style != null) {
+ setFontColor(DiagramColorRegistry.getInstance().getColor(new Integer(style.getFontColor())));
+ }
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void setFontColor(Color color) {
+ getFigure().setForegroundColor(color);
+ }
+
+ @Override
+ protected void setForegroundColor(Color color) {
+ getPrimaryShape().setBorderColor(color);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractConstraintEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractConstraintEditPart.java
index bf319fbfe5b..726b3ed4c6f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractConstraintEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractConstraintEditPart.java
@@ -1,106 +1,106 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-
-/**
- * this is an abstract editpart to manage a constraint
- *
- */
-public class AbstractConstraintEditPart extends NamedElementEditPart {
-
- protected static final String CONSTRAINT_VALUE_SPECIFICATION_LISTENER = "Constraint_valueSpecification_Listener";
-
- public AbstractConstraintEditPart(View view) {
- super(view);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * this methods add listeners on targets and sources
- */
- protected void addAssociationEndListeners() {
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.editparts.NodeEditPart#getPrimaryShape()
- */
- @Override
- public IPapyrusNodeFigure getPrimaryShape() {
- return new ConstraintFigure();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart#refreshLabelsFont(org.eclipse.swt.graphics.Font)
- */
- @Override
- protected void refreshLabelsFont(Font font) {
- // TODO Auto-generated method stub
- super.refreshLabelsFont(font);
- if(getPrimaryShape() instanceof ConstraintFigure) {
- ((ConstraintFigure)getPrimaryShape()).getTextFlow().setFont(font);
- }
- }
-
- @Override
- protected void refreshBackgroundColor() {
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(style != null) {
- if(style.getGradient() == null || !supportsGradient()) {
- setBackgroundColor(DiagramColorRegistry.getInstance().getColor(new Integer(style.getFillColor())));
- } else {
- setGradient(style.getGradient());
- }
- }
- }
-
- /**
- * Refresh figure's background transparency.
- *
- * @since 1.2
- */
- @Override
- protected void refreshTransparency() {
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(style.getGradient() != null) {
- setTransparency(style.getTransparency());
- } else {
- setTransparency(0);
- }
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart#setFontColor(org.eclipse.swt.graphics.Color)
- */
- @Override
- protected void setFontColor(Color color) {
- // TODO Auto-generated method stub
- super.setFontColor(color);
- if(getPrimaryShape() instanceof ConstraintFigure) {
- ((ConstraintFigure)getPrimaryShape()).getPageFlow().setForegroundColor(color);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramColorRegistry;
+import org.eclipse.gmf.runtime.notation.FillStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ConstraintFigure;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+
+/**
+ * this is an abstract editpart to manage a constraint
+ *
+ */
+public class AbstractConstraintEditPart extends NamedElementEditPart {
+
+ protected static final String CONSTRAINT_VALUE_SPECIFICATION_LISTENER = "Constraint_valueSpecification_Listener";
+
+ public AbstractConstraintEditPart(View view) {
+ super(view);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * this methods add listeners on targets and sources
+ */
+ protected void addAssociationEndListeners() {
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.editparts.NodeEditPart#getPrimaryShape()
+ */
+ @Override
+ public IPapyrusNodeFigure getPrimaryShape() {
+ return new ConstraintFigure();
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart#refreshLabelsFont(org.eclipse.swt.graphics.Font)
+ */
+ @Override
+ protected void refreshLabelsFont(Font font) {
+ // TODO Auto-generated method stub
+ super.refreshLabelsFont(font);
+ if(getPrimaryShape() instanceof ConstraintFigure) {
+ ((ConstraintFigure)getPrimaryShape()).getTextFlow().setFont(font);
+ }
+ }
+
+ @Override
+ protected void refreshBackgroundColor() {
+ FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if(style != null) {
+ if(style.getGradient() == null || !supportsGradient()) {
+ setBackgroundColor(DiagramColorRegistry.getInstance().getColor(new Integer(style.getFillColor())));
+ } else {
+ setGradient(style.getGradient());
+ }
+ }
+ }
+
+ /**
+ * Refresh figure's background transparency.
+ *
+ * @since 1.2
+ */
+ @Override
+ protected void refreshTransparency() {
+ FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if(style.getGradient() != null) {
+ setTransparency(style.getTransparency());
+ } else {
+ setTransparency(0);
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.editparts.NamedElementEditPart#setFontColor(org.eclipse.swt.graphics.Color)
+ */
+ @Override
+ protected void setFontColor(Color color) {
+ // TODO Auto-generated method stub
+ super.setFontColor(color);
+ if(getPrimaryShape() instanceof ConstraintFigure) {
+ ((ConstraintFigure)getPrimaryShape()).getPageFlow().setForegroundColor(color);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractLabelEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractLabelEditPart.java
index 8b8010889c3..99d05b1197d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractLabelEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractLabelEditPart.java
@@ -1,40 +1,40 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
-
-/**
- * This is an editpart in which we can access to the wrapping label for example
- * it can be use to display stereotype as external node
- */
-public abstract class AbstractLabelEditPart extends PapyrusLabelEditPart implements IPapyrusEditPart {
-
- public AbstractLabelEditPart(View view) {
- super(view);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public IFigure getPrimaryShape() {
- return getFigure();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
+
+/**
+ * This is an editpart in which we can access to the wrapping label for example
+ * it can be use to display stereotype as external node
+ */
+public abstract class AbstractLabelEditPart extends PapyrusLabelEditPart implements IPapyrusEditPart {
+
+ public AbstractLabelEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public IFigure getPrimaryShape() {
+ return getFigure();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShapeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShapeEditPart.java
index b9c7ba8a9d2..b2fdc222b9b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShapeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShapeEditPart.java
@@ -1,137 +1,137 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import java.net.MalformedURLException;
-import java.util.StringTokenizer;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
-import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ShapeNamedElementFigure;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- * this is an abstract class used to display an element as a shape. it looks for
- * image in the associated stereotype
- *
- */
-public abstract class AbstractShapeEditPart extends AbstractBorderedShapeEditPart implements IPapyrusEditPart {
-
- private static final String SHAPE_CONSTANT = "shape";
-
- public AbstractShapeEditPart(View view) {
- super(view);
- }
-
- @Override
- protected NodeFigure createMainFigure() {
- return null;
- }
-
- private IPageIconsRegistry editorRegistry;
-
- /**
- * Return the EditorRegistry for nested editor descriptors. Subclass should
- * implements this method in order to return the registry associated to the
- * extension point namespace.
- *
- * @return the EditorRegistry for nested editor descriptors
- *
- */
- protected IPageIconsRegistry createEditorRegistry() {
- try {
- return ServiceUtilsForEditPart.getInstance().getService(IPageIconsRegistry.class, this);
- } catch (ServiceException e) {
- // Not found, return an empty one which return null for each
- // request.
- return new PageIconsRegistry();
- } catch (NullPointerException e) {
- // if the editor is null null pointer exception is raised
- // Not found, return an empty one which return null for each
- // request.
- return new PageIconsRegistry();
- }
- }
-
- /**
- * Get the EditorRegistry used to create editor instances. This default
- * implementation return the singleton eINSTANCE. This method can be
- * subclassed to return another registry.
- *
- * @return the singleton eINSTANCE of editor registry
- *
- */
- protected IPageIconsRegistry getEditorRegistry() {
- if(editorRegistry == null) {
- editorRegistry = createEditorRegistry();
- }
- return editorRegistry;
- }
-
- /**
- * get the figure
- *
- * @return
- */
- public abstract ShapeNamedElementFigure getPrimaryShape();
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public void refresh() {
-
- refreshIcons();
- super.refresh();
- }
-
- protected Element getUMLElement() {
- return (Element)resolveSemanticElement();
- }
-
- /**
- * refresh the icon by taking in account the type of the diagram
- */
- private void refreshIcons() {
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getModel());
- StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
- if(tokenizer.hasMoreTokens()) {
- String firstStereotypeName = tokenizer.nextToken();
- Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName);
- org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(getUMLElement(), stereotype, SHAPE_CONSTANT);
- if(icon != null) {
- if(icon.getLocation() != "" && icon.getLocation() != null) {
- try {
- getPrimaryShape().setIcon(icon.getLocation());
- } catch (MalformedURLException e) {
- Activator.log.error(icon.getLocation() + " " + e.getLocalizedMessage(), e);
- }
- } else {
- getPrimaryShape().setIcon(Activator.getShape(getUMLElement(), stereotype, false));
- }
- }
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import java.net.MalformedURLException;
+import java.util.StringTokenizer;
+
+import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
+import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ShapeNamedElementFigure;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+/**
+ * this is an abstract class used to display an element as a shape. it looks for
+ * image in the associated stereotype
+ *
+ */
+public abstract class AbstractShapeEditPart extends AbstractBorderedShapeEditPart implements IPapyrusEditPart {
+
+ private static final String SHAPE_CONSTANT = "shape";
+
+ public AbstractShapeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected NodeFigure createMainFigure() {
+ return null;
+ }
+
+ private IPageIconsRegistry editorRegistry;
+
+ /**
+ * Return the EditorRegistry for nested editor descriptors. Subclass should
+ * implements this method in order to return the registry associated to the
+ * extension point namespace.
+ *
+ * @return the EditorRegistry for nested editor descriptors
+ *
+ */
+ protected IPageIconsRegistry createEditorRegistry() {
+ try {
+ return ServiceUtilsForEditPart.getInstance().getService(IPageIconsRegistry.class, this);
+ } catch (ServiceException e) {
+ // Not found, return an empty one which return null for each
+ // request.
+ return new PageIconsRegistry();
+ } catch (NullPointerException e) {
+ // if the editor is null null pointer exception is raised
+ // Not found, return an empty one which return null for each
+ // request.
+ return new PageIconsRegistry();
+ }
+ }
+
+ /**
+ * Get the EditorRegistry used to create editor instances. This default
+ * implementation return the singleton eINSTANCE. This method can be
+ * subclassed to return another registry.
+ *
+ * @return the singleton eINSTANCE of editor registry
+ *
+ */
+ protected IPageIconsRegistry getEditorRegistry() {
+ if(editorRegistry == null) {
+ editorRegistry = createEditorRegistry();
+ }
+ return editorRegistry;
+ }
+
+ /**
+ * get the figure
+ *
+ * @return
+ */
+ public abstract ShapeNamedElementFigure getPrimaryShape();
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void refresh() {
+
+ refreshIcons();
+ super.refresh();
+ }
+
+ protected Element getUMLElement() {
+ return (Element)resolveSemanticElement();
+ }
+
+ /**
+ * refresh the icon by taking in account the type of the diagram
+ */
+ private void refreshIcons() {
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getModel());
+ StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
+ if(tokenizer.hasMoreTokens()) {
+ String firstStereotypeName = tokenizer.nextToken();
+ Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName);
+ org.eclipse.uml2.uml.Image icon = ElementUtil.getStereotypeImage(getUMLElement(), stereotype, SHAPE_CONSTANT);
+ if(icon != null) {
+ if(icon.getLocation() != "" && icon.getLocation() != null) {
+ try {
+ getPrimaryShape().setIcon(icon.getLocation());
+ } catch (MalformedURLException e) {
+ Activator.log.error(icon.getLocation() + " " + e.getLocalizedMessage(), e);
+ }
+ } else {
+ getPrimaryShape().setIcon(Activator.getShape(getUMLElement(), stereotype, false));
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortCutDiagramEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortCutDiagramEditPart.java
index ac6f25aada0..923c3aedf41 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortCutDiagramEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortCutDiagramEditPart.java
@@ -1,170 +1,170 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
-import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.DiagramNodeFigure;
-
-/**
- * this class is used to constraint the behavior of a node to obtain the
- * behavior a short cut
- */
-public abstract class AbstractShortCutDiagramEditPart extends AbstractBorderedShapeEditPart implements Adapter {
-
- protected static final String DELETE_ICON = "icons/delete.gif";
-
- private IPageIconsRegistry editorRegistry;
-
- private Notifier target;
-
- protected Resource resourceToListen;
-
- public AbstractShortCutDiagramEditPart(View view) {
- super(view);
- }
-
- /**
- * Return the EditorRegistry for nested editor descriptors. Subclass should
- * implements this method in order to return the registry associated to the
- * extension point namespace.
- *
- * @return the EditorRegistry for nested editor descriptors
- *
- */
- protected IPageIconsRegistry createEditorRegistry() {
- try {
- return ServiceUtilsForEditPart.getInstance().getService(IPageIconsRegistry.class, this);
- } catch (ServiceException e) {
- // Not found, return an empty one which return null for each
- // request.
- return new PageIconsRegistry();
- } catch (NullPointerException e) {
- // if the editor is null null pointer exception is raised
- // Not found, return an empty one which return null for each
- // request.
- return new PageIconsRegistry();
- }
- }
-
- @Override
- public void activate() {
- // TODO Auto-generated method stub
- super.activate();
- EObject eObject = resolveSemanticElement();
- resourceToListen = eObject.eResource();
- resourceToListen.eAdapters().add(this);
-
- }
-
- /**
- * Get the EditorRegistry used to create editor instances. This default
- * implementation return the singleton eINSTANCE. This method can be
- * subclassed to return another registry.
- *
- * @return the singleton eINSTANCE of editor registry
- *
- */
- protected IPageIconsRegistry getEditorRegistry() {
- if(editorRegistry == null) {
- editorRegistry = createEditorRegistry();
- }
- return editorRegistry;
- }
-
- /**
- * get the figure
- *
- * @return
- */
- public abstract DiagramNodeFigure getPrimaryShape();
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public void refresh() {
-
- refreshIcons();
- super.refresh();
- }
-
- @Override
- public void notifyChanged(Notification notification) {
- // TODO Auto-generated method stub
- super.notifyChanged(notification);
- refreshIcons();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected void refreshBounds() {
- int width = 34;
- int height = 20;
- Dimension size = new Dimension(width, height);
- int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
- int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
- Point loc = new Point(x, y);
- ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
- }
-
- /**
- * refresh the icon by taking in account the type of the diagram
- */
- private void refreshIcons() {
- if(resolveSemanticElement() instanceof Diagram && resolveSemanticElement().eResource() != null) {
- getPrimaryShape().setIcon(getEditorRegistry().getEditorIcon(resolveSemanticElement()));
- } else {
- getPrimaryShape().setIcon(org.eclipse.papyrus.uml.diagram.common.Activator.getPluginIconImage(org.eclipse.papyrus.uml.diagram.common.Activator.ID, DELETE_ICON));
- }
- }
-
- @Override
- public void deactivate() {
- // TODO Auto-generated method stub
- super.deactivate();
- resourceToListen.eAdapters().remove(this);
- }
-
- public void setTarget(Notifier target) {
- this.target = target;
- }
-
- public Notifier getTarget() {
- return target;
- }
-
- public boolean isAdapterForType(Object type) {
- return (getModel().getClass() == type);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.editorsfactory.IPageIconsRegistry;
+import org.eclipse.papyrus.infra.core.editorsfactory.PageIconsRegistry;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.ServiceUtilsForEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.DiagramNodeFigure;
+
+/**
+ * this class is used to constraint the behavior of a node to obtain the
+ * behavior a short cut
+ */
+public abstract class AbstractShortCutDiagramEditPart extends AbstractBorderedShapeEditPart implements Adapter {
+
+ protected static final String DELETE_ICON = "icons/delete.gif";
+
+ private IPageIconsRegistry editorRegistry;
+
+ private Notifier target;
+
+ protected Resource resourceToListen;
+
+ public AbstractShortCutDiagramEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * Return the EditorRegistry for nested editor descriptors. Subclass should
+ * implements this method in order to return the registry associated to the
+ * extension point namespace.
+ *
+ * @return the EditorRegistry for nested editor descriptors
+ *
+ */
+ protected IPageIconsRegistry createEditorRegistry() {
+ try {
+ return ServiceUtilsForEditPart.getInstance().getService(IPageIconsRegistry.class, this);
+ } catch (ServiceException e) {
+ // Not found, return an empty one which return null for each
+ // request.
+ return new PageIconsRegistry();
+ } catch (NullPointerException e) {
+ // if the editor is null null pointer exception is raised
+ // Not found, return an empty one which return null for each
+ // request.
+ return new PageIconsRegistry();
+ }
+ }
+
+ @Override
+ public void activate() {
+ // TODO Auto-generated method stub
+ super.activate();
+ EObject eObject = resolveSemanticElement();
+ resourceToListen = eObject.eResource();
+ resourceToListen.eAdapters().add(this);
+
+ }
+
+ /**
+ * Get the EditorRegistry used to create editor instances. This default
+ * implementation return the singleton eINSTANCE. This method can be
+ * subclassed to return another registry.
+ *
+ * @return the singleton eINSTANCE of editor registry
+ *
+ */
+ protected IPageIconsRegistry getEditorRegistry() {
+ if(editorRegistry == null) {
+ editorRegistry = createEditorRegistry();
+ }
+ return editorRegistry;
+ }
+
+ /**
+ * get the figure
+ *
+ * @return
+ */
+ public abstract DiagramNodeFigure getPrimaryShape();
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void refresh() {
+
+ refreshIcons();
+ super.refresh();
+ }
+
+ @Override
+ public void notifyChanged(Notification notification) {
+ // TODO Auto-generated method stub
+ super.notifyChanged(notification);
+ refreshIcons();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void refreshBounds() {
+ int width = 34;
+ int height = 20;
+ Dimension size = new Dimension(width, height);
+ int x = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_X())).intValue();
+ int y = ((Integer)getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocation_Y())).intValue();
+ Point loc = new Point(x, y);
+ ((GraphicalEditPart)getParent()).setLayoutConstraint(this, getFigure(), new Rectangle(loc, size));
+ }
+
+ /**
+ * refresh the icon by taking in account the type of the diagram
+ */
+ private void refreshIcons() {
+ if(resolveSemanticElement() instanceof Diagram && resolveSemanticElement().eResource() != null) {
+ getPrimaryShape().setIcon(getEditorRegistry().getEditorIcon(resolveSemanticElement()));
+ } else {
+ getPrimaryShape().setIcon(org.eclipse.papyrus.uml.diagram.common.Activator.getPluginIconImage(org.eclipse.papyrus.uml.diagram.common.Activator.ID, DELETE_ICON));
+ }
+ }
+
+ @Override
+ public void deactivate() {
+ // TODO Auto-generated method stub
+ super.deactivate();
+ resourceToListen.eAdapters().remove(this);
+ }
+
+ public void setTarget(Notifier target) {
+ this.target = target;
+ }
+
+ public Notifier getTarget() {
+ return target;
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return (getModel().getClass() == type);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortcutDiagramNameEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortcutDiagramNameEditPart.java
index f68922ea0a7..8f3d38aaf5d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortcutDiagramNameEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/AbstractShortcutDiagramNameEditPart.java
@@ -1,113 +1,113 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier(CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-
-/**
- * this edit part has in charge to display the name of a diagram for a short cut
- *
- */
-public abstract class AbstractShortcutDiagramNameEditPart extends PapyrusLabelEditPart implements Adapter {
-
- public AbstractShortcutDiagramNameEditPart(View view) {
- super(view);
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#activate()
- *
- */
- @Override
- public void activate() {
- // TODO Auto-generated method stub
- super.activate();
- EObject eObject = resolveSemanticElement();
- resourceToListen = eObject.eResource();
- resourceToListen.eAdapters().add(this);
-
- }
-
- /**
- * the resouce that contains the diagram
- */
- protected Resource resourceToListen;
-
- /**
- * notifier
- */
- private Notifier target;
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#notifyChanged(org.eclipse.emf.common.notify.Notification)
- *
- * @param notification
- */
- @Override
- public void notifyChanged(Notification notification) {
- // TODO Auto-generated method stub
- super.notifyChanged(notification);
- refreshVisuals();
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#deactivate()
- *
- */
- @Override
- public void deactivate() {
- // TODO Auto-generated method stub
- super.deactivate();
- resourceToListen.eAdapters().remove(this);
- }
-
- /**
- *
- * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier)
- *
- */
- public void setTarget(Notifier target) {
- this.target = target;
- }
-
- /**
- *
- * @see org.eclipse.emf.common.notify.Adapter#getTarget()
- *
- */
- public Notifier getTarget() {
- return target;
- }
-
- /**
- *
- * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object)
- *
- */
- public boolean isAdapterForType(Object type) {
- Activator.log.debug(type.toString());
- return (getModel().getClass() == type);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier(CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+
+/**
+ * this edit part has in charge to display the name of a diagram for a short cut
+ *
+ */
+public abstract class AbstractShortcutDiagramNameEditPart extends PapyrusLabelEditPart implements Adapter {
+
+ public AbstractShortcutDiagramNameEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#activate()
+ *
+ */
+ @Override
+ public void activate() {
+ // TODO Auto-generated method stub
+ super.activate();
+ EObject eObject = resolveSemanticElement();
+ resourceToListen = eObject.eResource();
+ resourceToListen.eAdapters().add(this);
+
+ }
+
+ /**
+ * the resouce that contains the diagram
+ */
+ protected Resource resourceToListen;
+
+ /**
+ * notifier
+ */
+ private Notifier target;
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param notification
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ // TODO Auto-generated method stub
+ super.notifyChanged(notification);
+ refreshVisuals();
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart#deactivate()
+ *
+ */
+ @Override
+ public void deactivate() {
+ // TODO Auto-generated method stub
+ super.deactivate();
+ resourceToListen.eAdapters().remove(this);
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier)
+ *
+ */
+ public void setTarget(Notifier target) {
+ this.target = target;
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#getTarget()
+ *
+ */
+ public Notifier getTarget() {
+ return target;
+ }
+
+ /**
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object)
+ *
+ */
+ public boolean isAdapterForType(Object type) {
+ Activator.log.debug(type.toString());
+ return (getModel().getClass() == type);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderNodeEditPart.java
index ce97e1a73ad..c6033a1f9a4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderNodeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderNodeEditPart.java
@@ -1,187 +1,187 @@
-/*****************************************************************************
- * Copyright (c) 2008-2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.runtime.notation.datatype.GradientData;
-import org.eclipse.papyrus.infra.emf.appearance.helper.ShadowFigureHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * <pre>
- * Abstract EditPart supporting shadow and gradient management.
- * Similar implementation to {@link NodeEditPart} but inheriting from {@link BorderedBorderItemEditPart}
- * in order to provide support for Affixed Child nodes.
- * </pre>
- */
-public abstract class BorderNodeEditPart extends BorderedBorderItemEditPart implements IPapyrusEditPart {
-
- /**
- *
- * Constructor.
- *
- * @param view
- */
- public BorderNodeEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected NodeFigure createMainFigure() {
- return createNodeFigure();
- }
-
- /**
- * <p>
- * Returns the primary shape being the View of this edit part.
- * </p>
- * <b>Warning</b> It should never return <code>null</code>
- *
- * @return the primary shape associated to this edit part.
- */
- public abstract IPapyrusNodeFigure getPrimaryShape();
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean supportsGradient() {
- return true;
- }
-
- /**
- * Set the transparency to the correct figure
- *
- * {@inheritDoc}
- */
- @Override
- protected void setTransparency(int transp) {
- getPrimaryShape().setTransparency(transp);
- }
-
- /**
- * Set the background color of this edit part
- *
- * @param color
- * the new value of the back ground color
- *
- *
- */
- @Override
- protected void setBackgroundColor(Color color) {
- getPrimaryShape().setBackgroundColor(color);
- getPrimaryShape().setIsUsingGradient(false);
- getPrimaryShape().setGradientData(-1, -1, 0);
- }
-
- /**
- * Set the gradient data to the correct figure
- *
- * {@inheritDoc}
- */
- @Override
- protected void setGradient(GradientData gradient) {
- IPapyrusNodeFigure fig = getPrimaryShape();
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(gradient != null) {
- fig.setIsUsingGradient(true);;
- fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
- } else {
- fig.setIsUsingGradient(false);
- }
- }
-
- /**
- * Set the font color
- *
- * @param color
- * the new value of the font color
- */
- @Override
- protected void setFontColor(Color color) {
- // No operation.
- }
-
- /**
- * Set the foreground color of this edit part's figure
- *
- * @param color
- * the new value of the foreground color
- */
- @Override
- protected void setForegroundColor(Color color) {
- getPrimaryShape().setForegroundColor(color);
- }
-
- /**
- * Refresh the shadow of the figure
- */
- protected void refreshShadow() {
- getPrimaryShape().setShadow(ShadowFigureHelper.getShadowFigureValue((View)getModel()));
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
- *
- * @param event
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- // Update the figure when the line width changes
- Object feature = event.getFeature();
- if ((getModel() != null) && (getModel() == event.getNotifier())) {
- if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
- refreshLineWidth();
- } else if (NotationPackage.eINSTANCE.getLineTypeStyle_LineType().equals(feature)) {
- refreshLineType();
- }
- }
-
- if(resolveSemanticElement() != null) {
- refreshShadow();
- }
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshShadow();
- refreshLineType();
- refreshLineWidth();
- }
-
- protected void setLineWidth(int width) {
- if (width < 0) {
- width = 1;
- }
- getPrimaryShape().setLineWidth(width);
- }
-
- protected void setLineType(int style) {
- getPrimaryShape().setLineStyle(style);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008-2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.FillStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.datatype.GradientData;
+import org.eclipse.papyrus.infra.emf.appearance.helper.ShadowFigureHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * <pre>
+ * Abstract EditPart supporting shadow and gradient management.
+ * Similar implementation to {@link NodeEditPart} but inheriting from {@link BorderedBorderItemEditPart}
+ * in order to provide support for Affixed Child nodes.
+ * </pre>
+ */
+public abstract class BorderNodeEditPart extends BorderedBorderItemEditPart implements IPapyrusEditPart {
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param view
+ */
+ public BorderNodeEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected NodeFigure createMainFigure() {
+ return createNodeFigure();
+ }
+
+ /**
+ * <p>
+ * Returns the primary shape being the View of this edit part.
+ * </p>
+ * <b>Warning</b> It should never return <code>null</code>
+ *
+ * @return the primary shape associated to this edit part.
+ */
+ public abstract IPapyrusNodeFigure getPrimaryShape();
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean supportsGradient() {
+ return true;
+ }
+
+ /**
+ * Set the transparency to the correct figure
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setTransparency(int transp) {
+ getPrimaryShape().setTransparency(transp);
+ }
+
+ /**
+ * Set the background color of this edit part
+ *
+ * @param color
+ * the new value of the back ground color
+ *
+ *
+ */
+ @Override
+ protected void setBackgroundColor(Color color) {
+ getPrimaryShape().setBackgroundColor(color);
+ getPrimaryShape().setIsUsingGradient(false);
+ getPrimaryShape().setGradientData(-1, -1, 0);
+ }
+
+ /**
+ * Set the gradient data to the correct figure
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setGradient(GradientData gradient) {
+ IPapyrusNodeFigure fig = getPrimaryShape();
+ FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if(gradient != null) {
+ fig.setIsUsingGradient(true);;
+ fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
+ } else {
+ fig.setIsUsingGradient(false);
+ }
+ }
+
+ /**
+ * Set the font color
+ *
+ * @param color
+ * the new value of the font color
+ */
+ @Override
+ protected void setFontColor(Color color) {
+ // No operation.
+ }
+
+ /**
+ * Set the foreground color of this edit part's figure
+ *
+ * @param color
+ * the new value of the foreground color
+ */
+ @Override
+ protected void setForegroundColor(Color color) {
+ getPrimaryShape().setForegroundColor(color);
+ }
+
+ /**
+ * Refresh the shadow of the figure
+ */
+ protected void refreshShadow() {
+ getPrimaryShape().setShadow(ShadowFigureHelper.getShadowFigureValue((View)getModel()));
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart#handleNotificationEvent(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param event
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ // Update the figure when the line width changes
+ Object feature = event.getFeature();
+ if ((getModel() != null) && (getModel() == event.getNotifier())) {
+ if(NotationPackage.eINSTANCE.getLineStyle_LineWidth().equals(feature)) {
+ refreshLineWidth();
+ } else if (NotationPackage.eINSTANCE.getLineTypeStyle_LineType().equals(feature)) {
+ refreshLineType();
+ }
+ }
+
+ if(resolveSemanticElement() != null) {
+ refreshShadow();
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshShadow();
+ refreshLineType();
+ refreshLineWidth();
+ }
+
+ protected void setLineWidth(int width) {
+ if (width < 0) {
+ width = 1;
+ }
+ getPrimaryShape().setLineWidth(width);
+ }
+
+ protected void setLineType(int style) {
+ getPrimaryShape().setLineStyle(style);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderUMLNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderUMLNodeEditPart.java
index 4c81cf741f1..74c29e2df40 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderUMLNodeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/BorderUMLNodeEditPart.java
@@ -1,234 +1,234 @@
-/*****************************************************************************
- * Copyright (c) 2008-2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
-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.resource.FontDescriptor;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure;
-import org.eclipse.papyrus.uml.diagram.common.helper.ICompartmentLayoutHelper;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * <pre>
- * Abstract EditPart supporting :
- * - node and compartments management
- * - stereotype application
- * Similar implementation to {@link UMLNodeEditPart} but inheriting indirectly from {@link BorderedBorderItemEditPart}
- * in order to provide support for Affixed Child nodes.
- * </pre>
- */
-public abstract class BorderUMLNodeEditPart extends BorderNodeEditPart implements IUMLEditPart {
-
- /** FontDescriptor saved in order to dispose the font later */
- private FontDescriptor cachedFontDescriptor;
-
- /** Helper used to change compartment layout when existing **/
- private ICompartmentLayoutHelper compartmentLayoutHelper;
-
- /**
- * Get the compartment layout.
- *
- * @return the compartmentLayoutHelper
- */
- protected ICompartmentLayoutHelper getCompartmentLayoutHelper() {
- return compartmentLayoutHelper;
- }
-
- /**
- * Set the compartment layout.
- *
- * @param compartmentLayoutHelper
- * the compartmentLayoutHelper to set
- */
- protected void setCompartmentLayoutHelper(ICompartmentLayoutHelper compartmentLayoutHelper) {
- this.compartmentLayoutHelper = compartmentLayoutHelper;
- }
-
- /**
- * Constructor.
- *
- * @param view
- * the view controlled by this edit part
- */
- public BorderUMLNodeEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void refresh() {
- super.refresh();
-
- changeLayoutCompartment();
- }
-
- /**
- * {@inheritDoc}
- */
- public Element getUMLElement() {
- return (Element)resolveSemanticElement();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- if(event.getNotifier() instanceof EAnnotation) {
- if(VisualInformationPapyrusConstants.LAYOUTFIGURE.equals(((EAnnotation)event.getNotifier()).getSource())) {
- changeLayoutCompartment();
- }
- }
-
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- refreshFontColor();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- // Add the stereotype application edit policy
- installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
- }
-
- /**
- * this method has in charge to apply the good layout policy on compartments
- */
- protected void changeLayoutCompartment() {
- if(getCompartmentLayoutHelper() != null) {
- Iterator<?> childrenIterator = getChildren().iterator();
- while(childrenIterator.hasNext()) {
- EditPart currentEditPart = (EditPart)childrenIterator.next();
- if(currentEditPart instanceof ListCompartmentEditPart) {
- getCompartmentLayoutHelper().applyLayout((ListCompartmentEditPart)currentEditPart);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EditPart getTargetEditPart(Request request) {
- if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(request.getType())) {
- return this;
- }
- return super.getTargetEditPart(request);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
-
- refreshShadow();
- refreshFontColor();
- }
-
- /**
- * <pre>
- * Refresh used font. This method should not be overridden by subclasses.
- * To refresh labels font, the method refreshLabelsFont should be used.
- *
- * {@inheritDoc}
- * </pre>
- */
- @Override
- protected void refreshFont() {
- FontStyle style = (FontStyle)getPrimaryView().getStyle(NotationPackage.Literals.FONT_STYLE);
- if(style != null) {
- // Get the font
- FontDescriptor fontDescriptor = FontDescriptor.createFrom(getFontData(style));
- Font newFont = getResourceManager().createFont(fontDescriptor);
-
- refreshLabelsFont(newFont);
-
- // Dispose previous Font and FontDescriptor
- if(cachedFontDescriptor != null) {
- getResourceManager().destroyFont(cachedFontDescriptor);
- }
- cachedFontDescriptor = fontDescriptor;
- }
- }
-
- /**
- * <pre>
- * A method to specify the labels to be update when the font is refreshed.
- * Subclasses should call super.refreshLabelsFont(font).
- * </pre>
- *
- * @param font
- * the font to use
- */
- protected void refreshLabelsFont(Font font) {
- Label stereotypesLabel = ((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel();
- if(stereotypesLabel != null) {
- stereotypesLabel.setFont(font);
- }
- }
-
- /**
- * Get the fontData
- *
- * @param style
- * the font style of the figure
- * @return the new font data to use
- */
- protected FontData getFontData(FontStyle style) {
- return new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void setFontColor(Color color) {
- super.setFontColor(color);
-
- Label stereotypesLabel = ((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel();
- if(stereotypesLabel != null) {
- stereotypesLabel.setForegroundColor(color);
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008-2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import java.util.Iterator;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
+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.resource.FontDescriptor;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure;
+import org.eclipse.papyrus.uml.diagram.common.helper.ICompartmentLayoutHelper;
+import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * <pre>
+ * Abstract EditPart supporting :
+ * - node and compartments management
+ * - stereotype application
+ * Similar implementation to {@link UMLNodeEditPart} but inheriting indirectly from {@link BorderedBorderItemEditPart}
+ * in order to provide support for Affixed Child nodes.
+ * </pre>
+ */
+public abstract class BorderUMLNodeEditPart extends BorderNodeEditPart implements IUMLEditPart {
+
+ /** FontDescriptor saved in order to dispose the font later */
+ private FontDescriptor cachedFontDescriptor;
+
+ /** Helper used to change compartment layout when existing **/
+ private ICompartmentLayoutHelper compartmentLayoutHelper;
+
+ /**
+ * Get the compartment layout.
+ *
+ * @return the compartmentLayoutHelper
+ */
+ protected ICompartmentLayoutHelper getCompartmentLayoutHelper() {
+ return compartmentLayoutHelper;
+ }
+
+ /**
+ * Set the compartment layout.
+ *
+ * @param compartmentLayoutHelper
+ * the compartmentLayoutHelper to set
+ */
+ protected void setCompartmentLayoutHelper(ICompartmentLayoutHelper compartmentLayoutHelper) {
+ this.compartmentLayoutHelper = compartmentLayoutHelper;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param view
+ * the view controlled by this edit part
+ */
+ public BorderUMLNodeEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void refresh() {
+ super.refresh();
+
+ changeLayoutCompartment();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Element getUMLElement() {
+ return (Element)resolveSemanticElement();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ if(event.getNotifier() instanceof EAnnotation) {
+ if(VisualInformationPapyrusConstants.LAYOUTFIGURE.equals(((EAnnotation)event.getNotifier()).getSource())) {
+ changeLayoutCompartment();
+ }
+ }
+
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ refreshFontColor();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ // Add the stereotype application edit policy
+ installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
+ }
+
+ /**
+ * this method has in charge to apply the good layout policy on compartments
+ */
+ protected void changeLayoutCompartment() {
+ if(getCompartmentLayoutHelper() != null) {
+ Iterator<?> childrenIterator = getChildren().iterator();
+ while(childrenIterator.hasNext()) {
+ EditPart currentEditPart = (EditPart)childrenIterator.next();
+ if(currentEditPart instanceof ListCompartmentEditPart) {
+ getCompartmentLayoutHelper().applyLayout((ListCompartmentEditPart)currentEditPart);
+ }
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(request.getType())) {
+ return this;
+ }
+ return super.getTargetEditPart(request);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+
+ refreshShadow();
+ refreshFontColor();
+ }
+
+ /**
+ * <pre>
+ * Refresh used font. This method should not be overridden by subclasses.
+ * To refresh labels font, the method refreshLabelsFont should be used.
+ *
+ * {@inheritDoc}
+ * </pre>
+ */
+ @Override
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getPrimaryView().getStyle(NotationPackage.Literals.FONT_STYLE);
+ if(style != null) {
+ // Get the font
+ FontDescriptor fontDescriptor = FontDescriptor.createFrom(getFontData(style));
+ Font newFont = getResourceManager().createFont(fontDescriptor);
+
+ refreshLabelsFont(newFont);
+
+ // Dispose previous Font and FontDescriptor
+ if(cachedFontDescriptor != null) {
+ getResourceManager().destroyFont(cachedFontDescriptor);
+ }
+ cachedFontDescriptor = fontDescriptor;
+ }
+ }
+
+ /**
+ * <pre>
+ * A method to specify the labels to be update when the font is refreshed.
+ * Subclasses should call super.refreshLabelsFont(font).
+ * </pre>
+ *
+ * @param font
+ * the font to use
+ */
+ protected void refreshLabelsFont(Font font) {
+ Label stereotypesLabel = ((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel();
+ if(stereotypesLabel != null) {
+ stereotypesLabel.setFont(font);
+ }
+ }
+
+ /**
+ * Get the fontData
+ *
+ * @param style
+ * the font style of the figure
+ * @return the new font data to use
+ */
+ protected FontData getFontData(FontStyle style) {
+ return new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setFontColor(Color color) {
+ super.setFontColor(color);
+
+ Label stereotypesLabel = ((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel();
+ if(stereotypesLabel != null) {
+ stereotypesLabel.setForegroundColor(color);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ClassifierEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ClassifierEditPart.java
index e655c50cd50..09a4a9b3eea 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ClassifierEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ClassifierEditPart.java
@@ -1,103 +1,103 @@
-/****************************************************************************
- * 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:
- * Thibault Landre (Atos Origin) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ClassifierFigure;
-import org.eclipse.papyrus.uml.diagram.common.helper.BasicClassifierCompartmentLayoutHelper;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Classifier edit part.
- *
- * @author tlandre
- */
-public abstract class ClassifierEditPart extends NamedElementEditPart {
-
- /**
- * isAbstract Classifier property
- */
- private boolean isAbstract;
-
- /**
- * Constructor
- *
- * @param view
- */
- public ClassifierEditPart(View view) {
- super(view);
- setCompartmentLayoutHelper(BasicClassifierCompartmentLayoutHelper.getInstances());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void handleNotificationEvent(Notification notification) {
- super.handleNotificationEvent(notification);
- Object feature = notification.getFeature();
- if(resolveSemanticElement() != null) {
- // Manage isAbstract
- if(UMLPackage.eINSTANCE.getClassifier_IsAbstract().equals(feature)) {
- isAbstract = notification.getNewBooleanValue();
- refreshFont();
- }
- }
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- if(getPrimaryShape() != null && resolveSemanticElement() != null) {
- refreshAbstract();
- refreshIsActive();
- }
- }
-
- protected void refreshIsActive() {
- if(getUMLElement() instanceof org.eclipse.uml2.uml.Class) {
- if(getPrimaryShape() instanceof ClassifierFigure) {
- ((ClassifierFigure)getPrimaryShape()).setActive(((org.eclipse.uml2.uml.Class)getUMLElement()).isActive());
- }
- }
- }
-
- protected void refreshAbstract() {
- if(getUMLElement() instanceof Classifier) {
- isAbstract = ((Classifier)getUMLElement()).isAbstract();
- refreshFont();
-
- }
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected FontData getFontData(FontStyle style) {
- FontData data = super.getFontData(style);
- if(isAbstract) {
- data.setStyle(data.getStyle() | SWT.ITALIC); //Force the Italic flag
- } else {
- data.setStyle(data.getStyle() & ~SWT.ITALIC); //Remove the Italic flag
- }
- return data;
- }
-
-}
+/****************************************************************************
+ * 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:
+ * Thibault Landre (Atos Origin) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ClassifierFigure;
+import org.eclipse.papyrus.uml.diagram.common.helper.BasicClassifierCompartmentLayoutHelper;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Classifier edit part.
+ *
+ * @author tlandre
+ */
+public abstract class ClassifierEditPart extends NamedElementEditPart {
+
+ /**
+ * isAbstract Classifier property
+ */
+ private boolean isAbstract;
+
+ /**
+ * Constructor
+ *
+ * @param view
+ */
+ public ClassifierEditPart(View view) {
+ super(view);
+ setCompartmentLayoutHelper(BasicClassifierCompartmentLayoutHelper.getInstances());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleNotificationEvent(Notification notification) {
+ super.handleNotificationEvent(notification);
+ Object feature = notification.getFeature();
+ if(resolveSemanticElement() != null) {
+ // Manage isAbstract
+ if(UMLPackage.eINSTANCE.getClassifier_IsAbstract().equals(feature)) {
+ isAbstract = notification.getNewBooleanValue();
+ refreshFont();
+ }
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ if(getPrimaryShape() != null && resolveSemanticElement() != null) {
+ refreshAbstract();
+ refreshIsActive();
+ }
+ }
+
+ protected void refreshIsActive() {
+ if(getUMLElement() instanceof org.eclipse.uml2.uml.Class) {
+ if(getPrimaryShape() instanceof ClassifierFigure) {
+ ((ClassifierFigure)getPrimaryShape()).setActive(((org.eclipse.uml2.uml.Class)getUMLElement()).isActive());
+ }
+ }
+ }
+
+ protected void refreshAbstract() {
+ if(getUMLElement() instanceof Classifier) {
+ isAbstract = ((Classifier)getUMLElement()).isAbstract();
+ refreshFont();
+
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected FontData getFontData(FontStyle style) {
+ FontData data = super.getFontData(style);
+ if(isAbstract) {
+ data.setStyle(data.getStyle() | SWT.ITALIC); //Force the Italic flag
+ } else {
+ data.setStyle(data.getStyle() & ~SWT.ITALIC); //Remove the Italic flag
+ }
+ return data;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/CompositeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/CompositeEditPart.java
index d70be1b33c3..43faa8c3178 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/CompositeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/CompositeEditPart.java
@@ -1,104 +1,104 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.runtime.notation.datatype.GradientData;
-import org.eclipse.papyrus.infra.emf.appearance.helper.ShadowFigureHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * this uml edit part can refresh shadow and gradient.
- */
-public abstract class CompositeEditPart extends AbstractBorderedShapeEditPart {
-
- public CompositeEditPart(View view) {
- super(view);
- }
-
- @Override
- protected NodeFigure createMainFigure() {
- return createNodeFigure();
- }
-
- public abstract IPapyrusNodeFigure getPrimaryShape();
-
- @Override
- public boolean supportsGradient() {
- return true;
- }
-
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- // set the figure active when the feature of the of a class is true
- if(resolveSemanticElement() != null) {
- refreshShadow();
-
- }
- }
-
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshShadow();
- }
-
- @Override
- protected void setTransparency(int transp) {
- getPrimaryShape().setTransparency(transp);
- }
-
- /**
- * sets the back ground color of this edit part
- */
- @Override
- protected void setBackgroundColor(Color color) {
- getPrimaryShape().setBackgroundColor(color);
- getPrimaryShape().setIsUsingGradient(false);
- getPrimaryShape().setGradientData(-1, -1, 0);
- }
-
- /**
- * Override to set the gradient data to the correct figure
- */
- @Override
- protected void setGradient(GradientData gradient) {
- IPapyrusNodeFigure fig = getPrimaryShape();
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(gradient != null) {
- fig.setIsUsingGradient(true);;
- fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
- } else {
- fig.setIsUsingGradient(false);
- }
- }
-
- @Override
- protected void setForegroundColor(Color color) {
- getPrimaryShape().setForegroundColor(color);
- }
-
- protected void refreshShadow() {
- getPrimaryShape().setShadow(ShadowFigureHelper.getShadowFigureValue((View)getModel()));
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.FillStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.datatype.GradientData;
+import org.eclipse.papyrus.infra.emf.appearance.helper.ShadowFigureHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * this uml edit part can refresh shadow and gradient.
+ */
+public abstract class CompositeEditPart extends AbstractBorderedShapeEditPart {
+
+ public CompositeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected NodeFigure createMainFigure() {
+ return createNodeFigure();
+ }
+
+ public abstract IPapyrusNodeFigure getPrimaryShape();
+
+ @Override
+ public boolean supportsGradient() {
+ return true;
+ }
+
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ // set the figure active when the feature of the of a class is true
+ if(resolveSemanticElement() != null) {
+ refreshShadow();
+
+ }
+ }
+
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshShadow();
+ }
+
+ @Override
+ protected void setTransparency(int transp) {
+ getPrimaryShape().setTransparency(transp);
+ }
+
+ /**
+ * sets the back ground color of this edit part
+ */
+ @Override
+ protected void setBackgroundColor(Color color) {
+ getPrimaryShape().setBackgroundColor(color);
+ getPrimaryShape().setIsUsingGradient(false);
+ getPrimaryShape().setGradientData(-1, -1, 0);
+ }
+
+ /**
+ * Override to set the gradient data to the correct figure
+ */
+ @Override
+ protected void setGradient(GradientData gradient) {
+ IPapyrusNodeFigure fig = getPrimaryShape();
+ FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if(gradient != null) {
+ fig.setIsUsingGradient(true);;
+ fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
+ } else {
+ fig.setIsUsingGradient(false);
+ }
+ }
+
+ @Override
+ protected void setForegroundColor(Color color) {
+ getPrimaryShape().setForegroundColor(color);
+ }
+
+ protected void refreshShadow() {
+ getPrimaryShape().setShadow(ShadowFigureHelper.getShadowFigureValue((View)getModel()));
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/DeploymentNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/DeploymentNodeEditPart.java
index e0ea68841fa..fb179dc98d9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/DeploymentNodeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/DeploymentNodeEditPart.java
@@ -1,85 +1,85 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.gmf.runtime.notation.datatype.GradientData;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.swt.graphics.Color;
-
-public abstract class DeploymentNodeEditPart extends AbstractBorderedShapeEditPart implements IPapyrusEditPart {
-
- public DeploymentNodeEditPart(View view) {
- super(view);
- }
-
- @Override
- protected NodeFigure createMainFigure() {
- return createNodeFigure();
- }
-
- public abstract IPapyrusNodeFigure getPrimaryShape();
-
- @Override
- public boolean supportsGradient() {
- return true;
- }
-
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
- }
-
- @Override
- protected void setTransparency(int transp) {
- getPrimaryShape().setTransparency(transp);
- }
-
- /**
- * sets the back ground color of this edit part
- */
- @Override
- protected void setBackgroundColor(Color color) {
- getPrimaryShape().setBackgroundColor(color);
- getPrimaryShape().setIsUsingGradient(false);
- getPrimaryShape().setGradientData(-1, -1, 0);
- }
-
- /**
- * Override to set the gradient data to the correct figure
- */
- @Override
- protected void setGradient(GradientData gradient) {
- IPapyrusNodeFigure fig = getPrimaryShape();
- FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
- if(gradient != null) {
- fig.setIsUsingGradient(true);;
- fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
- } else {
- fig.setIsUsingGradient(false);
- }
- }
-
- @Override
- protected void setForegroundColor(Color color) {
- getPrimaryShape().setForegroundColor(color);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.AbstractBorderedShapeEditPart;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.FillStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.gmf.runtime.notation.datatype.GradientData;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.swt.graphics.Color;
+
+public abstract class DeploymentNodeEditPart extends AbstractBorderedShapeEditPart implements IPapyrusEditPart {
+
+ public DeploymentNodeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ protected NodeFigure createMainFigure() {
+ return createNodeFigure();
+ }
+
+ public abstract IPapyrusNodeFigure getPrimaryShape();
+
+ @Override
+ public boolean supportsGradient() {
+ return true;
+ }
+
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+ }
+
+ @Override
+ protected void setTransparency(int transp) {
+ getPrimaryShape().setTransparency(transp);
+ }
+
+ /**
+ * sets the back ground color of this edit part
+ */
+ @Override
+ protected void setBackgroundColor(Color color) {
+ getPrimaryShape().setBackgroundColor(color);
+ getPrimaryShape().setIsUsingGradient(false);
+ getPrimaryShape().setGradientData(-1, -1, 0);
+ }
+
+ /**
+ * Override to set the gradient data to the correct figure
+ */
+ @Override
+ protected void setGradient(GradientData gradient) {
+ IPapyrusNodeFigure fig = getPrimaryShape();
+ FillStyle style = (FillStyle)getPrimaryView().getStyle(NotationPackage.Literals.FILL_STYLE);
+ if(gradient != null) {
+ fig.setIsUsingGradient(true);;
+ fig.setGradientData(style.getFillColor(), gradient.getGradientColor1(), gradient.getGradientStyle());
+ } else {
+ fig.setIsUsingGradient(false);
+ }
+ }
+
+ @Override
+ protected void setForegroundColor(Color color) {
+ getPrimaryShape().setForegroundColor(color);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IEditpartListenerAccess.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IEditpartListenerAccess.java
index 9b0e1c4f752..9747c67e8c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IEditpartListenerAccess.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IEditpartListenerAccess.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import java.util.Iterator;
-
-/**
- * All edit part that implements this interface make accessible the set of
- * eventListener
- *
- * @see AbstractEditPart
- *
- */
-public interface IEditpartListenerAccess {
-
- /**
- * Returns an iterator for the specified type of listener
- *
- * @param clazz
- * the Listener type over which to iterate
- * @return Iterator
- */
- public Iterator getEventListenerIterator(Class clazz);
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import java.util.Iterator;
+
+/**
+ * All edit part that implements this interface make accessible the set of
+ * eventListener
+ *
+ * @see AbstractEditPart
+ *
+ */
+public interface IEditpartListenerAccess {
+
+ /**
+ * Returns an iterator for the specified type of listener
+ *
+ * @param clazz
+ * the Listener type over which to iterate
+ * @return Iterator
+ */
+ public Iterator getEventListenerIterator(Class clazz);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ILabelRoleProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ILabelRoleProvider.java
index 7c77a472450..8521d02a7b3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ILabelRoleProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/ILabelRoleProvider.java
@@ -1,37 +1,37 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-/**
- * This interface is used by the action ShowHideLabelsAction
- *
- *
- *
- */
-public interface ILabelRoleProvider {
-
- /**
- * Returns the label role
- *
- * @return the label role
- */
- public String getLabelRole();
-
- /**
- * Returns an icon illustrating the label role
- *
- * @return an icon illustrating the label role
- */
- public String getIconPathRole();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+/**
+ * This interface is used by the action ShowHideLabelsAction
+ *
+ *
+ *
+ */
+public interface ILabelRoleProvider {
+
+ /**
+ * Returns the label role
+ *
+ * @return the label role
+ */
+ public String getLabelRole();
+
+ /**
+ * Returns an icon illustrating the label role
+ *
+ * @return an icon illustrating the label role
+ */
+ public String getIconPathRole();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLEditPart.java
index d3f651eaf6b..44ee026b493 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLEditPart.java
@@ -1,43 +1,43 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.uml2.uml.Element;
-
-/**
- * this uml edit part can give the UML Element associated to this editpart
- *
- */
-public interface IUMLEditPart {
-
- /**
- * Constant for filters of the {@link DiagramEventBroker} that listen to
- * stereotype application/unapplication
- */
- public final String STEREOTYPED_ELEMENT = "StereotypedElement";
-
- /**
- * Constant for filters of the {@link DiagramEventBroker} that listen to
- * applied stereotype modifications (property changes, etc.)
- */
- public final String STEREOTYPABLE_ELEMENT = "StereotypableElement";
-
- /**
- * Gets the UML element.
- *
- * @return the UML element
- */
- public Element getUMLElement();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * this uml edit part can give the UML Element associated to this editpart
+ *
+ */
+public interface IUMLEditPart {
+
+ /**
+ * Constant for filters of the {@link DiagramEventBroker} that listen to
+ * stereotype application/unapplication
+ */
+ public final String STEREOTYPED_ELEMENT = "StereotypedElement";
+
+ /**
+ * Constant for filters of the {@link DiagramEventBroker} that listen to
+ * applied stereotype modifications (property changes, etc.)
+ */
+ public final String STEREOTYPABLE_ELEMENT = "StereotypableElement";
+
+ /**
+ * Gets the UML element.
+ *
+ * @return the UML element
+ */
+ public Element getUMLElement();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLNamedElementEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLNamedElementEditPart.java
index 0ce48662f73..f14010576ee 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLNamedElementEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/IUMLNamedElementEditPart.java
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * this uml edit part can give the UML NamedElement associated to this editpart.
- */
-public interface IUMLNamedElementEditPart extends IUMLEditPart {
-
- /**
- * Gets the named element.
- *
- * @return the named element
- */
- public NamedElement getNamedElement();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * this uml edit part can give the UML NamedElement associated to this editpart.
+ */
+public interface IUMLNamedElementEditPart extends IUMLEditPart {
+
+ /**
+ * Gets the named element.
+ *
+ * @return the named element
+ */
+ public NamedElement getNamedElement();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NoScrollBarShapeCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NoScrollBarShapeCompartmentEditPart.java
index 05a17f27530..ef8be88d807 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NoScrollBarShapeCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/NoScrollBarShapeCompartmentEditPart.java
@@ -1,39 +1,39 @@
-/*****************************************************************************
- * Copyright (c) 2009-2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (patrick.tessier@cea.fr) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.View;
-
-
-/**
- * this edit part is used to not display scrollbar in the compartment.
- *
- */
-public class NoScrollBarShapeCompartmentEditPart extends
- ShapeCompartmentEditPart {
-
- public NoScrollBarShapeCompartmentEditPart(View view) {
- super(view);
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (patrick.tessier@cea.fr) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.notation.View;
+
+
+/**
+ * this edit part is used to not display scrollbar in the compartment.
+ *
+ */
+public class NoScrollBarShapeCompartmentEditPart extends
+ ShapeCompartmentEditPart {
+
+ public NoScrollBarShapeCompartmentEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ ((ResizableCompartmentFigure)getFigure()).getScrollPane().setScrollBarVisibility(org.eclipse.draw2d.ScrollPane.NEVER);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLCompartmentEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLCompartmentEditPart.java
index 1cdfb0391aa..4e26e3a3aa8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLCompartmentEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLCompartmentEditPart.java
@@ -1,70 +1,70 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-
-/**
- * This edit part manages the application and unapplication of stereotypes on
- * creation.
- */
-public class UMLCompartmentEditPart extends PapyrusCompartmentEditPart {
-
- /**
- * Creates a new UMLCompartmentEditPart.
- *
- * @param model
- * the view managed by this edit part
- */
- public UMLCompartmentEditPart(EObject model) {
- super(model);
- }
-
- @Override
- public boolean isSelectable() {
- // See bug 351433 : https://bugs.eclipse.org/bugs/show_bug.cgi?id=351433
- // This fix changes the behavior of selecting a Class : until now, we
- // had
- // to select a class before being able to select one of its operations
- // or
- // attributes. With this fix, we can select directly the operations or
- // attributes, which means it is now harder to select the class
- // (For Drag&Drop or resizing)
- return getFigure().isShowing(); // FIXME : This is a temporary fix
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- // adds the stereotype application edit policy
- installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EditPart getTargetEditPart(Request request) {
- if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(request.getType())) {
- return this;
- }
- return super.getTargetEditPart(request);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
+
+/**
+ * This edit part manages the application and unapplication of stereotypes on
+ * creation.
+ */
+public class UMLCompartmentEditPart extends PapyrusCompartmentEditPart {
+
+ /**
+ * Creates a new UMLCompartmentEditPart.
+ *
+ * @param model
+ * the view managed by this edit part
+ */
+ public UMLCompartmentEditPart(EObject model) {
+ super(model);
+ }
+
+ @Override
+ public boolean isSelectable() {
+ // See bug 351433 : https://bugs.eclipse.org/bugs/show_bug.cgi?id=351433
+ // This fix changes the behavior of selecting a Class : until now, we
+ // had
+ // to select a class before being able to select one of its operations
+ // or
+ // attributes. With this fix, we can select directly the operations or
+ // attributes, which means it is now harder to select the class
+ // (For Drag&Drop or resizing)
+ return getFigure().isShowing(); // FIXME : This is a temporary fix
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ // adds the stereotype application edit policy
+ installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(request.getType())) {
+ return this;
+ }
+ return super.getTargetEditPart(request);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java
index 81518c67e90..db0db81e772 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLConnectionNodeEditPart.java
@@ -1,312 +1,312 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.edge.UMLEdgeFigure;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-import org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- * Abstract edit part for all connection nodes that control UML elements
- * represented by edges. It then defines basic behavior for Stereotype
- * management. It has facilities to retrieve UML element controlled by this edit
- * part
- */
-public abstract class UMLConnectionNodeEditPart extends ConnectionEditPart implements IUMLEditPart, IEditpartListenerAccess {
-
- /**
- * Creates a new UMLConnectionNodeEditPart
- *
- * @param view
- * owned view by this edit part
- */
- public UMLConnectionNodeEditPart(View view) {
- super(view);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void addSemanticListeners() {
- super.addSemanticListeners();
-
- // retrieve element
- final Element element = getUMLElement();
- if(element == null) {
- return;
- }
-
- // add listener to react to the application and remove of a stereotype
- addListenerFilter(STEREOTYPABLE_ELEMENT, this, resolveSemanticElement());
-
- // add a lister to each already applied stereotyped
- for(EObject stereotypeApplication : element.getStereotypeApplications()) {
- addListenerFilter(STEREOTYPED_ELEMENT, this, stereotypeApplication);
- }
- }
-
- public final Iterator getEventListenerIterator(Class clazz) {
- return getEventListeners(clazz);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- // NOTA: should check here which element has to be refreshed
-
- // check if this concerns a stereotype application or unapplication
- final int eventType = event.getEventType();
-
- if(eventType == PapyrusStereotypeListener.APPLIED_STEREOTYPE) {
- // a stereotype was applied to the notifier
- // then a new listener should be added to the stereotype application
- addListenerFilter(STEREOTYPED_ELEMENT, this, (EObject)event.getNewValue());
- }
-
- // // refresh the figure if stereotypes have changed
- // if (resolveSemanticElement() != null) {
- // refreshAppliedStereotypes();
- // }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- // adds the stereotype application edit policy
- installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
-
- // adds a custom EditPolicy to manage the displaying of each label on
- // the connector
- // this editpolicy erase ConnectionLabelsEditPolicy
- installEditPolicy(ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE, new ShowHideLabelEditPolicy());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EditPart getTargetEditPart(Request request) {
- if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(request.getType())) {
- return this;
- }
- return super.getTargetEditPart(request);
- }
-
- /**
- * <p>
- * Returns the primary shape being the View of this edit part.
- * </p>
- * <b>Warning</b> It should never return <code>null</code>
- *
- * @return the primary shape associated to this edit part.
- */
- public abstract UMLEdgeFigure getPrimaryShape();
-
- /**
- * Refresh the display of stereotypes for this uml node edit part.
- */
- public void refreshAppliedStereotypes() {
- // computes the stereotypes to be displayed
- final String stereotypesToDisplay = stereotypesToDisplay();
- // computes the icon to be displayed
- final Image imageToDisplay = stereotypeIconToDisplay();
-
- // if the string is not empty, then, the figure has to display it. Else,
- // it displays nothing
- if(stereotypesToDisplay != "" || imageToDisplay != null) {
- getPrimaryShape().setStereotypeDisplay(stereotypesToDisplay, imageToDisplay);
- } else {
- // getPrimaryShape().setStereotypeDisplay(null, null);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void removeSemanticListeners() {
- super.removeSemanticListeners();
-
- // remove listeners to react to the application and remove of
- // stereotypes
- removeListenerFilter(STEREOTYPABLE_ELEMENT);
- removeListenerFilter(STEREOTYPED_ELEMENT);
- }
-
- /**
- * {@inheritDoc}
- */
- public Element getUMLElement() {
- return (Element)resolveSemanticElement();
- }
-
- /**
- * get the list of stereotype to display from the eannotation
- *
- * @return the list of stereotypes to display
- */
- public String stereotypesToDisplay() {
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getModel());
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getModel());
-
- // check the presentation kind. if only icon => do not display
- // stereotypes
- if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
- return ""; // empty string, so stereotype label should not be
- // displayed
- }
-
- String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(((View)getModel()));
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
- return stereotypesToDisplay(Activator.ST_RIGHT + "\n" + Activator.ST_LEFT, stereotypesToDisplay, stereotypesToDisplayWithQN);
- } else {
- return stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN);
- }
- }
-
- /**
- * Returns the image to be displayed for the applied stereotypes.
- *
- * @return the image that represents the first applied stereotype or <code>null</code> if no image has to be displayed
- */
- public Image stereotypeIconToDisplay() {
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getModel());
- if(stereotypespresentationKind == null) {
- return null;
- }
- if(stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) {
-
- // retrieve the first stereotype in the list of displayed stereotype
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getModel());
- StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
- if(tokenizer.hasMoreTokens()) {
- String firstStereotypeName = tokenizer.nextToken();
- Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName);
- return Activator.getIconElement(getUMLElement(), stereotype, false);
- }
- }
- return null;
- }
-
- /**
- * Computes the string that displays the stereotypes for the current element
- *
- * @param separator
- * the separator used to split the string representing the
- * stereotypes.
- * @param stereotypesToDisplay
- * the list of stereotypes displayed
- * @param stereotypeWithQualifiedName
- * the list of stereotypes displayed using their qualified names
- * @return the string that represent the stereotypes
- */
- public String stereotypesToDisplay(String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName) {
-
- // AL Changes Feb. 07 - Beg
- // Style Handling for STEREOTYPE_NAME_APPEARANCE from
- // ProfileApplicationPreferencePage
- // Stereotype displayed according to UML standard (first letter forced
- // to lower case) -
- // default -
- // or kept as entered by user (user controlled)
-
- // Get the preference from PreferenceStore. there should be an assert
- final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- assert store != null : "The preference store was not found";
- if(store == null) {
- return "";
- }
- String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
-
- StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
- String out = "";
- while(strQualifiedName.hasMoreElements()) {
- String currentStereotype = strQualifiedName.nextToken();
-
- // check if current stereotype is applied
- final Element umlElement = getUMLElement();
- Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
- if(stereotype != null) {
- String name = currentStereotype;
- if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
- // property value contains qualifiedName ==> extract name
- // from it
- StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
-
- while(strToken.hasMoreTokens()) {
- name = strToken.nextToken();
- }
- }
- // AL Changes Feb. 07 - Beg
- // Handling STEREOTYPE_NAME_APPEARANCE preference (from
- // ProfileApplicationPreferencePage)
- // Previously lowercase forced onto first letter (standard UML)
- // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
- // 1).toLowerCase()+name.substring(1,
- // name.length())+","+separator;
-
- // check that the name has not already been added to the
- // displayed string
- if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
- if(out.indexOf(name) == -1) {
- out = out + name + separator;
- }
- } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
- // {
- name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
- if(out.indexOf(name) == -1) {
- out = out + name + separator;
- }
- }
- }
- }
- if(out.endsWith(",")) {
- out = out.substring(0, out.length() - 1);
- }
- if(out.endsWith(separator)) {
- out = out.substring(0, out.length() - separator.length());
- }
- if(out != "") {
- out = Activator.ST_LEFT + out + Activator.ST_RIGHT;
- }
- return out;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.ConnectionEditPart;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ShowHideLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.edge.UMLEdgeFigure;
+import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
+import org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+/**
+ * Abstract edit part for all connection nodes that control UML elements
+ * represented by edges. It then defines basic behavior for Stereotype
+ * management. It has facilities to retrieve UML element controlled by this edit
+ * part
+ */
+public abstract class UMLConnectionNodeEditPart extends ConnectionEditPart implements IUMLEditPart, IEditpartListenerAccess {
+
+ /**
+ * Creates a new UMLConnectionNodeEditPart
+ *
+ * @param view
+ * owned view by this edit part
+ */
+ public UMLConnectionNodeEditPart(View view) {
+ super(view);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void addSemanticListeners() {
+ super.addSemanticListeners();
+
+ // retrieve element
+ final Element element = getUMLElement();
+ if(element == null) {
+ return;
+ }
+
+ // add listener to react to the application and remove of a stereotype
+ addListenerFilter(STEREOTYPABLE_ELEMENT, this, resolveSemanticElement());
+
+ // add a lister to each already applied stereotyped
+ for(EObject stereotypeApplication : element.getStereotypeApplications()) {
+ addListenerFilter(STEREOTYPED_ELEMENT, this, stereotypeApplication);
+ }
+ }
+
+ public final Iterator getEventListenerIterator(Class clazz) {
+ return getEventListeners(clazz);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ // NOTA: should check here which element has to be refreshed
+
+ // check if this concerns a stereotype application or unapplication
+ final int eventType = event.getEventType();
+
+ if(eventType == PapyrusStereotypeListener.APPLIED_STEREOTYPE) {
+ // a stereotype was applied to the notifier
+ // then a new listener should be added to the stereotype application
+ addListenerFilter(STEREOTYPED_ELEMENT, this, (EObject)event.getNewValue());
+ }
+
+ // // refresh the figure if stereotypes have changed
+ // if (resolveSemanticElement() != null) {
+ // refreshAppliedStereotypes();
+ // }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ // adds the stereotype application edit policy
+ installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
+
+ // adds a custom EditPolicy to manage the displaying of each label on
+ // the connector
+ // this editpolicy erase ConnectionLabelsEditPolicy
+ installEditPolicy(ShowHideLabelEditPolicy.SHOW_HIDE_LABEL_ROLE, new ShowHideLabelEditPolicy());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(request.getType())) {
+ return this;
+ }
+ return super.getTargetEditPart(request);
+ }
+
+ /**
+ * <p>
+ * Returns the primary shape being the View of this edit part.
+ * </p>
+ * <b>Warning</b> It should never return <code>null</code>
+ *
+ * @return the primary shape associated to this edit part.
+ */
+ public abstract UMLEdgeFigure getPrimaryShape();
+
+ /**
+ * Refresh the display of stereotypes for this uml node edit part.
+ */
+ public void refreshAppliedStereotypes() {
+ // computes the stereotypes to be displayed
+ final String stereotypesToDisplay = stereotypesToDisplay();
+ // computes the icon to be displayed
+ final Image imageToDisplay = stereotypeIconToDisplay();
+
+ // if the string is not empty, then, the figure has to display it. Else,
+ // it displays nothing
+ if(stereotypesToDisplay != "" || imageToDisplay != null) {
+ getPrimaryShape().setStereotypeDisplay(stereotypesToDisplay, imageToDisplay);
+ } else {
+ // getPrimaryShape().setStereotypeDisplay(null, null);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void removeSemanticListeners() {
+ super.removeSemanticListeners();
+
+ // remove listeners to react to the application and remove of
+ // stereotypes
+ removeListenerFilter(STEREOTYPABLE_ELEMENT);
+ removeListenerFilter(STEREOTYPED_ELEMENT);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Element getUMLElement() {
+ return (Element)resolveSemanticElement();
+ }
+
+ /**
+ * get the list of stereotype to display from the eannotation
+ *
+ * @return the list of stereotypes to display
+ */
+ public String stereotypesToDisplay() {
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getModel());
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getModel());
+
+ // check the presentation kind. if only icon => do not display
+ // stereotypes
+ if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
+ return ""; // empty string, so stereotype label should not be
+ // displayed
+ }
+
+ String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(((View)getModel()));
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
+ return stereotypesToDisplay(Activator.ST_RIGHT + "\n" + Activator.ST_LEFT, stereotypesToDisplay, stereotypesToDisplayWithQN);
+ } else {
+ return stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN);
+ }
+ }
+
+ /**
+ * Returns the image to be displayed for the applied stereotypes.
+ *
+ * @return the image that represents the first applied stereotype or <code>null</code> if no image has to be displayed
+ */
+ public Image stereotypeIconToDisplay() {
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getModel());
+ if(stereotypespresentationKind == null) {
+ return null;
+ }
+ if(stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) {
+
+ // retrieve the first stereotype in the list of displayed stereotype
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getModel());
+ StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
+ if(tokenizer.hasMoreTokens()) {
+ String firstStereotypeName = tokenizer.nextToken();
+ Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName);
+ return Activator.getIconElement(getUMLElement(), stereotype, false);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Computes the string that displays the stereotypes for the current element
+ *
+ * @param separator
+ * the separator used to split the string representing the
+ * stereotypes.
+ * @param stereotypesToDisplay
+ * the list of stereotypes displayed
+ * @param stereotypeWithQualifiedName
+ * the list of stereotypes displayed using their qualified names
+ * @return the string that represent the stereotypes
+ */
+ public String stereotypesToDisplay(String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName) {
+
+ // AL Changes Feb. 07 - Beg
+ // Style Handling for STEREOTYPE_NAME_APPEARANCE from
+ // ProfileApplicationPreferencePage
+ // Stereotype displayed according to UML standard (first letter forced
+ // to lower case) -
+ // default -
+ // or kept as entered by user (user controlled)
+
+ // Get the preference from PreferenceStore. there should be an assert
+ final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ assert store != null : "The preference store was not found";
+ if(store == null) {
+ return "";
+ }
+ String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
+
+ StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
+ String out = "";
+ while(strQualifiedName.hasMoreElements()) {
+ String currentStereotype = strQualifiedName.nextToken();
+
+ // check if current stereotype is applied
+ final Element umlElement = getUMLElement();
+ Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
+ if(stereotype != null) {
+ String name = currentStereotype;
+ if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
+ // property value contains qualifiedName ==> extract name
+ // from it
+ StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
+
+ while(strToken.hasMoreTokens()) {
+ name = strToken.nextToken();
+ }
+ }
+ // AL Changes Feb. 07 - Beg
+ // Handling STEREOTYPE_NAME_APPEARANCE preference (from
+ // ProfileApplicationPreferencePage)
+ // Previously lowercase forced onto first letter (standard UML)
+ // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
+ // 1).toLowerCase()+name.substring(1,
+ // name.length())+","+separator;
+
+ // check that the name has not already been added to the
+ // displayed string
+ if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
+ if(out.indexOf(name) == -1) {
+ out = out + name + separator;
+ }
+ } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
+ // {
+ name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
+ if(out.indexOf(name) == -1) {
+ out = out + name + separator;
+ }
+ }
+ }
+ }
+ if(out.endsWith(",")) {
+ out = out.substring(0, out.length() - 1);
+ }
+ if(out.endsWith(separator)) {
+ out = out.substring(0, out.length() - separator.length());
+ }
+ if(out != "") {
+ out = Activator.ST_LEFT + out + Activator.ST_RIGHT;
+ }
+ return out;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLNodeEditPart.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLNodeEditPart.java
index 7fa08d1b9c8..a2a58d29c65 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLNodeEditPart.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editparts/UMLNodeEditPart.java
@@ -1,252 +1,252 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editparts;
-
-import java.util.Iterator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.Style;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.resource.FontDescriptor;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeCompartmentFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure;
-import org.eclipse.papyrus.uml.diagram.common.helper.ICompartmentLayoutHelper;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * This UML edit part that can manage node and compartments. It also manages the
- * application of stereotypes on UML elements represented by nodes
- *
- */
-public abstract class UMLNodeEditPart extends NodeEditPart implements IUMLEditPart {
-
- /**
- * Save the fontDescriptor in order to dispose the font later
- */
- private FontDescriptor cachedFontDescriptor;
-
- /** helper use to change the layout of compartment if exist **/
- private ICompartmentLayoutHelper compartmentLayoutHelper;
-
- /**
- * @return the compartmentLayoutHelper
- */
- protected ICompartmentLayoutHelper getCompartmentLayoutHelper() {
- return compartmentLayoutHelper;
- }
-
- /**
- * @param compartmentLayoutHelper
- * the compartmentLayoutHelper to set
- */
- protected void setCompartmentLayoutHelper(ICompartmentLayoutHelper compartmentLayoutHelper) {
- this.compartmentLayoutHelper = compartmentLayoutHelper;
- }
-
- /**
- * Creates a new UmlNodeEditPart.
- *
- * @param view
- * the view controlled by this edit part
- */
- public UMLNodeEditPart(View view) {
- super(view);
- }
-
- @Override
- public void refresh() {
- super.refresh();
- changeLayoutCompartment();
- fixCompartmentTitleVisibility();
- }
-
- /**
- * {@inheritDoc}
- */
- public Element getUMLElement() {
- return (Element)resolveSemanticElement();
- }
-
- @Override
- public void setLayoutConstraint(EditPart child, IFigure childFigure, Object constraint) {
- if(!(childFigure instanceof AppliedStereotypeCompartmentFigure)) {
- getContentPaneFor((IGraphicalEditPart)child).setConstraint(childFigure, constraint);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void handleNotificationEvent(Notification event) {
- super.handleNotificationEvent(event);
-
- if(event.getNotifier() instanceof EAnnotation) {
- if(VisualInformationPapyrusConstants.LAYOUTFIGURE.equals(((EAnnotation)event.getNotifier()).getSource())) {
- changeLayoutCompartment();
- }
- }
-
- Object feature = event.getFeature();
- if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
- refreshFontColor();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createDefaultEditPolicies() {
- super.createDefaultEditPolicies();
- // adds the stereotype application edit policy
- installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
- }
-
- /**
- * this method has in charge to apply the good layout policy on compartments
- */
- protected void changeLayoutCompartment() {
- if(getCompartmentLayoutHelper() != null) {
- Iterator<EditPart> childrenIterator = getChildren().iterator();
- while(childrenIterator.hasNext()) {
- EditPart currentEditPart = childrenIterator.next();
- if(currentEditPart instanceof ListCompartmentEditPart) {
- getCompartmentLayoutHelper().applyLayout((ListCompartmentEditPart)currentEditPart);
- }
- }
- }
- }
-
- /**
- * Models created with Papyrus 0.7.x do not have a TitleStyle in the
- * compartment views. In this case, the GMF code does not touch the
- * visibility of the title, i.e. it remains true by default. This does not
- * correspond to the diagrams in Papyrus 0.7.x having no title visible. See
- * bug 351084
- */
- public void fixCompartmentTitleVisibility() {
- for(Object currentEditPart : getChildren()) {
- if(currentEditPart instanceof ResizableCompartmentEditPart) {
- ResizableCompartmentEditPart rcep = (ResizableCompartmentEditPart)currentEditPart;
- View compartmentView = (View)rcep.getModel();
- Style titleStyle = compartmentView.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
- if(titleStyle == null) {
- if(rcep.getFigure() instanceof ResizableCompartmentFigure) {
- ResizableCompartmentFigure rcf = (ResizableCompartmentFigure)rcep.getFigure();
- rcf.setTitleVisibility(false);
- }
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EditPart getTargetEditPart(Request request) {
- if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(request.getType())) {
- return this;
- }
- return super.getTargetEditPart(request);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshShadow();
- refreshFontColor();
- }
-
- /**
- * Refresh the font. This method shouldn't be overriden by subclasses. To
- * refresh labels font, the method refreshLabelsFont should be used. {@inheritDoc}
- */
- @Override
- protected void refreshFont() {
- FontStyle style = (FontStyle)getPrimaryView().getStyle(NotationPackage.Literals.FONT_STYLE);
- if(style != null) {
- // Get the font
- FontDescriptor fontDescriptor = FontDescriptor.createFrom(getFontData(style));
- Font newFont = getResourceManager().createFont(fontDescriptor);
-
- refreshLabelsFont(newFont);
-
- // Dispose previous Font and FontDescriptor
- if(cachedFontDescriptor != null) {
- getResourceManager().destroyFont(cachedFontDescriptor);
- }
- cachedFontDescriptor = fontDescriptor;
- }
- }
-
- /**
- * A method to specify the labels to be update when the font is refreshed.
- * Subclasses should call super.refreshLabelsFont(font)
- *
- * @param font
- * the font to use
- */
- protected void refreshLabelsFont(Font font) {
- if(((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel() != null) {
- ((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel().setFont(font);
- }
-
- }
-
- /**
- * Update the fontData
- *
- * @param style
- * the font style of the figure
- * @return the new font data to use
- */
- protected FontData getFontData(FontStyle style) {
- return new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void setFontColor(Color color) {
- super.setFontColor(color);
- if(((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel() != null) {
- ((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel().setForegroundColor(color);
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editparts;
+
+import java.util.Iterator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ResizableCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Style;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.resource.FontDescriptor;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.NodeEditPart;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.ApplyStereotypeEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeCompartmentFigure;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure;
+import org.eclipse.papyrus.uml.diagram.common.helper.ICompartmentLayoutHelper;
+import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * This UML edit part that can manage node and compartments. It also manages the
+ * application of stereotypes on UML elements represented by nodes
+ *
+ */
+public abstract class UMLNodeEditPart extends NodeEditPart implements IUMLEditPart {
+
+ /**
+ * Save the fontDescriptor in order to dispose the font later
+ */
+ private FontDescriptor cachedFontDescriptor;
+
+ /** helper use to change the layout of compartment if exist **/
+ private ICompartmentLayoutHelper compartmentLayoutHelper;
+
+ /**
+ * @return the compartmentLayoutHelper
+ */
+ protected ICompartmentLayoutHelper getCompartmentLayoutHelper() {
+ return compartmentLayoutHelper;
+ }
+
+ /**
+ * @param compartmentLayoutHelper
+ * the compartmentLayoutHelper to set
+ */
+ protected void setCompartmentLayoutHelper(ICompartmentLayoutHelper compartmentLayoutHelper) {
+ this.compartmentLayoutHelper = compartmentLayoutHelper;
+ }
+
+ /**
+ * Creates a new UmlNodeEditPart.
+ *
+ * @param view
+ * the view controlled by this edit part
+ */
+ public UMLNodeEditPart(View view) {
+ super(view);
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ changeLayoutCompartment();
+ fixCompartmentTitleVisibility();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Element getUMLElement() {
+ return (Element)resolveSemanticElement();
+ }
+
+ @Override
+ public void setLayoutConstraint(EditPart child, IFigure childFigure, Object constraint) {
+ if(!(childFigure instanceof AppliedStereotypeCompartmentFigure)) {
+ getContentPaneFor((IGraphicalEditPart)child).setConstraint(childFigure, constraint);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void handleNotificationEvent(Notification event) {
+ super.handleNotificationEvent(event);
+
+ if(event.getNotifier() instanceof EAnnotation) {
+ if(VisualInformationPapyrusConstants.LAYOUTFIGURE.equals(((EAnnotation)event.getNotifier()).getSource())) {
+ changeLayoutCompartment();
+ }
+ }
+
+ Object feature = event.getFeature();
+ if(NotationPackage.eINSTANCE.getFontStyle_FontColor().equals(feature)) {
+ refreshFontColor();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createDefaultEditPolicies() {
+ super.createDefaultEditPolicies();
+ // adds the stereotype application edit policy
+ installEditPolicy(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST, new ApplyStereotypeEditPolicy());
+ }
+
+ /**
+ * this method has in charge to apply the good layout policy on compartments
+ */
+ protected void changeLayoutCompartment() {
+ if(getCompartmentLayoutHelper() != null) {
+ Iterator<EditPart> childrenIterator = getChildren().iterator();
+ while(childrenIterator.hasNext()) {
+ EditPart currentEditPart = childrenIterator.next();
+ if(currentEditPart instanceof ListCompartmentEditPart) {
+ getCompartmentLayoutHelper().applyLayout((ListCompartmentEditPart)currentEditPart);
+ }
+ }
+ }
+ }
+
+ /**
+ * Models created with Papyrus 0.7.x do not have a TitleStyle in the
+ * compartment views. In this case, the GMF code does not touch the
+ * visibility of the title, i.e. it remains true by default. This does not
+ * correspond to the diagrams in Papyrus 0.7.x having no title visible. See
+ * bug 351084
+ */
+ public void fixCompartmentTitleVisibility() {
+ for(Object currentEditPart : getChildren()) {
+ if(currentEditPart instanceof ResizableCompartmentEditPart) {
+ ResizableCompartmentEditPart rcep = (ResizableCompartmentEditPart)currentEditPart;
+ View compartmentView = (View)rcep.getModel();
+ Style titleStyle = compartmentView.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
+ if(titleStyle == null) {
+ if(rcep.getFigure() instanceof ResizableCompartmentFigure) {
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure)rcep.getFigure();
+ rcf.setTitleVisibility(false);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(request.getType())) {
+ return this;
+ }
+ return super.getTargetEditPart(request);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void refreshVisuals() {
+ super.refreshVisuals();
+ refreshShadow();
+ refreshFontColor();
+ }
+
+ /**
+ * Refresh the font. This method shouldn't be overriden by subclasses. To
+ * refresh labels font, the method refreshLabelsFont should be used. {@inheritDoc}
+ */
+ @Override
+ protected void refreshFont() {
+ FontStyle style = (FontStyle)getPrimaryView().getStyle(NotationPackage.Literals.FONT_STYLE);
+ if(style != null) {
+ // Get the font
+ FontDescriptor fontDescriptor = FontDescriptor.createFrom(getFontData(style));
+ Font newFont = getResourceManager().createFont(fontDescriptor);
+
+ refreshLabelsFont(newFont);
+
+ // Dispose previous Font and FontDescriptor
+ if(cachedFontDescriptor != null) {
+ getResourceManager().destroyFont(cachedFontDescriptor);
+ }
+ cachedFontDescriptor = fontDescriptor;
+ }
+ }
+
+ /**
+ * A method to specify the labels to be update when the font is refreshed.
+ * Subclasses should call super.refreshLabelsFont(font)
+ *
+ * @param font
+ * the font to use
+ */
+ protected void refreshLabelsFont(Font font) {
+ if(((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel() != null) {
+ ((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel().setFont(font);
+ }
+
+ }
+
+ /**
+ * Update the fontData
+ *
+ * @param style
+ * the font style of the figure
+ * @return the new font data to use
+ */
+ protected FontData getFontData(FontStyle style) {
+ return new FontData(style.getFontName(), style.getFontHeight(), (style.isBold() ? SWT.BOLD : SWT.NORMAL) | (style.isItalic() ? SWT.ITALIC : SWT.NORMAL));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setFontColor(Color color) {
+ super.setFontColor(color);
+ if(((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel() != null) {
+ ((IPapyrusNodeUMLElementFigure)getPrimaryShape()).getStereotypesLabel().setForegroundColor(color);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractAppliedStereotypeDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractAppliedStereotypeDisplayEditPolicy.java
index e2f5128137d..9d69dda22bb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractAppliedStereotypeDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractAppliedStereotypeDisplayEditPolicy.java
@@ -1,297 +1,297 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Nizar GUEDIDI (CEA LIST) - update getUMLElement()
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.DynamicEObjectImpl;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- * Specific edit policy for label displaying stereotypes and their properties
- * for representing UML elements.
- */
-public abstract class AbstractAppliedStereotypeDisplayEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
-
- /** constant for this edit policy role */
- public final static String STEREOTYPE_LABEL_POLICY = "AppliedStereotypeDisplayEditPolicy";
-
- /** host semantic element */
- protected Element hostSemanticElement;
-
- /**
- * Creates a new AppliedStereotype display edit policy
- */
- public AbstractAppliedStereotypeDisplayEditPolicy() {
- super();
- }
-
- /**
- * clean stereotype to display in Eannotation this method can be called directly
- * at the activation of this class
- */
- protected void cleanStereotypeDisplayInEAnnotation() {
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
- StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
- while(strQualifiedName.hasMoreElements()) {
- String currentStereotype = strQualifiedName.nextToken();
- // check if current stereotype is applied
- final Element umlElement = getUMLElement();
- Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
- if(stereotype == null) {
- removeEAnnotationAboutStereotype(currentStereotype);
- }
- }
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
- hostSemanticElement = getUMLElement();
- // adds a listener on the view and the element controlled by the
- // editpart
- getDiagramEventBroker().addNotificationListener(view, this);
- if(hostSemanticElement == null) {
- return;
- }
- getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
- // adds the listener for stereotype application and applied stereotypes
- // add listener to react to the application and remove of a stereotype
- // add a lister to each already applied stereotyped
- for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
- getDiagramEventBroker().addNotificationListener(stereotypeApplication, this);
- }
- refreshDisplay();
- // try to display stereotype properties
- cleanStereotypeDisplayInEAnnotation();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void deactivate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
- getDiagramEventBroker().removeNotificationListener(view, this);
- if(hostSemanticElement == null) {
- return;
- }
- // remove listeners to applied stereotyped
- for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
- getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this);
- }
- // remove notification on element
- getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this);
- // removes the reference to the semantic element
- hostSemanticElement = null;
- }
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
-
- /**
- * Returns the uml element controlled by the host edit part
- *
- * @return the uml element controlled by the host edit part
- */
- protected Element getUMLElement() {
- EObject element = getView().getElement();
- if(element instanceof Element) {
- return (Element)element;
- }
- return null;
- }
-
- /**
- * Returns the view controlled by the host edit part
- *
- * @return the view controlled by the host edit part
- */
- protected View getView() {
- return (View)getHost().getModel();
- }
-
- protected void removeEAnnotationAboutStereotype(final String stereotypeQN) {
- try {
- if(getView() != null) {
- final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(getView());
- if(editingDomain != null) {
- editingDomain.runExclusive(new Runnable() {
-
- public void run() {
- Display.getCurrent().asyncExec(new Runnable() {
-
- public void run() {
- if(getView() != null && editingDomain != null) {
- String presentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(getView());
- RecordingCommand command = AppliedStereotypeHelper.getRemoveAppliedStereotypeCommand(editingDomain, getView(), stereotypeQN, presentationKind);
- editingDomain.getCommandStack().execute(command);
- }
- }
- });
- }
- });
- }
- }
- } catch (InterruptedException e) {
- Activator.log.error(e);
- }
- }
-
- /**
- *
- * {@inheritedDoc}
- */
- public void notifyChanged(Notification notification) {
- // change the label of the figure managed by the host edit part (managed
- // by the parent edit
- // part in general...)
- // it must be changed only if:
- // - the annotation corresponding to the display of the stereotype
- // changes
- // - the stereotype application list has changed
- final int eventType = notification.getEventType();
- if(eventType == PapyrusStereotypeListener.APPLIED_STEREOTYPE) {
- // a stereotype was applied to the notifier
- // then a new listener should be added to the stereotype application
- getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), this);
- } else if(eventType == PapyrusStereotypeListener.UNAPPLIED_STEREOTYPE) {
- getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), this);
- cleanStereotypeDisplayInEAnnotation();
- }
- // if element that has changed is a stereotype => refresh the label.
- if(notification.getNotifier() instanceof EAnnotation) {
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION == ((EAnnotation)notification.getNotifier()).getSource()) {
- // stereotype annotation has changed => refresh label display
- refreshDisplay();
- }
- }
- // if element that has changed is a stereotype => refresh the label.
- if((eventType == PapyrusStereotypeListener.MODIFIED_STEREOTYPE)) {
- // stereotype annotation has changed => refresh label display
- refreshDisplay();
- }
- // The value of a property of stereotype (dynamic profile) has changed
- // To avoid refresh to be called during stereotype removal (stereotype#base_xxx set to null in particular) a complementary test is
- // added here to ensure the stereotype is still applied (the notifier is a stereotype application of the semantic element).
- if((notification.getNotifier() instanceof DynamicEObjectImpl) && (hostSemanticElement != null) && (hostSemanticElement.getStereotypeApplications().contains(notification.getNotifier()))) {
- refreshDisplay();
- }
- }
-
- /**
- * Refreshes the display for the element controlled by the edit part with
- * this edit policies
- */
- public abstract void refreshDisplay();
-
- /**
- * Parses the string containing the complete definition of properties to be
- * displayed, and generates a map.
- *
- * @param stereotypesToDisplay
- * the list of stereotypes to display
- * @param stereotypesPropertiesToDisplay
- * the properties of stereotypes to display
- * @return a map. The keys are the name of displayed stereotypes, the
- * corresponding data is a collection of its properties to be
- * displayed
- */
- protected Map<String, List<String>> parseStereotypeProperties(String stereotypesToDisplay, String stereotypesPropertiesToDisplay) {
- Map<String, List<String>> propertiesMap = new HashMap<String, List<String>>();
- StringTokenizer stringTokenizer = new StringTokenizer(stereotypesPropertiesToDisplay, UMLVisualInformationPapyrusConstant.STEREOTYPE_PROPERTIES_LIST_SEPARATOR);
- while(stringTokenizer.hasMoreTokens()) {
- String propertyName = stringTokenizer.nextToken();
- // retrieve the name of the stereotype for this property
- String stereotypeName = propertyName.substring(0, propertyName.lastIndexOf(".")); // stereotypequalifiedName.propertyname
- if(!propertiesMap.containsKey(stereotypeName)) {
- List<String> propertiesForStereotype = new ArrayList<String>();
- propertiesMap.put(stereotypeName, propertiesForStereotype);
- }
- propertiesMap.get(stereotypeName).add(propertyName.substring(propertyName.lastIndexOf(".") + 1, propertyName.length()));
- }
- return propertiesMap;
- }
-
- /**
- * Returns the image to be displayed for the applied stereotypes.
- *
- * @return the image that represents the first applied stereotype or <code>null</code> if no image has to be displayed
- */
- public Image stereotypeIconToDisplay() {
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getHost().getModel());
- if(stereotypespresentationKind == null) {
- return null;
- }
- if(stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) {
- // retrieve the first stereotype in the list of displayed stereotype
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
- StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
- if(tokenizer.hasMoreTokens()) {
- String firstStereotypeName = tokenizer.nextToken();
- Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName);
- return Activator.getIconElement(getUMLElement(), stereotype, false);
- }
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * Nizar GUEDIDI (CEA LIST) - update getUMLElement()
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.impl.DynamicEObjectImpl;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+
+/**
+ * Specific edit policy for label displaying stereotypes and their properties
+ * for representing UML elements.
+ */
+public abstract class AbstractAppliedStereotypeDisplayEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
+
+ /** constant for this edit policy role */
+ public final static String STEREOTYPE_LABEL_POLICY = "AppliedStereotypeDisplayEditPolicy";
+
+ /** host semantic element */
+ protected Element hostSemanticElement;
+
+ /**
+ * Creates a new AppliedStereotype display edit policy
+ */
+ public AbstractAppliedStereotypeDisplayEditPolicy() {
+ super();
+ }
+
+ /**
+ * clean stereotype to display in Eannotation this method can be called directly
+ * at the activation of this class
+ */
+ protected void cleanStereotypeDisplayInEAnnotation() {
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
+ StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
+ while(strQualifiedName.hasMoreElements()) {
+ String currentStereotype = strQualifiedName.nextToken();
+ // check if current stereotype is applied
+ final Element umlElement = getUMLElement();
+ Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
+ if(stereotype == null) {
+ removeEAnnotationAboutStereotype(currentStereotype);
+ }
+ }
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void activate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+ hostSemanticElement = getUMLElement();
+ // adds a listener on the view and the element controlled by the
+ // editpart
+ getDiagramEventBroker().addNotificationListener(view, this);
+ if(hostSemanticElement == null) {
+ return;
+ }
+ getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
+ // adds the listener for stereotype application and applied stereotypes
+ // add listener to react to the application and remove of a stereotype
+ // add a lister to each already applied stereotyped
+ for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
+ getDiagramEventBroker().addNotificationListener(stereotypeApplication, this);
+ }
+ refreshDisplay();
+ // try to display stereotype properties
+ cleanStereotypeDisplayInEAnnotation();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void deactivate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+ getDiagramEventBroker().removeNotificationListener(view, this);
+ if(hostSemanticElement == null) {
+ return;
+ }
+ // remove listeners to applied stereotyped
+ for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
+ getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this);
+ }
+ // remove notification on element
+ getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this);
+ // removes the reference to the semantic element
+ hostSemanticElement = null;
+ }
+
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ protected DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the uml element controlled by the host edit part
+ *
+ * @return the uml element controlled by the host edit part
+ */
+ protected Element getUMLElement() {
+ EObject element = getView().getElement();
+ if(element instanceof Element) {
+ return (Element)element;
+ }
+ return null;
+ }
+
+ /**
+ * Returns the view controlled by the host edit part
+ *
+ * @return the view controlled by the host edit part
+ */
+ protected View getView() {
+ return (View)getHost().getModel();
+ }
+
+ protected void removeEAnnotationAboutStereotype(final String stereotypeQN) {
+ try {
+ if(getView() != null) {
+ final TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(getView());
+ if(editingDomain != null) {
+ editingDomain.runExclusive(new Runnable() {
+
+ public void run() {
+ Display.getCurrent().asyncExec(new Runnable() {
+
+ public void run() {
+ if(getView() != null && editingDomain != null) {
+ String presentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(getView());
+ RecordingCommand command = AppliedStereotypeHelper.getRemoveAppliedStereotypeCommand(editingDomain, getView(), stereotypeQN, presentationKind);
+ editingDomain.getCommandStack().execute(command);
+ }
+ }
+ });
+ }
+ });
+ }
+ }
+ } catch (InterruptedException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ /**
+ *
+ * {@inheritedDoc}
+ */
+ public void notifyChanged(Notification notification) {
+ // change the label of the figure managed by the host edit part (managed
+ // by the parent edit
+ // part in general...)
+ // it must be changed only if:
+ // - the annotation corresponding to the display of the stereotype
+ // changes
+ // - the stereotype application list has changed
+ final int eventType = notification.getEventType();
+ if(eventType == PapyrusStereotypeListener.APPLIED_STEREOTYPE) {
+ // a stereotype was applied to the notifier
+ // then a new listener should be added to the stereotype application
+ getDiagramEventBroker().addNotificationListener((EObject)notification.getNewValue(), this);
+ } else if(eventType == PapyrusStereotypeListener.UNAPPLIED_STEREOTYPE) {
+ getDiagramEventBroker().removeNotificationListener((EObject)notification.getOldValue(), this);
+ cleanStereotypeDisplayInEAnnotation();
+ }
+ // if element that has changed is a stereotype => refresh the label.
+ if(notification.getNotifier() instanceof EAnnotation) {
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION == ((EAnnotation)notification.getNotifier()).getSource()) {
+ // stereotype annotation has changed => refresh label display
+ refreshDisplay();
+ }
+ }
+ // if element that has changed is a stereotype => refresh the label.
+ if((eventType == PapyrusStereotypeListener.MODIFIED_STEREOTYPE)) {
+ // stereotype annotation has changed => refresh label display
+ refreshDisplay();
+ }
+ // The value of a property of stereotype (dynamic profile) has changed
+ // To avoid refresh to be called during stereotype removal (stereotype#base_xxx set to null in particular) a complementary test is
+ // added here to ensure the stereotype is still applied (the notifier is a stereotype application of the semantic element).
+ if((notification.getNotifier() instanceof DynamicEObjectImpl) && (hostSemanticElement != null) && (hostSemanticElement.getStereotypeApplications().contains(notification.getNotifier()))) {
+ refreshDisplay();
+ }
+ }
+
+ /**
+ * Refreshes the display for the element controlled by the edit part with
+ * this edit policies
+ */
+ public abstract void refreshDisplay();
+
+ /**
+ * Parses the string containing the complete definition of properties to be
+ * displayed, and generates a map.
+ *
+ * @param stereotypesToDisplay
+ * the list of stereotypes to display
+ * @param stereotypesPropertiesToDisplay
+ * the properties of stereotypes to display
+ * @return a map. The keys are the name of displayed stereotypes, the
+ * corresponding data is a collection of its properties to be
+ * displayed
+ */
+ protected Map<String, List<String>> parseStereotypeProperties(String stereotypesToDisplay, String stereotypesPropertiesToDisplay) {
+ Map<String, List<String>> propertiesMap = new HashMap<String, List<String>>();
+ StringTokenizer stringTokenizer = new StringTokenizer(stereotypesPropertiesToDisplay, UMLVisualInformationPapyrusConstant.STEREOTYPE_PROPERTIES_LIST_SEPARATOR);
+ while(stringTokenizer.hasMoreTokens()) {
+ String propertyName = stringTokenizer.nextToken();
+ // retrieve the name of the stereotype for this property
+ String stereotypeName = propertyName.substring(0, propertyName.lastIndexOf(".")); // stereotypequalifiedName.propertyname
+ if(!propertiesMap.containsKey(stereotypeName)) {
+ List<String> propertiesForStereotype = new ArrayList<String>();
+ propertiesMap.put(stereotypeName, propertiesForStereotype);
+ }
+ propertiesMap.get(stereotypeName).add(propertyName.substring(propertyName.lastIndexOf(".") + 1, propertyName.length()));
+ }
+ return propertiesMap;
+ }
+
+ /**
+ * Returns the image to be displayed for the applied stereotypes.
+ *
+ * @return the image that represents the first applied stereotype or <code>null</code> if no image has to be displayed
+ */
+ public Image stereotypeIconToDisplay() {
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getHost().getModel());
+ if(stereotypespresentationKind == null) {
+ return null;
+ }
+ if(stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) {
+ // retrieve the first stereotype in the list of displayed stereotype
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
+ StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
+ if(tokenizer.hasMoreTokens()) {
+ String firstStereotypeName = tokenizer.nextToken();
+ Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName);
+ return Activator.getIconElement(getUMLElement(), stereotype, false);
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractMaskManagedEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractMaskManagedEditPolicy.java
index f2556359404..6baba6fbd36 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractMaskManagedEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractMaskManagedEditPolicy.java
@@ -1,251 +1,251 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.GraphicalEditPolicyEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-import org.eclipse.papyrus.infra.emf.appearance.commands.AddMaskManagedLabelDisplayCommand;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.infra.emf.commands.RemoveEAnnotationCommand;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * Default Abstract implementation of the {@link IMaskManagedLabelEditPolicy}.
- */
-@SuppressWarnings("restriction")
-public abstract class AbstractMaskManagedEditPolicy extends GraphicalEditPolicyEx implements NotificationListener, IPapyrusListener, IMaskManagedLabelEditPolicy {
-
- /**
- * Stores the semantic element related to the edit policy. If
- * resolveSemanticElement is used, there are problems when the edit part is
- * getting destroyed, i.e. the link to the semantic element is removed, but
- * the listeners should still be removed
- */
- protected Element hostSemanticElement;
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
- hostSemanticElement = initSemanticElement();
- if(hostSemanticElement != null) {
-
- // adds a listener on the view and the element controlled by the
- // editpart
- getDiagramEventBroker().addNotificationListener(view, this);
- getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
-
- addAdditionalListeners();
-
- refreshDisplay();
- } else {
- Activator.log.error("No semantic element was found during activation of the mask managed label edit policy", null);
- }
- }
-
- /**
- * Sets the semantic element which is linked to the edit policy
- *
- * @return the element linked to the edit policy
- */
- protected Element initSemanticElement() {
- return (Element)getView().getElement();
- }
-
- /**
- * Adds more listeners upon activation
- */
- protected void addAdditionalListeners() {
- // default implementation does nothing
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void refresh() {
- super.refresh();
- refreshDisplay();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public void deactivate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
- // remove notification on element and view
- getDiagramEventBroker().removeNotificationListener(view, this);
-
- if(hostSemanticElement != null) {
- getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this);
- removeAdditionalListeners();
- }
-
- // removes the reference to the semantic element
- hostSemanticElement = null;
- }
-
- /**
- * Remove additional listeners that were added during activation of the edit
- * policy
- */
- protected void removeAdditionalListeners() {
- // default implementation does nothing
- }
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
-
- /**
- * Returns the {@link Element} managed by this edit part.
- *
- * @return the {@link Element} managed by this edit part.
- */
- public Element getUMLElement() {
- return hostSemanticElement;
- }
-
- /**
- * Returns the view controlled by the host edit part
- *
- * @return the view controlled by the host edit part
- */
- protected View getView() {
- return (View)getHost().getModel();
- }
-
- /**
- * Returns <code>true</code> if the specified object is the annotation in
- * charge of the mask managed label.
- *
- * @param object
- * the object to be checked
- * @return <code>true</code> if the object is an {@link EAnnotation} and its
- * source is the correct one.
- */
- protected boolean isMaskManagedAnnotation(Object object) {
- // check the notifier is an annotation
- if((object instanceof EAnnotation)) {
-
- // notifier is the eannotation. Check this is the annotation in
- // charge of the property
- // label display
- if(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION.equals(((EAnnotation)object).getSource())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns <code>true</code> if the the annotation in charge of the mask
- * managed label is removed from the given object which should be a View.
- *
- * @param object
- * the object to be checked
- * @param notification
- * the notification passed to the policy (which is a listener)
- * @return <code>true</code> if the object is an {@link EAnnotation} and its
- * source is the correct one.
- */
- protected boolean isRemovedMaskManagedLabelAnnotation(Object object, Notification notification) {
- // object is a model element, that means it has EAnnotations
- if(object instanceof EModelElement) {
-
- // something was removed.
- if(notification.getEventType() == Notification.REMOVE) {
- Object oldValue = notification.getOldValue();
-
- // this is an annotation which is returned
- if(oldValue instanceof EAnnotation) {
- // returns true if the annotation has the correct source
- return VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION.equals(((EAnnotation)oldValue).getSource());
- }
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- abstract public void refreshDisplay();
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
- *
- * @param notification
- * the notification object
- */
- public void notifyChanged(Notification notification) {
- Object object = notification.getNotifier();
- if(object != null && object.equals(getView())) {
- refreshDisplay();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void setDefaultDisplayValue() {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(editingDomain != null) {
- editingDomain.getCommandStack().execute(new RemoveEAnnotationCommand(editingDomain, (EModelElement)getHost().getModel(), VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION));
- }
-
- }
-
- /**
- * {@inheritDoc}
- */
- public void updateDisplayValue(int newValue) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(editingDomain != null) {
- editingDomain.getCommandStack().execute(new AddMaskManagedLabelDisplayCommand(editingDomain, (EModelElement)getHost().getModel(), newValue));
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.GraphicalEditPolicyEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
+import org.eclipse.papyrus.infra.emf.appearance.commands.AddMaskManagedLabelDisplayCommand;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.infra.emf.commands.RemoveEAnnotationCommand;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Default Abstract implementation of the {@link IMaskManagedLabelEditPolicy}.
+ */
+@SuppressWarnings("restriction")
+public abstract class AbstractMaskManagedEditPolicy extends GraphicalEditPolicyEx implements NotificationListener, IPapyrusListener, IMaskManagedLabelEditPolicy {
+
+ /**
+ * Stores the semantic element related to the edit policy. If
+ * resolveSemanticElement is used, there are problems when the edit part is
+ * getting destroyed, i.e. the link to the semantic element is removed, but
+ * the listeners should still be removed
+ */
+ protected Element hostSemanticElement;
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void activate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+ hostSemanticElement = initSemanticElement();
+ if(hostSemanticElement != null) {
+
+ // adds a listener on the view and the element controlled by the
+ // editpart
+ getDiagramEventBroker().addNotificationListener(view, this);
+ getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
+
+ addAdditionalListeners();
+
+ refreshDisplay();
+ } else {
+ Activator.log.error("No semantic element was found during activation of the mask managed label edit policy", null);
+ }
+ }
+
+ /**
+ * Sets the semantic element which is linked to the edit policy
+ *
+ * @return the element linked to the edit policy
+ */
+ protected Element initSemanticElement() {
+ return (Element)getView().getElement();
+ }
+
+ /**
+ * Adds more listeners upon activation
+ */
+ protected void addAdditionalListeners() {
+ // default implementation does nothing
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void refresh() {
+ super.refresh();
+ refreshDisplay();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void deactivate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+ // remove notification on element and view
+ getDiagramEventBroker().removeNotificationListener(view, this);
+
+ if(hostSemanticElement != null) {
+ getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this);
+ removeAdditionalListeners();
+ }
+
+ // removes the reference to the semantic element
+ hostSemanticElement = null;
+ }
+
+ /**
+ * Remove additional listeners that were added during activation of the edit
+ * policy
+ */
+ protected void removeAdditionalListeners() {
+ // default implementation does nothing
+ }
+
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ protected DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the {@link Element} managed by this edit part.
+ *
+ * @return the {@link Element} managed by this edit part.
+ */
+ public Element getUMLElement() {
+ return hostSemanticElement;
+ }
+
+ /**
+ * Returns the view controlled by the host edit part
+ *
+ * @return the view controlled by the host edit part
+ */
+ protected View getView() {
+ return (View)getHost().getModel();
+ }
+
+ /**
+ * Returns <code>true</code> if the specified object is the annotation in
+ * charge of the mask managed label.
+ *
+ * @param object
+ * the object to be checked
+ * @return <code>true</code> if the object is an {@link EAnnotation} and its
+ * source is the correct one.
+ */
+ protected boolean isMaskManagedAnnotation(Object object) {
+ // check the notifier is an annotation
+ if((object instanceof EAnnotation)) {
+
+ // notifier is the eannotation. Check this is the annotation in
+ // charge of the property
+ // label display
+ if(VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION.equals(((EAnnotation)object).getSource())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns <code>true</code> if the the annotation in charge of the mask
+ * managed label is removed from the given object which should be a View.
+ *
+ * @param object
+ * the object to be checked
+ * @param notification
+ * the notification passed to the policy (which is a listener)
+ * @return <code>true</code> if the object is an {@link EAnnotation} and its
+ * source is the correct one.
+ */
+ protected boolean isRemovedMaskManagedLabelAnnotation(Object object, Notification notification) {
+ // object is a model element, that means it has EAnnotations
+ if(object instanceof EModelElement) {
+
+ // something was removed.
+ if(notification.getEventType() == Notification.REMOVE) {
+ Object oldValue = notification.getOldValue();
+
+ // this is an annotation which is returned
+ if(oldValue instanceof EAnnotation) {
+ // returns true if the annotation has the correct source
+ return VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION.equals(((EAnnotation)oldValue).getSource());
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ abstract public void refreshDisplay();
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param notification
+ * the notification object
+ */
+ public void notifyChanged(Notification notification) {
+ Object object = notification.getNotifier();
+ if(object != null && object.equals(getView())) {
+ refreshDisplay();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setDefaultDisplayValue() {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(editingDomain != null) {
+ editingDomain.getCommandStack().execute(new RemoveEAnnotationCommand(editingDomain, (EModelElement)getHost().getModel(), VisualInformationPapyrusConstants.CUSTOM_APPEARENCE_ANNOTATION));
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void updateDisplayValue(int newValue) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(editingDomain != null) {
+ editingDomain.getCommandStack().execute(new AddMaskManagedLabelDisplayCommand(editingDomain, (EModelElement)getHost().getModel(), newValue));
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractNameReferencesListenerEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractNameReferencesListenerEditPolicy.java
index 255e94024eb..0260f37e5e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractNameReferencesListenerEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AbstractNameReferencesListenerEditPolicy.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (camille.letavernier@cea.fr) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.GraphicalEditPolicyEx;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.uml.tools.namereferences.NameReferencesHelper;
-
-/**
- * Install listeners on NamedElements referenced by this EditPart
- *
- * @author Camille Letavernier
- *
- * @see {@link NameReferencesHelper}
- */
-public abstract class AbstractNameReferencesListenerEditPolicy extends GraphicalEditPolicyEx implements Adapter {
-
- public static final String NAME_REFERENCES_LISTENER_ID = "nameReferencesListener";
-
- @Override
- public void activate() {
- super.activate();
-
- helper = new NameReferencesHelper(getModel().eResource());
- helper.addListener(this);
- helper.replaceReferences(getText());
- }
-
- protected EObject getModel() {
- return EMFHelper.getEObject(getHost());
- }
-
- protected abstract String getText();
-
- @Override
- public void deactivate() {
- super.deactivate();
-
- helper.removeListener(this);
- helper.dispose();
- }
-
- @Override
- public void refresh() {
- super.refresh();
- if(helper != null) {
- helper.replaceReferences(getText()); //Update listeners after a change on the contents
- }
- }
-
- private NameReferencesHelper helper;
-
- public void notifyChanged(Notification notification) {
- if(getHost() != null && getHost().isActive()) {
- getHost().refresh();
- }
- }
-
- public Notifier getTarget() {
- return null;
- //Ignore
- }
-
- public void setTarget(Notifier newTarget) {
- //Ignore
- }
-
- public boolean isAdapterForType(Object type) {
- return false;
- //Ignore
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (camille.letavernier@cea.fr) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.GraphicalEditPolicyEx;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.uml.tools.namereferences.NameReferencesHelper;
+
+/**
+ * Install listeners on NamedElements referenced by this EditPart
+ *
+ * @author Camille Letavernier
+ *
+ * @see {@link NameReferencesHelper}
+ */
+public abstract class AbstractNameReferencesListenerEditPolicy extends GraphicalEditPolicyEx implements Adapter {
+
+ public static final String NAME_REFERENCES_LISTENER_ID = "nameReferencesListener";
+
+ @Override
+ public void activate() {
+ super.activate();
+
+ helper = new NameReferencesHelper(getModel().eResource());
+ helper.addListener(this);
+ helper.replaceReferences(getText());
+ }
+
+ protected EObject getModel() {
+ return EMFHelper.getEObject(getHost());
+ }
+
+ protected abstract String getText();
+
+ @Override
+ public void deactivate() {
+ super.deactivate();
+
+ helper.removeListener(this);
+ helper.dispose();
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ if(helper != null) {
+ helper.replaceReferences(getText()); //Update listeners after a change on the contents
+ }
+ }
+
+ private NameReferencesHelper helper;
+
+ public void notifyChanged(Notification notification) {
+ if(getHost() != null && getHost().isActive()) {
+ getHost().refresh();
+ }
+ }
+
+ public Notifier getTarget() {
+ return null;
+ //Ignore
+ }
+
+ public void setTarget(Notifier newTarget) {
+ //Ignore
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return false;
+ //Ignore
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AffixedNodeAlignmentEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AffixedNodeAlignmentEditPolicy.java
index 55e21714c15..23f9e094063 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AffixedNodeAlignmentEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AffixedNodeAlignmentEditPolicy.java
@@ -1,45 +1,45 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-
-/**
- *
- * This EditPolicy provides the command for the alignment. In the case of
- * AffixedNode, the parent is not a {@link CompartmentEditPart}, but directly
- * the object. For example, a port is owned by a ClassCompositeEditPart and not
- * by a ClassCompositeCompartmentEditPart
- */
-public class AffixedNodeAlignmentEditPolicy extends ConstrainedItemBorderLayoutEditPolicy {
-
- /** the key for the Port Alignment EditPolicy */
- public static final String AFFIXED_CHILD_ALIGNMENT_ROLE = "affixed node alignment editpolicy"; //$NON-NLS-1$
-
- /**
- * Creates command for <tt>REQ_ALIGN_CHILDREN</tt> requests only; all others
- * requests are ignored
- *
- * @see #getCommand(Request)
- */
- @Override
- public Command getCommand(Request request) {
- if(REQ_ALIGN_CHILDREN.equals(request.getType())) {
- return super.getCommand(request);
- }
-
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+
+/**
+ *
+ * This EditPolicy provides the command for the alignment. In the case of
+ * AffixedNode, the parent is not a {@link CompartmentEditPart}, but directly
+ * the object. For example, a port is owned by a ClassCompositeEditPart and not
+ * by a ClassCompositeCompartmentEditPart
+ */
+public class AffixedNodeAlignmentEditPolicy extends ConstrainedItemBorderLayoutEditPolicy {
+
+ /** the key for the Port Alignment EditPolicy */
+ public static final String AFFIXED_CHILD_ALIGNMENT_ROLE = "affixed node alignment editpolicy"; //$NON-NLS-1$
+
+ /**
+ * Creates command for <tt>REQ_ALIGN_CHILDREN</tt> requests only; all others
+ * requests are ignored
+ *
+ * @see #getCommand(Request)
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if(REQ_ALIGN_CHILDREN.equals(request.getType())) {
+ return super.getCommand(request);
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeAbstractionLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeAbstractionLabelDisplayEditPolicy.java
index fb7c0bfa19f..6aee9a837a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeAbstractionLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeAbstractionLabelDisplayEditPolicy.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-
-/**
- * Edit Policy for Applied Stereotype Label for {@link Abstraction}.
- * <p>
- * It simply adds a tag "abstraction" to the label. Thanks to GMF, it is not possible to call a cTor with a parameter. So it calls super cTor with the
- * "abstraction" parameter
- * </p>
- */
-public class AppliedStereotypeAbstractionLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
-
- /**
- * Creates a new AppliedStereotypeAbstractionLabelDisplayEditPolicy, with
- * the correct tag.
- */
- public AppliedStereotypeAbstractionLabelDisplayEditPolicy() {
- super(Messages.AppliedStereotypeLabel_AbstractionTag);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+
+/**
+ * Edit Policy for Applied Stereotype Label for {@link Abstraction}.
+ * <p>
+ * It simply adds a tag "abstraction" to the label. Thanks to GMF, it is not possible to call a cTor with a parameter. So it calls super cTor with the
+ * "abstraction" parameter
+ * </p>
+ */
+public class AppliedStereotypeAbstractionLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ /**
+ * Creates a new AppliedStereotypeAbstractionLabelDisplayEditPolicy, with
+ * the correct tag.
+ */
+ public AppliedStereotypeAbstractionLabelDisplayEditPolicy() {
+ super(Messages.AppliedStereotypeLabel_AbstractionTag);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeDeploymentLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeDeploymentLabelDisplayEditPolicy.java
index 95941958a75..e904e0fd654 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeDeploymentLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeDeploymentLabelDisplayEditPolicy.java
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-
-
-/**
- * Edit Policy for Applied Stereotype Label for {@link Deployment}.
- */
-public class AppliedStereotypeDeploymentLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
-
- /**
- * Creates the EditPolicy, with the correct tag.
- */
- public AppliedStereotypeDeploymentLabelDisplayEditPolicy() {
- super("deployment"); //$NON-NLS-1$
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+
+
+/**
+ * Edit Policy for Applied Stereotype Label for {@link Deployment}.
+ */
+public class AppliedStereotypeDeploymentLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ /**
+ * Creates the EditPolicy, with the correct tag.
+ */
+ public AppliedStereotypeDeploymentLabelDisplayEditPolicy() {
+ super("deployment"); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java
index b143a87919b..726d4a90d4a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeExternalNodeEditPolicy.java
@@ -1,148 +1,148 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- * Patrick Tessier (CEA LIST) - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
-import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
-
-/**
- * This edit policy is used to display only applied stereotypes and properties
- * in a external node (that is a labelEditPart) In order to use it, the edit
- * part has to be {@link IPapyrusEditPart} and the associated figure has to be {@link IPapyrusUMLElementFigure}
- */
-public class AppliedStereotypeExternalNodeEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
-
- protected View parentView = null;
-
- public AppliedStereotypeExternalNodeEditPolicy() {
- super();
- }
-
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
- super.activate();
- // add a listener for TimeObservationEditPart
- // eContainer = getParent() , but here it's the ECore model
- EObject parent = view.eContainer();
- if(parent instanceof View) {
- parentView = (View)parent;
- getDiagramEventBroker().addNotificationListener(parentView, this);
- }
-
- refreshDisplay();
-
- }
-
- @Override
- public void deactivate() {
- if(parentView != null)
- getDiagramEventBroker().removeNotificationListener(parentView, this);
-
- super.deactivate();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void refreshDisplay() {
- refreshStereotypeDisplay();
- }
-
- /**
- *
- *
- * @return the list of stereotypes to display with properties if there are
- * selected to be displayed
- */
- public String stereotypesToDisplay() {
-
- // retrieve all stereotypes to be displayed
-
- if (parentView == null) {
- return "";
- }
-
- // try to display stereotype properties
- String stereotypespresentationLocation = AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization(parentView);
- String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay(parentView);
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay(parentView);
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(parentView);
-
-
- // now check presentation.
- // if horizontal => equivalent to the inBrace visualization in nodes
- // (i.e. only name =
- // value, separator = comma, delimited with brace
- // if vertical => equivalent to compartment visualization name of
- // stereotype, NL, property =
- // value, NL, etC.
-
- // check the presentation kind. if only icon => do not display
- // stereotype, only values
- if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
- return StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
- }
- String display = "";
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION.equals(stereotypespresentationLocation)) {
- String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(parentView);
-
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
- display += stereotypesAndPropertiesToDisplay("\n", stereotypesToDisplay, stereotypesToDisplayWithQN, stereotypesPropertiesToDisplay);
- } else {
- final String st = stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN);
- if(st != null && !st.equals("")) {
- display += Activator.ST_LEFT + st + Activator.ST_RIGHT;
- }
- final String propSt = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
- if(propSt != null && !propSt.equals("")) {
- if(st != null && !st.equals("")) {
- display += "\n";
- }
- display += "{" + propSt + "}";
- }
- }
- }
- return display;
- }
-
- /**
- * Refresh the text of the stereotype
- */
-
- protected void refreshStereotypeDisplay() {
- if(getHost() instanceof IPapyrusEditPart) {
- IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
-
- if(figure instanceof IPapyrusUMLElementFigure) {// calculate text
- // and icon to
- // display
- final String stereotypesToDisplay = stereotypesToDisplay();
- ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(tag + (stereotypesToDisplay), null);
- }
- }
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+
+/**
+ * This edit policy is used to display only applied stereotypes and properties
+ * in a external node (that is a labelEditPart) In order to use it, the edit
+ * part has to be {@link IPapyrusEditPart} and the associated figure has to be {@link IPapyrusUMLElementFigure}
+ */
+public class AppliedStereotypeExternalNodeEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
+
+ protected View parentView = null;
+
+ public AppliedStereotypeExternalNodeEditPolicy() {
+ super();
+ }
+
+ public void activate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+ super.activate();
+ // add a listener for TimeObservationEditPart
+ // eContainer = getParent() , but here it's the ECore model
+ EObject parent = view.eContainer();
+ if(parent instanceof View) {
+ parentView = (View)parent;
+ getDiagramEventBroker().addNotificationListener(parentView, this);
+ }
+
+ refreshDisplay();
+
+ }
+
+ @Override
+ public void deactivate() {
+ if(parentView != null)
+ getDiagramEventBroker().removeNotificationListener(parentView, this);
+
+ super.deactivate();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void refreshDisplay() {
+ refreshStereotypeDisplay();
+ }
+
+ /**
+ *
+ *
+ * @return the list of stereotypes to display with properties if there are
+ * selected to be displayed
+ */
+ public String stereotypesToDisplay() {
+
+ // retrieve all stereotypes to be displayed
+
+ if (parentView == null) {
+ return "";
+ }
+
+ // try to display stereotype properties
+ String stereotypespresentationLocation = AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization(parentView);
+ String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay(parentView);
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay(parentView);
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(parentView);
+
+
+ // now check presentation.
+ // if horizontal => equivalent to the inBrace visualization in nodes
+ // (i.e. only name =
+ // value, separator = comma, delimited with brace
+ // if vertical => equivalent to compartment visualization name of
+ // stereotype, NL, property =
+ // value, NL, etC.
+
+ // check the presentation kind. if only icon => do not display
+ // stereotype, only values
+ if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
+ return StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
+ }
+ String display = "";
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION.equals(stereotypespresentationLocation)) {
+ String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(parentView);
+
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
+ display += stereotypesAndPropertiesToDisplay("\n", stereotypesToDisplay, stereotypesToDisplayWithQN, stereotypesPropertiesToDisplay);
+ } else {
+ final String st = stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN);
+ if(st != null && !st.equals("")) {
+ display += Activator.ST_LEFT + st + Activator.ST_RIGHT;
+ }
+ final String propSt = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
+ if(propSt != null && !propSt.equals("")) {
+ if(st != null && !st.equals("")) {
+ display += "\n";
+ }
+ display += "{" + propSt + "}";
+ }
+ }
+ }
+ return display;
+ }
+
+ /**
+ * Refresh the text of the stereotype
+ */
+
+ protected void refreshStereotypeDisplay() {
+ if(getHost() instanceof IPapyrusEditPart) {
+ IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
+
+ if(figure instanceof IPapyrusUMLElementFigure) {// calculate text
+ // and icon to
+ // display
+ final String stereotypesToDisplay = stereotypesToDisplay();
+ ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(tag + (stereotypesToDisplay), null);
+ }
+ }
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeIconlDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeIconlDisplayEditPolicy.java
index 8f96a872dc6..463dd2be8fa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeIconlDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeIconlDisplayEditPolicy.java
@@ -1,41 +1,41 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
-
-/**
- * This edit policy displays only icon of applied stereotypes if its exists *.
- * In order to use it, the edit part has to be {@link IPapyrusEditPart} and the
- * associated figure has to be {@link IPapyrusUMLElementFigure}
- */
-public class AppliedStereotypeIconlDisplayEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected void refreshStereotypeDisplay() {
- if(getHost() instanceof IPapyrusEditPart) {
- IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
-
- if(figure instanceof IPapyrusUMLElementFigure) {
- ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(null, stereotypeIconToDisplay());
- }
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
+
+/**
+ * This edit policy displays only icon of applied stereotypes if its exists *.
+ * In order to use it, the edit part has to be {@link IPapyrusEditPart} and the
+ * associated figure has to be {@link IPapyrusUMLElementFigure}
+ */
+public class AppliedStereotypeIconlDisplayEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void refreshStereotypeDisplay() {
+ if(getHost() instanceof IPapyrusEditPart) {
+ IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
+
+ if(figure instanceof IPapyrusUMLElementFigure) {
+ ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(null, stereotypeIconToDisplay());
+ }
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeInformationFlowLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeInformationFlowLabelDisplayEditPolicy.java
index 3ded3ac3fa1..3107f070167 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeInformationFlowLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeInformationFlowLabelDisplayEditPolicy.java
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-
-
-/**
- * Edit Policy for Applied Stereotype Label for {@link InformationFlow}.
- */
-public class AppliedStereotypeInformationFlowLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
-
- /**
- * Creates the EditPolicy, with the correct tag.
- */
- public AppliedStereotypeInformationFlowLabelDisplayEditPolicy() {
- super("flow"); //$NON-NLS-1$
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+
+
+/**
+ * Edit Policy for Applied Stereotype Label for {@link InformationFlow}.
+ */
+public class AppliedStereotypeInformationFlowLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ /**
+ * Creates the EditPolicy, with the correct tag.
+ */
+ public AppliedStereotypeInformationFlowLabelDisplayEditPolicy() {
+ super("flow"); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLabelDisplayEditPolicy.java
index c40bb8d0f0f..12baffe8f84 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLabelDisplayEditPolicy.java
@@ -1,323 +1,323 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- * Specific edit policy for label displaying stereotypes and their properties
- * for edges representing UML elements.
- * <p>
- * It also displays the tag for the links, for example "use" for {@link Usage}.
- *
- */
-public abstract class AppliedStereotypeLabelDisplayEditPolicy extends AbstractAppliedStereotypeDisplayEditPolicy {
-
- /** constant for this edit policy role */
- public final static String STEREOTYPE_LABEL_POLICY = "AppliedStereotypeLabelDisplayEditPolicy";
-
- /** tag displayed for the UML element */
- public String tag;
-
- /**
- * Creates a new AppliedStereotypeLabelDisplayEditPolicy, with the specified
- * tag for the element.
- *
- * @param tag
- * the tag for element, for example "use" for {@link Usage}.
- */
- public AppliedStereotypeLabelDisplayEditPolicy(String tag) {
- super();
- this.tag = Activator.ST_LEFT + tag + Activator.ST_RIGHT;
- }
-
- /**
- * Creates a new AppliedStereotypeLabelDisplayEditPolicy, with no tag for
- * the element.
- */
- public AppliedStereotypeLabelDisplayEditPolicy() {
- super();
- this.tag = "";
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void refreshDisplay() {
- refreshStereotypeDisplay();
- }
-
- /**
- * Refreshes the stereotype display
- */
- protected abstract void refreshStereotypeDisplay();
-
- /**
- * Returns the image to be displayed for the applied stereotypes.
- *
- * @return the image that represents the first applied stereotype or <code>null</code> if no image has to be displayed
- */
- public Image stereotypeIconToDisplay() {
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getHost().getModel());
- if(stereotypespresentationKind == null) {
- return null;
- }
- if(stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) {
-
- // retrieve the first stereotype in the list of displayed stereotype
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
- StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
- if(tokenizer.hasMoreTokens()) {
- String firstStereotypeName = tokenizer.nextToken();
- Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName);
- return Activator.getIconElement(getUMLElement(), stereotype, false);
- }
- }
- return null;
- }
-
- /**
- * Returns a String that displays stereotypes (using their simple name or
- * their qualified name) and their properties
- *
- * @param separator
- * the separator used to split the string representing the
- * stereotypes.
- * @param stereotypesToDisplay
- * the list of stereotypes displayed
- * @param stereotypeWithQualifiedName
- * the list of stereotypes displayed using their qualified names
- * @param stereotypesPropertiesToDisplay
- * the list of properties to display
- * @return a string that displays stereotypes (using their simple name or
- * their qualified name) and their properties
- */
- public String stereotypesAndPropertiesToDisplay(String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName, String stereotypesPropertiesToDisplay) {
- // Get the preference from PreferenceStore. there should be an assert
- final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- assert store != null : "The preference store was not found";
- if(store == null) {
- return "";
- }
- // retrieve if the name of the stereotype has to put to lower case or
- // not
- String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
-
- // changes the string of properties into a map, where the entries of the
- // map are the
- // stereotype qualified name, and the properties to display are the data
- Map<String, List<String>> propertiesToDisplay = parseStereotypeProperties(stereotypesToDisplay, stereotypesPropertiesToDisplay);
-
- StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
- String out = "";
- while(strQualifiedName.hasMoreElements()) {
- String currentStereotype = strQualifiedName.nextToken();
-
- // check if current stereotype is applied
- final Element umlElement = getUMLElement();
- Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
- if(stereotype != null) {
- String name = currentStereotype;
- if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
- // property value contains qualifiedName ==> extract name
- // from it
- StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
-
- while(strToken.hasMoreTokens()) {
- name = strToken.nextToken();
- }
- }
- // AL Changes Feb. 07 - Beg
- // Handling STEREOTYPE_NAME_APPEARANCE preference (from
- // ProfileApplicationPreferencePage)
- // Previously lowercase forced onto first letter (standard UML)
- // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
- // 1).toLowerCase()+name.substring(1,
- // name.length())+","+separator;
-
- // check that the name has not already been added to the
- // displayed string
- if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
- if(out.indexOf(name) == -1) {
- out = out + Activator.ST_LEFT + name + Activator.ST_RIGHT + separator;
- }
- } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
- // {
- name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
- if(out.indexOf(name) == -1) {
- out = out + Activator.ST_LEFT + name + Activator.ST_RIGHT + separator;
- }
- }
-
- // now should add all properties associated to this stereotype
- List<String> properties = propertiesToDisplay.get(stereotype.getQualifiedName());
- if(properties != null) {
- // retrieve property
- for(String propertyName : properties) {
- out = out + StereotypeUtil.displayPropertyValue(stereotype, StereotypeUtil.getPropertyByName(stereotype, propertyName), getUMLElement(), "\n");
- }
- }
- }
- }
- if(out.endsWith(",")) {
- return out.substring(0, out.length() - 1);
- }
- if(out.endsWith(separator)) {
- return out.substring(0, out.length() - separator.length());
- }
- return out;
- }
-
- /**
- * get the list of stereotype to display from the eannotation
- *
- * @return the list of stereotypes to display
- */
- public String stereotypesToDisplay() {
-
- // retrieve all stereotypes to be displayed
-
- // try to display stereotype properties
- String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay((View)getHost().getModel());
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getHost().getModel());
-
- // now check presentation.
- // if horizontal => equivalent to the inBrace visualization in nodes
- // (i.e. only name =
- // value, separator = comma, delimited with brace
- // if vertical => equivalent to compartment visualization name of
- // stereotype, NL, property =
- // value, NL, etC.
-
- // check the presentation kind. if only icon => do not display
- // stereotype, only values
- if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
- return StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
- }
-
- String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(((View)getHost().getModel()));
- String display = "";
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
- display += stereotypesAndPropertiesToDisplay("\n", stereotypesToDisplay, stereotypesToDisplayWithQN, stereotypesPropertiesToDisplay);
- } else {
- final String st = stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN);
- if(st != null && !st.equals("")) {
- display += Activator.ST_LEFT + st + Activator.ST_RIGHT;
- }
- final String propSt = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
- if(propSt != null && !propSt.equals("")) {
- if(st != null && !st.equals("")) {
- display += "\n";
- }
- display += "{" + propSt + "}";
- }
- }
- return display;
- }
-
- /**
- * Computes the string that displays the stereotypes for the current element
- *
- * @param separator
- * the separator used to split the string representing the
- * stereotypes.
- * @param stereotypesToDisplay
- * the list of stereotypes displayed
- * @param stereotypeWithQualifiedName
- * the list of stereotypes displayed using their qualified names
- * @return the string that represent the stereotypes
- */
- public String stereotypesToDisplay(String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName) {
-
- // AL Changes Feb. 07 - Beg
- // Style Handling for STEREOTYPE_NAME_APPEARANCE from
- // ProfileApplicationPreferencePage
- // Stereotype displayed according to UML standard (first letter forced
- // to lower case) -
- // default -
- // or kept as entered by user (user controlled)
-
- // Get the preference from PreferenceStore. there should be an assert
- final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- assert store != null : "The preference store was not found";
- if(store == null) {
- return "";
- }
- String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
-
- StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
- String out = "";
- while(strQualifiedName.hasMoreElements()) {
- String currentStereotype = strQualifiedName.nextToken();
-
- // check if current stereotype is applied
- final Element umlElement = getUMLElement();
- Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
- if(stereotype != null) {
- String name = currentStereotype;
- if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
- // property value contains qualifiedName ==> extract name
- // from it
- StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
-
- while(strToken.hasMoreTokens()) {
- name = strToken.nextToken();
- }
- }
- // AL Changes Feb. 07 - Beg
- // Handling STEREOTYPE_NAME_APPEARANCE preference (from
- // ProfileApplicationPreferencePage)
- // Previously lowercase forced onto first letter (standard UML)
- // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
- // 1).toLowerCase()+name.substring(1,
- // name.length())+","+separator;
-
- // check that the name has not already been added to the
- // displayed string
- if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
- if(out.indexOf(name) == -1) {
- out = out + name + separator;
- }
- } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
- // {
- name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
- if(out.indexOf(name) == -1) {
- out = out + name + separator;
- }
- }
- }
- }
- if(out.endsWith(",")) {
- return out.substring(0, out.length() - 1);
- }
- if(out.endsWith(separator)) {
- return out.substring(0, out.length() - separator.length());
- }
- return out;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+/**
+ * Specific edit policy for label displaying stereotypes and their properties
+ * for edges representing UML elements.
+ * <p>
+ * It also displays the tag for the links, for example "use" for {@link Usage}.
+ *
+ */
+public abstract class AppliedStereotypeLabelDisplayEditPolicy extends AbstractAppliedStereotypeDisplayEditPolicy {
+
+ /** constant for this edit policy role */
+ public final static String STEREOTYPE_LABEL_POLICY = "AppliedStereotypeLabelDisplayEditPolicy";
+
+ /** tag displayed for the UML element */
+ public String tag;
+
+ /**
+ * Creates a new AppliedStereotypeLabelDisplayEditPolicy, with the specified
+ * tag for the element.
+ *
+ * @param tag
+ * the tag for element, for example "use" for {@link Usage}.
+ */
+ public AppliedStereotypeLabelDisplayEditPolicy(String tag) {
+ super();
+ this.tag = Activator.ST_LEFT + tag + Activator.ST_RIGHT;
+ }
+
+ /**
+ * Creates a new AppliedStereotypeLabelDisplayEditPolicy, with no tag for
+ * the element.
+ */
+ public AppliedStereotypeLabelDisplayEditPolicy() {
+ super();
+ this.tag = "";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void refreshDisplay() {
+ refreshStereotypeDisplay();
+ }
+
+ /**
+ * Refreshes the stereotype display
+ */
+ protected abstract void refreshStereotypeDisplay();
+
+ /**
+ * Returns the image to be displayed for the applied stereotypes.
+ *
+ * @return the image that represents the first applied stereotype or <code>null</code> if no image has to be displayed
+ */
+ public Image stereotypeIconToDisplay() {
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getHost().getModel());
+ if(stereotypespresentationKind == null) {
+ return null;
+ }
+ if(stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) {
+
+ // retrieve the first stereotype in the list of displayed stereotype
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
+ StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
+ if(tokenizer.hasMoreTokens()) {
+ String firstStereotypeName = tokenizer.nextToken();
+ Stereotype stereotype = getUMLElement().getAppliedStereotype(firstStereotypeName);
+ return Activator.getIconElement(getUMLElement(), stereotype, false);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns a String that displays stereotypes (using their simple name or
+ * their qualified name) and their properties
+ *
+ * @param separator
+ * the separator used to split the string representing the
+ * stereotypes.
+ * @param stereotypesToDisplay
+ * the list of stereotypes displayed
+ * @param stereotypeWithQualifiedName
+ * the list of stereotypes displayed using their qualified names
+ * @param stereotypesPropertiesToDisplay
+ * the list of properties to display
+ * @return a string that displays stereotypes (using their simple name or
+ * their qualified name) and their properties
+ */
+ public String stereotypesAndPropertiesToDisplay(String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName, String stereotypesPropertiesToDisplay) {
+ // Get the preference from PreferenceStore. there should be an assert
+ final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ assert store != null : "The preference store was not found";
+ if(store == null) {
+ return "";
+ }
+ // retrieve if the name of the stereotype has to put to lower case or
+ // not
+ String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
+
+ // changes the string of properties into a map, where the entries of the
+ // map are the
+ // stereotype qualified name, and the properties to display are the data
+ Map<String, List<String>> propertiesToDisplay = parseStereotypeProperties(stereotypesToDisplay, stereotypesPropertiesToDisplay);
+
+ StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
+ String out = "";
+ while(strQualifiedName.hasMoreElements()) {
+ String currentStereotype = strQualifiedName.nextToken();
+
+ // check if current stereotype is applied
+ final Element umlElement = getUMLElement();
+ Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
+ if(stereotype != null) {
+ String name = currentStereotype;
+ if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
+ // property value contains qualifiedName ==> extract name
+ // from it
+ StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
+
+ while(strToken.hasMoreTokens()) {
+ name = strToken.nextToken();
+ }
+ }
+ // AL Changes Feb. 07 - Beg
+ // Handling STEREOTYPE_NAME_APPEARANCE preference (from
+ // ProfileApplicationPreferencePage)
+ // Previously lowercase forced onto first letter (standard UML)
+ // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
+ // 1).toLowerCase()+name.substring(1,
+ // name.length())+","+separator;
+
+ // check that the name has not already been added to the
+ // displayed string
+ if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
+ if(out.indexOf(name) == -1) {
+ out = out + Activator.ST_LEFT + name + Activator.ST_RIGHT + separator;
+ }
+ } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
+ // {
+ name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
+ if(out.indexOf(name) == -1) {
+ out = out + Activator.ST_LEFT + name + Activator.ST_RIGHT + separator;
+ }
+ }
+
+ // now should add all properties associated to this stereotype
+ List<String> properties = propertiesToDisplay.get(stereotype.getQualifiedName());
+ if(properties != null) {
+ // retrieve property
+ for(String propertyName : properties) {
+ out = out + StereotypeUtil.displayPropertyValue(stereotype, StereotypeUtil.getPropertyByName(stereotype, propertyName), getUMLElement(), "\n");
+ }
+ }
+ }
+ }
+ if(out.endsWith(",")) {
+ return out.substring(0, out.length() - 1);
+ }
+ if(out.endsWith(separator)) {
+ return out.substring(0, out.length() - separator.length());
+ }
+ return out;
+ }
+
+ /**
+ * get the list of stereotype to display from the eannotation
+ *
+ * @return the list of stereotypes to display
+ */
+ public String stereotypesToDisplay() {
+
+ // retrieve all stereotypes to be displayed
+
+ // try to display stereotype properties
+ String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay((View)getHost().getModel());
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getHost().getModel());
+
+ // now check presentation.
+ // if horizontal => equivalent to the inBrace visualization in nodes
+ // (i.e. only name =
+ // value, separator = comma, delimited with brace
+ // if vertical => equivalent to compartment visualization name of
+ // stereotype, NL, property =
+ // value, NL, etC.
+
+ // check the presentation kind. if only icon => do not display
+ // stereotype, only values
+ if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
+ return StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
+ }
+
+ String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(((View)getHost().getModel()));
+ String display = "";
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
+ display += stereotypesAndPropertiesToDisplay("\n", stereotypesToDisplay, stereotypesToDisplayWithQN, stereotypesPropertiesToDisplay);
+ } else {
+ final String st = stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN);
+ if(st != null && !st.equals("")) {
+ display += Activator.ST_LEFT + st + Activator.ST_RIGHT;
+ }
+ final String propSt = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
+ if(propSt != null && !propSt.equals("")) {
+ if(st != null && !st.equals("")) {
+ display += "\n";
+ }
+ display += "{" + propSt + "}";
+ }
+ }
+ return display;
+ }
+
+ /**
+ * Computes the string that displays the stereotypes for the current element
+ *
+ * @param separator
+ * the separator used to split the string representing the
+ * stereotypes.
+ * @param stereotypesToDisplay
+ * the list of stereotypes displayed
+ * @param stereotypeWithQualifiedName
+ * the list of stereotypes displayed using their qualified names
+ * @return the string that represent the stereotypes
+ */
+ public String stereotypesToDisplay(String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName) {
+
+ // AL Changes Feb. 07 - Beg
+ // Style Handling for STEREOTYPE_NAME_APPEARANCE from
+ // ProfileApplicationPreferencePage
+ // Stereotype displayed according to UML standard (first letter forced
+ // to lower case) -
+ // default -
+ // or kept as entered by user (user controlled)
+
+ // Get the preference from PreferenceStore. there should be an assert
+ final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ assert store != null : "The preference store was not found";
+ if(store == null) {
+ return "";
+ }
+ String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
+
+ StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
+ String out = "";
+ while(strQualifiedName.hasMoreElements()) {
+ String currentStereotype = strQualifiedName.nextToken();
+
+ // check if current stereotype is applied
+ final Element umlElement = getUMLElement();
+ Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
+ if(stereotype != null) {
+ String name = currentStereotype;
+ if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
+ // property value contains qualifiedName ==> extract name
+ // from it
+ StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
+
+ while(strToken.hasMoreTokens()) {
+ name = strToken.nextToken();
+ }
+ }
+ // AL Changes Feb. 07 - Beg
+ // Handling STEREOTYPE_NAME_APPEARANCE preference (from
+ // ProfileApplicationPreferencePage)
+ // Previously lowercase forced onto first letter (standard UML)
+ // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
+ // 1).toLowerCase()+name.substring(1,
+ // name.length())+","+separator;
+
+ // check that the name has not already been added to the
+ // displayed string
+ if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
+ if(out.indexOf(name) == -1) {
+ out = out + name + separator;
+ }
+ } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
+ // {
+ name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
+ if(out.indexOf(name) == -1) {
+ out = out + name + separator;
+ }
+ }
+ }
+ }
+ if(out.endsWith(",")) {
+ return out.substring(0, out.length() - 1);
+ }
+ if(out.endsWith(separator)) {
+ return out.substring(0, out.length() - separator.length());
+ }
+ return out;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLinkLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLinkLabelDisplayEditPolicy.java
index 45908461c7d..7585b41fc41 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLinkLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeLinkLabelDisplayEditPolicy.java
@@ -1,68 +1,68 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * the goal of this edit policy is to display applied stereotype and properties
- * of stereotypes in to a label attached to a link the edge figure figure has to
- * be a {@link IPapyrusUMLElementFigure}
- */
-public class AppliedStereotypeLinkLabelDisplayEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
-
- public AppliedStereotypeLinkLabelDisplayEditPolicy() {
- super();
- }
-
- public AppliedStereotypeLinkLabelDisplayEditPolicy(String tag) {
- super(tag);
- }
-
- @Override
- public String stereotypesToDisplay() {
- //if the display is not as Brace location the properties of the stereotype is not display
- String stereotypespresentationLocation = AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization(((View)getHost().getModel()));
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION.equals(stereotypespresentationLocation)) {
- return super.stereotypesToDisplay();
- }
- return "";
- }
- /**
- * Refreshes the stereotype display
- */
- protected void refreshStereotypeDisplay() {
- IFigure figure = ((GraphicalEditPart)getHost()).getFigure();
- // View view = (View) getHost().getModel();
-
- // calculate text and icon to display
- final String stereotypesToDisplay = stereotypesToDisplay();
- // computes the icon to be displayed
- final Image imageToDisplay = stereotypeIconToDisplay();
-
- // if the string is not empty, then, the figure has to display it. Else,
- // it displays nothing
- // if (stereotypesToDisplay != "" || imageToDisplay != null) {
- if(figure instanceof IPapyrusUMLElementFigure) {
- ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(tag + (stereotypesToDisplay.equals("") ? stereotypesToDisplay : "\n" + stereotypesToDisplay), imageToDisplay);
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * the goal of this edit policy is to display applied stereotype and properties
+ * of stereotypes in to a label attached to a link the edge figure figure has to
+ * be a {@link IPapyrusUMLElementFigure}
+ */
+public class AppliedStereotypeLinkLabelDisplayEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
+
+ public AppliedStereotypeLinkLabelDisplayEditPolicy() {
+ super();
+ }
+
+ public AppliedStereotypeLinkLabelDisplayEditPolicy(String tag) {
+ super(tag);
+ }
+
+ @Override
+ public String stereotypesToDisplay() {
+ //if the display is not as Brace location the properties of the stereotype is not display
+ String stereotypespresentationLocation = AppliedStereotypeHelper.getAppliedStereotypesPropertiesLocalization(((View)getHost().getModel()));
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION.equals(stereotypespresentationLocation)) {
+ return super.stereotypesToDisplay();
+ }
+ return "";
+ }
+ /**
+ * Refreshes the stereotype display
+ */
+ protected void refreshStereotypeDisplay() {
+ IFigure figure = ((GraphicalEditPart)getHost()).getFigure();
+ // View view = (View) getHost().getModel();
+
+ // calculate text and icon to display
+ final String stereotypesToDisplay = stereotypesToDisplay();
+ // computes the icon to be displayed
+ final Image imageToDisplay = stereotypeIconToDisplay();
+
+ // if the string is not empty, then, the figure has to display it. Else,
+ // it displays nothing
+ // if (stereotypesToDisplay != "" || imageToDisplay != null) {
+ if(figure instanceof IPapyrusUMLElementFigure) {
+ ((IPapyrusUMLElementFigure)figure).setStereotypeDisplay(tag + (stereotypesToDisplay.equals("") ? stereotypesToDisplay : "\n" + stereotypesToDisplay), imageToDisplay);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeManifestationLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeManifestationLabelDisplayEditPolicy.java
index d495cc5f184..d04aa70933a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeManifestationLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeManifestationLabelDisplayEditPolicy.java
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-
-
-/**
- * Edit Policy for Applied Stereotype Label for {@link Manifestation}.
- */
-public class AppliedStereotypeManifestationLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
-
- /**
- * Creates the EditPolicy, with the correct tag.
- */
- public AppliedStereotypeManifestationLabelDisplayEditPolicy() {
- super("manifestation"); //$NON-NLS-1$
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+
+
+/**
+ * Edit Policy for Applied Stereotype Label for {@link Manifestation}.
+ */
+public class AppliedStereotypeManifestationLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ /**
+ * Creates the EditPolicy, with the correct tag.
+ */
+ public AppliedStereotypeManifestationLabelDisplayEditPolicy() {
+ super("manifestation"); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeNodeLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeNodeLabelDisplayEditPolicy.java
index f651b9b2a9b..243b254cd64 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeNodeLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeNodeLabelDisplayEditPolicy.java
@@ -1,154 +1,154 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure;
-import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * this edit policy can be apply only on {@link IPapyrusEditPart} in order to
- * access to primary figure. the primary figure has to be a {@link IPapyrusNodeUMLElementFigure}
- */
-public class AppliedStereotypeNodeLabelDisplayEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
-
- public AppliedStereotypeNodeLabelDisplayEditPolicy() {
- super();
- }
-
- public AppliedStereotypeNodeLabelDisplayEditPolicy(String tag) {
- super(tag);
- }
-
- /**
- * Refreshes the stereotype display
- */
- protected void refreshStereotypeDisplay() {
- if(getHost() instanceof IPapyrusEditPart) {
- IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
-
- // calculate text and icon to display
- final String stereotypesToDisplay = stereotypesOnlyToDisplay();
- // computes the icon to be displayed
- final Image imageToDisplay = stereotypeIconToDisplay();
-
- // if the string is not empty, then, the figure has to display it.
- // Else, it displays
- // nothing
- // if (stereotypesToDisplay != "" || imageToDisplay != null) {
- if(figure instanceof IPapyrusNodeUMLElementFigure) {
- ((IPapyrusNodeUMLElementFigure)figure).setStereotypeDisplay(tag + (stereotypesOnlyToDisplay().equals("") ? stereotypesToDisplay : stereotypesToDisplay), imageToDisplay);
- refreshAppliedStereotypesProperties(((IPapyrusNodeUMLElementFigure)figure));
- }
- // TODO we should manage PapyrusNodeFigure here too (and
- // WrappingLabel ?)
- }
- }
-
- /**
- * Refreshes the displayed stereotypes properties for this edit part.
- */
- protected void refreshAppliedStereotypesProperties(IPapyrusNodeUMLElementFigure figure) {
- final String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay((View)getHost().getModel());
-
- refreshAppliedStereotypesPropertiesInCompartment(stereotypesPropertiesToDisplay, figure);
- refreshAppliedStereotypesPropertiesInBrace(stereotypesPropertiesToDisplay, figure);
- }
-
- /**
- * Refreshes the stereotypes properties displayed in a compartment of this
- * edit part.
- *
- * @param stereotypesPropertiesToDisplay
- * list of properties to display
- * @param figure
- * the figure in which stereotype will be displayed
- */
- protected void refreshAppliedStereotypesPropertiesInCompartment(String stereotypesPropertiesToDisplay, IPapyrusNodeUMLElementFigure figure) {
- // retrieve the stereotype properties to be displayed
-
- final boolean displayInCompartment = AppliedStereotypeHelper.hasAppliedStereotypesPropertiesToDisplay((View)(View)getHost().getModel(), UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION);
-
- // if the string is not empty, then, the figure has to display it. Else,
- // it displays nothing
- if(displayInCompartment) {
- String todisplay = StereotypeUtil.getPropertiesValues(stereotypesPropertiesToDisplay, getUMLElement());
- figure.setStereotypePropertiesInCompartment(todisplay);
- } else {
- figure.setStereotypePropertiesInCompartment(null);
- }
- }
-
- /**
- * Refreshes the stereotypes properties displayed above name of the element
- * in this edit part.
- */
- protected void refreshAppliedStereotypesPropertiesInBrace(String stereotypesPropertiesToDisplay, IPapyrusNodeUMLElementFigure figure) {
- // check if properties have to be displayed in braces.
- final boolean displayInBrace = AppliedStereotypeHelper.hasAppliedStereotypesPropertiesToDisplay((View)getHost().getModel(), UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION);
-
- // if the string is not empty, then, the figure has to display it. Else,
- // it displays nothing
- if(displayInBrace) {
- // it has to be displayed in braces, so compute the string to
- // display
- String todisplay = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
- figure.setStereotypePropertiesInBrace(todisplay);
- } else {
- figure.setStereotypePropertiesInBrace(null);
- }
- }
-
- /**
- * this method is used to display only applied stereotypes
- *
- * @return the string with applied stereotypes. It can return "" if there is
- * no stereotypes to display
- */
- public String stereotypesOnlyToDisplay() {
- // list of stereotypes to display
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
- // Kind of the representation
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getHost().getModel());
-
- // check the presentation kind. if only icon => do not display
- // stereotypes
- if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
- return ""; // empty string, so stereotype label should not be
- // displayed
- }
-
- // stereotypes with qualified name to display
- String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(((View)getHost().getModel()));
-
- // the set is empty
- if(stereotypesToDisplayWithQN.length() == 0 && stereotypesToDisplay.length() == 0) {
- return "";
- }
- // vertical representation
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
- return Activator.ST_LEFT + stereotypesToDisplay(Activator.ST_RIGHT + "\n" + Activator.ST_LEFT, stereotypesToDisplay, stereotypesToDisplayWithQN) + Activator.ST_RIGHT;
- } else {// horizontal representation
- return Activator.ST_LEFT + stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN) + Activator.ST_RIGHT;
-
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeUMLElementFigure;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * this edit policy can be apply only on {@link IPapyrusEditPart} in order to
+ * access to primary figure. the primary figure has to be a {@link IPapyrusNodeUMLElementFigure}
+ */
+public class AppliedStereotypeNodeLabelDisplayEditPolicy extends AppliedStereotypeLabelDisplayEditPolicy {
+
+ public AppliedStereotypeNodeLabelDisplayEditPolicy() {
+ super();
+ }
+
+ public AppliedStereotypeNodeLabelDisplayEditPolicy(String tag) {
+ super(tag);
+ }
+
+ /**
+ * Refreshes the stereotype display
+ */
+ protected void refreshStereotypeDisplay() {
+ if(getHost() instanceof IPapyrusEditPart) {
+ IFigure figure = ((IPapyrusEditPart)getHost()).getPrimaryShape();
+
+ // calculate text and icon to display
+ final String stereotypesToDisplay = stereotypesOnlyToDisplay();
+ // computes the icon to be displayed
+ final Image imageToDisplay = stereotypeIconToDisplay();
+
+ // if the string is not empty, then, the figure has to display it.
+ // Else, it displays
+ // nothing
+ // if (stereotypesToDisplay != "" || imageToDisplay != null) {
+ if(figure instanceof IPapyrusNodeUMLElementFigure) {
+ ((IPapyrusNodeUMLElementFigure)figure).setStereotypeDisplay(tag + (stereotypesOnlyToDisplay().equals("") ? stereotypesToDisplay : stereotypesToDisplay), imageToDisplay);
+ refreshAppliedStereotypesProperties(((IPapyrusNodeUMLElementFigure)figure));
+ }
+ // TODO we should manage PapyrusNodeFigure here too (and
+ // WrappingLabel ?)
+ }
+ }
+
+ /**
+ * Refreshes the displayed stereotypes properties for this edit part.
+ */
+ protected void refreshAppliedStereotypesProperties(IPapyrusNodeUMLElementFigure figure) {
+ final String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay((View)getHost().getModel());
+
+ refreshAppliedStereotypesPropertiesInCompartment(stereotypesPropertiesToDisplay, figure);
+ refreshAppliedStereotypesPropertiesInBrace(stereotypesPropertiesToDisplay, figure);
+ }
+
+ /**
+ * Refreshes the stereotypes properties displayed in a compartment of this
+ * edit part.
+ *
+ * @param stereotypesPropertiesToDisplay
+ * list of properties to display
+ * @param figure
+ * the figure in which stereotype will be displayed
+ */
+ protected void refreshAppliedStereotypesPropertiesInCompartment(String stereotypesPropertiesToDisplay, IPapyrusNodeUMLElementFigure figure) {
+ // retrieve the stereotype properties to be displayed
+
+ final boolean displayInCompartment = AppliedStereotypeHelper.hasAppliedStereotypesPropertiesToDisplay((View)(View)getHost().getModel(), UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION);
+
+ // if the string is not empty, then, the figure has to display it. Else,
+ // it displays nothing
+ if(displayInCompartment) {
+ String todisplay = StereotypeUtil.getPropertiesValues(stereotypesPropertiesToDisplay, getUMLElement());
+ figure.setStereotypePropertiesInCompartment(todisplay);
+ } else {
+ figure.setStereotypePropertiesInCompartment(null);
+ }
+ }
+
+ /**
+ * Refreshes the stereotypes properties displayed above name of the element
+ * in this edit part.
+ */
+ protected void refreshAppliedStereotypesPropertiesInBrace(String stereotypesPropertiesToDisplay, IPapyrusNodeUMLElementFigure figure) {
+ // check if properties have to be displayed in braces.
+ final boolean displayInBrace = AppliedStereotypeHelper.hasAppliedStereotypesPropertiesToDisplay((View)getHost().getModel(), UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION);
+
+ // if the string is not empty, then, the figure has to display it. Else,
+ // it displays nothing
+ if(displayInBrace) {
+ // it has to be displayed in braces, so compute the string to
+ // display
+ String todisplay = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement());
+ figure.setStereotypePropertiesInBrace(todisplay);
+ } else {
+ figure.setStereotypePropertiesInBrace(null);
+ }
+ }
+
+ /**
+ * this method is used to display only applied stereotypes
+ *
+ * @return the string with applied stereotypes. It can return "" if there is
+ * no stereotypes to display
+ */
+ public String stereotypesOnlyToDisplay() {
+ // list of stereotypes to display
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)getHost().getModel());
+ // Kind of the representation
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)getHost().getModel());
+
+ // check the presentation kind. if only icon => do not display
+ // stereotypes
+ if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
+ return ""; // empty string, so stereotype label should not be
+ // displayed
+ }
+
+ // stereotypes with qualified name to display
+ String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(((View)getHost().getModel()));
+
+ // the set is empty
+ if(stereotypesToDisplayWithQN.length() == 0 && stereotypesToDisplay.length() == 0) {
+ return "";
+ }
+ // vertical representation
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
+ return Activator.ST_LEFT + stereotypesToDisplay(Activator.ST_RIGHT + "\n" + Activator.ST_LEFT, stereotypesToDisplay, stereotypesToDisplayWithQN) + Activator.ST_RIGHT;
+ } else {// horizontal representation
+ return Activator.ST_LEFT + stereotypesToDisplay(", ", stereotypesToDisplay, stereotypesToDisplayWithQN) + Activator.ST_RIGHT;
+
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageImportLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageImportLabelDisplayEditPolicy.java
index 87ced9100aa..1689427101b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageImportLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageImportLabelDisplayEditPolicy.java
@@ -1,59 +1,59 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-import org.eclipse.uml2.uml.PackageImport;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.VisibilityKind;
-
-/**
- * Edit Policy for Applied Stereotype Label for {@link PackageImport}.
- * <p>
- * It simply adds a tag "use" to the label. Thanks to GMF, it is not possible to call a cTor with a parameter. So it calls super cTor with the
- * "import" parameter
- * </p>
- */
-public class AppliedStereotypePackageImportLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
-
- String importTag = Activator.ST_LEFT + Messages.AppliedStereotypeLabel_PackageImportTag + Activator.ST_RIGHT;
-
- String accessTag = Activator.ST_LEFT + Messages.AppliedStereotypeLabel_PackageImportAccessTag + Activator.ST_RIGHT;
-
- @Override
- public void activate() {
- super.activate();
- if(hostSemanticElement instanceof PackageImport) {
- changeTag(((PackageImport)hostSemanticElement).getVisibility());
- }
- }
-
- public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- if(UMLPackage.Literals.PACKAGE_IMPORT__VISIBILITY.equals(notification.getFeature())) {
- changeTag((VisibilityKind)notification.getNewValue());
- }
- }
-
- protected void changeTag(VisibilityKind visibility) {
- if(VisibilityKind.PUBLIC_LITERAL.equals(visibility)) {
- tag = importTag;
- } else {
- tag = accessTag;
- }
- refreshDisplay();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.uml2.uml.PackageImport;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.VisibilityKind;
+
+/**
+ * Edit Policy for Applied Stereotype Label for {@link PackageImport}.
+ * <p>
+ * It simply adds a tag "use" to the label. Thanks to GMF, it is not possible to call a cTor with a parameter. So it calls super cTor with the
+ * "import" parameter
+ * </p>
+ */
+public class AppliedStereotypePackageImportLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ String importTag = Activator.ST_LEFT + Messages.AppliedStereotypeLabel_PackageImportTag + Activator.ST_RIGHT;
+
+ String accessTag = Activator.ST_LEFT + Messages.AppliedStereotypeLabel_PackageImportAccessTag + Activator.ST_RIGHT;
+
+ @Override
+ public void activate() {
+ super.activate();
+ if(hostSemanticElement instanceof PackageImport) {
+ changeTag(((PackageImport)hostSemanticElement).getVisibility());
+ }
+ }
+
+ public void notifyChanged(Notification notification) {
+ super.notifyChanged(notification);
+ if(UMLPackage.Literals.PACKAGE_IMPORT__VISIBILITY.equals(notification.getFeature())) {
+ changeTag((VisibilityKind)notification.getNewValue());
+ }
+ }
+
+ protected void changeTag(VisibilityKind visibility) {
+ if(VisibilityKind.PUBLIC_LITERAL.equals(visibility)) {
+ tag = importTag;
+ } else {
+ tag = accessTag;
+ }
+ refreshDisplay();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageMergeLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageMergeLabelDisplayEditPolicy.java
index 44448b5ec30..1de5dd0e2e8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageMergeLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePackageMergeLabelDisplayEditPolicy.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-
-/**
- * Edit Policy for Applied Stereotype Label for {@link PackageMerge}.
- * <p>
- * It simply adds a tag "use" to the label. Thanks to GMF, it is not possible to call a cTor with a parameter. So it calls super cTor with the "merge"
- * parameter
- * </p>
- */
-public class AppliedStereotypePackageMergeLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
-
- /**
- * Creates a new AppliedStereotypePackageMergeLabelDisplayEditPolicy, with
- * the correct tag.
- */
- public AppliedStereotypePackageMergeLabelDisplayEditPolicy() {
- super(Messages.AppliedStereotypeLabel_PackageMergeTag);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+
+/**
+ * Edit Policy for Applied Stereotype Label for {@link PackageMerge}.
+ * <p>
+ * It simply adds a tag "use" to the label. Thanks to GMF, it is not possible to call a cTor with a parameter. So it calls super cTor with the "merge"
+ * parameter
+ * </p>
+ */
+public class AppliedStereotypePackageMergeLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ /**
+ * Creates a new AppliedStereotypePackageMergeLabelDisplayEditPolicy, with
+ * the correct tag.
+ */
+ public AppliedStereotypePackageMergeLabelDisplayEditPolicy() {
+ super(Messages.AppliedStereotypeLabel_PackageMergeTag);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePropertyDirectEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePropertyDirectEditPolicy.java
index 6bd581fec44..bf83d1cb5c5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePropertyDirectEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypePropertyDirectEditPolicy.java
@@ -1,65 +1,65 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
-
-
-public class AppliedStereotypePropertyDirectEditPolicy extends LabelDirectEditPolicy {
-
- /**
- * @see DirectEditPolicy#getDirectEditCommand(DirectEditRequest)
- */
- protected Command getDirectEditCommand(DirectEditRequest edit) {
- if (edit.getCellEditor() instanceof TextCellEditorEx)
- if (!((TextCellEditorEx) edit.getCellEditor()).hasValueChanged())
- return null;
-
- String labelText = (String) edit.getCellEditor().getValue();
-
- //for CellEditor, null is always returned for invalid values
- if (labelText == null) {
- return null;
- }
-
- ITextAwareEditPart compartment = (ITextAwareEditPart) getHost();
- EObject model = (EObject)compartment.getModel();
- SemanticAdapter elementAdapter = null ;
- if (model instanceof View) {
- View view = (View)model;
- elementAdapter =new SemanticAdapter(((View)model).getElement(), model);
- }
- else
- elementAdapter = new SemanticAdapter(((View)model).getElement(), model);
- // check to make sure an edit has occurred before returning a command.
- String prevText = compartment.getParser().getEditString(elementAdapter,
- compartment.getParserOptions().intValue());
- if (!prevText.equals(labelText)) {
- ICommand iCommand =
- compartment.getParser().getParseCommand(elementAdapter, labelText, 0);
- return new ICommandProxy(iCommand);
- }
-
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+
+
+public class AppliedStereotypePropertyDirectEditPolicy extends LabelDirectEditPolicy {
+
+ /**
+ * @see DirectEditPolicy#getDirectEditCommand(DirectEditRequest)
+ */
+ protected Command getDirectEditCommand(DirectEditRequest edit) {
+ if (edit.getCellEditor() instanceof TextCellEditorEx)
+ if (!((TextCellEditorEx) edit.getCellEditor()).hasValueChanged())
+ return null;
+
+ String labelText = (String) edit.getCellEditor().getValue();
+
+ //for CellEditor, null is always returned for invalid values
+ if (labelText == null) {
+ return null;
+ }
+
+ ITextAwareEditPart compartment = (ITextAwareEditPart) getHost();
+ EObject model = (EObject)compartment.getModel();
+ SemanticAdapter elementAdapter = null ;
+ if (model instanceof View) {
+ View view = (View)model;
+ elementAdapter =new SemanticAdapter(((View)model).getElement(), model);
+ }
+ else
+ elementAdapter = new SemanticAdapter(((View)model).getElement(), model);
+ // check to make sure an edit has occurred before returning a command.
+ String prevText = compartment.getParser().getEditString(elementAdapter,
+ compartment.getParserOptions().intValue());
+ if (!prevText.equals(labelText)) {
+ ICommand iCommand =
+ compartment.getParser().getParseCommand(elementAdapter, labelText, 0);
+ return new ICommandProxy(iCommand);
+ }
+
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeSubstitutionLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeSubstitutionLabelDisplayEditPolicy.java
index a036b879867..9e8b55afba8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeSubstitutionLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeSubstitutionLabelDisplayEditPolicy.java
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-
-
-/**
- * Edit Policy for Applied Stereotype Label for {@link Substitution}.
- */
-public class AppliedStereotypeSubstitutionLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
-
- /**
- * Creates the EditPolicy, with the correct tag.
- */
- public AppliedStereotypeSubstitutionLabelDisplayEditPolicy() {
- super("substitution"); //$NON-NLS-1$
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+
+
+/**
+ * Edit Policy for Applied Stereotype Label for {@link Substitution}.
+ */
+public class AppliedStereotypeSubstitutionLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ /**
+ * Creates the EditPolicy, with the correct tag.
+ */
+ public AppliedStereotypeSubstitutionLabelDisplayEditPolicy() {
+ super("substitution"); //$NON-NLS-1$
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeUsageLabelDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeUsageLabelDisplayEditPolicy.java
index d319042084a..28db4159ad3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeUsageLabelDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/AppliedStereotypeUsageLabelDisplayEditPolicy.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-
-/**
- * Edit Policy for Applied Stereotype LAbel for {@link Usage}.
- * <p>
- * It simply adds a tag "use" to the label. Thanks to GMF, it is not possible to call a cTor with a parameter. So it calls super cTor with the "use"
- * parameter
- * </p>
- */
-public class AppliedStereotypeUsageLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
-
- /**
- * Creates a new AppliedStereotypeUsageLabelDisplayEditPolicy, with the
- * correct tag.
- */
- public AppliedStereotypeUsageLabelDisplayEditPolicy() {
- super(Messages.AppliedStereotypeLabel_UsageTag);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+
+/**
+ * Edit Policy for Applied Stereotype LAbel for {@link Usage}.
+ * <p>
+ * It simply adds a tag "use" to the label. Thanks to GMF, it is not possible to call a cTor with a parameter. So it calls super cTor with the "use"
+ * parameter
+ * </p>
+ */
+public class AppliedStereotypeUsageLabelDisplayEditPolicy extends AppliedStereotypeLinkLabelDisplayEditPolicy {
+
+ /**
+ * Creates a new AppliedStereotypeUsageLabelDisplayEditPolicy, with the
+ * correct tag.
+ */
+ public AppliedStereotypeUsageLabelDisplayEditPolicy() {
+ super(Messages.AppliedStereotypeLabel_UsageTag);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ApplyStereotypeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ApplyStereotypeEditPolicy.java
index c7c72d99095..a3070560813 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ApplyStereotypeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ApplyStereotypeEditPolicy.java
@@ -1,104 +1,104 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.common.commands.ApplyStereotypeCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.DefferedAppliedStereotypeToDisplayCommand;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * Apply Stereotype edit policy.
- * <P>
- * Edit policy in charge of applying stereotypes on uml elements
- * </P>
- */
-public class ApplyStereotypeEditPolicy extends AbstractEditPolicy {
-
- /**
- * Creates a new ApplyStereotypeEditPolicy.
- */
- public ApplyStereotypeEditPolicy() {
- super();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Command getCommand(Request request) {
- if(understandsRequest(request)) {
- return getApplyStereotypeCommand((ApplyStereotypeRequest)request);
- } else
- return super.getCommand(request);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean understandsRequest(Request req) {
- if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(req.getType())) {
- return true;
- }
- return super.understandsRequest(req);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public EditPart getTargetEditPart(Request request) {
- if(understandsRequest(request)) {
- return getHost();
- }
- return super.getTargetEditPart(request);
- }
-
- /**
- * Returns the <code>Command</code> contribution for the given <code>ApplyStereotypeRequest</code>
- *
- * @param request
- * the request linked to this edit policy
- * @return the command that applies the stereotype or <code>null</code>
- */
- protected Command getApplyStereotypeCommand(ApplyStereotypeRequest request) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- CompositeTransactionalCommand cc = new CompositeTransactionalCommand(editingDomain, "Apply Stereotype");
- final Element element = (Element)(((View)getHost().getModel()).getElement());
-
- if (request.getElement() == null) {
- request.setElement(element);
- }
-
- // 1. apply stereotypes
- cc.compose(new ApplyStereotypeCommand(editingDomain, request));
-
- // 2. display stereotypes
- cc.compose(new EMFtoGMFCommandWrapper(new DefferedAppliedStereotypeToDisplayCommand(editingDomain, getHost(), "")));
-
- return new ICommandProxy(cc.reduce());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.AbstractEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.common.commands.ApplyStereotypeCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.DefferedAppliedStereotypeToDisplayCommand;
+import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Apply Stereotype edit policy.
+ * <P>
+ * Edit policy in charge of applying stereotypes on uml elements
+ * </P>
+ */
+public class ApplyStereotypeEditPolicy extends AbstractEditPolicy {
+
+ /**
+ * Creates a new ApplyStereotypeEditPolicy.
+ */
+ public ApplyStereotypeEditPolicy() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if(understandsRequest(request)) {
+ return getApplyStereotypeCommand((ApplyStereotypeRequest)request);
+ } else
+ return super.getCommand(request);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean understandsRequest(Request req) {
+ if(ApplyStereotypeRequest.APPLY_STEREOTYPE_REQUEST.equals(req.getType())) {
+ return true;
+ }
+ return super.understandsRequest(req);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ if(understandsRequest(request)) {
+ return getHost();
+ }
+ return super.getTargetEditPart(request);
+ }
+
+ /**
+ * Returns the <code>Command</code> contribution for the given <code>ApplyStereotypeRequest</code>
+ *
+ * @param request
+ * the request linked to this edit policy
+ * @return the command that applies the stereotype or <code>null</code>
+ */
+ protected Command getApplyStereotypeCommand(ApplyStereotypeRequest request) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ CompositeTransactionalCommand cc = new CompositeTransactionalCommand(editingDomain, "Apply Stereotype");
+ final Element element = (Element)(((View)getHost().getModel()).getElement());
+
+ if (request.getElement() == null) {
+ request.setElement(element);
+ }
+
+ // 1. apply stereotypes
+ cc.compose(new ApplyStereotypeCommand(editingDomain, request));
+
+ // 2. display stereotypes
+ cc.compose(new EMFtoGMFCommandWrapper(new DefferedAppliedStereotypeToDisplayCommand(editingDomain, getHost(), "")));
+
+ return new ICommandProxy(cc.reduce());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/BorderItemResizableEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/BorderItemResizableEditPolicy.java
index 1f0ef6410c2..cf7092821af 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/BorderItemResizableEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/BorderItemResizableEditPolicy.java
@@ -1,111 +1,111 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Allow the alignment Request
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- *
- * @author Patrick Tessier Policy that allows resizing border item code comes
- * form {@link BorderItemSelectionEditPolicy} and modify in order to use
- * resize behavior
- */
-public class BorderItemResizableEditPolicy extends ResizableShapeEditPolicy {
-
- @Override
- public void eraseSourceFeedback(Request request) {
- if((REQ_MOVE.equals(request.getType()) && isDragAllowed()) || REQ_CLONE.equals(request.getType()) || REQ_ADD.equals(request.getType()) || RequestConstants.REQ_DROP.equals(request.getType()) || REQ_RESIZE.equals(request.getType()))
- eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Command getMoveCommand(ChangeBoundsRequest request) {
- IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
- IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
-
- if(borderItemLocator != null) {
- PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
- getHostFigure().translateToAbsolute(rect);
- rect.translate(request.getMoveDelta());
- rect.resize(request.getSizeDelta());
-
- getHostFigure().translateToRelative(rect);
- Rectangle realLocation = borderItemLocator.getValidLocation(rect.getCopy(), borderItemEP.getFigure());
-
- Point parentOrigin = borderItemEP.getFigure().getParent().getBounds().getTopLeft();
- Dimension d = realLocation.getTopLeft().getDifference(parentOrigin);
- Point location = new Point(d.width, d.height);
-
- ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View)getHost().getModel()), location);
- return new ICommandProxy(moveCommand);
- }
- return null;
- }
-
- /**
- * Shows or updates feedback for a change bounds request.
- *
- * @param request
- * the request
- */
- @Override
- protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
- IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
- IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
-
- if(borderItemLocator != null) {
- IFigure feedback = getDragSourceFeedbackFigure();
- PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
- getHostFigure().translateToAbsolute(rect);
- rect.translate(request.getMoveDelta());
- rect.resize(request.getSizeDelta());
- getHostFigure().translateToRelative(rect);
- Rectangle realLocation = borderItemLocator.getValidLocation(rect.getCopy(), borderItemEP.getFigure());
- getHostFigure().translateToAbsolute(realLocation);
- feedback.translateToRelative(realLocation);
- feedback.setBounds(realLocation);
- }
- }
-
- /**
- * Calls other methods as appropriate.
- */
- @Override
- public void showSourceFeedback(Request request) {
- if((REQ_MOVE.equals(request.getType()) && isDragAllowed()) || REQ_ADD.equals(request.getType()) || REQ_CLONE.equals(request.getType()) || RequestConstants.REQ_DROP.equals(request.getType()) || REQ_RESIZE.equals(request.getType()))
- showChangeBoundsFeedback((ChangeBoundsRequest)request);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - Allow the alignment Request
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableShapeEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ *
+ * @author Patrick Tessier Policy that allows resizing border item code comes
+ * form {@link BorderItemSelectionEditPolicy} and modify in order to use
+ * resize behavior
+ */
+public class BorderItemResizableEditPolicy extends ResizableShapeEditPolicy {
+
+ @Override
+ public void eraseSourceFeedback(Request request) {
+ if((REQ_MOVE.equals(request.getType()) && isDragAllowed()) || REQ_CLONE.equals(request.getType()) || REQ_ADD.equals(request.getType()) || RequestConstants.REQ_DROP.equals(request.getType()) || REQ_RESIZE.equals(request.getType()))
+ eraseChangeBoundsFeedback((ChangeBoundsRequest)request);
+
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getMoveCommand(ChangeBoundsRequest request) {
+ IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
+ IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
+
+ if(borderItemLocator != null) {
+ PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
+ getHostFigure().translateToAbsolute(rect);
+ rect.translate(request.getMoveDelta());
+ rect.resize(request.getSizeDelta());
+
+ getHostFigure().translateToRelative(rect);
+ Rectangle realLocation = borderItemLocator.getValidLocation(rect.getCopy(), borderItemEP.getFigure());
+
+ Point parentOrigin = borderItemEP.getFigure().getParent().getBounds().getTopLeft();
+ Dimension d = realLocation.getTopLeft().getDifference(parentOrigin);
+ Point location = new Point(d.width, d.height);
+
+ ICommand moveCommand = new SetBoundsCommand(borderItemEP.getEditingDomain(), DiagramUIMessages.Commands_MoveElement, new EObjectAdapter((View)getHost().getModel()), location);
+ return new ICommandProxy(moveCommand);
+ }
+ return null;
+ }
+
+ /**
+ * Shows or updates feedback for a change bounds request.
+ *
+ * @param request
+ * the request
+ */
+ @Override
+ protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
+ IBorderItemEditPart borderItemEP = (IBorderItemEditPart)getHost();
+ IBorderItemLocator borderItemLocator = borderItemEP.getBorderItemLocator();
+
+ if(borderItemLocator != null) {
+ IFigure feedback = getDragSourceFeedbackFigure();
+ PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
+ getHostFigure().translateToAbsolute(rect);
+ rect.translate(request.getMoveDelta());
+ rect.resize(request.getSizeDelta());
+ getHostFigure().translateToRelative(rect);
+ Rectangle realLocation = borderItemLocator.getValidLocation(rect.getCopy(), borderItemEP.getFigure());
+ getHostFigure().translateToAbsolute(realLocation);
+ feedback.translateToRelative(realLocation);
+ feedback.setBounds(realLocation);
+ }
+ }
+
+ /**
+ * Calls other methods as appropriate.
+ */
+ @Override
+ public void showSourceFeedback(Request request) {
+ if((REQ_MOVE.equals(request.getType()) && isDragAllowed()) || REQ_ADD.equals(request.getType()) || REQ_CLONE.equals(request.getType()) || RequestConstants.REQ_DROP.equals(request.getType()) || REQ_RESIZE.equals(request.getType()))
+ showChangeBoundsFeedback((ChangeBoundsRequest)request);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CResizableCompartmentEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CResizableCompartmentEditPolicy.java
index 23e250e07fe..c6d7736bebc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CResizableCompartmentEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CResizableCompartmentEditPolicy.java
@@ -1,133 +1,133 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.LayerConstants;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.handles.ResizableHandleKit;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.internal.handles.CompartmentResizeHandle;
-
-/**
- *
- * this class is used to display an handle and command to make a compartment
- * resizable by the user
- */
-// @unused
-public class CResizableCompartmentEditPolicy extends ResizableCompartmentEditPolicy {
-
- public CResizableCompartmentEditPolicy() {
- super(true);
- }
-
- /**
- * use to create handle to see the small triangle to collapse a compartment
- */
- protected void addCollapsableHandles() {
- removeSelectionHandles();
- IFigure layer = getLayer(LayerConstants.HANDLE_LAYER);
- handles = createCollapseHandles();
- for(int i = 0; i < handles.size(); i++) {
- layer.add((IFigure)handles.get(i));
- }
- }
-
- /**
- * @see org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy#createSelectionHandles()
- */
- @Override
- protected List createSelectionHandles() {
- List selectionHandles = new ArrayList();
- IGraphicalEditPart part = (IGraphicalEditPart)getHost();
- int d1 = isHorizontal() ? PositionConstants.WEST : PositionConstants.NORTH;
- int d2 = isHorizontal() ? PositionConstants.EAST : PositionConstants.SOUTH;
- selectionHandles.addAll(createCollapseHandles());// add collapsable
- // handle
- selectionHandles.add(new CompartmentResizeHandle(part, d1));
- selectionHandles.add(new CompartmentResizeHandle(part, d2));
- // add resize handle in the south
- ResizableHandleKit.addHandle((GraphicalEditPart)getHost(), selectionHandles, PositionConstants.SOUTH);
-
- return selectionHandles;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Command getResizeCommand(ChangeBoundsRequest request) {
- int indexOfTheLast = getHost().getParent().getChildren().size() - 1;
- ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_RESIZE_CHILDREN);
- req.setEditParts(getHost());
- req.setMoveDelta(request.getMoveDelta());
- req.setSizeDelta(request.getSizeDelta());
- req.setLocation(request.getLocation());
- req.setExtendedData(request.getExtendedData());
- req.setResizeDirection(request.getResizeDirection());
- // if this is the last compartment the command is redirect to the parent
- if(getHost().getParent().getChildren().indexOf(getHost()) == indexOfTheLast) {
- req.setEditParts(getHost().getParent());
- return getHost().getParent().getParent().getCommand(req);
- } else {
- return getHost().getParent().getCommand(req);
- }
-
- // return super.getResizeCommand(request);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
- IFigure feedback = getDragSourceFeedbackFigure();
-
- PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
- getHostFigure().translateToAbsolute(rect);
- rect.translate(request.getMoveDelta());
- rect.resize(request.getSizeDelta());
-
- feedback.translateToRelative(rect);
- feedback.setBounds(rect);
- }
-
- /**
- * @see org.eclipse.gef.editpolicies.SelectionEditPolicy#showSelection()
- */
- @Override
- protected void showSelection() {
- // not selected but we want to see collapsable handle
- if(getHost().getSelected() == EditPart.SELECTED_NONE) {
- addCollapsableHandles();
- }
- // selected we want to see collapsable handle and resize handle
- if(getHost().getSelected() == EditPart.SELECTED_PRIMARY) {
- super.showSelection();
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.handles.ResizableHandleKit;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.internal.handles.CompartmentResizeHandle;
+
+/**
+ *
+ * this class is used to display an handle and command to make a compartment
+ * resizable by the user
+ */
+// @unused
+public class CResizableCompartmentEditPolicy extends ResizableCompartmentEditPolicy {
+
+ public CResizableCompartmentEditPolicy() {
+ super(true);
+ }
+
+ /**
+ * use to create handle to see the small triangle to collapse a compartment
+ */
+ protected void addCollapsableHandles() {
+ removeSelectionHandles();
+ IFigure layer = getLayer(LayerConstants.HANDLE_LAYER);
+ handles = createCollapseHandles();
+ for(int i = 0; i < handles.size(); i++) {
+ layer.add((IFigure)handles.get(i));
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy#createSelectionHandles()
+ */
+ @Override
+ protected List createSelectionHandles() {
+ List selectionHandles = new ArrayList();
+ IGraphicalEditPart part = (IGraphicalEditPart)getHost();
+ int d1 = isHorizontal() ? PositionConstants.WEST : PositionConstants.NORTH;
+ int d2 = isHorizontal() ? PositionConstants.EAST : PositionConstants.SOUTH;
+ selectionHandles.addAll(createCollapseHandles());// add collapsable
+ // handle
+ selectionHandles.add(new CompartmentResizeHandle(part, d1));
+ selectionHandles.add(new CompartmentResizeHandle(part, d2));
+ // add resize handle in the south
+ ResizableHandleKit.addHandle((GraphicalEditPart)getHost(), selectionHandles, PositionConstants.SOUTH);
+
+ return selectionHandles;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getResizeCommand(ChangeBoundsRequest request) {
+ int indexOfTheLast = getHost().getParent().getChildren().size() - 1;
+ ChangeBoundsRequest req = new ChangeBoundsRequest(REQ_RESIZE_CHILDREN);
+ req.setEditParts(getHost());
+ req.setMoveDelta(request.getMoveDelta());
+ req.setSizeDelta(request.getSizeDelta());
+ req.setLocation(request.getLocation());
+ req.setExtendedData(request.getExtendedData());
+ req.setResizeDirection(request.getResizeDirection());
+ // if this is the last compartment the command is redirect to the parent
+ if(getHost().getParent().getChildren().indexOf(getHost()) == indexOfTheLast) {
+ req.setEditParts(getHost().getParent());
+ return getHost().getParent().getParent().getCommand(req);
+ } else {
+ return getHost().getParent().getCommand(req);
+ }
+
+ // return super.getResizeCommand(request);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void showChangeBoundsFeedback(ChangeBoundsRequest request) {
+ IFigure feedback = getDragSourceFeedbackFigure();
+
+ PrecisionRectangle rect = new PrecisionRectangle(getInitialFeedbackBounds().getCopy());
+ getHostFigure().translateToAbsolute(rect);
+ rect.translate(request.getMoveDelta());
+ rect.resize(request.getSizeDelta());
+
+ feedback.translateToRelative(rect);
+ feedback.setBounds(rect);
+ }
+
+ /**
+ * @see org.eclipse.gef.editpolicies.SelectionEditPolicy#showSelection()
+ */
+ @Override
+ protected void showSelection() {
+ // not selected but we want to see collapsable handle
+ if(getHost().getSelected() == EditPart.SELECTED_NONE) {
+ addCollapsableHandles();
+ }
+ // selected we want to see collapsable handle and resize handle
+ if(getHost().getSelected() == EditPart.SELECTED_PRIMARY) {
+ super.showSelection();
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ChangeStereotypedShapeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ChangeStereotypedShapeEditPolicy.java
index a470a539dd7..81ea86dba20 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ChangeStereotypedShapeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ChangeStereotypedShapeEditPolicy.java
@@ -1,250 +1,250 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractShapeEditPart;
-import org.eclipse.uml2.uml.Element;
-
-
-public abstract class ChangeStereotypedShapeEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
-
-
- /** constant for this edit policy role */
- public final static String CHANGE_SHAPE_POLICY = "CHANGE_SHAPE_POLICY";
-
- /** host semantic element */
- protected Element hostSemanticElement;
-
- /**
- * Creates a new AppliedStereotype display edit policy
- */
- public ChangeStereotypedShapeEditPolicy() {
- super();
- }
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
-
- /**
- * Returns the uml element controlled by the host edit part
- *
- * @return the uml element controlled by the host edit part
- * can return null if this semantic element is not an uml element
- */
- protected Element getUMLElement() {
- if(getView().getElement() instanceof Element) {
- return (Element)getView().getElement();
- }
- return null;
- }
-
- /**
- * Returns the view controlled by the host edit part
- *
- * @return the view controlled by the host edit part
- */
- protected View getView() {
- return (View)getHost().getModel();
- }
-
- /**
- * get all semantic link that are source or target of the graphical edit part
- * @param gmfpart the graphical editpart for each we look for source and target link
- * @return a list of eobject
- */
- public ArrayList<EObject> getAllSemanticLink(GraphicalEditPart gmfpart){
- ArrayList<EObject> elementToDrop= new ArrayList<EObject>();
- Iterator linkIter= gmfpart.getNotationView().getSourceEdges().iterator();
- while(linkIter.hasNext()) {
- Edge edge = (Edge)linkIter.next();
- if(edge.getElement()!=null){
- elementToDrop.add(edge.getElement());
-
- }
-
- }
- linkIter= gmfpart.getNotationView().getTargetEdges().iterator();
- while(linkIter.hasNext()) {
- Edge edge = (Edge)linkIter.next();
- if(edge.getElement()!=null){
- elementToDrop.add(edge.getElement());
- }
-
- }
- return elementToDrop;
- }
-
- /**
- * drop a set of link into the container
- * @param gmfparent the parent which contain the links
- * @param elementToDrop contains the list of semantic link to drop
- *
- */
- public void dropLink(GraphicalEditPart gmfparent, ArrayList<EObject> elementToDrop){
-
- Iterator<EObject> iterDrop= elementToDrop.iterator();
- while(iterDrop.hasNext()) {
- EObject currentObject = (EObject)iterDrop.next();
- DropObjectsRequest dropObjectsRequest= new DropObjectsRequest();
- ArrayList<EObject> list = new ArrayList<EObject>();
- list.add((Element)currentObject);
- dropObjectsRequest.setObjects(list);
- dropObjectsRequest.setLocation(new Point(0,0));
- Command cmd= gmfparent.getCommand(dropObjectsRequest);
- gmfparent.getDiagramEditDomain().getDiagramCommandStack().execute(cmd);
- }
- }
-
- /**
- *
- * {@inheritedDoc}
- */
- public void notifyChanged(Notification notification) {
- // change the label of the figure managed by the host edit part (managed by the parent edit
- // part in general...)
- // it must be changed only if:
- // - the annotation corresponding to the display of the stereotype changes
- // - the stereotype application list has changed
-
-
- // if element that has changed is a stereotype => refresh the label.
- if(notification.getNotifier() instanceof EAnnotation) {
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION == ((EAnnotation)notification.getNotifier()).getSource()) {
- // stereotype annotation has changed => refresh label display
- //add a test about kind old value
- if(!(getHost() instanceof AbstractShapeEditPart) && AppliedStereotypeHelper.getAppliedStereotypePresentationKind(getView()) == UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION) {
- if(notification.getNewValue() instanceof Map.Entry<?, ?>) {
- if(((Map.Entry<?, ?>)notification.getNewValue()).getKey().equals(UMLVisualInformationPapyrusConstant.STEREOTYPE_PRESENTATION_KIND)) {
- transformIntoShape(getHost());
- }
- }
- }
- if((getHost() instanceof AbstractShapeEditPart) && AppliedStereotypeHelper.getAppliedStereotypePresentationKind(getView()) != UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION) {
- if(notification.getNewValue() instanceof Map.Entry<?, ?>) {
- if(((Map.Entry<?, ?>)notification.getNewValue()).getKey().equals(UMLVisualInformationPapyrusConstant.STEREOTYPE_PRESENTATION_KIND)) {
- transformIntoNormalShape(getHost());
- }
- }
- }
- }
- }
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
- hostSemanticElement = getUMLElement();
-
- // adds a listener on the view and the element controlled by the editpart
- getDiagramEventBroker().addNotificationListener(view, this);
-
- if(hostSemanticElement == null) {
- return;
- }
- getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
-
- // adds the listener for stereotype application and applied stereotypes
- // add listener to react to the application and remove of a stereotype
-
- // add a lister to each already applied stereotyped
- for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
- getDiagramEventBroker().addNotificationListener(stereotypeApplication, this);
- }
-
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void deactivate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
-
- getDiagramEventBroker().removeNotificationListener(view, this);
-
- if(hostSemanticElement == null) {
- return;
- }
- // remove listeners to applied stereotyped
- for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
- getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this);
- }
- // remove notification on element
- getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this);
-
- // removes the reference to the semantic element
- hostSemanticElement = null;
- }
-
- /**
- * implementation to transform this editpart into shape from the stereotype
- *
- * @param part
- * the graphical editpart to change
- */
- public abstract void transformIntoShape(EditPart part);
-
-
- /**
- * implementation to transform a shape editpart into normal editpart
- *
- * @param part
- * the graphical editpart to change
- */
- public abstract void transformIntoNormalShape(EditPart part);
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.editparts.AbstractShapeEditPart;
+import org.eclipse.uml2.uml.Element;
+
+
+public abstract class ChangeStereotypedShapeEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
+
+
+ /** constant for this edit policy role */
+ public final static String CHANGE_SHAPE_POLICY = "CHANGE_SHAPE_POLICY";
+
+ /** host semantic element */
+ protected Element hostSemanticElement;
+
+ /**
+ * Creates a new AppliedStereotype display edit policy
+ */
+ public ChangeStereotypedShapeEditPolicy() {
+ super();
+ }
+
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ protected DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the uml element controlled by the host edit part
+ *
+ * @return the uml element controlled by the host edit part
+ * can return null if this semantic element is not an uml element
+ */
+ protected Element getUMLElement() {
+ if(getView().getElement() instanceof Element) {
+ return (Element)getView().getElement();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the view controlled by the host edit part
+ *
+ * @return the view controlled by the host edit part
+ */
+ protected View getView() {
+ return (View)getHost().getModel();
+ }
+
+ /**
+ * get all semantic link that are source or target of the graphical edit part
+ * @param gmfpart the graphical editpart for each we look for source and target link
+ * @return a list of eobject
+ */
+ public ArrayList<EObject> getAllSemanticLink(GraphicalEditPart gmfpart){
+ ArrayList<EObject> elementToDrop= new ArrayList<EObject>();
+ Iterator linkIter= gmfpart.getNotationView().getSourceEdges().iterator();
+ while(linkIter.hasNext()) {
+ Edge edge = (Edge)linkIter.next();
+ if(edge.getElement()!=null){
+ elementToDrop.add(edge.getElement());
+
+ }
+
+ }
+ linkIter= gmfpart.getNotationView().getTargetEdges().iterator();
+ while(linkIter.hasNext()) {
+ Edge edge = (Edge)linkIter.next();
+ if(edge.getElement()!=null){
+ elementToDrop.add(edge.getElement());
+ }
+
+ }
+ return elementToDrop;
+ }
+
+ /**
+ * drop a set of link into the container
+ * @param gmfparent the parent which contain the links
+ * @param elementToDrop contains the list of semantic link to drop
+ *
+ */
+ public void dropLink(GraphicalEditPart gmfparent, ArrayList<EObject> elementToDrop){
+
+ Iterator<EObject> iterDrop= elementToDrop.iterator();
+ while(iterDrop.hasNext()) {
+ EObject currentObject = (EObject)iterDrop.next();
+ DropObjectsRequest dropObjectsRequest= new DropObjectsRequest();
+ ArrayList<EObject> list = new ArrayList<EObject>();
+ list.add((Element)currentObject);
+ dropObjectsRequest.setObjects(list);
+ dropObjectsRequest.setLocation(new Point(0,0));
+ Command cmd= gmfparent.getCommand(dropObjectsRequest);
+ gmfparent.getDiagramEditDomain().getDiagramCommandStack().execute(cmd);
+ }
+ }
+
+ /**
+ *
+ * {@inheritedDoc}
+ */
+ public void notifyChanged(Notification notification) {
+ // change the label of the figure managed by the host edit part (managed by the parent edit
+ // part in general...)
+ // it must be changed only if:
+ // - the annotation corresponding to the display of the stereotype changes
+ // - the stereotype application list has changed
+
+
+ // if element that has changed is a stereotype => refresh the label.
+ if(notification.getNotifier() instanceof EAnnotation) {
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_ANNOTATION == ((EAnnotation)notification.getNotifier()).getSource()) {
+ // stereotype annotation has changed => refresh label display
+ //add a test about kind old value
+ if(!(getHost() instanceof AbstractShapeEditPart) && AppliedStereotypeHelper.getAppliedStereotypePresentationKind(getView()) == UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION) {
+ if(notification.getNewValue() instanceof Map.Entry<?, ?>) {
+ if(((Map.Entry<?, ?>)notification.getNewValue()).getKey().equals(UMLVisualInformationPapyrusConstant.STEREOTYPE_PRESENTATION_KIND)) {
+ transformIntoShape(getHost());
+ }
+ }
+ }
+ if((getHost() instanceof AbstractShapeEditPart) && AppliedStereotypeHelper.getAppliedStereotypePresentationKind(getView()) != UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION) {
+ if(notification.getNewValue() instanceof Map.Entry<?, ?>) {
+ if(((Map.Entry<?, ?>)notification.getNewValue()).getKey().equals(UMLVisualInformationPapyrusConstant.STEREOTYPE_PRESENTATION_KIND)) {
+ transformIntoNormalShape(getHost());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void activate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+ hostSemanticElement = getUMLElement();
+
+ // adds a listener on the view and the element controlled by the editpart
+ getDiagramEventBroker().addNotificationListener(view, this);
+
+ if(hostSemanticElement == null) {
+ return;
+ }
+ getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
+
+ // adds the listener for stereotype application and applied stereotypes
+ // add listener to react to the application and remove of a stereotype
+
+ // add a lister to each already applied stereotyped
+ for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
+ getDiagramEventBroker().addNotificationListener(stereotypeApplication, this);
+ }
+
+
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void deactivate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+
+ getDiagramEventBroker().removeNotificationListener(view, this);
+
+ if(hostSemanticElement == null) {
+ return;
+ }
+ // remove listeners to applied stereotyped
+ for(EObject stereotypeApplication : hostSemanticElement.getStereotypeApplications()) {
+ getDiagramEventBroker().removeNotificationListener(stereotypeApplication, this);
+ }
+ // remove notification on element
+ getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this);
+
+ // removes the reference to the semantic element
+ hostSemanticElement = null;
+ }
+
+ /**
+ * implementation to transform this editpart into shape from the stereotype
+ *
+ * @param part
+ * the graphical editpart to change
+ */
+ public abstract void transformIntoShape(EditPart part);
+
+
+ /**
+ * implementation to transform a shape editpart into normal editpart
+ *
+ * @param part
+ * the graphical editpart to change
+ */
+ public abstract void transformIntoNormalShape(EditPart part);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentReferencesListenerEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentReferencesListenerEditPolicy.java
index 8f136887f3e..9777a8b31d8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentReferencesListenerEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentReferencesListenerEditPolicy.java
@@ -1,31 +1,31 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (camille.letavernier@cea.fr) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.uml2.uml.Comment;
-
-
-public class CommentReferencesListenerEditPolicy extends AbstractNameReferencesListenerEditPolicy {
-
- @Override
- protected String getText() {
- return getModel().getBody();
- }
-
- @Override
- protected Comment getModel() {
- return (Comment)super.getModel();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (camille.letavernier@cea.fr) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.uml2.uml.Comment;
+
+
+public class CommentReferencesListenerEditPolicy extends AbstractNameReferencesListenerEditPolicy {
+
+ @Override
+ protected String getText() {
+ return getModel().getBody();
+ }
+
+ @Override
+ protected Comment getModel() {
+ return (Comment)super.getModel();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentShapeForAppliedStereotypeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentShapeForAppliedStereotypeEditPolicy.java
index f1703b542cf..2374d47501e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentShapeForAppliedStereotypeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommentShapeForAppliedStereotypeEditPolicy.java
@@ -1,188 +1,188 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.Transaction;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.impl.InternalTransaction;
-import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.notation.EObjectValueStyle;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * this editpolicy attached to StereotypeCommentEdipart has in charge to prevent the remove form model
- * and launch command of deletion if it detect that any properties of applied stereotype are displayed
- *
- */
-public class CommentShapeForAppliedStereotypeEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
-
- public void notifyChanged(Notification notification) {
- View commentNode=getView();
- final TransactionalEditingDomain domain= TransactionUtil.getEditingDomain(commentNode);
- if(getUMLElement()==null){
- executeAppliedStereotypeCommentDeletion(domain, commentNode);
- }
- final int eventType = notification.getEventType();
- if(eventType==Notification.SET && notification.getFeature().equals(NotationPackage.eINSTANCE.getView_Visible())){
-
- if(getView()!=null){
-
- if (getvisibleAppliedStereotypeCompartment(commentNode, getUMLElement())==0){
-
- executeAppliedStereotypeCommentDeletion(domain, commentNode);
-
- }
- }
- }
- }
-
- /**
- * Returns the uml element controlled by the host edit part
- *
- * @return the uml element controlled by the host edit part
- */
- protected Element getUMLElement() {
- if( (Element)getView().getElement()!=null){
- return (Element)getView().getElement();
- }
- if(getView().getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), "BASE_ELEMENT")!=null){
- EObjectValueStyle eObjectValueStyle=(EObjectValueStyle)getView().getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), "BASE_ELEMENT");
- return (Element)eObjectValueStyle.getEObjectValue();
- }
- return null;
- }
- @Override
- public Command getCommand(Request request) {
- if(request instanceof EditCommandRequestWrapper){
- if(((EditCommandRequestWrapper)(request)).getEditCommandRequest() instanceof DestroyElementRequest){
- return UnexecutableCommand.INSTANCE;
- }
- }
- return super.getCommand(request);
- }
-
-
- protected void executeAppliedStereotypeCommentDeletion( final TransactionalEditingDomain domain, final View commentNode) {
- try {
- domain.runExclusive(new Runnable() {
-
- public void run() {
- Display.getCurrent().asyncExec(new Runnable() {
-
- public void run() {
- //because it is asynchrone the comment node maybe become s null
- if( commentNode!= null&& TransactionUtil.getEditingDomain(commentNode)!=null){
- DeleteCommand command= new DeleteCommand(commentNode);
- Map<String,Boolean> options = new HashMap<String,Boolean>();
- options.put(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
- try{
- InternalTransaction it=((InternalTransactionalEditingDomain) TransactionUtil.getEditingDomain(commentNode)).startTransaction(false, options);
- GMFtoEMFCommandWrapper warpperCmd= new GMFtoEMFCommandWrapper (command);
- warpperCmd.execute();
- it.commit();
- }catch(Exception e){
- Activator.log.error(e);
- }
- }
- }
- });
- }
- });
- } catch (Exception e) {
- Activator.log.error(e);
- }
- }
- protected int getvisibleAppliedStereotypeCompartment(View view, EObject eobject){
- int nbVisibleCompartment=0;
- Iterator<View> iteratorView= view.getChildren().iterator();
- while(iteratorView.hasNext()) {
- View subview = (View)iteratorView.next();
- if( subview.isVisible()==true){
- nbVisibleCompartment++;
- }
- }
- return nbVisibleCompartment;
- }
-
-
- @Override
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
-
- // adds a listener on the view and the element controlled by the
- // editpart
- getDiagramEventBroker().addNotificationListener(view, this);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void deactivate() {
- // retrieve the view and the element managed by the edit part
- View view = getView();
- if(view == null) {
- return;
- }
-
- getDiagramEventBroker().removeNotificationListener(view, this);
- }
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
- /**
- * Returns the view controlled by the host edit part
- *
- * @return the view controlled by the host edit part
- */
- protected View getView() {
- return (View)getHost().getModel();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.Transaction;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.impl.InternalTransaction;
+import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.EObjectValueStyle;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * this editpolicy attached to StereotypeCommentEdipart has in charge to prevent the remove form model
+ * and launch command of deletion if it detect that any properties of applied stereotype are displayed
+ *
+ */
+public class CommentShapeForAppliedStereotypeEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
+
+ public void notifyChanged(Notification notification) {
+ View commentNode=getView();
+ final TransactionalEditingDomain domain= TransactionUtil.getEditingDomain(commentNode);
+ if(getUMLElement()==null){
+ executeAppliedStereotypeCommentDeletion(domain, commentNode);
+ }
+ final int eventType = notification.getEventType();
+ if(eventType==Notification.SET && notification.getFeature().equals(NotationPackage.eINSTANCE.getView_Visible())){
+
+ if(getView()!=null){
+
+ if (getvisibleAppliedStereotypeCompartment(commentNode, getUMLElement())==0){
+
+ executeAppliedStereotypeCommentDeletion(domain, commentNode);
+
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the uml element controlled by the host edit part
+ *
+ * @return the uml element controlled by the host edit part
+ */
+ protected Element getUMLElement() {
+ if( (Element)getView().getElement()!=null){
+ return (Element)getView().getElement();
+ }
+ if(getView().getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), "BASE_ELEMENT")!=null){
+ EObjectValueStyle eObjectValueStyle=(EObjectValueStyle)getView().getNamedStyle(NotationPackage.eINSTANCE.getEObjectValueStyle(), "BASE_ELEMENT");
+ return (Element)eObjectValueStyle.getEObjectValue();
+ }
+ return null;
+ }
+ @Override
+ public Command getCommand(Request request) {
+ if(request instanceof EditCommandRequestWrapper){
+ if(((EditCommandRequestWrapper)(request)).getEditCommandRequest() instanceof DestroyElementRequest){
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+ return super.getCommand(request);
+ }
+
+
+ protected void executeAppliedStereotypeCommentDeletion( final TransactionalEditingDomain domain, final View commentNode) {
+ try {
+ domain.runExclusive(new Runnable() {
+
+ public void run() {
+ Display.getCurrent().asyncExec(new Runnable() {
+
+ public void run() {
+ //because it is asynchrone the comment node maybe become s null
+ if( commentNode!= null&& TransactionUtil.getEditingDomain(commentNode)!=null){
+ DeleteCommand command= new DeleteCommand(commentNode);
+ Map<String,Boolean> options = new HashMap<String,Boolean>();
+ options.put(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
+ try{
+ InternalTransaction it=((InternalTransactionalEditingDomain) TransactionUtil.getEditingDomain(commentNode)).startTransaction(false, options);
+ GMFtoEMFCommandWrapper warpperCmd= new GMFtoEMFCommandWrapper (command);
+ warpperCmd.execute();
+ it.commit();
+ }catch(Exception e){
+ Activator.log.error(e);
+ }
+ }
+ }
+ });
+ }
+ });
+ } catch (Exception e) {
+ Activator.log.error(e);
+ }
+ }
+ protected int getvisibleAppliedStereotypeCompartment(View view, EObject eobject){
+ int nbVisibleCompartment=0;
+ Iterator<View> iteratorView= view.getChildren().iterator();
+ while(iteratorView.hasNext()) {
+ View subview = (View)iteratorView.next();
+ if( subview.isVisible()==true){
+ nbVisibleCompartment++;
+ }
+ }
+ return nbVisibleCompartment;
+ }
+
+
+ @Override
+ public void activate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+
+ // adds a listener on the view and the element controlled by the
+ // editpart
+ getDiagramEventBroker().addNotificationListener(view, this);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void deactivate() {
+ // retrieve the view and the element managed by the edit part
+ View view = getView();
+ if(view == null) {
+ return;
+ }
+
+ getDiagramEventBroker().removeNotificationListener(view, this);
+ }
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ protected DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ return null;
+ }
+ /**
+ * Returns the view controlled by the host edit part
+ *
+ * @return the view controlled by the host edit part
+ */
+ protected View getView() {
+ return (View)getHost().getModel();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommonDiagramDragDropEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommonDiagramDragDropEditPolicy.java
index a74889a14e2..ed28e175964 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommonDiagramDragDropEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CommonDiagramDragDropEditPolicy.java
@@ -1,682 +1,682 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - add the line ViewServiceUtil.forceLoad();
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.commands.operations.IUndoableOperation;
-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.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-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.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy;
-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.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.CommandProxyWithResult;
-import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.DeferredCreateCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
-import org.eclipse.papyrus.uml.diagram.common.helper.ILinkMappingHelper;
-import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.diagram.common.util.ViewServiceUtil;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * This class is used to execute the drag and drop from the outline. It can
- * manage the drop of nodes and binary links.
- */
-public abstract class CommonDiagramDragDropEditPolicy extends DiagramDragDropEditPolicy {
-
- /** The specific drop. */
- private Set<Integer> specificDrop = null;
-
- /** The specified link mapping helper depending on the diagram */
- protected ILinkMappingHelper linkmappingHelper;
-
- /**
- * Instantiates a new custom diagram drag drop edit policy.
- *
- * @param mappingHelper
- * the mapping helper
- */
- public CommonDiagramDragDropEditPolicy(ILinkMappingHelper mappingHelper) {
- linkmappingHelper = mappingHelper;
- }
-
- /**
- * Gets elements visual id that can be dropped in the diagram
- */
- protected Set<Integer> getSpecificDrop() {
- if(specificDrop == null) {
- specificDrop = getDroppableElementVisualId();
- }
- return specificDrop;
- }
-
- /**
- * Gets the UML element type for the specified
- *
- * @param elementID
- * the element id
- *
- * @return the uML element type
- */
- public abstract IElementType getUMLElementType(int elementID);
-
- public abstract int getNodeVisualID(View containerView, EObject domainElement);
-
- public abstract int getLinkWithClassVisualID(EObject domainElement);
-
- /**
- * The list of visualID that the policy manages.
- */
- protected abstract Set<Integer> getDroppableElementVisualId();
-
- /**
- * {@inheritedDoc}
- */
- @Override
- protected Command createViewsAndArrangeCommand(DropObjectsRequest dropRequest, List viewDescriptors) {
- CreateViewRequest createViewRequest = new CreateViewRequest(viewDescriptors);
- createViewRequest.setLocation(dropRequest.getLocation());
- Command createCommand = getHost().getCommand(createViewRequest);
- return createCommand;
- }
-
- /**
- * 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 dropBinaryLink(CompositeCommand cc, Element source, Element target, int linkVISUALID, Point absoluteLocation, Element semanticLink) {
- // look for editpart
- GraphicalEditPart sourceEditPart = (GraphicalEditPart)lookForEditPart(source);
- GraphicalEditPart targetEditPart = (GraphicalEditPart)lookForEditPart(target);
-
- // 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) {
- ICommand createCommand = getDefaultDropNodeCommand(getLinkSourceDropLocation(absoluteLocation,source, target), source);
- cc.add(createCommand);
-
- sourceAdapter = (IAdaptable)createCommand.getCommandResult().getReturnValue();
- } else {
- sourceAdapter = new SemanticAdapter(null, sourceEditPart.getModel());
- }
- if(targetEditPart == null) {
- ICommand createCommand = getDefaultDropNodeCommand(getLinkTargetDropLocation(absoluteLocation,source, target), target);
- cc.add(createCommand);
-
- targetAdapter = (IAdaptable)createCommand.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;
-
- }
-
- /**
- * This method allows to specify a location for the creation of a node at
- * the source of a dropped link. Overriding implementations must not modify
- * the absoluteLocation parameter (use {@link Point#getCopy()})
- *
- * @param absoluteLocation the request's drop location
- * @param source the source of the dropped link
- * @param target the target of the dropped link
- * @return the new location for the node
- */
- protected Point getLinkSourceDropLocation(Point absoluteLocation, Element source, Element target) {
- return absoluteLocation;
- }
-
- /**
- * This method allows to specify a location for the creation of a node at
- * the target of a dropped link. Overriding implementations must not modify
- * the absoluteLocation parameter (use {@link Point#getCopy()})
- *
- * @param absoluteLocation the request's drop location
- * @param source the source of the dropped link
- * @param target the target of the dropped link
- * @return the new location for the node
- */
- protected Point getLinkTargetDropLocation(Point absoluteLocation, Element source, Element target) {
- if (lookForEditPart(source) == null && lookForEditPart(target) == null) {
- return absoluteLocation.getTranslated(100, 0);
- }
- return absoluteLocation;
- }
-
- /**
- * Gets the diagram preferences hint.
- *
- * @return the diagram preferences hint
- */
- protected PreferencesHint getDiagramPreferencesHint() {
- return ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint();
- }
-
- /**
- * {@inheritedDoc}.
- */
- @Override
- public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
- /*
- * when it's the first action after the opening of Papyrus, the
- * viewService is not loaded! see bug 302555
- *
- * Duration test for 100000 creations of DropCommand : Here 2 solutions
- * : - call ViewServiceUtil.forceLoad(); for each drop -> ~2500ms
- *
- * - test if the command cc can be executed at the end of the method,
- * and if not : - call ViewServiceUtil.forceLoad(); - and return
- * getDropObjectsCommand(getDropObjectsCommand) -> ~4700ms
- *
- * - for information : without call ViewServiceUtil.forceLoad(); ->
- * ~1600ms
- *
- * It's better don't test if the command is executable!
- */
- ViewServiceUtil.forceLoad();
-
- if(dropRequest.getObjects().size() > 0 && dropRequest.getObjects().get(0) instanceof String) {
- return getDropFileCommand(dropRequest);
- }
-
- // Create a view request from the drop request and then forward getting
- // the command for that.
- CompositeCommand cc = new CompositeCommand("Drop"); //$NON-NLS-1$
- Iterator<?> iter = dropRequest.getObjects().iterator();
-
- while(iter.hasNext()) {
- EObject droppedObject = (EObject)iter.next();
- cc.add(getDropObjectCommand(dropRequest, droppedObject));
- }
-
- return new ICommandProxy(cc);
- }
-
- protected IUndoableOperation getDropObjectCommand(DropObjectsRequest dropRequest, EObject droppedObject) {
- Point location = dropRequest.getLocation().getCopy();
-
- int nodeVISUALID = getNodeVisualID(((IGraphicalEditPart)getHost()).getNotationView(), droppedObject);
- int linkVISUALID = getLinkWithClassVisualID(droppedObject);
- if(getSpecificDrop().contains(nodeVISUALID) || getSpecificDrop().contains(linkVISUALID)) {
- Command specificDropCommand = getSpecificDropCommand(dropRequest, (Element)droppedObject, nodeVISUALID, linkVISUALID);
- CompositeCommand cc = new CompositeCommand("Drop command");
- cc.compose(new CommandProxy(specificDropCommand));
- // If ctrl key activate, get the content of element dropped
- if(isCopy(dropRequest)) {
- // Check for ICommandProxy and CompoundCommand the most command type used
- if(specificDropCommand instanceof ICommandProxy) {
- ICommandProxy specificDropCommandProxy = (ICommandProxy)specificDropCommand;
- createDeferredCommandWithCommandResult(droppedObject, cc, specificDropCommandProxy);
- } else if(specificDropCommand instanceof CompoundCommand) {
- CompoundCommand specificDropCompoundCommand = (CompoundCommand)specificDropCommand;
- ICommandProxy cp = getCommandProxyFromCompoundCommand(specificDropCompoundCommand);
- if(cp != null) {
- createDeferredCommandWithCommandResult(droppedObject, cc, cp);
- }
- }
- }
- return cc;
- }
-
- if(linkVISUALID == -1 && nodeVISUALID != -1) {
- // The element to drop is a node
- // Retrieve it's expected graphical parent
- EObject graphicalParent = ((GraphicalEditPart)getHost()).resolveSemanticElement();
-
- // Restrict the default node creation to the following cases:
- // . Take the containment relationship into consideration
- // . Release the constraint when GraphicalParent is a diagram
- if(getHost().getModel() instanceof Diagram) {
- return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, dropRequest);
- } else if((graphicalParent instanceof Element) && ((Element)graphicalParent).getOwnedElements().contains(droppedObject)) {
- return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, dropRequest);
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
-
- }
- if(linkVISUALID != -1) {
- Collection<?> sources = linkmappingHelper.getSource((Element)droppedObject);
- Collection<?> targets = linkmappingHelper.getTarget((Element)droppedObject);
- if(sources.size() == 0 || targets.size() == 0) {
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
- // binary association
- Element source = (Element)sources.toArray()[0];
- Element target = (Element)targets.toArray()[0];
- CompositeCommand cc = new CompositeCommand("Add Link"); //$NON-NLS-1$
- dropBinaryLink(cc, source, target, linkVISUALID, location, (Element)droppedObject);
- return cc;
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Get a command proxy from the compound command
- *
- * @param cc
- * the compound command
- * @return the command proxy found or null
- */
- protected ICommandProxy getCommandProxyFromCompoundCommand(CompoundCommand cc) {
- if(cc != null && cc.getCommands() != null) {
- for(Object command : cc.getCommands()) {
- if(command instanceof ICommandProxy) {
- return (ICommandProxy)command;
- } else if(command instanceof CompoundCommand) {
- getCommandProxyFromCompoundCommand((CompoundCommand)command);
- }
- }
- }
- return null;
- }
-
- /**
- * Create deferred command for a command proxy
- *
- * @param droppedObject
- * the dropped object
- * @param cc
- * the composite command to add the deferred command
- * @param specificDropCommandProxy
- * the specific drop command to get the result
- */
- protected void createDeferredCommandWithCommandResult(EObject droppedObject, CompositeCommand cc, ICommandProxy specificDropCommandProxy) {
- if(specificDropCommandProxy != null && specificDropCommandProxy.getICommand() != null && specificDropCommandProxy.getICommand().getCommandResult() != null && specificDropCommandProxy.getICommand().getCommandResult().getReturnValue() != null) {
- Object object = specificDropCommandProxy.getICommand().getCommandResult().getReturnValue();
- if(object instanceof Collection<?>) {
- for(Object o : (Collection<?>)object) {
- if(o instanceof CreateViewRequest.ViewDescriptor) {
- CreateViewRequest.ViewDescriptor viewDescritor = (CreateViewRequest.ViewDescriptor)o;
- DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)viewDescritor, getHost().getViewer());
- cc.compose(createCommand2);
- }
- }
- }
- }
- }
-
- /**
- * Get a new Point translated to relative coordinate
- *
- * @param absoluteLocation
- * the absolute point
- * @return the relative point
- */
- protected Point getTranslatedToRelative(Point absoluteLocation) {
- Point relativeLocation = absoluteLocation.getCopy();
- ((GraphicalEditPart)getHost()).getContentPane().translateToRelative(relativeLocation);
- ((GraphicalEditPart)getHost()).getContentPane().translateFromParent(relativeLocation);
- relativeLocation.translate(((GraphicalEditPart)getHost()).getContentPane().getClientArea().getLocation().getNegated());
- return relativeLocation;
- }
-
- /**
- * This method returns the default drop command for node. It create the view
- * at the specified location, using the gmf command framework so the
- * policies are used.
- *
- * @param nodeVISUALID
- * the node visual identifier
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @param request
- * the drop request
- * @return the creation node command
- */
- protected ICommand getDefaultDropNodeCommand(int nodeVISUALID, Point absoluteLocation, EObject droppedObject, DropObjectsRequest request) {
- return getDefaultDropNodeCommand(getHost(), nodeVISUALID, absoluteLocation, droppedObject);
- }
-
- /**
- * This method returns the default drop command for node. It create the view
- * at the specified location, using the gmf command framework so the
- * policies are used.
- *
- * @param nodeVISUALID
- * the node visual identifier
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return the creation node command
- */
- protected ICommand getDefaultDropNodeCommand(int nodeVISUALID, Point absoluteLocation, EObject droppedObject) {
- return getDefaultDropNodeCommand(nodeVISUALID, absoluteLocation, droppedObject, null);
- }
-
- /**
- * This method returns the default drop command for node. It create the view
- * at the specified location, using the gmf command framework so the
- * policies are used.
- *
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return the creation node command
- */
- protected ICommand getDefaultDropNodeCommand(Point absoluteLocation, EObject droppedObject) {
- return getDefaultDropNodeCommand(getHost(), null, absoluteLocation, droppedObject);
- }
-
- /**
- * This method returns the default drop command for node. It create the view
- * at the specified location, using the gmf command framework so the
- * policies are used.
- *
- * @param hostEP
- * The host edit part which will be the parent of the new node
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return the creation node command
- */
- protected ICommand getDefaultDropNodeCommand(EditPart hostEP, Point absoluteLocation, EObject droppedObject) {
- return getDefaultDropNodeCommand(hostEP, null, absoluteLocation, droppedObject);
- }
-
- /**
- * This method returns the default drop command for node. It create the view
- * at the specified location, using the gmf command framework so the
- * policies are used.
- *
- * @param hostEP
- * The host edit part which will be the parent of the new node
- * @param nodeVISUALID
- * the node visual identifier
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @param request
- * the drop request
- * @return the creation node command
- */
- protected ICommand getDefaultDropNodeCommand(EditPart hostEP, int nodeVISUALID, Point absoluteLocation, EObject droppedObject, DropObjectsRequest request) {
- IHintedType type = ((IHintedType)getUMLElementType(nodeVISUALID));
-
- String semanticHint = null;
- if(type != null) {
- semanticHint = type.getSemanticHint();
- }
-
- return getDefaultDropNodeCommand(getHost(), semanticHint, absoluteLocation, droppedObject, request);
- }
-
- /**
- * This method returns the default drop command for node. It create the view
- * at the specified location, using the gmf command framework so the
- * policies are used.
- *
- * @param hostEP
- * The host edit part which will be the parent of the new node
- * @param nodeVISUALID
- * the node visual identifier
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return the creation node command
- */
- protected ICommand getDefaultDropNodeCommand(EditPart hostEP, int nodeVISUALID, Point absoluteLocation, EObject droppedObject) {
- return getDefaultDropNodeCommand(hostEP, nodeVISUALID, absoluteLocation, droppedObject, null);
- }
-
- /**
- * This method returns the default drop command for node. It create the view
- * at the specified location, using the gmf command framework so the
- * policies are used.
- *
- * @param hostEP
- * The host edit part which will be the parent of the new node
- * @param semanticHint
- * the semantic hint of the view to create
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return the creation node command
- */
- protected ICommand getDefaultDropNodeCommand(EditPart hostEP, String semanticHint, Point absoluteLocation, EObject droppedObject) {
- return getDefaultDropNodeCommand(hostEP, semanticHint, absoluteLocation, droppedObject, null);
- }
-
- /**
- * This method returns the default drop command for node. It create the view
- * at the specified location, using the gmf command framework so the
- * policies are used.
- * If the ctrl key is pressed, do a command to add content of the new node
- *
- * @param hostEP
- * The host edit part which will be the parent of the new node
- * @param semanticHint
- * the semantic hint of the view to create
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @param request
- * the drop request (use to test ctrl key)
- * @return the creation node command
- */
- protected ICommand getDefaultDropNodeCommand(EditPart hostEP, String semanticHint, Point absoluteLocation, EObject droppedObject, DropObjectsRequest request) {
- List<View> existingViews = DiagramEditPartsUtil.findViews(droppedObject, getViewer());
-
- // only allow one view instance of a single element by diagram
- if(existingViews.isEmpty()) {
- IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
-
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, semanticHint, ViewUtil.APPEND, true, getDiagramPreferencesHint());
- CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
- createViewRequest.setLocation(absoluteLocation);
-
- // "ask" the host for a command associated with the
- // CreateViewRequest
- Command command = hostEP.getCommand(createViewRequest);
- if(isCopy(request) && createViewRequest.getNewObject() instanceof List) {
- for(Object object : (List<?>)createViewRequest.getNewObject()) {
- if(object instanceof IAdaptable) {
- DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)object, getHost().getViewer());
- command.chain(new ICommandProxy(createCommand2));
- }
- }
- }
- // set the viewdescriptor as result
- // it then can be used as an adaptable to retrieve the View
- return new CommandProxyWithResult(command, descriptor);
- }
-
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Check if the ctrl key event is activate
- *
- * @param dropRequest
- * the request which contain the event
- * @return true if ctrl key is activate, else return false
- */
- public boolean isCopy(DropObjectsRequest dropRequest) {
- if(dropRequest != null && dropRequest.getExtendedData() != null && dropRequest.getExtendedData().get(DropTargetListener.EVENT_DETAIL) instanceof Integer) {
- int eventDetail = (Integer)dropRequest.getExtendedData().get(DropTargetListener.EVENT_DETAIL);
- if(((eventDetail & DND.DROP_COPY) != 0)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Gets the editing domain.
- *
- * @return the editing domain
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-
- /**
- * for specific case of drop, the designers has to write the algorithm of
- * its own drop. for example case of associationClass, multi dependency
- * etc....
- *
- * @param dropRequest
- * the drop request
- * @param nodeVISUALID
- * the node visualid
- * @param linkVISUALID
- * the link visualid
- * @param semanticLink
- * the semantic link
- *
- * @return the specific drop command
- */
- protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticLink, int nodeVISUALID, int linkVISUALID) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Gets the viewer.
- *
- * @return the viewer
- */
- protected EditPartViewer getViewer() {
- return ((IGraphicalEditPart)getHost()).getViewer();
- }
-
- /**
- * Look for editPart from its semantic.
- *
- * @param semantic
- * the semantic
- *
- * @return the edits the part or null if not found
- */
- protected EditPart lookForEditPart(EObject semantic) {
- Collection<EditPart> editPartSet = getHost().getViewer().getEditPartRegistry().values();
- Iterator<EditPart> editPartIterator = editPartSet.iterator();
- EditPart existedEditPart = null;
- while(editPartIterator.hasNext() && existedEditPart == null) {
- EditPart currentEditPart = editPartIterator.next();
-
- if(isEditPartTypeAdapted(currentEditPart.getClass(), semantic.eClass()) && semantic.equals(((GraphicalEditPart)currentEditPart).resolveSemanticElement())) {
- existedEditPart = currentEditPart;
- }
- }
- return existedEditPart;
- }
-
- /**
- * Check if the edit part type is the best one to represent an object of the
- * given EClass type
- *
- * @param editPartClass
- * the type of EditPart which may represent a semantic element
- * @param eClass
- * the EClass type of the represented semantic element
- * @return true if an edit part of this type should be selected
- */
- private boolean isEditPartTypeAdapted(Class<? extends EditPart> editPartClass, EClass eClass) {
- if(DiagramEditPart.class.isAssignableFrom(editPartClass) || CompartmentEditPart.class.isAssignableFrom(editPartClass)) {
- // the edit part is disqualified, as a compartment or a diagram can
- // not be dropped
- return false;
- } else if(GraphicalEditPart.class.isAssignableFrom(editPartClass)) {
- // check the edit part type against advised ones
- return isEditPartTypeSuitableForEClass(editPartClass.asSubclass(GraphicalEditPart.class), eClass);
- } else {
- // only a GraphicalEditPart must be selected
- return false;
- }
- }
-
- /**
- * Check if an edit part type correctly represent a semantic element of the
- * given EClass. Subclasses should implement this method to restrict the
- * possibilities during drop of a link. If an edit part is not of a suitable
- * type, returning false will eliminate it to represent the element as a
- * source or target edit part. This can be used for example to disable label
- * edit parts, which may represent the same model element as the main node.
- *
- * @param editPartClass
- * the type of EditPart which must be checked
- * @param eClass
- * the EClass type of the element which the edit part must
- * represent
- * @return the only edit part type which can be selected (return a common
- * super type if several edit parts can be chosen)
- */
- protected boolean isEditPartTypeSuitableForEClass(Class<? extends GraphicalEditPart> editPartClass, EClass eClass) {
- return true;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - add the line ViewServiceUtil.forceLoad();
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.commands.operations.IUndoableOperation;
+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.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+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.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy;
+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.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.CommandProxyWithResult;
+import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.DeferredCreateCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+import org.eclipse.papyrus.uml.diagram.common.helper.ILinkMappingHelper;
+import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.papyrus.uml.diagram.common.util.ViewServiceUtil;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * This class is used to execute the drag and drop from the outline. It can
+ * manage the drop of nodes and binary links.
+ */
+public abstract class CommonDiagramDragDropEditPolicy extends DiagramDragDropEditPolicy {
+
+ /** The specific drop. */
+ private Set<Integer> specificDrop = null;
+
+ /** The specified link mapping helper depending on the diagram */
+ protected ILinkMappingHelper linkmappingHelper;
+
+ /**
+ * Instantiates a new custom diagram drag drop edit policy.
+ *
+ * @param mappingHelper
+ * the mapping helper
+ */
+ public CommonDiagramDragDropEditPolicy(ILinkMappingHelper mappingHelper) {
+ linkmappingHelper = mappingHelper;
+ }
+
+ /**
+ * Gets elements visual id that can be dropped in the diagram
+ */
+ protected Set<Integer> getSpecificDrop() {
+ if(specificDrop == null) {
+ specificDrop = getDroppableElementVisualId();
+ }
+ return specificDrop;
+ }
+
+ /**
+ * Gets the UML element type for the specified
+ *
+ * @param elementID
+ * the element id
+ *
+ * @return the uML element type
+ */
+ public abstract IElementType getUMLElementType(int elementID);
+
+ public abstract int getNodeVisualID(View containerView, EObject domainElement);
+
+ public abstract int getLinkWithClassVisualID(EObject domainElement);
+
+ /**
+ * The list of visualID that the policy manages.
+ */
+ protected abstract Set<Integer> getDroppableElementVisualId();
+
+ /**
+ * {@inheritedDoc}
+ */
+ @Override
+ protected Command createViewsAndArrangeCommand(DropObjectsRequest dropRequest, List viewDescriptors) {
+ CreateViewRequest createViewRequest = new CreateViewRequest(viewDescriptors);
+ createViewRequest.setLocation(dropRequest.getLocation());
+ Command createCommand = getHost().getCommand(createViewRequest);
+ return createCommand;
+ }
+
+ /**
+ * 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 dropBinaryLink(CompositeCommand cc, Element source, Element target, int linkVISUALID, Point absoluteLocation, Element semanticLink) {
+ // look for editpart
+ GraphicalEditPart sourceEditPart = (GraphicalEditPart)lookForEditPart(source);
+ GraphicalEditPart targetEditPart = (GraphicalEditPart)lookForEditPart(target);
+
+ // 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) {
+ ICommand createCommand = getDefaultDropNodeCommand(getLinkSourceDropLocation(absoluteLocation,source, target), source);
+ cc.add(createCommand);
+
+ sourceAdapter = (IAdaptable)createCommand.getCommandResult().getReturnValue();
+ } else {
+ sourceAdapter = new SemanticAdapter(null, sourceEditPart.getModel());
+ }
+ if(targetEditPart == null) {
+ ICommand createCommand = getDefaultDropNodeCommand(getLinkTargetDropLocation(absoluteLocation,source, target), target);
+ cc.add(createCommand);
+
+ targetAdapter = (IAdaptable)createCommand.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;
+
+ }
+
+ /**
+ * This method allows to specify a location for the creation of a node at
+ * the source of a dropped link. Overriding implementations must not modify
+ * the absoluteLocation parameter (use {@link Point#getCopy()})
+ *
+ * @param absoluteLocation the request's drop location
+ * @param source the source of the dropped link
+ * @param target the target of the dropped link
+ * @return the new location for the node
+ */
+ protected Point getLinkSourceDropLocation(Point absoluteLocation, Element source, Element target) {
+ return absoluteLocation;
+ }
+
+ /**
+ * This method allows to specify a location for the creation of a node at
+ * the target of a dropped link. Overriding implementations must not modify
+ * the absoluteLocation parameter (use {@link Point#getCopy()})
+ *
+ * @param absoluteLocation the request's drop location
+ * @param source the source of the dropped link
+ * @param target the target of the dropped link
+ * @return the new location for the node
+ */
+ protected Point getLinkTargetDropLocation(Point absoluteLocation, Element source, Element target) {
+ if (lookForEditPart(source) == null && lookForEditPart(target) == null) {
+ return absoluteLocation.getTranslated(100, 0);
+ }
+ return absoluteLocation;
+ }
+
+ /**
+ * Gets the diagram preferences hint.
+ *
+ * @return the diagram preferences hint
+ */
+ protected PreferencesHint getDiagramPreferencesHint() {
+ return ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint();
+ }
+
+ /**
+ * {@inheritedDoc}.
+ */
+ @Override
+ public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
+ /*
+ * when it's the first action after the opening of Papyrus, the
+ * viewService is not loaded! see bug 302555
+ *
+ * Duration test for 100000 creations of DropCommand : Here 2 solutions
+ * : - call ViewServiceUtil.forceLoad(); for each drop -> ~2500ms
+ *
+ * - test if the command cc can be executed at the end of the method,
+ * and if not : - call ViewServiceUtil.forceLoad(); - and return
+ * getDropObjectsCommand(getDropObjectsCommand) -> ~4700ms
+ *
+ * - for information : without call ViewServiceUtil.forceLoad(); ->
+ * ~1600ms
+ *
+ * It's better don't test if the command is executable!
+ */
+ ViewServiceUtil.forceLoad();
+
+ if(dropRequest.getObjects().size() > 0 && dropRequest.getObjects().get(0) instanceof String) {
+ return getDropFileCommand(dropRequest);
+ }
+
+ // Create a view request from the drop request and then forward getting
+ // the command for that.
+ CompositeCommand cc = new CompositeCommand("Drop"); //$NON-NLS-1$
+ Iterator<?> iter = dropRequest.getObjects().iterator();
+
+ while(iter.hasNext()) {
+ EObject droppedObject = (EObject)iter.next();
+ cc.add(getDropObjectCommand(dropRequest, droppedObject));
+ }
+
+ return new ICommandProxy(cc);
+ }
+
+ protected IUndoableOperation getDropObjectCommand(DropObjectsRequest dropRequest, EObject droppedObject) {
+ Point location = dropRequest.getLocation().getCopy();
+
+ int nodeVISUALID = getNodeVisualID(((IGraphicalEditPart)getHost()).getNotationView(), droppedObject);
+ int linkVISUALID = getLinkWithClassVisualID(droppedObject);
+ if(getSpecificDrop().contains(nodeVISUALID) || getSpecificDrop().contains(linkVISUALID)) {
+ Command specificDropCommand = getSpecificDropCommand(dropRequest, (Element)droppedObject, nodeVISUALID, linkVISUALID);
+ CompositeCommand cc = new CompositeCommand("Drop command");
+ cc.compose(new CommandProxy(specificDropCommand));
+ // If ctrl key activate, get the content of element dropped
+ if(isCopy(dropRequest)) {
+ // Check for ICommandProxy and CompoundCommand the most command type used
+ if(specificDropCommand instanceof ICommandProxy) {
+ ICommandProxy specificDropCommandProxy = (ICommandProxy)specificDropCommand;
+ createDeferredCommandWithCommandResult(droppedObject, cc, specificDropCommandProxy);
+ } else if(specificDropCommand instanceof CompoundCommand) {
+ CompoundCommand specificDropCompoundCommand = (CompoundCommand)specificDropCommand;
+ ICommandProxy cp = getCommandProxyFromCompoundCommand(specificDropCompoundCommand);
+ if(cp != null) {
+ createDeferredCommandWithCommandResult(droppedObject, cc, cp);
+ }
+ }
+ }
+ return cc;
+ }
+
+ if(linkVISUALID == -1 && nodeVISUALID != -1) {
+ // The element to drop is a node
+ // Retrieve it's expected graphical parent
+ EObject graphicalParent = ((GraphicalEditPart)getHost()).resolveSemanticElement();
+
+ // Restrict the default node creation to the following cases:
+ // . Take the containment relationship into consideration
+ // . Release the constraint when GraphicalParent is a diagram
+ if(getHost().getModel() instanceof Diagram) {
+ return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, dropRequest);
+ } else if((graphicalParent instanceof Element) && ((Element)graphicalParent).getOwnedElements().contains(droppedObject)) {
+ return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, dropRequest);
+ }
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+
+ }
+ if(linkVISUALID != -1) {
+ Collection<?> sources = linkmappingHelper.getSource((Element)droppedObject);
+ Collection<?> targets = linkmappingHelper.getTarget((Element)droppedObject);
+ if(sources.size() == 0 || targets.size() == 0) {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+ // binary association
+ Element source = (Element)sources.toArray()[0];
+ Element target = (Element)targets.toArray()[0];
+ CompositeCommand cc = new CompositeCommand("Add Link"); //$NON-NLS-1$
+ dropBinaryLink(cc, source, target, linkVISUALID, location, (Element)droppedObject);
+ return cc;
+ }
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Get a command proxy from the compound command
+ *
+ * @param cc
+ * the compound command
+ * @return the command proxy found or null
+ */
+ protected ICommandProxy getCommandProxyFromCompoundCommand(CompoundCommand cc) {
+ if(cc != null && cc.getCommands() != null) {
+ for(Object command : cc.getCommands()) {
+ if(command instanceof ICommandProxy) {
+ return (ICommandProxy)command;
+ } else if(command instanceof CompoundCommand) {
+ getCommandProxyFromCompoundCommand((CompoundCommand)command);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create deferred command for a command proxy
+ *
+ * @param droppedObject
+ * the dropped object
+ * @param cc
+ * the composite command to add the deferred command
+ * @param specificDropCommandProxy
+ * the specific drop command to get the result
+ */
+ protected void createDeferredCommandWithCommandResult(EObject droppedObject, CompositeCommand cc, ICommandProxy specificDropCommandProxy) {
+ if(specificDropCommandProxy != null && specificDropCommandProxy.getICommand() != null && specificDropCommandProxy.getICommand().getCommandResult() != null && specificDropCommandProxy.getICommand().getCommandResult().getReturnValue() != null) {
+ Object object = specificDropCommandProxy.getICommand().getCommandResult().getReturnValue();
+ if(object instanceof Collection<?>) {
+ for(Object o : (Collection<?>)object) {
+ if(o instanceof CreateViewRequest.ViewDescriptor) {
+ CreateViewRequest.ViewDescriptor viewDescritor = (CreateViewRequest.ViewDescriptor)o;
+ DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)viewDescritor, getHost().getViewer());
+ cc.compose(createCommand2);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Get a new Point translated to relative coordinate
+ *
+ * @param absoluteLocation
+ * the absolute point
+ * @return the relative point
+ */
+ protected Point getTranslatedToRelative(Point absoluteLocation) {
+ Point relativeLocation = absoluteLocation.getCopy();
+ ((GraphicalEditPart)getHost()).getContentPane().translateToRelative(relativeLocation);
+ ((GraphicalEditPart)getHost()).getContentPane().translateFromParent(relativeLocation);
+ relativeLocation.translate(((GraphicalEditPart)getHost()).getContentPane().getClientArea().getLocation().getNegated());
+ return relativeLocation;
+ }
+
+ /**
+ * This method returns the default drop command for node. It create the view
+ * at the specified location, using the gmf command framework so the
+ * policies are used.
+ *
+ * @param nodeVISUALID
+ * the node visual identifier
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @param request
+ * the drop request
+ * @return the creation node command
+ */
+ protected ICommand getDefaultDropNodeCommand(int nodeVISUALID, Point absoluteLocation, EObject droppedObject, DropObjectsRequest request) {
+ return getDefaultDropNodeCommand(getHost(), nodeVISUALID, absoluteLocation, droppedObject);
+ }
+
+ /**
+ * This method returns the default drop command for node. It create the view
+ * at the specified location, using the gmf command framework so the
+ * policies are used.
+ *
+ * @param nodeVISUALID
+ * the node visual identifier
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @return the creation node command
+ */
+ protected ICommand getDefaultDropNodeCommand(int nodeVISUALID, Point absoluteLocation, EObject droppedObject) {
+ return getDefaultDropNodeCommand(nodeVISUALID, absoluteLocation, droppedObject, null);
+ }
+
+ /**
+ * This method returns the default drop command for node. It create the view
+ * at the specified location, using the gmf command framework so the
+ * policies are used.
+ *
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @return the creation node command
+ */
+ protected ICommand getDefaultDropNodeCommand(Point absoluteLocation, EObject droppedObject) {
+ return getDefaultDropNodeCommand(getHost(), null, absoluteLocation, droppedObject);
+ }
+
+ /**
+ * This method returns the default drop command for node. It create the view
+ * at the specified location, using the gmf command framework so the
+ * policies are used.
+ *
+ * @param hostEP
+ * The host edit part which will be the parent of the new node
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @return the creation node command
+ */
+ protected ICommand getDefaultDropNodeCommand(EditPart hostEP, Point absoluteLocation, EObject droppedObject) {
+ return getDefaultDropNodeCommand(hostEP, null, absoluteLocation, droppedObject);
+ }
+
+ /**
+ * This method returns the default drop command for node. It create the view
+ * at the specified location, using the gmf command framework so the
+ * policies are used.
+ *
+ * @param hostEP
+ * The host edit part which will be the parent of the new node
+ * @param nodeVISUALID
+ * the node visual identifier
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @param request
+ * the drop request
+ * @return the creation node command
+ */
+ protected ICommand getDefaultDropNodeCommand(EditPart hostEP, int nodeVISUALID, Point absoluteLocation, EObject droppedObject, DropObjectsRequest request) {
+ IHintedType type = ((IHintedType)getUMLElementType(nodeVISUALID));
+
+ String semanticHint = null;
+ if(type != null) {
+ semanticHint = type.getSemanticHint();
+ }
+
+ return getDefaultDropNodeCommand(getHost(), semanticHint, absoluteLocation, droppedObject, request);
+ }
+
+ /**
+ * This method returns the default drop command for node. It create the view
+ * at the specified location, using the gmf command framework so the
+ * policies are used.
+ *
+ * @param hostEP
+ * The host edit part which will be the parent of the new node
+ * @param nodeVISUALID
+ * the node visual identifier
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @return the creation node command
+ */
+ protected ICommand getDefaultDropNodeCommand(EditPart hostEP, int nodeVISUALID, Point absoluteLocation, EObject droppedObject) {
+ return getDefaultDropNodeCommand(hostEP, nodeVISUALID, absoluteLocation, droppedObject, null);
+ }
+
+ /**
+ * This method returns the default drop command for node. It create the view
+ * at the specified location, using the gmf command framework so the
+ * policies are used.
+ *
+ * @param hostEP
+ * The host edit part which will be the parent of the new node
+ * @param semanticHint
+ * the semantic hint of the view to create
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @return the creation node command
+ */
+ protected ICommand getDefaultDropNodeCommand(EditPart hostEP, String semanticHint, Point absoluteLocation, EObject droppedObject) {
+ return getDefaultDropNodeCommand(hostEP, semanticHint, absoluteLocation, droppedObject, null);
+ }
+
+ /**
+ * This method returns the default drop command for node. It create the view
+ * at the specified location, using the gmf command framework so the
+ * policies are used.
+ * If the ctrl key is pressed, do a command to add content of the new node
+ *
+ * @param hostEP
+ * The host edit part which will be the parent of the new node
+ * @param semanticHint
+ * the semantic hint of the view to create
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @param request
+ * the drop request (use to test ctrl key)
+ * @return the creation node command
+ */
+ protected ICommand getDefaultDropNodeCommand(EditPart hostEP, String semanticHint, Point absoluteLocation, EObject droppedObject, DropObjectsRequest request) {
+ List<View> existingViews = DiagramEditPartsUtil.findViews(droppedObject, getViewer());
+
+ // only allow one view instance of a single element by diagram
+ if(existingViews.isEmpty()) {
+ IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
+
+ ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, semanticHint, ViewUtil.APPEND, true, getDiagramPreferencesHint());
+ CreateViewRequest createViewRequest = new CreateViewRequest(descriptor);
+ createViewRequest.setLocation(absoluteLocation);
+
+ // "ask" the host for a command associated with the
+ // CreateViewRequest
+ Command command = hostEP.getCommand(createViewRequest);
+ if(isCopy(request) && createViewRequest.getNewObject() instanceof List) {
+ for(Object object : (List<?>)createViewRequest.getNewObject()) {
+ if(object instanceof IAdaptable) {
+ DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)object, getHost().getViewer());
+ command.chain(new ICommandProxy(createCommand2));
+ }
+ }
+ }
+ // set the viewdescriptor as result
+ // it then can be used as an adaptable to retrieve the View
+ return new CommandProxyWithResult(command, descriptor);
+ }
+
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Check if the ctrl key event is activate
+ *
+ * @param dropRequest
+ * the request which contain the event
+ * @return true if ctrl key is activate, else return false
+ */
+ public boolean isCopy(DropObjectsRequest dropRequest) {
+ if(dropRequest != null && dropRequest.getExtendedData() != null && dropRequest.getExtendedData().get(DropTargetListener.EVENT_DETAIL) instanceof Integer) {
+ int eventDetail = (Integer)dropRequest.getExtendedData().get(DropTargetListener.EVENT_DETAIL);
+ if(((eventDetail & DND.DROP_COPY) != 0)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Gets the editing domain.
+ *
+ * @return the editing domain
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ }
+
+ /**
+ * for specific case of drop, the designers has to write the algorithm of
+ * its own drop. for example case of associationClass, multi dependency
+ * etc....
+ *
+ * @param dropRequest
+ * the drop request
+ * @param nodeVISUALID
+ * the node visualid
+ * @param linkVISUALID
+ * the link visualid
+ * @param semanticLink
+ * the semantic link
+ *
+ * @return the specific drop command
+ */
+ protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticLink, int nodeVISUALID, int linkVISUALID) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Gets the viewer.
+ *
+ * @return the viewer
+ */
+ protected EditPartViewer getViewer() {
+ return ((IGraphicalEditPart)getHost()).getViewer();
+ }
+
+ /**
+ * Look for editPart from its semantic.
+ *
+ * @param semantic
+ * the semantic
+ *
+ * @return the edits the part or null if not found
+ */
+ protected EditPart lookForEditPart(EObject semantic) {
+ Collection<EditPart> editPartSet = getHost().getViewer().getEditPartRegistry().values();
+ Iterator<EditPart> editPartIterator = editPartSet.iterator();
+ EditPart existedEditPart = null;
+ while(editPartIterator.hasNext() && existedEditPart == null) {
+ EditPart currentEditPart = editPartIterator.next();
+
+ if(isEditPartTypeAdapted(currentEditPart.getClass(), semantic.eClass()) && semantic.equals(((GraphicalEditPart)currentEditPart).resolveSemanticElement())) {
+ existedEditPart = currentEditPart;
+ }
+ }
+ return existedEditPart;
+ }
+
+ /**
+ * Check if the edit part type is the best one to represent an object of the
+ * given EClass type
+ *
+ * @param editPartClass
+ * the type of EditPart which may represent a semantic element
+ * @param eClass
+ * the EClass type of the represented semantic element
+ * @return true if an edit part of this type should be selected
+ */
+ private boolean isEditPartTypeAdapted(Class<? extends EditPart> editPartClass, EClass eClass) {
+ if(DiagramEditPart.class.isAssignableFrom(editPartClass) || CompartmentEditPart.class.isAssignableFrom(editPartClass)) {
+ // the edit part is disqualified, as a compartment or a diagram can
+ // not be dropped
+ return false;
+ } else if(GraphicalEditPart.class.isAssignableFrom(editPartClass)) {
+ // check the edit part type against advised ones
+ return isEditPartTypeSuitableForEClass(editPartClass.asSubclass(GraphicalEditPart.class), eClass);
+ } else {
+ // only a GraphicalEditPart must be selected
+ return false;
+ }
+ }
+
+ /**
+ * Check if an edit part type correctly represent a semantic element of the
+ * given EClass. Subclasses should implement this method to restrict the
+ * possibilities during drop of a link. If an edit part is not of a suitable
+ * type, returning false will eliminate it to represent the element as a
+ * source or target edit part. This can be used for example to disable label
+ * edit parts, which may represent the same model element as the main node.
+ *
+ * @param editPartClass
+ * the type of EditPart which must be checked
+ * @param eClass
+ * the EClass type of the element which the edit part must
+ * represent
+ * @return the only edit part type which can be selected (return a common
+ * super type if several edit parts can be chosen)
+ */
+ protected boolean isEditPartTypeSuitableForEClass(Class<? extends GraphicalEditPart> editPartClass, EClass eClass) {
+ return true;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ConstrainedItemBorderLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ConstrainedItemBorderLayoutEditPolicy.java
index 15ee9257272..a7141d539d2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ConstrainedItemBorderLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ConstrainedItemBorderLayoutEditPolicy.java
@@ -1,131 +1,131 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-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.ConstrainedLayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * @author Patrick Tessier
- *
- * this class is used to create a resize command for border items and
- * add the {@link BorderItemResizableEditPolicy} on border Item
- */
-public class ConstrainedItemBorderLayoutEditPolicy extends ConstrainedLayoutEditPolicy {
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
-
- // code that comes form XYLayoutEditPolicy
- Rectangle newBounds = (Rectangle)constraint;
- View shapeView = (View)child.getModel();
-
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
-
- ICommand boundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(shapeView), newBounds);
- return new ICommandProxy(boundsCommand);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- if(child instanceof IBorderItemEditPart) {
- // return new BorderItemSelectionEditPolicy();
- return new BorderItemResizableEditPolicy();
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if(result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public Command getCommand(Request request) {
- if(REQ_RESIZE_CHILDREN.equals(request.getType()))
- return getResizeChildrenCommand((ChangeBoundsRequest)request);
-
- return super.getCommand(request);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Object getConstraintFor(ChangeBoundsRequest request, GraphicalEditPart child) {
- // TODO Auto-generated method stub
- return super.getConstraintFor(request, child);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Object getConstraintFor(Point point) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Object getConstraintFor(Rectangle rect) {
- return rect;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+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.ConstrainedLayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * @author Patrick Tessier
+ *
+ * this class is used to create a resize command for border items and
+ * add the {@link BorderItemResizableEditPolicy} on border Item
+ */
+public class ConstrainedItemBorderLayoutEditPolicy extends ConstrainedLayoutEditPolicy {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
+
+ // code that comes form XYLayoutEditPolicy
+ Rectangle newBounds = (Rectangle)constraint;
+ View shapeView = (View)child.getModel();
+
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+
+ ICommand boundsCommand = new SetBoundsCommand(editingDomain, DiagramUIMessages.SetLocationCommand_Label_Resize, new EObjectAdapter(shapeView), newBounds);
+ return new ICommandProxy(boundsCommand);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ if(child instanceof IBorderItemEditPart) {
+ // return new BorderItemSelectionEditPolicy();
+ return new BorderItemResizableEditPolicy();
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if(result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if(REQ_RESIZE_CHILDREN.equals(request.getType()))
+ return getResizeChildrenCommand((ChangeBoundsRequest)request);
+
+ return super.getCommand(request);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Object getConstraintFor(ChangeBoundsRequest request, GraphicalEditPart child) {
+ // TODO Auto-generated method stub
+ return super.getConstraintFor(request, child);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Object getConstraintFor(Point point) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Object getConstraintFor(Rectangle rect) {
+ return rect;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Command getCreateCommand(CreateRequest request) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomConnectionLabelsEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomConnectionLabelsEditPolicy.java
index 4763a8c8c62..fe3fb1859cd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomConnectionLabelsEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomConnectionLabelsEditPolicy.java
@@ -1,85 +1,85 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.SetPropertyCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.internal.properties.Properties;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideConnectionLabelsRequest;
-
-/**
- * This EditPolicy is used to show or hide only one Label View for a connection.
- * The EditPolicy {@link ConnectionLabelsEditPolicy} provided by GMF allows only
- * show or hide all the labels for a connection and not only some of them
- *
- *
- *
- */
-public class CustomConnectionLabelsEditPolicy extends ConnectionLabelsEditPolicy {
-
- /** key for this editpolicy */
- public static final String CUSTOM_CONNECTION_LABELS_ROLE = "CustomConnectionLabelsRole"; //$NON-NLS-1$
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#understandsRequest(org.eclipse.gef.Request)
- *
- * @param request
- * @return
- */
- @Override
- public boolean understandsRequest(Request request) {
- if(ShowHideConnectionLabelsRequest.SHOW_HIDE_LABELS_REQUEST_TYPE.equals(request.getType())) {
- return true;
- }
- return super.understandsRequest(request);
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#getCommand(org.eclipse.gef.Request)
- *
- * @param request
- * @return
- */
- @Override
- public Command getCommand(Request request) {
- if(ShowHideConnectionLabelsRequest.SHOW_HIDE_LABELS_REQUEST_TYPE.equals(request.getType())) {
- SetPropertyCommand cmd = new SetPropertyCommand(getEditingDomain(), new EObjectAdapter(((ShowHideConnectionLabelsRequest)request).getView()), Properties.ID_ISVISIBLE, DiagramUIMessages.Command_hideLabel_Label, Boolean.valueOf(((ShowHideConnectionLabelsRequest)request).showConnectionLabel()));
- return new ICommandProxy(cmd);
- } else {
- return super.getCommand(request);
- }
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- *
- * @param request
- * @return
- */
- @Override
- public EditPart getTargetEditPart(Request request) {
- // nothing to do here!
- return super.getTargetEditPart(request);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.SetPropertyCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.internal.properties.Properties;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideConnectionLabelsRequest;
+
+/**
+ * This EditPolicy is used to show or hide only one Label View for a connection.
+ * The EditPolicy {@link ConnectionLabelsEditPolicy} provided by GMF allows only
+ * show or hide all the labels for a connection and not only some of them
+ *
+ *
+ *
+ */
+public class CustomConnectionLabelsEditPolicy extends ConnectionLabelsEditPolicy {
+
+ /** key for this editpolicy */
+ public static final String CUSTOM_CONNECTION_LABELS_ROLE = "CustomConnectionLabelsRole"; //$NON-NLS-1$
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#understandsRequest(org.eclipse.gef.Request)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ public boolean understandsRequest(Request request) {
+ if(ShowHideConnectionLabelsRequest.SHOW_HIDE_LABELS_REQUEST_TYPE.equals(request.getType())) {
+ return true;
+ }
+ return super.understandsRequest(request);
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#getCommand(org.eclipse.gef.Request)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if(ShowHideConnectionLabelsRequest.SHOW_HIDE_LABELS_REQUEST_TYPE.equals(request.getType())) {
+ SetPropertyCommand cmd = new SetPropertyCommand(getEditingDomain(), new EObjectAdapter(((ShowHideConnectionLabelsRequest)request).getView()), Properties.ID_ISVISIBLE, DiagramUIMessages.Command_hideLabel_Label, Boolean.valueOf(((ShowHideConnectionLabelsRequest)request).showConnectionLabel()));
+ return new ICommandProxy(cmd);
+ } else {
+ return super.getCommand(request);
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ // nothing to do here!
+ return super.getTargetEditPart(request);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomContainerEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomContainerEditPolicy.java
index 4b3c9d8d28c..f817e6fc666 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomContainerEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/CustomContainerEditPolicy.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerNodeEditPolicy;
-
-/**
- * this class is used in order to trace link between elements even if the
- * element contains a XYlayout. the method ContainerEditPolicy is overloaded the
- * method has to return null in order to select the editpart parent. this policy
- * has to be associated to container XY layout
- */
-public class CustomContainerEditPolicy extends ContainerNodeEditPolicy {
-
- /**
- *
- * {@inheritedDoc}
- */
- public EditPart getTargetEditPart(Request request) {
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerNodeEditPolicy;
+
+/**
+ * this class is used in order to trace link between elements even if the
+ * element contains a XYlayout. the method ContainerEditPolicy is overloaded the
+ * method has to return null in order to select the editpart parent. this policy
+ * has to be associated to container XY layout
+ */
+public class CustomContainerEditPolicy extends ContainerNodeEditPolicy {
+
+ /**
+ *
+ * {@inheritedDoc}
+ */
+ public EditPart getTargetEditPart(Request request) {
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/DuplicatePasteEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/DuplicatePasteEditPolicy.java
index 9b83699b786..29b4f62a6a5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/DuplicatePasteEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/DuplicatePasteEditPolicy.java
@@ -1,213 +1,213 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GroupEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ListItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.internal.commands.DuplicateViewsCommand;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DuplicateRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.diagram.ui.requests.PasteViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
-import org.eclipse.gmf.runtime.emf.clipboard.core.ClipboardSupportUtil;
-import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.commands.PapyrusDuplicateViewsCommand;
-import org.eclipse.papyrus.uml.pastemanager.request.PasteRequest;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * this class has in charge to give a paste command, ie to copy graphically
- * element
- */
-
-@SuppressWarnings({ "rawtypes", "restriction" })
-public class DuplicatePasteEditPolicy extends ContainerEditPolicy {
-
- public final static String PASTE_ROLE = "PASTE_ROLE";
-
- /**
- * @see org.eclipse.gef.EditPolicy#getCommand(Request)
- */
- public Command getCommand(Request request) {
-
- if(PasteRequest.REQ_PAPYRUS_PASTE.equals(request.getType())) {
-
- if(request instanceof PasteRequest) {
- return getPasteCommand((PasteRequest)request);
- } else {
- return getPasteCommand((PasteViewRequest)request);
- }
- }
-
- if(RequestConstants.REQ_DUPLICATE.equals(request.getType())) {
- return getDuplicateCommand(((DuplicateRequest)request));
- }
-
- return super.getCommand(request);
- }
-
- @SuppressWarnings("unchecked")
- protected Command getPasteCommand(PasteRequest request) {
- List notationView = new ArrayList();
- if(request.getElementToPaste() != null && request.getElementToPaste().size() > 0) {
- notationView.addAll(request.getElementToPaste());
- HashSet semanticElement = new HashSet();
- return constructDuplicationCommand(notationView, semanticElement, request.getDuplicate(), ((IGraphicalEditPart)getHost()).getEditingDomain());
- }
- return null;
- }
-
- /**
- * Returns a command to to duplicate views and their underlying semantic
- * elements (if applicable) of the given editparts.
- *
- * @param request
- * the <code>DuplicateElementsRequest</code> whose list of
- * duplicated views will be populated when the command is
- * executed
- * @return the command to perform the duplication
- */
- @SuppressWarnings("unchecked")
- private Command getDuplicateCommand(DuplicateRequest request) {
- List notationViewsToDuplicate = new ArrayList();
- Set elementsToDuplicate = new HashSet();
-
- for(Iterator iter = request.getEditParts().iterator(); iter.hasNext();) {
- Object ep = iter.next();
-
- // Disable duplicate on groups for now. See bugzilla 182972.
- if(ep instanceof GroupEditPart) {
- return UnexecutableCommand.INSTANCE;
- }
-
- if(ep instanceof ConnectionEditPart || ep instanceof ShapeEditPart || ep instanceof ListItemEditPart) {
-
- View notationView = (View)((IGraphicalEditPart)ep).getModel();
- if(notationView != null) {
- notationViewsToDuplicate.add(notationView);
- }
- }
-
- }
-
- // Remove views whose container view is getting copied.
- ClipboardSupportUtil.getCopyElements(notationViewsToDuplicate);
-
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
-
- for(Iterator iter = notationViewsToDuplicate.iterator(); iter.hasNext();) {
- View view = (View)iter.next();
- EObject element = view.getElement();
-
- if(element != null) {
- EObject resolvedElement = EMFCoreUtil.resolve(editingDomain, element);
- if(resolvedElement != null) {
- elementsToDuplicate.add(resolvedElement);
- }
- }
- }
- return constructDuplicationCommand(notationViewsToDuplicate, elementsToDuplicate, request, editingDomain);
- }
-
- /**
- * code comes from superclass {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- protected Command constructDuplicationCommand(List notationViewsToDuplicate, Set elementsToDuplicate, DuplicateRequest request, TransactionalEditingDomain editingDomain) {
- /*
- * We must append all inner edges of a node being duplicated. Edges are
- * non-containment references, hence they won't be duplicated for free.
- * Therefore, we add them here to the list views to duplicate. We don't
- * add semantic elements of the edges to the list of semantic elements
- * to duplicate since we assume that their semantic elements are owned
- * by source or target or their semantic containers.
- */
- /**
- * Until duplicate views action enablement is driven by the created
- * duplicate views command, we can't look for edges to duplicate. It's a
- * performance hit.
- */
- // List<Edge> allInnerEdges = new LinkedList<Edge>();
- // for (Iterator itr = notationViewsToDuplicate.iterator();
- // itr.hasNext();) {
- // allInnerEdges.addAll(ViewUtil.getAllInnerEdges((View) itr.next()));
- // }
- // notationViewsToDuplicate.addAll(allInnerEdges);
-
- if(!notationViewsToDuplicate.isEmpty()) {
- if(!elementsToDuplicate.isEmpty()) {
- ArrayList<EObject> stereotypedSelection = new ArrayList<EObject>();
- // copy stereotype contained into
- Iterator<EObject> iter=elementsToDuplicate.iterator();
- while (iter.hasNext()) {
- EObject subeObject = (EObject) iter.next();
- if( subeObject instanceof Element){
- stereotypedSelection.addAll(((Element)subeObject).getStereotypeApplications());
- }
-
- }
- ArrayList<EObject> resultToCopy=new ArrayList(elementsToDuplicate);
- resultToCopy.addAll(stereotypedSelection);
- org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest duplicateElementsRequest = new DuplicateElementsRequest(editingDomain, new ArrayList(resultToCopy));
-
- Command duplicateElementsCommand = getHost().getCommand(new EditCommandRequestWrapper(duplicateElementsRequest, request.getExtendedData()));
- if(duplicateElementsCommand != null && duplicateElementsCommand.canExecute()) {
- CompositeCommand cc = new CompositeCommand(DiagramUIMessages.Commands_Duplicate_Label);
- cc.compose(new CommandProxy(duplicateElementsCommand));
-
- cc.compose(new DuplicateViewsCommand(editingDomain, DiagramUIMessages.Commands_Duplicate_Label, request, notationViewsToDuplicate, duplicateElementsRequest.getAllDuplicatedElementsMap(), getDuplicateViewsOffset(request)));
- return new ICommandProxy(cc);
- }
- } else {
- return new ICommandProxy(new PapyrusDuplicateViewsCommand(editingDomain, DiagramUIMessages.Commands_Duplicate_Label, request, notationViewsToDuplicate, new HashMap(), getDuplicateViewsOffset(request), (View)getHost().getModel()));
- }
- }
- return null;
- }
-
- /**
- * code comes from super class
- */
- protected Point getDuplicateViewsOffset(DuplicateRequest request) {
- if(request.getOffset() != null) {
- return request.getOffset();
- }
- int offset = MapModeUtil.getMapMode(((org.eclipse.gef.GraphicalEditPart)getHost()).getFigure()).DPtoLP(10);
- return new Point(offset, offset);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GroupEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ListItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ContainerEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.internal.commands.DuplicateViewsCommand;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DuplicateRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.diagram.ui.requests.PasteViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
+import org.eclipse.gmf.runtime.emf.clipboard.core.ClipboardSupportUtil;
+import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.commands.PapyrusDuplicateViewsCommand;
+import org.eclipse.papyrus.uml.pastemanager.request.PasteRequest;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * this class has in charge to give a paste command, ie to copy graphically
+ * element
+ */
+
+@SuppressWarnings({ "rawtypes", "restriction" })
+public class DuplicatePasteEditPolicy extends ContainerEditPolicy {
+
+ public final static String PASTE_ROLE = "PASTE_ROLE";
+
+ /**
+ * @see org.eclipse.gef.EditPolicy#getCommand(Request)
+ */
+ public Command getCommand(Request request) {
+
+ if(PasteRequest.REQ_PAPYRUS_PASTE.equals(request.getType())) {
+
+ if(request instanceof PasteRequest) {
+ return getPasteCommand((PasteRequest)request);
+ } else {
+ return getPasteCommand((PasteViewRequest)request);
+ }
+ }
+
+ if(RequestConstants.REQ_DUPLICATE.equals(request.getType())) {
+ return getDuplicateCommand(((DuplicateRequest)request));
+ }
+
+ return super.getCommand(request);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected Command getPasteCommand(PasteRequest request) {
+ List notationView = new ArrayList();
+ if(request.getElementToPaste() != null && request.getElementToPaste().size() > 0) {
+ notationView.addAll(request.getElementToPaste());
+ HashSet semanticElement = new HashSet();
+ return constructDuplicationCommand(notationView, semanticElement, request.getDuplicate(), ((IGraphicalEditPart)getHost()).getEditingDomain());
+ }
+ return null;
+ }
+
+ /**
+ * Returns a command to to duplicate views and their underlying semantic
+ * elements (if applicable) of the given editparts.
+ *
+ * @param request
+ * the <code>DuplicateElementsRequest</code> whose list of
+ * duplicated views will be populated when the command is
+ * executed
+ * @return the command to perform the duplication
+ */
+ @SuppressWarnings("unchecked")
+ private Command getDuplicateCommand(DuplicateRequest request) {
+ List notationViewsToDuplicate = new ArrayList();
+ Set elementsToDuplicate = new HashSet();
+
+ for(Iterator iter = request.getEditParts().iterator(); iter.hasNext();) {
+ Object ep = iter.next();
+
+ // Disable duplicate on groups for now. See bugzilla 182972.
+ if(ep instanceof GroupEditPart) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ if(ep instanceof ConnectionEditPart || ep instanceof ShapeEditPart || ep instanceof ListItemEditPart) {
+
+ View notationView = (View)((IGraphicalEditPart)ep).getModel();
+ if(notationView != null) {
+ notationViewsToDuplicate.add(notationView);
+ }
+ }
+
+ }
+
+ // Remove views whose container view is getting copied.
+ ClipboardSupportUtil.getCopyElements(notationViewsToDuplicate);
+
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+
+ for(Iterator iter = notationViewsToDuplicate.iterator(); iter.hasNext();) {
+ View view = (View)iter.next();
+ EObject element = view.getElement();
+
+ if(element != null) {
+ EObject resolvedElement = EMFCoreUtil.resolve(editingDomain, element);
+ if(resolvedElement != null) {
+ elementsToDuplicate.add(resolvedElement);
+ }
+ }
+ }
+ return constructDuplicationCommand(notationViewsToDuplicate, elementsToDuplicate, request, editingDomain);
+ }
+
+ /**
+ * code comes from superclass {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ protected Command constructDuplicationCommand(List notationViewsToDuplicate, Set elementsToDuplicate, DuplicateRequest request, TransactionalEditingDomain editingDomain) {
+ /*
+ * We must append all inner edges of a node being duplicated. Edges are
+ * non-containment references, hence they won't be duplicated for free.
+ * Therefore, we add them here to the list views to duplicate. We don't
+ * add semantic elements of the edges to the list of semantic elements
+ * to duplicate since we assume that their semantic elements are owned
+ * by source or target or their semantic containers.
+ */
+ /**
+ * Until duplicate views action enablement is driven by the created
+ * duplicate views command, we can't look for edges to duplicate. It's a
+ * performance hit.
+ */
+ // List<Edge> allInnerEdges = new LinkedList<Edge>();
+ // for (Iterator itr = notationViewsToDuplicate.iterator();
+ // itr.hasNext();) {
+ // allInnerEdges.addAll(ViewUtil.getAllInnerEdges((View) itr.next()));
+ // }
+ // notationViewsToDuplicate.addAll(allInnerEdges);
+
+ if(!notationViewsToDuplicate.isEmpty()) {
+ if(!elementsToDuplicate.isEmpty()) {
+ ArrayList<EObject> stereotypedSelection = new ArrayList<EObject>();
+ // copy stereotype contained into
+ Iterator<EObject> iter=elementsToDuplicate.iterator();
+ while (iter.hasNext()) {
+ EObject subeObject = (EObject) iter.next();
+ if( subeObject instanceof Element){
+ stereotypedSelection.addAll(((Element)subeObject).getStereotypeApplications());
+ }
+
+ }
+ ArrayList<EObject> resultToCopy=new ArrayList(elementsToDuplicate);
+ resultToCopy.addAll(stereotypedSelection);
+ org.eclipse.gmf.runtime.emf.type.core.requests.DuplicateElementsRequest duplicateElementsRequest = new DuplicateElementsRequest(editingDomain, new ArrayList(resultToCopy));
+
+ Command duplicateElementsCommand = getHost().getCommand(new EditCommandRequestWrapper(duplicateElementsRequest, request.getExtendedData()));
+ if(duplicateElementsCommand != null && duplicateElementsCommand.canExecute()) {
+ CompositeCommand cc = new CompositeCommand(DiagramUIMessages.Commands_Duplicate_Label);
+ cc.compose(new CommandProxy(duplicateElementsCommand));
+
+ cc.compose(new DuplicateViewsCommand(editingDomain, DiagramUIMessages.Commands_Duplicate_Label, request, notationViewsToDuplicate, duplicateElementsRequest.getAllDuplicatedElementsMap(), getDuplicateViewsOffset(request)));
+ return new ICommandProxy(cc);
+ }
+ } else {
+ return new ICommandProxy(new PapyrusDuplicateViewsCommand(editingDomain, DiagramUIMessages.Commands_Duplicate_Label, request, notationViewsToDuplicate, new HashMap(), getDuplicateViewsOffset(request), (View)getHost().getModel()));
+ }
+ }
+ return null;
+ }
+
+ /**
+ * code comes from super class
+ */
+ protected Point getDuplicateViewsOffset(DuplicateRequest request) {
+ if(request.getOffset() != null) {
+ return request.getOffset();
+ }
+ int offset = MapModeUtil.getMapMode(((org.eclipse.gef.GraphicalEditPart)getHost()).getFigure()).DPtoLP(10);
+ return new Point(offset, offset);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ExtendedDirectEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ExtendedDirectEditPolicy.java
index 4e7b325941e..b4dcadf5dec 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ExtendedDirectEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ExtendedDirectEditPolicy.java
@@ -1,362 +1,362 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.draw2d.FigureUtilities;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.transaction.RunnableWithResult;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.DirectEditRequest;
-import org.eclipse.gef.tools.CellEditorLocator;
-import org.eclipse.gef.tools.DirectEditManager;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.window.Window;
-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.papyrus.uml.diagram.common.directedit.FigureControler;
-import org.eclipse.papyrus.uml.diagram.common.directedit.ILabelControler;
-import org.eclipse.papyrus.uml.diagram.common.directedit.PropertyAccessor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.ElementImport;
-import org.eclipse.uml2.uml.NamedElement;
-
-/**
- * Extended edit policy for direct edit. this policy checks if an editor is
- * available in the editor registry for the given edited element
- */
-public class ExtendedDirectEditPolicy extends LabelDirectEditPolicy {
-
- /** direct edition mode (default, undefined, registered editor, etc.) */
- protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
-
- /** configuration from a registered edit dialog */
- private IDirectEditorConfiguration configuration;
-
- /** Manager for editing class name */
- protected DirectEditManager manager;
-
- @Override
- protected Command getDirectEditCommand(DirectEditRequest request) {
- return performDirectEdit(request);
- }
-
- /**
- * The direct edit mechanism requires the edit part to handle the direct
- * edit request.
- *
- * @param req
- * the request that called the direct edit.
- */
- public Command performDirectEdit(DirectEditRequest req) {
- if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
- directEditionMode = getDirectEditionType();
- }
- switch(directEditionMode) {
- case IDirectEdition.NO_DIRECT_EDITION:
- // no direct edition mode => does nothing
- return null;
- case IDirectEdition.EXTENDED_DIRECT_EDITOR:
- // opens a dialog using specific configuration
- configuration.preEditAction(getUMLElement());
- final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getUMLElement(), configuration.getTextToEdit(getUMLElement()), configuration);
- if(Window.OK == dialog.open()) {
- TransactionalEditingDomain domain = getEditingDomain();
- try {
- domain.runExclusive(new RunnableWithResult() {
-
- private Object result = null;
-
- private IStatus status = Status.OK_STATUS;
-
- public Object getResult() {
- return result;
- }
-
- public IStatus getStatus() {
- return status;
- }
-
- public void setStatus(IStatus status) {
- this.status = status;
- }
-
- public void run() {
- result = configuration.postEditAction(getUMLElement(), dialog.getValue());
- }
-
- });
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- return null;
- case IDirectEdition.DEFAULT_DIRECT_EDITOR:
- return super.getDirectEditCommand(req);
- default:
- return null;
- }
-
- }
-
- /**
- * Returns the view controlled by the host edit part
- *
- * @return the view controlled by the host edit part
- */
- protected View getView() {
- return (View)getHost().getModel();
- }
-
- /**
- * Returns the {@link Element} managed by this edit part.
- *
- * @return the {@link Element} managed by this edit part.
- */
- protected Element getUMLElement() {
- return (Element)getView().getElement();
- }
-
- /**
- * Returns the style of direct edition.
- * <p>
- * Note: This method should never be overridden. Override sub-methods instead.
- * </p>
- *
- * @return the style of direct edition
- */
- 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.
- */
- protected boolean checkExtendedEditor() {
- if(getUMLElement() != null) {
- return DirectEditorsUtil.hasSpecificEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, getUMLElement().eClass().getInstanceClassName());
- }
- return false;
- }
-
- /**
- * Checks if a default direct edition is available
- *
- * @return <code>true</code> if a default direct edition is available
- */
- protected boolean checkDefaultEdition() {
- return (getUMLElement() instanceof NamedElement);
- }
-
- /**
- * Initializes the extended editor configuration
- */
- protected void initExtendedEditorConfiguration() {
- if(configuration == null) {
- configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, getUMLElement().eClass().getInstanceClassName());
- }
- }
-
- /**
- * Init the label direct edit manager. This method should be called when a
- * Direct Edit request is performed.
- */
- // @unused
- protected void initLabelEditManager() {
- if(manager == null) {
- // locator for the cell editor (on the name label)
- CellEditorLocator locator = getTextCellEditorLocator();
-
- // defining how properties are modified in the model
- PropertyAccessor accessor = new PropertyAccessor() {
-
- @Override
- public String getPropertyName() {
- return "Name";
- }
-
- @Override
- public String getValue() {
- if(isElementImport()) {
- return getElementImport().getAlias();
- } else if(getUMLElement() instanceof NamedElement) {
- return ((NamedElement)getUMLElement()).getName();
- }
- return "";
-
- }
-
- @Override
- public void setValue(String value) {
- if(isElementImport()) {
- getElementImport().setAlias(value);
- } else if(getUMLElement() instanceof NamedElement) {
- ((NamedElement)getUMLElement()).setName(value);
- }
- }
- };
- // defines the controller: link between model and view
- ILabelControler labelControler = new FigureControler(getHostFigure(), accessor);
-
- // creates the editing manager.
- manager = new TextDirectEditManager((GraphicalEditPart)getHost(), TextCellEditorEx.class, locator);
- }
- }
-
- private CellEditorLocator getTextCellEditorLocator() {
- if(getHostFigure() instanceof WrappingLabel) {
- return new TextCellEditorLocator((WrappingLabel)getHostFigure());
- } else if(getHostFigure() instanceof WrappingLabel) {
- return new LabelCellEditorLocator((Label)getHostFigure());
- } else {
- Activator.log("Problem to locate the direct edit editor. Figure is neither a label nor a wrapping label");
- return null;
- }
- }
-
- /**
- * Returns <code>true</code> if the uml element is an element import
- *
- * @return <code>true</code> if the uml element is an element import
- */
- public boolean isElementImport() {
- return (getUMLElement() instanceof ElementImport);
- }
-
- /**
- * Returns the element associated to the edit part hosting this edit policy
- *
- * @return the element associated to the edit part hosting this edit policy
- * or <code>null</code> if the element is not an element import
- */
- public ElementImport getElementImport() {
- if(isElementImport()) {
- return (ElementImport)getUMLElement();
- }
- return null;
- }
-
- private class TextCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private final WrappingLabel wrapLabel;
-
- /**
- * @generated
- */
- public TextCellEditorLocator(WrappingLabel wrapLabel) {
- this.wrapLabel = wrapLabel;
- }
-
- /**
- * @generated
- */
- public WrappingLabel getWrapLabel() {
- return wrapLabel;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getWrapLabel().getTextBounds().getCopy();
- getWrapLabel().translateToAbsolute(rect);
- if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
- rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
- } else {
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- }
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
- private class LabelCellEditorLocator implements CellEditorLocator {
-
- /**
- * @generated
- */
- private final Label label;
-
- /**
- * @generated
- */
- public LabelCellEditorLocator(Label label) {
- this.label = label;
- }
-
- /**
- * @generated
- */
- public Label getLabel() {
- return label;
- }
-
- /**
- * @generated
- */
- public void relocate(CellEditor celleditor) {
- Text text = (Text)celleditor.getControl();
- Rectangle rect = getLabel().getTextBounds().getCopy();
- getLabel().translateToAbsolute(rect);
- int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
- rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
- if(!rect.equals(new Rectangle(text.getBounds()))) {
- text.setBounds(rect.x, rect.y, rect.width, rect.height);
- }
- }
- }
-
- /**
- * retrieves the host editing domain
- *
- * @return the {@link TransactionalEditingDomain} of the host edit part.
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.draw2d.FigureUtilities;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.DirectEditRequest;
+import org.eclipse.gef.tools.CellEditorLocator;
+import org.eclipse.gef.tools.DirectEditManager;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.gef.ui.internal.parts.TextCellEditorEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.window.Window;
+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.papyrus.uml.diagram.common.directedit.FigureControler;
+import org.eclipse.papyrus.uml.diagram.common.directedit.ILabelControler;
+import org.eclipse.papyrus.uml.diagram.common.directedit.PropertyAccessor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.NamedElement;
+
+/**
+ * Extended edit policy for direct edit. this policy checks if an editor is
+ * available in the editor registry for the given edited element
+ */
+public class ExtendedDirectEditPolicy extends LabelDirectEditPolicy {
+
+ /** direct edition mode (default, undefined, registered editor, etc.) */
+ protected int directEditionMode = IDirectEdition.UNDEFINED_DIRECT_EDITOR;
+
+ /** configuration from a registered edit dialog */
+ private IDirectEditorConfiguration configuration;
+
+ /** Manager for editing class name */
+ protected DirectEditManager manager;
+
+ @Override
+ protected Command getDirectEditCommand(DirectEditRequest request) {
+ return performDirectEdit(request);
+ }
+
+ /**
+ * The direct edit mechanism requires the edit part to handle the direct
+ * edit request.
+ *
+ * @param req
+ * the request that called the direct edit.
+ */
+ public Command performDirectEdit(DirectEditRequest req) {
+ if(IDirectEdition.UNDEFINED_DIRECT_EDITOR == directEditionMode) {
+ directEditionMode = getDirectEditionType();
+ }
+ switch(directEditionMode) {
+ case IDirectEdition.NO_DIRECT_EDITION:
+ // no direct edition mode => does nothing
+ return null;
+ case IDirectEdition.EXTENDED_DIRECT_EDITOR:
+ // opens a dialog using specific configuration
+ configuration.preEditAction(getUMLElement());
+ final ExtendedDirectEditionDialog dialog = new ExtendedDirectEditionDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), getUMLElement(), configuration.getTextToEdit(getUMLElement()), configuration);
+ if(Window.OK == dialog.open()) {
+ TransactionalEditingDomain domain = getEditingDomain();
+ try {
+ domain.runExclusive(new RunnableWithResult() {
+
+ private Object result = null;
+
+ private IStatus status = Status.OK_STATUS;
+
+ public Object getResult() {
+ return result;
+ }
+
+ public IStatus getStatus() {
+ return status;
+ }
+
+ public void setStatus(IStatus status) {
+ this.status = status;
+ }
+
+ public void run() {
+ result = configuration.postEditAction(getUMLElement(), dialog.getValue());
+ }
+
+ });
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ case IDirectEdition.DEFAULT_DIRECT_EDITOR:
+ return super.getDirectEditCommand(req);
+ default:
+ return null;
+ }
+
+ }
+
+ /**
+ * Returns the view controlled by the host edit part
+ *
+ * @return the view controlled by the host edit part
+ */
+ protected View getView() {
+ return (View)getHost().getModel();
+ }
+
+ /**
+ * Returns the {@link Element} managed by this edit part.
+ *
+ * @return the {@link Element} managed by this edit part.
+ */
+ protected Element getUMLElement() {
+ return (Element)getView().getElement();
+ }
+
+ /**
+ * Returns the style of direct edition.
+ * <p>
+ * Note: This method should never be overridden. Override sub-methods instead.
+ * </p>
+ *
+ * @return the style of direct edition
+ */
+ 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.
+ */
+ protected boolean checkExtendedEditor() {
+ if(getUMLElement() != null) {
+ return DirectEditorsUtil.hasSpecificEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, getUMLElement().eClass().getInstanceClassName());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if a default direct edition is available
+ *
+ * @return <code>true</code> if a default direct edition is available
+ */
+ protected boolean checkDefaultEdition() {
+ return (getUMLElement() instanceof NamedElement);
+ }
+
+ /**
+ * Initializes the extended editor configuration
+ */
+ protected void initExtendedEditorConfiguration() {
+ if(configuration == null) {
+ configuration = DirectEditorsUtil.findEditorConfiguration(IDirectEditorsIds.UML_LANGUAGE, getUMLElement().eClass().getInstanceClassName());
+ }
+ }
+
+ /**
+ * Init the label direct edit manager. This method should be called when a
+ * Direct Edit request is performed.
+ */
+ // @unused
+ protected void initLabelEditManager() {
+ if(manager == null) {
+ // locator for the cell editor (on the name label)
+ CellEditorLocator locator = getTextCellEditorLocator();
+
+ // defining how properties are modified in the model
+ PropertyAccessor accessor = new PropertyAccessor() {
+
+ @Override
+ public String getPropertyName() {
+ return "Name";
+ }
+
+ @Override
+ public String getValue() {
+ if(isElementImport()) {
+ return getElementImport().getAlias();
+ } else if(getUMLElement() instanceof NamedElement) {
+ return ((NamedElement)getUMLElement()).getName();
+ }
+ return "";
+
+ }
+
+ @Override
+ public void setValue(String value) {
+ if(isElementImport()) {
+ getElementImport().setAlias(value);
+ } else if(getUMLElement() instanceof NamedElement) {
+ ((NamedElement)getUMLElement()).setName(value);
+ }
+ }
+ };
+ // defines the controller: link between model and view
+ ILabelControler labelControler = new FigureControler(getHostFigure(), accessor);
+
+ // creates the editing manager.
+ manager = new TextDirectEditManager((GraphicalEditPart)getHost(), TextCellEditorEx.class, locator);
+ }
+ }
+
+ private CellEditorLocator getTextCellEditorLocator() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ return new TextCellEditorLocator((WrappingLabel)getHostFigure());
+ } else if(getHostFigure() instanceof WrappingLabel) {
+ return new LabelCellEditorLocator((Label)getHostFigure());
+ } else {
+ Activator.log("Problem to locate the direct edit editor. Figure is neither a label nor a wrapping label");
+ return null;
+ }
+ }
+
+ /**
+ * Returns <code>true</code> if the uml element is an element import
+ *
+ * @return <code>true</code> if the uml element is an element import
+ */
+ public boolean isElementImport() {
+ return (getUMLElement() instanceof ElementImport);
+ }
+
+ /**
+ * Returns the element associated to the edit part hosting this edit policy
+ *
+ * @return the element associated to the edit part hosting this edit policy
+ * or <code>null</code> if the element is not an element import
+ */
+ public ElementImport getElementImport() {
+ if(isElementImport()) {
+ return (ElementImport)getUMLElement();
+ }
+ return null;
+ }
+
+ private class TextCellEditorLocator implements CellEditorLocator {
+
+ /**
+ * @generated
+ */
+ private final WrappingLabel wrapLabel;
+
+ /**
+ * @generated
+ */
+ public TextCellEditorLocator(WrappingLabel wrapLabel) {
+ this.wrapLabel = wrapLabel;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappingLabel getWrapLabel() {
+ return wrapLabel;
+ }
+
+ /**
+ * @generated
+ */
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Rectangle rect = getWrapLabel().getTextBounds().getCopy();
+ getWrapLabel().translateToAbsolute(rect);
+ if(getWrapLabel().isTextWrapOn() && getWrapLabel().getText().length() > 0) {
+ rect.setSize(new Dimension(text.computeSize(rect.width, SWT.DEFAULT)));
+ } else {
+ int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
+ rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
+ }
+ if(!rect.equals(new Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+ }
+
+ private class LabelCellEditorLocator implements CellEditorLocator {
+
+ /**
+ * @generated
+ */
+ private final Label label;
+
+ /**
+ * @generated
+ */
+ public LabelCellEditorLocator(Label label) {
+ this.label = label;
+ }
+
+ /**
+ * @generated
+ */
+ public Label getLabel() {
+ return label;
+ }
+
+ /**
+ * @generated
+ */
+ public void relocate(CellEditor celleditor) {
+ Text text = (Text)celleditor.getControl();
+ Rectangle rect = getLabel().getTextBounds().getCopy();
+ getLabel().translateToAbsolute(rect);
+ int avr = FigureUtilities.getFontMetrics(text.getFont()).getAverageCharWidth();
+ rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT, SWT.DEFAULT)).expand(avr * 2, 0));
+ if(!rect.equals(new Rectangle(text.getBounds()))) {
+ text.setBounds(rect.x, rect.y, rect.width, rect.height);
+ }
+ }
+ }
+
+ /**
+ * retrieves the host editing domain
+ *
+ * @return the {@link TransactionalEditingDomain} of the host edit part.
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IDirectEdition.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IDirectEdition.java
index 41b35909bb4..8720d536eeb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IDirectEdition.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IDirectEdition.java
@@ -1,35 +1,35 @@
-/*******************************************************************************
- * Copyright (c) 2008 CEA LIST.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-/**
- * Interface that defines constants for direct edition in Papyrus.
- */
-public interface IDirectEdition {
-
- /**
- * constant for undefined role. no editors have been checked for this
- * element
- */
- final int UNDEFINED_DIRECT_EDITOR = 0;
-
- /** default direct editor (in diagram edition) */
- final int DEFAULT_DIRECT_EDITOR = 1 << 1;
-
- /** extended editor, i.e opens a new dialog window */
- final int EXTENDED_DIRECT_EDITOR = 1 << 2;
-
- /**
- * no editor for this element. this element does not respond to a direct
- * edit request
- */
- final int NO_DIRECT_EDITION = 1 << 3;
-}
+/*******************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+/**
+ * Interface that defines constants for direct edition in Papyrus.
+ */
+public interface IDirectEdition {
+
+ /**
+ * constant for undefined role. no editors have been checked for this
+ * element
+ */
+ final int UNDEFINED_DIRECT_EDITOR = 0;
+
+ /** default direct editor (in diagram edition) */
+ final int DEFAULT_DIRECT_EDITOR = 1 << 1;
+
+ /** extended editor, i.e opens a new dialog window */
+ final int EXTENDED_DIRECT_EDITOR = 1 << 2;
+
+ /**
+ * no editor for this element. this element does not respond to a direct
+ * edit request
+ */
+ final int NO_DIRECT_EDITION = 1 << 3;
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IStructuralFeatureListener.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IStructuralFeatureListener.java
index 14f3355fbdc..c076f6d0276 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IStructuralFeatureListener.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/IStructuralFeatureListener.java
@@ -1,40 +1,40 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- * Arthur Daussy (Atos) arthur.daussy@atos.net - Bug 249786: [General] drag'n'drop does not work for elements stored in nested classifier compartment
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationPreCommitListener;
-
-import com.google.common.collect.ImmutableSet;
-/**
- * This interface is used in order to listen some structural feature with a specific event.
- * @author arthur daussy
- *
- */
-public interface IStructuralFeatureListener extends NotificationPreCommitListener {
- /**
- * Set of all structural feature to listen
- * @return
- */
- ImmutableSet<EStructuralFeature> getEStructuralFeaturesToListen();
- /**
- * Event type to listen
- * @param type
- * @return
- */
- boolean handleNotificationType(int type);
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ * Arthur Daussy (Atos) arthur.daussy@atos.net - Bug 249786: [General] drag'n'drop does not work for elements stored in nested classifier compartment
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationPreCommitListener;
+
+import com.google.common.collect.ImmutableSet;
+/**
+ * This interface is used in order to listen some structural feature with a specific event.
+ * @author arthur daussy
+ *
+ */
+public interface IStructuralFeatureListener extends NotificationPreCommitListener {
+ /**
+ * Set of all structural feature to listen
+ * @return
+ */
+ ImmutableSet<EStructuralFeature> getEStructuralFeaturesToListen();
+ /**
+ * Event type to listen
+ * @param type
+ * @return
+ */
+ boolean handleNotificationType(int type);
+
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ListenerEventEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ListenerEventEditPolicy.java
index 5a63fc8bbbe..07f1486be2e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ListenerEventEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ListenerEventEditPolicy.java
@@ -1,237 +1,237 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- * Arthur Daussy (Atos) arthur.daussy@atos.net - Bug 249786: [General] drag'n'drop does not work for elements stored in nested classifier compartment
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-
-import com.google.common.collect.ImmutableSet;
-
-public abstract class ListenerEventEditPolicy extends AbstractEditPolicy implements IStructuralFeatureListener {
-
- /** Adds <code>String.class</tt> adaptablity to return a factory hint. Copied from {@link CanonicalEditPolicy} */
- protected static final class ElementListenerAdapter extends EObjectAdapter {
-
- private String _hint;
-
- /**
- * constructor
- *
- * @param element
- * @param hint
- */
- public ElementListenerAdapter(EObject element, String hint) {
- super(element);
- _hint = hint;
- }
-
- /** Adds <code>String.class</tt> adaptablity. */
- public Object getAdapter(Class adapter) {
- if(adapter.equals(String.class)) {
- return _hint;
- }
- return super.getAdapter(adapter);
- }
- }
-
- public ListenerEventEditPolicy() {
- super();
- }
-
- /**
- * This method tries to locate the position that the view will be
- * inserted into it's parent. The position is determined by the position
- * of the semantic element. If the semantic element is not found the view
- * will be appended to it's parent.
- *
- * @param semanticChild
- * @return position where the view should be inserted
- */
- protected int getViewIndexFor(EObject semanticChild) {
- // The default implementation returns APPEND
- return ViewUtil.APPEND;
- }
-
- /**
- * Returns the default factory hint.
- *
- * @return <code>host().getView().getSemanticType()</code>
- */
- protected String getDefaultFactoryHint() {
- return ((View)host().getModel()).getType();
- }
-
-
- /**
- * Return a view descriptor.
- *
- * @param elementAdapter
- * semantic element
- * @param viewKind
- * type of view to create
- * @param hint
- * factory hint
- * @param index
- * index
- * @return a create <i>non-persisted</i> view descriptor
- */
- protected CreateViewRequest.ViewDescriptor getViewDescriptor(IAdaptable elementAdapter, Class viewKind, String hint, int index) {
- return new CreateViewRequest.ViewDescriptor(elementAdapter, viewKind, hint, index, false, host().getDiagramPreferencesHint());
- }
-
-
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- private DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- throw new IllegalStateException("EditPolicy unable to retrive the DiagramEventBroker");////$NON-NLS-0$
- }
-
- /**
- * Return the {@link IGraphicalEditPart} host (never null)
- *
- * @return
- */
- protected IGraphicalEditPart host() {
- EditPart host = getHost();
- if(host instanceof IGraphicalEditPart) {
- return ((IGraphicalEditPart)host);
- }
- throw new IllegalStateException("The host of this EditPolicy is not an instance of IGraphicalEditPart");////$NON-NLS-0$
- }
-
- /**
- *
- * @return {@link EObject} of the host of this edit Policy or null if error
- */
- protected EObject getSemanticHost() {
- IGraphicalEditPart host = host();
- if(host != null) {
- return host.resolveSemanticElement();
- }
- return null;
- }
-
- /**
- * Add the listeners corresponding to to the structural feature
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#activate()
- */
- @Override
- public void activate() {
- for(EStructuralFeature feature : getEStructuralFeaturesToListen()) {
- getDiagramEventBroker().addNotificationListener(getSemanticHost(), feature, this);
- }
- super.activate();
- }
-
- /**
- * Add the listeners corresponding to to the structural feature
- *
- * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#activate()
- */
- @Override
- public void deactivate() {
- for(EStructuralFeature feature : getEStructuralFeaturesToListen()) {
- getDiagramEventBroker().removeNotificationListener(getSemanticHost(), feature, this);
- }
- super.deactivate();
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationPreCommitListener#transactionAboutToCommit(org.eclipse.emf.common.notify.Notification)
- *
- * @param notification
- * @return
- */
- public org.eclipse.emf.common.command.Command transactionAboutToCommit(Notification notification) {
- ICommand result = null;
- if(getEStructuralFeaturesToListen().contains(notification.getFeature()) && handleNotificationType(notification.getEventType())) {
- Object newObject = notification.getNewValue();
- Object oldObject = notification.getOldValue();
- Object feature = notification.getFeature();
- int eventType = notification.getEventType();
- Object notifier = notification.getNotifier();
- if(isInstaceofOrNull(newObject,EObject.class) && isInstaceofOrNull(oldObject,EObject.class)&& feature instanceof EStructuralFeature && isInstaceofOrNull(notifier,EObject.class)) {
- result = getCommand((EObject)newObject, (EObject)oldObject, (EStructuralFeature)feature, eventType, (EObject)notifier);
- } else {
- result = getSpecialCommandCommand(notification);
- }
- }
- return (result != null) ? new GMFtoEMFCommandWrapper(result) : null;
- }
- /**
- * Similar to instance but return true if the objet is null
- * @param o
- * @param clazz
- * @return
- */
- private boolean isInstaceofOrNull(Object o, Class clazz){
- return o == null || clazz.isInstance(o);
- }
-
- /**
- * This method could be override by extended class to handle specific notification
- *
- * @param notification
- * @return
- */
- protected ICommand getSpecialCommandCommand(Notification notification) {
- return null;
- }
-
- protected abstract ICommand getCommand(EObject newObject, EObject oldObject, EStructuralFeature feature, int eventType, EObject notifier);
-
- /**
- * {@inheritDoc IStructuralFeatureListener}
- *
- * @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IStructuralFeatureListener#handleNotificationType(int)
- *
- * @param type
- * @return
- */
- public abstract boolean handleNotificationType(int type);
-
- /**
- * {@inheritDoc IStructuralFeatureListener}
- *
- * @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IStructuralFeatureListener#getEStructuralFeaturesToListen()
- *
- * @param type
- * @return
- */
- public abstract ImmutableSet<EStructuralFeature> getEStructuralFeaturesToListen();
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ * Arthur Daussy (Atos) arthur.daussy@atos.net - Bug 249786: [General] drag'n'drop does not work for elements stored in nested classifier compartment
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.editpolicies.AbstractEditPolicy;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+
+import com.google.common.collect.ImmutableSet;
+
+public abstract class ListenerEventEditPolicy extends AbstractEditPolicy implements IStructuralFeatureListener {
+
+ /** Adds <code>String.class</tt> adaptablity to return a factory hint. Copied from {@link CanonicalEditPolicy} */
+ protected static final class ElementListenerAdapter extends EObjectAdapter {
+
+ private String _hint;
+
+ /**
+ * constructor
+ *
+ * @param element
+ * @param hint
+ */
+ public ElementListenerAdapter(EObject element, String hint) {
+ super(element);
+ _hint = hint;
+ }
+
+ /** Adds <code>String.class</tt> adaptablity. */
+ public Object getAdapter(Class adapter) {
+ if(adapter.equals(String.class)) {
+ return _hint;
+ }
+ return super.getAdapter(adapter);
+ }
+ }
+
+ public ListenerEventEditPolicy() {
+ super();
+ }
+
+ /**
+ * This method tries to locate the position that the view will be
+ * inserted into it's parent. The position is determined by the position
+ * of the semantic element. If the semantic element is not found the view
+ * will be appended to it's parent.
+ *
+ * @param semanticChild
+ * @return position where the view should be inserted
+ */
+ protected int getViewIndexFor(EObject semanticChild) {
+ // The default implementation returns APPEND
+ return ViewUtil.APPEND;
+ }
+
+ /**
+ * Returns the default factory hint.
+ *
+ * @return <code>host().getView().getSemanticType()</code>
+ */
+ protected String getDefaultFactoryHint() {
+ return ((View)host().getModel()).getType();
+ }
+
+
+ /**
+ * Return a view descriptor.
+ *
+ * @param elementAdapter
+ * semantic element
+ * @param viewKind
+ * type of view to create
+ * @param hint
+ * factory hint
+ * @param index
+ * index
+ * @return a create <i>non-persisted</i> view descriptor
+ */
+ protected CreateViewRequest.ViewDescriptor getViewDescriptor(IAdaptable elementAdapter, Class viewKind, String hint, int index) {
+ return new CreateViewRequest.ViewDescriptor(elementAdapter, viewKind, hint, index, false, host().getDiagramPreferencesHint());
+ }
+
+
+
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ private DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ throw new IllegalStateException("EditPolicy unable to retrive the DiagramEventBroker");////$NON-NLS-0$
+ }
+
+ /**
+ * Return the {@link IGraphicalEditPart} host (never null)
+ *
+ * @return
+ */
+ protected IGraphicalEditPart host() {
+ EditPart host = getHost();
+ if(host instanceof IGraphicalEditPart) {
+ return ((IGraphicalEditPart)host);
+ }
+ throw new IllegalStateException("The host of this EditPolicy is not an instance of IGraphicalEditPart");////$NON-NLS-0$
+ }
+
+ /**
+ *
+ * @return {@link EObject} of the host of this edit Policy or null if error
+ */
+ protected EObject getSemanticHost() {
+ IGraphicalEditPart host = host();
+ if(host != null) {
+ return host.resolveSemanticElement();
+ }
+ return null;
+ }
+
+ /**
+ * Add the listeners corresponding to to the structural feature
+ *
+ * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#activate()
+ */
+ @Override
+ public void activate() {
+ for(EStructuralFeature feature : getEStructuralFeaturesToListen()) {
+ getDiagramEventBroker().addNotificationListener(getSemanticHost(), feature, this);
+ }
+ super.activate();
+ }
+
+ /**
+ * Add the listeners corresponding to to the structural feature
+ *
+ * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#activate()
+ */
+ @Override
+ public void deactivate() {
+ for(EStructuralFeature feature : getEStructuralFeaturesToListen()) {
+ getDiagramEventBroker().removeNotificationListener(getSemanticHost(), feature, this);
+ }
+ super.deactivate();
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationPreCommitListener#transactionAboutToCommit(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param notification
+ * @return
+ */
+ public org.eclipse.emf.common.command.Command transactionAboutToCommit(Notification notification) {
+ ICommand result = null;
+ if(getEStructuralFeaturesToListen().contains(notification.getFeature()) && handleNotificationType(notification.getEventType())) {
+ Object newObject = notification.getNewValue();
+ Object oldObject = notification.getOldValue();
+ Object feature = notification.getFeature();
+ int eventType = notification.getEventType();
+ Object notifier = notification.getNotifier();
+ if(isInstaceofOrNull(newObject,EObject.class) && isInstaceofOrNull(oldObject,EObject.class)&& feature instanceof EStructuralFeature && isInstaceofOrNull(notifier,EObject.class)) {
+ result = getCommand((EObject)newObject, (EObject)oldObject, (EStructuralFeature)feature, eventType, (EObject)notifier);
+ } else {
+ result = getSpecialCommandCommand(notification);
+ }
+ }
+ return (result != null) ? new GMFtoEMFCommandWrapper(result) : null;
+ }
+ /**
+ * Similar to instance but return true if the objet is null
+ * @param o
+ * @param clazz
+ * @return
+ */
+ private boolean isInstaceofOrNull(Object o, Class clazz){
+ return o == null || clazz.isInstance(o);
+ }
+
+ /**
+ * This method could be override by extended class to handle specific notification
+ *
+ * @param notification
+ * @return
+ */
+ protected ICommand getSpecialCommandCommand(Notification notification) {
+ return null;
+ }
+
+ protected abstract ICommand getCommand(EObject newObject, EObject oldObject, EStructuralFeature feature, int eventType, EObject notifier);
+
+ /**
+ * {@inheritDoc IStructuralFeatureListener}
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IStructuralFeatureListener#handleNotificationType(int)
+ *
+ * @param type
+ * @return
+ */
+ public abstract boolean handleNotificationType(int type);
+
+ /**
+ * {@inheritDoc IStructuralFeatureListener}
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.editpolicies.IStructuralFeatureListener#getEStructuralFeaturesToListen()
+ *
+ * @param type
+ * @return
+ */
+ public abstract ImmutableSet<EStructuralFeature> getEStructuralFeaturesToListen();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OldCommonDiagramDragDropEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OldCommonDiagramDragDropEditPolicy.java
index 06a1b37a921..b704dae02ba 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OldCommonDiagramDragDropEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OldCommonDiagramDragDropEditPolicy.java
@@ -1,679 +1,679 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - add the line ViewServiceUtil.forceLoad();
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.commands.operations.IUndoableOperation;
-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.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-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.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.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.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.DeferredCreateCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
-import org.eclipse.papyrus.uml.diagram.common.helper.ILinkMappingHelper;
-import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener;
-import org.eclipse.papyrus.uml.diagram.common.util.ViewServiceUtil;
-import org.eclipse.swt.dnd.DND;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @deprecated This class is used to execute the drag and drop from the outline.
- * It can manage the drop of nodes and binary links.
- */
-public abstract class OldCommonDiagramDragDropEditPolicy extends DiagramDragDropEditPolicy {
-
- /** The specific drop. */
- private Set<Integer> specificDrop = null;
-
- /** The specified link mapping helper depending on the diagram */
- protected ILinkMappingHelper linkmappingHelper;
-
- /**
- * Instantiates a new custom diagram drag drop edit policy.
- *
- * @param mappingHelper
- * the mapping helper
- */
- public OldCommonDiagramDragDropEditPolicy(ILinkMappingHelper mappingHelper) {
- linkmappingHelper = mappingHelper;
- }
-
- /**
- * Gets elements visual id that can be dropped in the diagram
- */
- private Set<Integer> getSpecificDrop() {
- if(specificDrop == null) {
- specificDrop = getDroppableElementVisualId();
- }
- return specificDrop;
- }
-
- /**
- * Gets the UML element type for the specified
- *
- * @param elementID
- * the element id
- *
- * @return the uML element type
- */
- public abstract IElementType getUMLElementType(int elementID);
-
- public abstract int getNodeVisualID(View containerView, EObject domainElement);
-
- public abstract int getLinkWithClassVisualID(EObject domainElement);
-
- /**
- * The list of visualID that the policy manages.
- */
- protected abstract Set<Integer> getDroppableElementVisualId();
-
- /**
- * {@inheritedDoc}
- */
- @Override
- protected Command createViewsAndArrangeCommand(DropObjectsRequest dropRequest, List viewDescriptors) {
- CreateViewRequest createViewRequest = new CreateViewRequest(viewDescriptors);
- createViewRequest.setLocation(dropRequest.getLocation());
- Command createCommand = getHost().getCommand(createViewRequest);
- return createCommand;
- }
-
- /**
- * 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 dropBinaryLink(CompositeCommand cc, Element source, Element target, int linkVISUALID, Point location, Element semanticLink) {
- // look for editpart
- GraphicalEditPart sourceEditPart = (GraphicalEditPart)lookForEditPart(source);
- GraphicalEditPart targetEditPart = (GraphicalEditPart)lookForEditPart(target);
-
- // 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), Node.class, null, ViewUtil.APPEND, true, ((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)); //$NON-NLS-1$
- cc.compose(setBoundsCommand);
-
- sourceAdapter = (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue();
- } else {
- sourceAdapter = new SemanticAdapter(null, sourceEditPart.getModel());
- }
- if(targetEditPart == null) {
- // creation of the node
- ViewDescriptor descriptor = new ViewDescriptor(new EObjectAdapter(target), Node.class, null, ViewUtil.APPEND, true, ((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)); //$NON-NLS-1$
- 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;
-
- }
-
- /**
- * Gets the diagram preferences hint.
- *
- * @return the diagram preferences hint
- */
- protected PreferencesHint getDiagramPreferencesHint() {
- return ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint();
- }
-
- /**
- * {@inheritedDoc}.
- */
- @Override
- public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
- /*
- * when it's the first action after the opening of Papyrus, the
- * viewService is not loaded! see bug 302555
- *
- * Duration test for 100000 creations of DropCommand : Here 2 solutions
- * : - call ViewServiceUtil.forceLoad(); for each drop -> ~2500ms
- *
- * - test if the command cc can be executed at the end of the method,
- * and if not : - call ViewServiceUtil.forceLoad(); - and return
- * getDropObjectsCommand(getDropObjectsCommand) -> ~4700ms
- *
- * - for information : without call ViewServiceUtil.forceLoad(); ->
- * ~1600ms
- *
- * It's better don't test if the command is executable!
- */
- ViewServiceUtil.forceLoad();
-
- if(dropRequest.getObjects().size() > 0 && dropRequest.getObjects().get(0) instanceof String) {
- return getDropFileCommand(dropRequest);
- }
-
- // Create a view request from the drop request and then forward getting
- // the command for that.
- CompositeCommand cc = new CompositeCommand("Drop"); //$NON-NLS-1$
- Iterator<?> iter = dropRequest.getObjects().iterator();
- Point location = getTranslatedLocation(dropRequest);
-
- while(iter.hasNext()) {
- EObject droppedObject = (EObject)iter.next();
- cc.add(getDropObjectCommand(dropRequest, droppedObject, location));
- }
-
- return new ICommandProxy(cc);
- }
-
- /**
- * Check if the ctrl key event is activate
- *
- * @param dropRequest
- * the request which contain the event
- * @return true if ctrl key is activate, else return false
- */
- public boolean isCopy(DropObjectsRequest dropRequest) {
- if(dropRequest != null && dropRequest.getExtendedData() != null && dropRequest.getExtendedData().get(DropTargetListener.EVENT_DETAIL) instanceof Integer) {
- int eventDetail = (Integer)dropRequest.getExtendedData().get(DropTargetListener.EVENT_DETAIL);
- if(((eventDetail & DND.DROP_COPY) != 0)) {
- return true;
- }
- }
- return false;
- }
-
- protected IUndoableOperation getDropObjectCommand(DropObjectsRequest dropRequest, EObject droppedObject, Point location) {
- int nodeVISUALID = getNodeVisualID(((IGraphicalEditPart)getHost()).getNotationView(), droppedObject);
- int linkVISUALID = getLinkWithClassVisualID(droppedObject);
- if(getSpecificDrop().contains(nodeVISUALID) || getSpecificDrop().contains(linkVISUALID)) {
- dropRequest.setLocation(location);
- Command specificDropCommand = getSpecificDropCommand(dropRequest, (Element)droppedObject, nodeVISUALID, linkVISUALID);
- CompositeCommand cc = new CompositeCommand("Drop command");
- cc.compose(new CommandProxy(specificDropCommand));
- // If ctrl key activate, get the content of element dropped
- if(isCopy(dropRequest)) {
- // Check for ICommandProxy and CompoundCommand the most command type used
- if(specificDropCommand instanceof ICommandProxy) {
- ICommandProxy specificDropCommandProxy = (ICommandProxy)specificDropCommand;
- createDeferredCommandWithCommandResult(droppedObject, cc, specificDropCommandProxy);
- } else if(specificDropCommand instanceof CompoundCommand) {
- CompoundCommand specificDropCompoundCommand = (CompoundCommand)specificDropCommand;
- ICommandProxy cp = getCommandProxyFromCompoundCommand(specificDropCompoundCommand);
- if(cp != null) {
- createDeferredCommandWithCommandResult(droppedObject, cc, cp);
- }
- }
- }
- return cc;
- }
-
- if(linkVISUALID == -1 && nodeVISUALID != -1) {
- // The element to drop is a node
- // Retrieve it's expected graphical parent
- EObject graphicalParent = ((GraphicalEditPart)getHost()).resolveSemanticElement();
-
- // Restrict the default node creation to the following cases:
- // . Take the containment relationship into consideration
- // . Release the constraint when GraphicalParent is a diagram
- if(getHost().getModel() instanceof Diagram) {
- return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, dropRequest);
-
- } else if((graphicalParent instanceof Element) && ((Element)graphicalParent).getOwnedElements().contains(droppedObject)) {
- return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, dropRequest);
-
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
-
- }
- if(linkVISUALID != -1) {
- Collection<?> sources = linkmappingHelper.getSource((Element)droppedObject);
- Collection<?> targets = linkmappingHelper.getTarget((Element)droppedObject);
- if(sources.size() == 0 || targets.size() == 0) {
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
- // binary association
- Element source = (Element)sources.toArray()[0];
- Element target = (Element)targets.toArray()[0];
- CompositeCommand cc = new CompositeCommand("Add Link"); //$NON-NLS-1$
- dropBinaryLink(cc, source, target, linkVISUALID, dropRequest.getLocation(), (Element)droppedObject);
- return cc;
- }
- return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Get a command proxy from the compound command
- *
- * @param cc
- * the compound command
- * @return the command proxy found or null
- */
- protected ICommandProxy getCommandProxyFromCompoundCommand(CompoundCommand cc) {
- if(cc != null && cc.getCommands() != null) {
- for(Object command : cc.getCommands()) {
- if(command instanceof ICommandProxy) {
- return (ICommandProxy)command;
- } else if(command instanceof CompoundCommand) {
- getCommandProxyFromCompoundCommand((CompoundCommand)command);
- }
- }
- }
- return null;
- }
-
- /**
- * Create deferred command for a command proxy
- *
- * @param droppedObject
- * the dropped object
- * @param cc
- * the composite command to add the deferred command
- * @param specificDropCommandProxy
- * the specific drop command to get the result
- */
- protected void createDeferredCommandWithCommandResult(EObject droppedObject, CompositeCommand cc, ICommandProxy specificDropCommandProxy) {
- if(specificDropCommandProxy != null && specificDropCommandProxy.getICommand() != null && specificDropCommandProxy.getICommand().getCommandResult() != null && specificDropCommandProxy.getICommand().getCommandResult().getReturnValue() != null) {
- Object object = specificDropCommandProxy.getICommand().getCommandResult().getReturnValue();
- if(object instanceof Collection<?>) {
- for(Object o : (Collection<?>)object) {
- if(o instanceof CreateViewRequest.ViewDescriptor) {
- CreateViewRequest.ViewDescriptor viewDescritor = (CreateViewRequest.ViewDescriptor)o;
- DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)viewDescritor, getHost().getViewer());
- cc.compose(createCommand2);
- }
- }
- }
- }
- }
-
- protected Point getTranslatedLocation(DropObjectsRequest dropRequest) {
- Point location = dropRequest.getLocation().getCopy();
- ((GraphicalEditPart)getHost()).getContentPane().translateToRelative(location);
- ((GraphicalEditPart)getHost()).getContentPane().translateFromParent(location);
- location.translate(((GraphicalEditPart)getHost()).getContentPane().getClientArea().getLocation().getNegated());
- return location;
- }
-
- /**
- * This method returns the default drop command for node. Default here means
- * the no consideration is made regarding the semantic elements, the
- * expected figure is basically created where expected.
- *
- * @param nodeVISUALID
- * the node visual identifier
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return a CompositeCommand for Drop
- */
- protected CompositeCommand getDefaultDropNodeCommand(int nodeVISUALID, Point location, EObject droppedObject) {
- return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, null);
- }
-
- /**
- * This method returns the default drop command for node. Default here means
- * the no consideration is made regarding the semantic elements, the
- * expected figure is basically created where expected.
- *
- * @param nodeVISUALID
- * the node visual identifier
- * @param location
- * the drop location
- * @param droppedObject
- * the object to drop
- * @return a CompositeCommand for Drop
- */
- protected CompositeCommand getDefaultDropNodeCommand(int nodeVISUALID, Point location, EObject droppedObject, DropObjectsRequest request) {
- CompositeCommand cc = new CompositeCommand("Drop"); //$NON-NLS-1$
- IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
-
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType)getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, true, getDiagramPreferencesHint());
- CreateCommand createCommand = new CreateCommand(getEditingDomain(), descriptor, ((View)(getHost().getModel())));
- cc.compose(createCommand);
-
- SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)createCommand.getCommandResult().getReturnValue(), location); //$NON-NLS-1$
- cc.compose(setBoundsCommand);
- // If specific drop, the deferred command is already done in the getDropObjectCommand method
- // Only if CTRL key is active
- if(!getSpecificDrop().contains(nodeVISUALID) && isCopy(request)) {
- DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)createCommand.getCommandResult().getReturnValue(), getHost().getViewer());
- cc.compose(createCommand2);
- }
- return cc;
- }
-
- /**
- * Gets the editing domain.
- *
- * @return the editing domain
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-
- /**
- * for specific case of drop, the designers has to write the algorithm of
- * its own drop. for example case of associationClass, multi dependency
- * etc....
- *
- * @param dropRequest
- * the drop request
- * @param nodeVISUALID
- * the node visualid
- * @param linkVISUALID
- * the link visualid
- * @param semanticLink
- * the semantic link
- *
- * @return the specific drop command
- */
- protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticLink, int nodeVISUALID, int linkVISUALID) {
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Gets the viewer.
- *
- * @return the viewer
- */
- protected EditPartViewer getViewer() {
- return ((IGraphicalEditPart)getHost()).getViewer();
- }
-
- /**
- * Look for editPart from its semantic.
- *
- * @param semantic
- * the semantic
- *
- * @return the edits the part or null if not found
- */
- protected EditPart lookForEditPart(EObject semantic) {
- Collection<EditPart> editPartSet = getHost().getViewer().getEditPartRegistry().values();
- Iterator<EditPart> editPartIterator = editPartSet.iterator();
- EditPart existedEditPart = null;
- while(editPartIterator.hasNext() && existedEditPart == null) {
- EditPart currentEditPart = editPartIterator.next();
-
- if(isEditPartTypeAdapted(currentEditPart.getClass(), semantic.eClass()) && semantic.equals(((GraphicalEditPart)currentEditPart).resolveSemanticElement())) {
- existedEditPart = currentEditPart;
- }
- }
- return existedEditPart;
- }
-
- /**
- * Check if the edit part type is the best one to represent an object of the
- * given EClass type
- *
- * @param editPartClass
- * the type of EditPart which may represent a semantic element
- * @param eClass
- * the EClass type of the represented semantic element
- * @return true if an edit part of this type should be selected
- */
- private boolean isEditPartTypeAdapted(Class<? extends EditPart> editPartClass, EClass eClass) {
- if(DiagramEditPart.class.isAssignableFrom(editPartClass) || CompartmentEditPart.class.isAssignableFrom(editPartClass)) {
- // the edit part is disqualified, as a compartment or a diagram can
- // not be dropped
- return false;
- } else if(GraphicalEditPart.class.isAssignableFrom(editPartClass)) {
- // check the edit part type against advised ones
- return isEditPartTypeSuitableForEClass(editPartClass.asSubclass(GraphicalEditPart.class), eClass);
- } else {
- // only a GraphicalEditPart must be selected
- return false;
- }
- }
-
- /**
- * Check if an edit part type correctly represent a semantic element of the
- * given EClass. Subclasses should implement this method to restrict the
- * possibilities during drop of a link. If an edit part is not of a suitable
- * type, returning false will eliminate it to represent the element as a
- * source or target edit part. This can be used for example to disable label
- * edit parts, which may represent the same model element as the main node.
- *
- * @param editPartClass
- * the type of EditPart which must be checked
- * @param eClass
- * the EClass type of the element which the edit part must
- * represent
- * @return the only edit part type which can be selected (return a common
- * super type if several edit parts can be chosen)
- */
- protected boolean isEditPartTypeSuitableForEClass(Class<? extends GraphicalEditPart> editPartClass, EClass eClass) {
- return true;
- }
-
- /**
- * Returns The command to drop the {@link Constraint} and the links, if the
- * constraints elements are on the diagram
- *
- * @param comment
- * the comment to drop
- * @param viewer
- * the viewer
- * @param diagramPreferencesHint
- * the diagram preference hint
- * @param location
- * the location for the drop
- * @param containerView
- * the container view for the drop
- * @param commentType
- * the IHintedType for the {@link Comment}
- * @param linkForComment
- * the IHintedType for the link which attach the {@link Comment} to the annotated Element
- * @return The command to drop the {@link Constraint} and the links, if the
- * constraints elements are on the diagram
- */
- protected Command getDropConstraintCommand(Constraint constraint, EditPartViewer viewer, PreferencesHint diagramPreferencesHint, Point location, View containerView, IHintedType commentType, IHintedType linkForComment) {
- /* for further information, see bug 302555 */
- CompositeCommand cc = new CompositeCommand("dropConstraint");
- int nbAnnotated = constraint.getConstrainedElements().size();
-
- // 0. Obtain list of the annotatedElement
- ArrayList<Element> endToConnect = new ArrayList<Element>(constraint.getConstrainedElements());
- GraphicalEditPart[] endEditPart = new GraphicalEditPart[nbAnnotated];
-
- // 1. Look for if each annotated element is on the diagram
- Iterator<Element> iteratorProp = endToConnect.iterator();
- int index = 0;
- while(iteratorProp.hasNext()) {
- Element currentAnnotatedElement = iteratorProp.next();
- endEditPart[index] = (GraphicalEditPart)lookForEditPart(currentAnnotatedElement);
- index += 1;
- }
-
- // 2. creation of the node Comment
- IAdaptable elementAdapter = new EObjectAdapter(constraint);
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, commentType.getSemanticHint(), ViewUtil.APPEND, true, diagramPreferencesHint);
- CreateCommand nodeCreationCommand = new CreateCommand(getEditingDomain(), descriptor, (containerView));
- cc.compose(nodeCreationCommand);
-
- SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue(), location);
- cc.compose(setBoundsCommand);
-
- if(nbAnnotated != 0) {
- IAdaptable sourceEventAdapter = null;
- IAdaptable targetEventAdapter = null;
-
- // obtain the node figure
- sourceEventAdapter = (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue();
-
- // used in the creation command of each event
- ConnectionViewDescriptor dashedLineViewDescriptor = new ConnectionViewDescriptor(linkForComment, linkForComment.getSemanticHint(), diagramPreferencesHint);
-
- // 3. creation of the dashed line between the Comment and the
- // annotated element
- for(GraphicalEditPart current : endEditPart) {
- if(current != null) {
- targetEventAdapter = new SemanticAdapter(null, current.getModel());
- CommonDeferredCreateConnectionViewCommand dashedLineCmd = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), linkForComment.getSemanticHint(), (sourceEventAdapter), (targetEventAdapter), viewer, diagramPreferencesHint, dashedLineViewDescriptor, null);
- // dashedLineCmd.setElement(constraint);
- dashedLineCmd.setElement(null);
- if(dashedLineCmd.canExecute()) {
- cc.compose(dashedLineCmd);
- }
- }
- }
-
- }
- return new ICommandProxy(cc);
- }
-
- /**
- * Returns The command to drop the {@link Comment} and the links, if the
- * attached elements are on the diagram
- *
- * @param comment
- * the comment to drop
- * @param viewer
- * the viewer
- * @param diagramPreferencesHint
- * the diagram preference hint
- * @param location
- * the location for the drop
- * @param containerView
- * the container view for the drop
- * @param commentType
- * the IHintedType for the {@link Comment}
- * @param linkForComment
- * the IHintedType for the link which attach the {@link Comment} to the annotated Element
- * @return The command to drop the {@link Comment} and the link, if the
- * attached elements are on the diagram
- */
- protected Command getDropCommentCommand(Comment comment, EditPartViewer viewer, PreferencesHint diagramPreferencesHint, Point location, View containerView, IHintedType commentType, IHintedType linkForComment) {
- /* for further information, see bug 302555 */
- ViewServiceUtil.forceLoad();
- CompositeCommand cc = new CompositeCommand("dropComment");
- int nbAnnotated = comment.getAnnotatedElements().size();
-
- // 0. Obtain list of the annotatedElement
- ArrayList<Element> endToConnect = new ArrayList<Element>(comment.getAnnotatedElements());
- GraphicalEditPart[] endEditPart = new GraphicalEditPart[nbAnnotated];
-
- // 1. Look for if each annotated element is on the diagram
- Iterator<Element> iteratorProp = endToConnect.iterator();
- int index = 0;
- while(iteratorProp.hasNext()) {
- Element currentAnnotatedElement = iteratorProp.next();
- endEditPart[index] = (GraphicalEditPart)lookForEditPart(currentAnnotatedElement);
- index += 1;
- }
-
- // 2. creation of the node Comment
- IAdaptable elementAdapter = new EObjectAdapter(comment);
- ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, commentType.getSemanticHint(), ViewUtil.APPEND, true, diagramPreferencesHint);
- CreateCommand nodeCreationCommand = new CreateCommand(getEditingDomain(), descriptor, (containerView));
- cc.compose(nodeCreationCommand);
-
- SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue(), location);
- cc.compose(setBoundsCommand);
- // obtain the node figure
- IAdaptable sourceEventAdapter = (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue();
- IAdaptable targetEventAdapter = null;
- if(nbAnnotated != 0) {
-
- // used in the creation command of each event
- ConnectionViewDescriptor dashedLineViewDescriptor = new ConnectionViewDescriptor(linkForComment, linkForComment.getSemanticHint(), diagramPreferencesHint);
-
- // 3. creation of the dashed line between the Constraint and the
- // constrained element
- for(GraphicalEditPart current : endEditPart) {
- if(current != null) {
- targetEventAdapter = new SemanticAdapter(null, current.getModel());
- CommonDeferredCreateConnectionViewCommand dashedLineCmd = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), linkForComment.getSemanticHint(), (sourceEventAdapter), (targetEventAdapter), viewer, diagramPreferencesHint, dashedLineViewDescriptor, null);
- // dashedLineCmd.setElement(comment);
- dashedLineCmd.setElement(null);
- if(dashedLineCmd.canExecute()) {
- cc.compose(dashedLineCmd);
- }
- }
- }
-
- }
- return new ICommandProxy(cc);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - add the line ViewServiceUtil.forceLoad();
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.commands.operations.IUndoableOperation;
+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.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+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.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.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.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.commands.CommonDeferredCreateConnectionViewCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.DeferredCreateCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.SemanticAdapter;
+import org.eclipse.papyrus.uml.diagram.common.helper.ILinkMappingHelper;
+import org.eclipse.papyrus.uml.diagram.common.listeners.DropTargetListener;
+import org.eclipse.papyrus.uml.diagram.common.util.ViewServiceUtil;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.uml2.uml.Comment;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * @deprecated This class is used to execute the drag and drop from the outline.
+ * It can manage the drop of nodes and binary links.
+ */
+public abstract class OldCommonDiagramDragDropEditPolicy extends DiagramDragDropEditPolicy {
+
+ /** The specific drop. */
+ private Set<Integer> specificDrop = null;
+
+ /** The specified link mapping helper depending on the diagram */
+ protected ILinkMappingHelper linkmappingHelper;
+
+ /**
+ * Instantiates a new custom diagram drag drop edit policy.
+ *
+ * @param mappingHelper
+ * the mapping helper
+ */
+ public OldCommonDiagramDragDropEditPolicy(ILinkMappingHelper mappingHelper) {
+ linkmappingHelper = mappingHelper;
+ }
+
+ /**
+ * Gets elements visual id that can be dropped in the diagram
+ */
+ private Set<Integer> getSpecificDrop() {
+ if(specificDrop == null) {
+ specificDrop = getDroppableElementVisualId();
+ }
+ return specificDrop;
+ }
+
+ /**
+ * Gets the UML element type for the specified
+ *
+ * @param elementID
+ * the element id
+ *
+ * @return the uML element type
+ */
+ public abstract IElementType getUMLElementType(int elementID);
+
+ public abstract int getNodeVisualID(View containerView, EObject domainElement);
+
+ public abstract int getLinkWithClassVisualID(EObject domainElement);
+
+ /**
+ * The list of visualID that the policy manages.
+ */
+ protected abstract Set<Integer> getDroppableElementVisualId();
+
+ /**
+ * {@inheritedDoc}
+ */
+ @Override
+ protected Command createViewsAndArrangeCommand(DropObjectsRequest dropRequest, List viewDescriptors) {
+ CreateViewRequest createViewRequest = new CreateViewRequest(viewDescriptors);
+ createViewRequest.setLocation(dropRequest.getLocation());
+ Command createCommand = getHost().getCommand(createViewRequest);
+ return createCommand;
+ }
+
+ /**
+ * 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 dropBinaryLink(CompositeCommand cc, Element source, Element target, int linkVISUALID, Point location, Element semanticLink) {
+ // look for editpart
+ GraphicalEditPart sourceEditPart = (GraphicalEditPart)lookForEditPart(source);
+ GraphicalEditPart targetEditPart = (GraphicalEditPart)lookForEditPart(target);
+
+ // 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), Node.class, null, ViewUtil.APPEND, true, ((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)); //$NON-NLS-1$
+ cc.compose(setBoundsCommand);
+
+ sourceAdapter = (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue();
+ } else {
+ sourceAdapter = new SemanticAdapter(null, sourceEditPart.getModel());
+ }
+ if(targetEditPart == null) {
+ // creation of the node
+ ViewDescriptor descriptor = new ViewDescriptor(new EObjectAdapter(target), Node.class, null, ViewUtil.APPEND, true, ((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)); //$NON-NLS-1$
+ 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;
+
+ }
+
+ /**
+ * Gets the diagram preferences hint.
+ *
+ * @return the diagram preferences hint
+ */
+ protected PreferencesHint getDiagramPreferencesHint() {
+ return ((IGraphicalEditPart)getHost()).getDiagramPreferencesHint();
+ }
+
+ /**
+ * {@inheritedDoc}.
+ */
+ @Override
+ public Command getDropObjectsCommand(DropObjectsRequest dropRequest) {
+ /*
+ * when it's the first action after the opening of Papyrus, the
+ * viewService is not loaded! see bug 302555
+ *
+ * Duration test for 100000 creations of DropCommand : Here 2 solutions
+ * : - call ViewServiceUtil.forceLoad(); for each drop -> ~2500ms
+ *
+ * - test if the command cc can be executed at the end of the method,
+ * and if not : - call ViewServiceUtil.forceLoad(); - and return
+ * getDropObjectsCommand(getDropObjectsCommand) -> ~4700ms
+ *
+ * - for information : without call ViewServiceUtil.forceLoad(); ->
+ * ~1600ms
+ *
+ * It's better don't test if the command is executable!
+ */
+ ViewServiceUtil.forceLoad();
+
+ if(dropRequest.getObjects().size() > 0 && dropRequest.getObjects().get(0) instanceof String) {
+ return getDropFileCommand(dropRequest);
+ }
+
+ // Create a view request from the drop request and then forward getting
+ // the command for that.
+ CompositeCommand cc = new CompositeCommand("Drop"); //$NON-NLS-1$
+ Iterator<?> iter = dropRequest.getObjects().iterator();
+ Point location = getTranslatedLocation(dropRequest);
+
+ while(iter.hasNext()) {
+ EObject droppedObject = (EObject)iter.next();
+ cc.add(getDropObjectCommand(dropRequest, droppedObject, location));
+ }
+
+ return new ICommandProxy(cc);
+ }
+
+ /**
+ * Check if the ctrl key event is activate
+ *
+ * @param dropRequest
+ * the request which contain the event
+ * @return true if ctrl key is activate, else return false
+ */
+ public boolean isCopy(DropObjectsRequest dropRequest) {
+ if(dropRequest != null && dropRequest.getExtendedData() != null && dropRequest.getExtendedData().get(DropTargetListener.EVENT_DETAIL) instanceof Integer) {
+ int eventDetail = (Integer)dropRequest.getExtendedData().get(DropTargetListener.EVENT_DETAIL);
+ if(((eventDetail & DND.DROP_COPY) != 0)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected IUndoableOperation getDropObjectCommand(DropObjectsRequest dropRequest, EObject droppedObject, Point location) {
+ int nodeVISUALID = getNodeVisualID(((IGraphicalEditPart)getHost()).getNotationView(), droppedObject);
+ int linkVISUALID = getLinkWithClassVisualID(droppedObject);
+ if(getSpecificDrop().contains(nodeVISUALID) || getSpecificDrop().contains(linkVISUALID)) {
+ dropRequest.setLocation(location);
+ Command specificDropCommand = getSpecificDropCommand(dropRequest, (Element)droppedObject, nodeVISUALID, linkVISUALID);
+ CompositeCommand cc = new CompositeCommand("Drop command");
+ cc.compose(new CommandProxy(specificDropCommand));
+ // If ctrl key activate, get the content of element dropped
+ if(isCopy(dropRequest)) {
+ // Check for ICommandProxy and CompoundCommand the most command type used
+ if(specificDropCommand instanceof ICommandProxy) {
+ ICommandProxy specificDropCommandProxy = (ICommandProxy)specificDropCommand;
+ createDeferredCommandWithCommandResult(droppedObject, cc, specificDropCommandProxy);
+ } else if(specificDropCommand instanceof CompoundCommand) {
+ CompoundCommand specificDropCompoundCommand = (CompoundCommand)specificDropCommand;
+ ICommandProxy cp = getCommandProxyFromCompoundCommand(specificDropCompoundCommand);
+ if(cp != null) {
+ createDeferredCommandWithCommandResult(droppedObject, cc, cp);
+ }
+ }
+ }
+ return cc;
+ }
+
+ if(linkVISUALID == -1 && nodeVISUALID != -1) {
+ // The element to drop is a node
+ // Retrieve it's expected graphical parent
+ EObject graphicalParent = ((GraphicalEditPart)getHost()).resolveSemanticElement();
+
+ // Restrict the default node creation to the following cases:
+ // . Take the containment relationship into consideration
+ // . Release the constraint when GraphicalParent is a diagram
+ if(getHost().getModel() instanceof Diagram) {
+ return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, dropRequest);
+
+ } else if((graphicalParent instanceof Element) && ((Element)graphicalParent).getOwnedElements().contains(droppedObject)) {
+ return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, dropRequest);
+
+ }
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+
+ }
+ if(linkVISUALID != -1) {
+ Collection<?> sources = linkmappingHelper.getSource((Element)droppedObject);
+ Collection<?> targets = linkmappingHelper.getTarget((Element)droppedObject);
+ if(sources.size() == 0 || targets.size() == 0) {
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+ // binary association
+ Element source = (Element)sources.toArray()[0];
+ Element target = (Element)targets.toArray()[0];
+ CompositeCommand cc = new CompositeCommand("Add Link"); //$NON-NLS-1$
+ dropBinaryLink(cc, source, target, linkVISUALID, dropRequest.getLocation(), (Element)droppedObject);
+ return cc;
+ }
+ return org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Get a command proxy from the compound command
+ *
+ * @param cc
+ * the compound command
+ * @return the command proxy found or null
+ */
+ protected ICommandProxy getCommandProxyFromCompoundCommand(CompoundCommand cc) {
+ if(cc != null && cc.getCommands() != null) {
+ for(Object command : cc.getCommands()) {
+ if(command instanceof ICommandProxy) {
+ return (ICommandProxy)command;
+ } else if(command instanceof CompoundCommand) {
+ getCommandProxyFromCompoundCommand((CompoundCommand)command);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create deferred command for a command proxy
+ *
+ * @param droppedObject
+ * the dropped object
+ * @param cc
+ * the composite command to add the deferred command
+ * @param specificDropCommandProxy
+ * the specific drop command to get the result
+ */
+ protected void createDeferredCommandWithCommandResult(EObject droppedObject, CompositeCommand cc, ICommandProxy specificDropCommandProxy) {
+ if(specificDropCommandProxy != null && specificDropCommandProxy.getICommand() != null && specificDropCommandProxy.getICommand().getCommandResult() != null && specificDropCommandProxy.getICommand().getCommandResult().getReturnValue() != null) {
+ Object object = specificDropCommandProxy.getICommand().getCommandResult().getReturnValue();
+ if(object instanceof Collection<?>) {
+ for(Object o : (Collection<?>)object) {
+ if(o instanceof CreateViewRequest.ViewDescriptor) {
+ CreateViewRequest.ViewDescriptor viewDescritor = (CreateViewRequest.ViewDescriptor)o;
+ DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)viewDescritor, getHost().getViewer());
+ cc.compose(createCommand2);
+ }
+ }
+ }
+ }
+ }
+
+ protected Point getTranslatedLocation(DropObjectsRequest dropRequest) {
+ Point location = dropRequest.getLocation().getCopy();
+ ((GraphicalEditPart)getHost()).getContentPane().translateToRelative(location);
+ ((GraphicalEditPart)getHost()).getContentPane().translateFromParent(location);
+ location.translate(((GraphicalEditPart)getHost()).getContentPane().getClientArea().getLocation().getNegated());
+ return location;
+ }
+
+ /**
+ * This method returns the default drop command for node. Default here means
+ * the no consideration is made regarding the semantic elements, the
+ * expected figure is basically created where expected.
+ *
+ * @param nodeVISUALID
+ * the node visual identifier
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @return a CompositeCommand for Drop
+ */
+ protected CompositeCommand getDefaultDropNodeCommand(int nodeVISUALID, Point location, EObject droppedObject) {
+ return getDefaultDropNodeCommand(nodeVISUALID, location, droppedObject, null);
+ }
+
+ /**
+ * This method returns the default drop command for node. Default here means
+ * the no consideration is made regarding the semantic elements, the
+ * expected figure is basically created where expected.
+ *
+ * @param nodeVISUALID
+ * the node visual identifier
+ * @param location
+ * the drop location
+ * @param droppedObject
+ * the object to drop
+ * @return a CompositeCommand for Drop
+ */
+ protected CompositeCommand getDefaultDropNodeCommand(int nodeVISUALID, Point location, EObject droppedObject, DropObjectsRequest request) {
+ CompositeCommand cc = new CompositeCommand("Drop"); //$NON-NLS-1$
+ IAdaptable elementAdapter = new EObjectAdapter(droppedObject);
+
+ ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, ((IHintedType)getUMLElementType(nodeVISUALID)).getSemanticHint(), ViewUtil.APPEND, true, getDiagramPreferencesHint());
+ CreateCommand createCommand = new CreateCommand(getEditingDomain(), descriptor, ((View)(getHost().getModel())));
+ cc.compose(createCommand);
+
+ SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)createCommand.getCommandResult().getReturnValue(), location); //$NON-NLS-1$
+ cc.compose(setBoundsCommand);
+ // If specific drop, the deferred command is already done in the getDropObjectCommand method
+ // Only if CTRL key is active
+ if(!getSpecificDrop().contains(nodeVISUALID) && isCopy(request)) {
+ DeferredCreateCommand createCommand2 = new DeferredCreateCommand(getEditingDomain(), droppedObject, (IAdaptable)createCommand.getCommandResult().getReturnValue(), getHost().getViewer());
+ cc.compose(createCommand2);
+ }
+ return cc;
+ }
+
+ /**
+ * Gets the editing domain.
+ *
+ * @return the editing domain
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ }
+
+ /**
+ * for specific case of drop, the designers has to write the algorithm of
+ * its own drop. for example case of associationClass, multi dependency
+ * etc....
+ *
+ * @param dropRequest
+ * the drop request
+ * @param nodeVISUALID
+ * the node visualid
+ * @param linkVISUALID
+ * the link visualid
+ * @param semanticLink
+ * the semantic link
+ *
+ * @return the specific drop command
+ */
+ protected Command getSpecificDropCommand(DropObjectsRequest dropRequest, Element semanticLink, int nodeVISUALID, int linkVISUALID) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Gets the viewer.
+ *
+ * @return the viewer
+ */
+ protected EditPartViewer getViewer() {
+ return ((IGraphicalEditPart)getHost()).getViewer();
+ }
+
+ /**
+ * Look for editPart from its semantic.
+ *
+ * @param semantic
+ * the semantic
+ *
+ * @return the edits the part or null if not found
+ */
+ protected EditPart lookForEditPart(EObject semantic) {
+ Collection<EditPart> editPartSet = getHost().getViewer().getEditPartRegistry().values();
+ Iterator<EditPart> editPartIterator = editPartSet.iterator();
+ EditPart existedEditPart = null;
+ while(editPartIterator.hasNext() && existedEditPart == null) {
+ EditPart currentEditPart = editPartIterator.next();
+
+ if(isEditPartTypeAdapted(currentEditPart.getClass(), semantic.eClass()) && semantic.equals(((GraphicalEditPart)currentEditPart).resolveSemanticElement())) {
+ existedEditPart = currentEditPart;
+ }
+ }
+ return existedEditPart;
+ }
+
+ /**
+ * Check if the edit part type is the best one to represent an object of the
+ * given EClass type
+ *
+ * @param editPartClass
+ * the type of EditPart which may represent a semantic element
+ * @param eClass
+ * the EClass type of the represented semantic element
+ * @return true if an edit part of this type should be selected
+ */
+ private boolean isEditPartTypeAdapted(Class<? extends EditPart> editPartClass, EClass eClass) {
+ if(DiagramEditPart.class.isAssignableFrom(editPartClass) || CompartmentEditPart.class.isAssignableFrom(editPartClass)) {
+ // the edit part is disqualified, as a compartment or a diagram can
+ // not be dropped
+ return false;
+ } else if(GraphicalEditPart.class.isAssignableFrom(editPartClass)) {
+ // check the edit part type against advised ones
+ return isEditPartTypeSuitableForEClass(editPartClass.asSubclass(GraphicalEditPart.class), eClass);
+ } else {
+ // only a GraphicalEditPart must be selected
+ return false;
+ }
+ }
+
+ /**
+ * Check if an edit part type correctly represent a semantic element of the
+ * given EClass. Subclasses should implement this method to restrict the
+ * possibilities during drop of a link. If an edit part is not of a suitable
+ * type, returning false will eliminate it to represent the element as a
+ * source or target edit part. This can be used for example to disable label
+ * edit parts, which may represent the same model element as the main node.
+ *
+ * @param editPartClass
+ * the type of EditPart which must be checked
+ * @param eClass
+ * the EClass type of the element which the edit part must
+ * represent
+ * @return the only edit part type which can be selected (return a common
+ * super type if several edit parts can be chosen)
+ */
+ protected boolean isEditPartTypeSuitableForEClass(Class<? extends GraphicalEditPart> editPartClass, EClass eClass) {
+ return true;
+ }
+
+ /**
+ * Returns The command to drop the {@link Constraint} and the links, if the
+ * constraints elements are on the diagram
+ *
+ * @param comment
+ * the comment to drop
+ * @param viewer
+ * the viewer
+ * @param diagramPreferencesHint
+ * the diagram preference hint
+ * @param location
+ * the location for the drop
+ * @param containerView
+ * the container view for the drop
+ * @param commentType
+ * the IHintedType for the {@link Comment}
+ * @param linkForComment
+ * the IHintedType for the link which attach the {@link Comment} to the annotated Element
+ * @return The command to drop the {@link Constraint} and the links, if the
+ * constraints elements are on the diagram
+ */
+ protected Command getDropConstraintCommand(Constraint constraint, EditPartViewer viewer, PreferencesHint diagramPreferencesHint, Point location, View containerView, IHintedType commentType, IHintedType linkForComment) {
+ /* for further information, see bug 302555 */
+ CompositeCommand cc = new CompositeCommand("dropConstraint");
+ int nbAnnotated = constraint.getConstrainedElements().size();
+
+ // 0. Obtain list of the annotatedElement
+ ArrayList<Element> endToConnect = new ArrayList<Element>(constraint.getConstrainedElements());
+ GraphicalEditPart[] endEditPart = new GraphicalEditPart[nbAnnotated];
+
+ // 1. Look for if each annotated element is on the diagram
+ Iterator<Element> iteratorProp = endToConnect.iterator();
+ int index = 0;
+ while(iteratorProp.hasNext()) {
+ Element currentAnnotatedElement = iteratorProp.next();
+ endEditPart[index] = (GraphicalEditPart)lookForEditPart(currentAnnotatedElement);
+ index += 1;
+ }
+
+ // 2. creation of the node Comment
+ IAdaptable elementAdapter = new EObjectAdapter(constraint);
+ ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, commentType.getSemanticHint(), ViewUtil.APPEND, true, diagramPreferencesHint);
+ CreateCommand nodeCreationCommand = new CreateCommand(getEditingDomain(), descriptor, (containerView));
+ cc.compose(nodeCreationCommand);
+
+ SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue(), location);
+ cc.compose(setBoundsCommand);
+
+ if(nbAnnotated != 0) {
+ IAdaptable sourceEventAdapter = null;
+ IAdaptable targetEventAdapter = null;
+
+ // obtain the node figure
+ sourceEventAdapter = (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue();
+
+ // used in the creation command of each event
+ ConnectionViewDescriptor dashedLineViewDescriptor = new ConnectionViewDescriptor(linkForComment, linkForComment.getSemanticHint(), diagramPreferencesHint);
+
+ // 3. creation of the dashed line between the Comment and the
+ // annotated element
+ for(GraphicalEditPart current : endEditPart) {
+ if(current != null) {
+ targetEventAdapter = new SemanticAdapter(null, current.getModel());
+ CommonDeferredCreateConnectionViewCommand dashedLineCmd = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), linkForComment.getSemanticHint(), (sourceEventAdapter), (targetEventAdapter), viewer, diagramPreferencesHint, dashedLineViewDescriptor, null);
+ // dashedLineCmd.setElement(constraint);
+ dashedLineCmd.setElement(null);
+ if(dashedLineCmd.canExecute()) {
+ cc.compose(dashedLineCmd);
+ }
+ }
+ }
+
+ }
+ return new ICommandProxy(cc);
+ }
+
+ /**
+ * Returns The command to drop the {@link Comment} and the links, if the
+ * attached elements are on the diagram
+ *
+ * @param comment
+ * the comment to drop
+ * @param viewer
+ * the viewer
+ * @param diagramPreferencesHint
+ * the diagram preference hint
+ * @param location
+ * the location for the drop
+ * @param containerView
+ * the container view for the drop
+ * @param commentType
+ * the IHintedType for the {@link Comment}
+ * @param linkForComment
+ * the IHintedType for the link which attach the {@link Comment} to the annotated Element
+ * @return The command to drop the {@link Comment} and the link, if the
+ * attached elements are on the diagram
+ */
+ protected Command getDropCommentCommand(Comment comment, EditPartViewer viewer, PreferencesHint diagramPreferencesHint, Point location, View containerView, IHintedType commentType, IHintedType linkForComment) {
+ /* for further information, see bug 302555 */
+ ViewServiceUtil.forceLoad();
+ CompositeCommand cc = new CompositeCommand("dropComment");
+ int nbAnnotated = comment.getAnnotatedElements().size();
+
+ // 0. Obtain list of the annotatedElement
+ ArrayList<Element> endToConnect = new ArrayList<Element>(comment.getAnnotatedElements());
+ GraphicalEditPart[] endEditPart = new GraphicalEditPart[nbAnnotated];
+
+ // 1. Look for if each annotated element is on the diagram
+ Iterator<Element> iteratorProp = endToConnect.iterator();
+ int index = 0;
+ while(iteratorProp.hasNext()) {
+ Element currentAnnotatedElement = iteratorProp.next();
+ endEditPart[index] = (GraphicalEditPart)lookForEditPart(currentAnnotatedElement);
+ index += 1;
+ }
+
+ // 2. creation of the node Comment
+ IAdaptable elementAdapter = new EObjectAdapter(comment);
+ ViewDescriptor descriptor = new ViewDescriptor(elementAdapter, Node.class, commentType.getSemanticHint(), ViewUtil.APPEND, true, diagramPreferencesHint);
+ CreateCommand nodeCreationCommand = new CreateCommand(getEditingDomain(), descriptor, (containerView));
+ cc.compose(nodeCreationCommand);
+
+ SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue(), location);
+ cc.compose(setBoundsCommand);
+ // obtain the node figure
+ IAdaptable sourceEventAdapter = (IAdaptable)nodeCreationCommand.getCommandResult().getReturnValue();
+ IAdaptable targetEventAdapter = null;
+ if(nbAnnotated != 0) {
+
+ // used in the creation command of each event
+ ConnectionViewDescriptor dashedLineViewDescriptor = new ConnectionViewDescriptor(linkForComment, linkForComment.getSemanticHint(), diagramPreferencesHint);
+
+ // 3. creation of the dashed line between the Constraint and the
+ // constrained element
+ for(GraphicalEditPart current : endEditPart) {
+ if(current != null) {
+ targetEventAdapter = new SemanticAdapter(null, current.getModel());
+ CommonDeferredCreateConnectionViewCommand dashedLineCmd = new CommonDeferredCreateConnectionViewCommand(getEditingDomain(), linkForComment.getSemanticHint(), (sourceEventAdapter), (targetEventAdapter), viewer, diagramPreferencesHint, dashedLineViewDescriptor, null);
+ // dashedLineCmd.setElement(comment);
+ dashedLineCmd.setElement(null);
+ if(dashedLineCmd.canExecute()) {
+ cc.compose(dashedLineCmd);
+ }
+ }
+ }
+
+ }
+ return new ICommandProxy(cc);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OrphanViewPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OrphanViewPolicy.java
index 4e86b73fe45..d802648fba8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OrphanViewPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/OrphanViewPolicy.java
@@ -1,602 +1,602 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - additional features
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import static org.eclipse.papyrus.uml.diagram.common.Activator.log;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-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.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.Transaction;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gmf.runtime.common.core.util.StringStatics;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-
-/**
- * Edit Policy in charge of the removal of views that are not linked to semantic
- * elements, when they should be linked to semantic elements.
- * <P>
- * Sometimes, {@link View}s are not linked to semantic elements, like the comment link. This link represents the annotated element feature for a
- * {@link Comment}, but they are not themselves connected to a semantic element. <BR/>
- * Thus, when this policy is created, it reads a table of integer that corresponds to the set of visual IDs, ids linked to views that are never linked
- * to a semantic element.
- * </P>
- * <P>
- * This view checks that the host edit part, usually a container edit part, has child views that are not orphaned. It listens for model notifications.
- * As soon as it receives a add or remove event, it checks that the child views are still valid, ie they are connected to a semantic element if they
- * should.<BR/>
- * There is then an invariant: The edit part, by the intermediate of his orphan edit policy, must always know the list of semantic parents of the
- * semantic elements displayed by views children of the view associated to this edit part. So it knows when a child element of this parent is deleted,
- * and then can react to this destruction.<BR/>
- * To respect this condition, the policy keeps a list of parent elements, which is updated as soon as the list receives notification about this parent
- * semantic elements.
- * </P>
- */
-public class OrphanViewPolicy extends AbstractEditPolicy implements NotificationListener, IPapyrusListener {
-
- /**
- * array list of visual id that correspond to views that are not linked to
- * semantic elements. For example, comment links
- */
- private ArrayList<Integer> notOrphanList = new ArrayList<Integer>();
-
- /** the pattern that checks visual ids are valid integers */
- private static Pattern digit = Pattern.compile("\\d+");
-
- /** list of element to listen */
- protected HashMap<EObject, List<View>> additionalParentToListen = new HashMap<EObject, List<View>>();
-
- /** stores the host associated semantic element */
- protected EObject hostSemanticElement;
-
- /**
- * Adds additional listeners to the diagram event broker.
- */
- @SuppressWarnings("unchecked")
- @Override
- public void activate() {
-
- // retrieve the view and the element associated to the host edit part
- final View hostView = (View)getHost().getModel();
- hostSemanticElement = hostView.getElement();
-
- // adds listener to the event broker, listening for the view and the
- // semantic element associated to the host edit part
- getDiagramEventBroker().addNotificationListener(hostView, this);
- getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
-
- // retrieve the list of parent semantic element to listen in case of
- // modification
- // for each child views, checks which parent has the semantic element
- // associated to the view
- // if dif
- Iterator<View> it = hostView.getChildren().listIterator();
- while(it.hasNext()) {
- View childView = it.next();
- addListenerForView(childView);
- }
-
- // debug purpose
- if(log.isDebugEnabled()) {
- log.debug("Activate: " + prettyPrint(additionalParentToListen));
- }
-
- super.activate();
- }
-
- /**
- * Adds this edit policy as listener for changes to the specified
- * semanticParent
- *
- * @param semanticParent
- * the semantic parent to listen
- * @param childView
- * the view that requires this additional listener
- */
- protected void addAdditionalParentToListen(EObject semanticParent, View childView) {
- // check if the list already contains the semantic Parent
- // if it already contains the parent, adds the view to the list of views
- // responsible of this parent
- // if not, it creates a new entry in the map
- if(additionalParentToListen.containsKey(semanticParent)) {
- List<View> views = additionalParentToListen.get(semanticParent);
- assert (views != null) : "list should not be null";
- views.add(childView);
- // no need to add listener, it should already be done
- } else {
- // creates the list of views associated to this parent and adds it
- // to the additional parent to listen, with the key
- // "semantic parent"
- ArrayList<View> views = new ArrayList<View>();
- views.add(childView);
- additionalParentToListen.put(semanticParent, views);
- getDiagramEventBroker().addNotificationListener(semanticParent, this);
- }
- }
-
- /**
- * Removes this edit policy as listener for changes to the specified
- * semanticParent
- *
- * @param semanticParent
- * the semantic parent to stop listen
- * @param childView
- * the view that does not requires this additional listener
- */
- protected void removeAdditionalParentToListen(EObject semanticParent, View childView) {
- // removes the view from the list of views that requires a listener for
- // the semantic parent
- if(additionalParentToListen.containsKey(semanticParent)) {
- List<View> views = additionalParentToListen.get(semanticParent);
- assert (views != null) : "list should not be null";
- views.remove(childView);
- if(views.isEmpty()) {
- additionalParentToListen.remove(semanticParent);
- // check this is not the parent semantic element of the host's
- // semantic element
- if(!semanticParent.equals(((View)getHost().getModel()).getElement())) {
- getDiagramEventBroker().removeNotificationListener(semanticParent, this);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void deactivate() {
- // retrieve the view and the element associated to the host edit part
- final View hostView = (View)getHost().getModel();
-
- // removes all notification listeners for the additional parent to
- // listen
- for(EObject parent : additionalParentToListen.keySet()) {
- getDiagramEventBroker().removeNotificationListener(parent, this);
- }
- additionalParentToListen.clear();
- additionalParentToListen = null;
-
- getDiagramEventBroker().removeNotificationListener(hostView, this);
- getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this);
-
- // removes the reference to the semantic element
- hostSemanticElement = null;
-
- super.deactivate();
- }
-
- /**
- * Deletes a list of views. The views will be deleted <tt>iff</tt> their
- * semantic element has also been deleted.
- *
- * @param views
- * an iterator on a list of views.
- * @return <tt>true</tt> if the host editpart should be refreshed; either
- * one one of the supplied views was deleted or has been reparented.
- */
- protected final boolean deleteViews(Iterator<View> views) {
-
- final CompoundCommand cc = new CompoundCommand(DiagramUIMessages.DeleteCommand_Label);
- while(views.hasNext()) {
- View view = (View)views.next();
- cc.add(getDeleteViewCommand(view));
- }
-
- boolean doDelete = !cc.isEmpty() && cc.canExecute();
- if(doDelete) {
- executeCommand(cc);
- }
- return doDelete;
- }
-
- /**
- * Executes the supplied command inside an <code>unchecked action</code>
- *
- * @param cmd
- * command that can be executed (i.e., cmd.canExecute() == true)
- */
- protected void executeCommand(final Command cmd) {
- Map<String, Boolean> options = null;
- EditPart ep = getHost();
- boolean isActivating = true;
- // use the viewer to determine if we are still initializing the diagram
- // do not use the DiagramEditPart.isActivating since
- // ConnectionEditPart's
- // parent will not be a diagram edit part
- EditPartViewer viewer = ep.getViewer();
- if(viewer instanceof DiagramGraphicalViewer) {
- isActivating = ((DiagramGraphicalViewer)viewer).isInitializing();
- }
-
- if(isActivating || !EditPartUtil.isWriteTransactionInProgress((IGraphicalEditPart)getHost(), false, false))
- options = Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
-
- AbstractEMFOperation operation = new AbstractEMFOperation(((IGraphicalEditPart)getHost()).getEditingDomain(), StringStatics.BLANK, options) {
-
- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- cmd.execute();
-
- return Status.OK_STATUS;
- }
- };
- try {
- operation.execute(new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- log.error(e);
- }
- }
-
- /**
- * Retrieve the list of orphaned views among the specified list view
- *
- * @param viewChildrenIterator
- * the iterator on the list of views to check
- * @return the list of views that are orphaned
- */
- protected List<View> findOrphanView(Iterator<? extends EObject> viewChildrenIterator) {
- ArrayList<View> orphanView = new ArrayList<View>();
- while(viewChildrenIterator.hasNext()) {
- EObject view = viewChildrenIterator.next();
- if(view instanceof View) {
- if(isOrphaned((View)view)) {
- orphanView.add((View)view);
- }
- }
- }
- return orphanView;
- }
-
- /**
- * Returns a {@link Command} to delete the supplied {@link View}.
- *
- * @param view
- * view to delete
- * @return the command that destroys the specified view
- */
- protected Command getDeleteViewCommand(View view) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- return new ICommandProxy(new DeleteCommand(editingDomain, view));
- }
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
-
- /**
- * Inits the list of children that should never be attached to a semantic
- * element, for example comment links.
- *
- * @param notOrphanVisualID
- * the list of visual id of views that should never be attached
- * to a semantic element
- */
- public void init(int[] notOrphanVisualID) {
- for(int i = 0; i < notOrphanVisualID.length; i++) {
- notOrphanList.add(new Integer(notOrphanVisualID[i]));
- }
- }
-
- /**
- * Tests if the view is orphaned, i.e. it is still attached to a semantic
- * element.
- * <P>
- * It checks also that it is not a view that is never attached to a semantic element (For example, comment links do not have semantic elements
- * attached...)
- * <P/>
- *
- * @param view
- * the view to check
- * @return <code>true</code> if the view is not attached to a semantic
- * element. <code>false</code> if it is still attached to a semantic
- * element or if it should never be attached to a semantic element
- */
- protected boolean isOrphaned(View view) {
- String semanticHint = view.getType();
- if(isInteger(semanticHint) && notOrphanList.contains(new Integer(semanticHint))) {
- return false;
- }
- return !view.isSetElement();
- }
-
- /**
- * Checks if the string is an integer.
- *
- * @param s
- * the specified string
- *
- * @return true, if is integer
- */
- public static boolean isInteger(String s) {
- boolean result = false;
- Matcher matcher = digit.matcher(s);
- if(matcher != null) {
- result = matcher.matches();
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public void notifyChanged(Notification notification) {
- // something has change. What ? :)
- // check who is responsible of notification. If this is host edit part
- // related semantic element, act as standard
- Object notifier = notification.getNotifier();
- // View hostView = (View)getHost().getModel();
- if(notifier.equals(hostSemanticElement)) {
- if(Notification.REMOVE == notification.getEventType() || Notification.SET == notification.getEventType()) {
- refreshViews();
- }
- } else {
- // this is perhaps one of the scoped semantic parent
- if(notifier instanceof EObject) {
- if(!(notifier instanceof View)) {
- if(Notification.REMOVE == notification.getEventType()) {
-
- // 2 cases... remove or simple move ?
- // this can be checked with the view, if it is now
- // orphaned or not
- // if it is orphaned, element has to be destroyed,
- // remove from parent listener, etc.
- // if not, this was just a move => change listener using
- // new parent
- // checks also for whole hierarchy...
- EObject parentNotifier = (EObject)notifier;
-
- if(additionalParentToListen.containsKey(parentNotifier)) {
- // this should be one of the elements that are
- // inside the
- List<View> views = additionalParentToListen.get(parentNotifier);
-
- List<View> orphaned = findOrphanView(views.iterator());
- //
- // delete all the remaining views
- deleteViews(orphaned.iterator());
-
- removeListeners(orphaned);
- }
- }
- } else { // Notifier is a View
- // REMOVE or ADD are interesting events:
- // if remove, remove the list (perhaps) from the views
- // contributing to the delete action
- // if add, checks it does not need to be watched
- if(Notification.REMOVE == notification.getEventType()) {
- if(notification.getNewValue() instanceof View) {
- View oldView = (View)notification.getOldValue();
- removeListenerForView(oldView);
- }
-
- } else if(Notification.ADD == notification.getEventType()) {
- // check the parent of the associated semantic element
- if(notification.getNewValue() instanceof View) {
- View newView = (View)notification.getNewValue();
- addListenerForView(newView);
- }
- }
-
- }
- }
- }
- }
-
- /**
- * Adds a listener for the specified view, if necessary.
- * <P>
- * It has to be added if the parent of the semantic element attached to the view is not the host semantic element.
- * </P>
- *
- * @param newView
- * the new view to check
- */
- protected void addListenerForView(View newView) {
- // get semantic element attached to the host edit part
- View hostView = (View)getHost().getModel();
-
- // get the parent of the new view. if it is the same as current parent,
- // does not add additional listeners
- if(newView.getElement() != null) {
- EObject semanticParent = newView.getElement().eContainer();
- if(semanticParent != null) {
- if(!semanticParent.equals(hostSemanticElement)) {
- // add each parent of the semantic parent to the list of
- // additional listeners
- for(EObject parent : getElementHierarchy(semanticParent)) {
- addAdditionalParentToListen(parent, newView);
- }
- }
- }
- }
- }
-
- /**
- * Removes a listener for the specified view, if it exists.
- *
- * @param oldView
- * the old view to check
- */
- protected void removeListenerForView(View oldView) {
- // create a temp list of elements to delete (iterator concurrent
- // modification..)
- Map<EObject, List<View>> parentsToDelete = new HashMap<EObject, List<View>>();
-
- for(EObject parent : additionalParentToListen.keySet()) {
- List<View> parentViews = additionalParentToListen.get(parent);
- if(parentViews.contains(oldView)) {
-
- List<View> views = parentsToDelete.get(parent);
- if(views == null) {
- views = new ArrayList<View>();
- }
- views.add(oldView);
- parentsToDelete.put(parent, views);
- }
- }
- }
-
- /**
- * Updates the listeners for the specified semantic parent
- */
- protected void removeListeners(List<View> impactedViews) {
- // create a temp list of elements to delete (iterator concurrent
- // modification..)
- Map<EObject, List<View>> parentsToDelete = new HashMap<EObject, List<View>>();
-
- // collect the elements to delete
- for(View view : impactedViews) {
- for(EObject parent : additionalParentToListen.keySet()) {
- List<View> parentViews = additionalParentToListen.get(parent);
- if(parentViews.contains(view)) {
-
- List<View> views = parentsToDelete.get(parent);
- if(views == null) {
- views = new ArrayList<View>();
- }
- views.add(view);
- parentsToDelete.put(parent, views);
- }
- }
- }
-
- // do the job
- for(EObject object : parentsToDelete.keySet()) {
- List<View> views = parentsToDelete.get(object);
- for(View view : views) {
- removeAdditionalParentToListen(object, view);
- }
- }
- }
-
- /**
- * Returns the list of parent for the specified element
- *
- * @return the list of parent for the specified element, with the element
- * itself
- */
- public List<EObject> getElementHierarchy(EObject eObject) {
- List<EObject> list = new ArrayList<EObject>();
- EObject currentObject = eObject;
- while(currentObject != null) {
- list.add(currentObject);
- currentObject = currentObject.eContainer();
- }
- return list;
- }
-
- /**
- * Refresh the child views of the host edit part
- *
- * @return an empty list?
- */
- protected List refreshViews() {
- // current connection views
- Iterator<EObject> viewChildrenIterator = ((EObject)getHost().getModel()).eContents().iterator();
-
- List<View> orphaned = findOrphanView(viewChildrenIterator);
- //
- // delete all the remaining views
- deleteViews(orphaned.iterator());
-
- // update listeners
- removeListeners(orphaned);
-
- // create a view for each remaining semantic element.
- // FIXME why returning an empty list ?
- List viewDescriptors = new ArrayList();
-
- return viewDescriptors;
- }
-
- /**
- * launch a weak synchronization. It could be useful in order to clean a
- * diagram by an external tool.
- */
- public void forceRefresh() {
- refreshViews();
- }
-
- /**
- * Debug method. Displays the additionalParentToListen map correclty
- *
- * @param additionalParentToListen
- * the map to display
- * @return the pretty - print string
- */
- private String prettyPrint(Map<EObject, List<View>> additionalParentToListen) {
- StringBuffer buffer = new StringBuffer();
- if(additionalParentToListen == null) {
- return "Empty listener for " + getHost();
- }
- buffer.append("addtionnal listeners for ");
- buffer.append(getHost());
- buffer.append("\n");
- for(EObject object : additionalParentToListen.keySet()) {
- buffer.append("\n");
- buffer.append(object);
- buffer.append("(");
- buffer.append(additionalParentToListen.get(object).size());
- buffer.append("):\n");
- for(View view : additionalParentToListen.get(object)) {
- buffer.append("- ");
- buffer.append(view);
- buffer.append("\n");
- }
- buffer.append("\n");
- }
-
- return buffer.toString();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - additional features
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import static org.eclipse.papyrus.uml.diagram.common.Activator.log;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+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.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.Transaction;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.editpolicies.AbstractEditPolicy;
+import org.eclipse.gmf.runtime.common.core.util.StringStatics;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
+
+/**
+ * Edit Policy in charge of the removal of views that are not linked to semantic
+ * elements, when they should be linked to semantic elements.
+ * <P>
+ * Sometimes, {@link View}s are not linked to semantic elements, like the comment link. This link represents the annotated element feature for a
+ * {@link Comment}, but they are not themselves connected to a semantic element. <BR/>
+ * Thus, when this policy is created, it reads a table of integer that corresponds to the set of visual IDs, ids linked to views that are never linked
+ * to a semantic element.
+ * </P>
+ * <P>
+ * This view checks that the host edit part, usually a container edit part, has child views that are not orphaned. It listens for model notifications.
+ * As soon as it receives a add or remove event, it checks that the child views are still valid, ie they are connected to a semantic element if they
+ * should.<BR/>
+ * There is then an invariant: The edit part, by the intermediate of his orphan edit policy, must always know the list of semantic parents of the
+ * semantic elements displayed by views children of the view associated to this edit part. So it knows when a child element of this parent is deleted,
+ * and then can react to this destruction.<BR/>
+ * To respect this condition, the policy keeps a list of parent elements, which is updated as soon as the list receives notification about this parent
+ * semantic elements.
+ * </P>
+ */
+public class OrphanViewPolicy extends AbstractEditPolicy implements NotificationListener, IPapyrusListener {
+
+ /**
+ * array list of visual id that correspond to views that are not linked to
+ * semantic elements. For example, comment links
+ */
+ private ArrayList<Integer> notOrphanList = new ArrayList<Integer>();
+
+ /** the pattern that checks visual ids are valid integers */
+ private static Pattern digit = Pattern.compile("\\d+");
+
+ /** list of element to listen */
+ protected HashMap<EObject, List<View>> additionalParentToListen = new HashMap<EObject, List<View>>();
+
+ /** stores the host associated semantic element */
+ protected EObject hostSemanticElement;
+
+ /**
+ * Adds additional listeners to the diagram event broker.
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void activate() {
+
+ // retrieve the view and the element associated to the host edit part
+ final View hostView = (View)getHost().getModel();
+ hostSemanticElement = hostView.getElement();
+
+ // adds listener to the event broker, listening for the view and the
+ // semantic element associated to the host edit part
+ getDiagramEventBroker().addNotificationListener(hostView, this);
+ getDiagramEventBroker().addNotificationListener(hostSemanticElement, this);
+
+ // retrieve the list of parent semantic element to listen in case of
+ // modification
+ // for each child views, checks which parent has the semantic element
+ // associated to the view
+ // if dif
+ Iterator<View> it = hostView.getChildren().listIterator();
+ while(it.hasNext()) {
+ View childView = it.next();
+ addListenerForView(childView);
+ }
+
+ // debug purpose
+ if(log.isDebugEnabled()) {
+ log.debug("Activate: " + prettyPrint(additionalParentToListen));
+ }
+
+ super.activate();
+ }
+
+ /**
+ * Adds this edit policy as listener for changes to the specified
+ * semanticParent
+ *
+ * @param semanticParent
+ * the semantic parent to listen
+ * @param childView
+ * the view that requires this additional listener
+ */
+ protected void addAdditionalParentToListen(EObject semanticParent, View childView) {
+ // check if the list already contains the semantic Parent
+ // if it already contains the parent, adds the view to the list of views
+ // responsible of this parent
+ // if not, it creates a new entry in the map
+ if(additionalParentToListen.containsKey(semanticParent)) {
+ List<View> views = additionalParentToListen.get(semanticParent);
+ assert (views != null) : "list should not be null";
+ views.add(childView);
+ // no need to add listener, it should already be done
+ } else {
+ // creates the list of views associated to this parent and adds it
+ // to the additional parent to listen, with the key
+ // "semantic parent"
+ ArrayList<View> views = new ArrayList<View>();
+ views.add(childView);
+ additionalParentToListen.put(semanticParent, views);
+ getDiagramEventBroker().addNotificationListener(semanticParent, this);
+ }
+ }
+
+ /**
+ * Removes this edit policy as listener for changes to the specified
+ * semanticParent
+ *
+ * @param semanticParent
+ * the semantic parent to stop listen
+ * @param childView
+ * the view that does not requires this additional listener
+ */
+ protected void removeAdditionalParentToListen(EObject semanticParent, View childView) {
+ // removes the view from the list of views that requires a listener for
+ // the semantic parent
+ if(additionalParentToListen.containsKey(semanticParent)) {
+ List<View> views = additionalParentToListen.get(semanticParent);
+ assert (views != null) : "list should not be null";
+ views.remove(childView);
+ if(views.isEmpty()) {
+ additionalParentToListen.remove(semanticParent);
+ // check this is not the parent semantic element of the host's
+ // semantic element
+ if(!semanticParent.equals(((View)getHost().getModel()).getElement())) {
+ getDiagramEventBroker().removeNotificationListener(semanticParent, this);
+ }
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void deactivate() {
+ // retrieve the view and the element associated to the host edit part
+ final View hostView = (View)getHost().getModel();
+
+ // removes all notification listeners for the additional parent to
+ // listen
+ for(EObject parent : additionalParentToListen.keySet()) {
+ getDiagramEventBroker().removeNotificationListener(parent, this);
+ }
+ additionalParentToListen.clear();
+ additionalParentToListen = null;
+
+ getDiagramEventBroker().removeNotificationListener(hostView, this);
+ getDiagramEventBroker().removeNotificationListener(hostSemanticElement, this);
+
+ // removes the reference to the semantic element
+ hostSemanticElement = null;
+
+ super.deactivate();
+ }
+
+ /**
+ * Deletes a list of views. The views will be deleted <tt>iff</tt> their
+ * semantic element has also been deleted.
+ *
+ * @param views
+ * an iterator on a list of views.
+ * @return <tt>true</tt> if the host editpart should be refreshed; either
+ * one one of the supplied views was deleted or has been reparented.
+ */
+ protected final boolean deleteViews(Iterator<View> views) {
+
+ final CompoundCommand cc = new CompoundCommand(DiagramUIMessages.DeleteCommand_Label);
+ while(views.hasNext()) {
+ View view = (View)views.next();
+ cc.add(getDeleteViewCommand(view));
+ }
+
+ boolean doDelete = !cc.isEmpty() && cc.canExecute();
+ if(doDelete) {
+ executeCommand(cc);
+ }
+ return doDelete;
+ }
+
+ /**
+ * Executes the supplied command inside an <code>unchecked action</code>
+ *
+ * @param cmd
+ * command that can be executed (i.e., cmd.canExecute() == true)
+ */
+ protected void executeCommand(final Command cmd) {
+ Map<String, Boolean> options = null;
+ EditPart ep = getHost();
+ boolean isActivating = true;
+ // use the viewer to determine if we are still initializing the diagram
+ // do not use the DiagramEditPart.isActivating since
+ // ConnectionEditPart's
+ // parent will not be a diagram edit part
+ EditPartViewer viewer = ep.getViewer();
+ if(viewer instanceof DiagramGraphicalViewer) {
+ isActivating = ((DiagramGraphicalViewer)viewer).isInitializing();
+ }
+
+ if(isActivating || !EditPartUtil.isWriteTransactionInProgress((IGraphicalEditPart)getHost(), false, false))
+ options = Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
+
+ AbstractEMFOperation operation = new AbstractEMFOperation(((IGraphicalEditPart)getHost()).getEditingDomain(), StringStatics.BLANK, options) {
+
+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ cmd.execute();
+
+ return Status.OK_STATUS;
+ }
+ };
+ try {
+ operation.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ log.error(e);
+ }
+ }
+
+ /**
+ * Retrieve the list of orphaned views among the specified list view
+ *
+ * @param viewChildrenIterator
+ * the iterator on the list of views to check
+ * @return the list of views that are orphaned
+ */
+ protected List<View> findOrphanView(Iterator<? extends EObject> viewChildrenIterator) {
+ ArrayList<View> orphanView = new ArrayList<View>();
+ while(viewChildrenIterator.hasNext()) {
+ EObject view = viewChildrenIterator.next();
+ if(view instanceof View) {
+ if(isOrphaned((View)view)) {
+ orphanView.add((View)view);
+ }
+ }
+ }
+ return orphanView;
+ }
+
+ /**
+ * Returns a {@link Command} to delete the supplied {@link View}.
+ *
+ * @param view
+ * view to delete
+ * @return the command that destroys the specified view
+ */
+ protected Command getDeleteViewCommand(View view) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ return new ICommandProxy(new DeleteCommand(editingDomain, view));
+ }
+
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ protected DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ return null;
+ }
+
+ /**
+ * Inits the list of children that should never be attached to a semantic
+ * element, for example comment links.
+ *
+ * @param notOrphanVisualID
+ * the list of visual id of views that should never be attached
+ * to a semantic element
+ */
+ public void init(int[] notOrphanVisualID) {
+ for(int i = 0; i < notOrphanVisualID.length; i++) {
+ notOrphanList.add(new Integer(notOrphanVisualID[i]));
+ }
+ }
+
+ /**
+ * Tests if the view is orphaned, i.e. it is still attached to a semantic
+ * element.
+ * <P>
+ * It checks also that it is not a view that is never attached to a semantic element (For example, comment links do not have semantic elements
+ * attached...)
+ * <P/>
+ *
+ * @param view
+ * the view to check
+ * @return <code>true</code> if the view is not attached to a semantic
+ * element. <code>false</code> if it is still attached to a semantic
+ * element or if it should never be attached to a semantic element
+ */
+ protected boolean isOrphaned(View view) {
+ String semanticHint = view.getType();
+ if(isInteger(semanticHint) && notOrphanList.contains(new Integer(semanticHint))) {
+ return false;
+ }
+ return !view.isSetElement();
+ }
+
+ /**
+ * Checks if the string is an integer.
+ *
+ * @param s
+ * the specified string
+ *
+ * @return true, if is integer
+ */
+ public static boolean isInteger(String s) {
+ boolean result = false;
+ Matcher matcher = digit.matcher(s);
+ if(matcher != null) {
+ result = matcher.matches();
+ }
+ return result;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void notifyChanged(Notification notification) {
+ // something has change. What ? :)
+ // check who is responsible of notification. If this is host edit part
+ // related semantic element, act as standard
+ Object notifier = notification.getNotifier();
+ // View hostView = (View)getHost().getModel();
+ if(notifier.equals(hostSemanticElement)) {
+ if(Notification.REMOVE == notification.getEventType() || Notification.SET == notification.getEventType()) {
+ refreshViews();
+ }
+ } else {
+ // this is perhaps one of the scoped semantic parent
+ if(notifier instanceof EObject) {
+ if(!(notifier instanceof View)) {
+ if(Notification.REMOVE == notification.getEventType()) {
+
+ // 2 cases... remove or simple move ?
+ // this can be checked with the view, if it is now
+ // orphaned or not
+ // if it is orphaned, element has to be destroyed,
+ // remove from parent listener, etc.
+ // if not, this was just a move => change listener using
+ // new parent
+ // checks also for whole hierarchy...
+ EObject parentNotifier = (EObject)notifier;
+
+ if(additionalParentToListen.containsKey(parentNotifier)) {
+ // this should be one of the elements that are
+ // inside the
+ List<View> views = additionalParentToListen.get(parentNotifier);
+
+ List<View> orphaned = findOrphanView(views.iterator());
+ //
+ // delete all the remaining views
+ deleteViews(orphaned.iterator());
+
+ removeListeners(orphaned);
+ }
+ }
+ } else { // Notifier is a View
+ // REMOVE or ADD are interesting events:
+ // if remove, remove the list (perhaps) from the views
+ // contributing to the delete action
+ // if add, checks it does not need to be watched
+ if(Notification.REMOVE == notification.getEventType()) {
+ if(notification.getNewValue() instanceof View) {
+ View oldView = (View)notification.getOldValue();
+ removeListenerForView(oldView);
+ }
+
+ } else if(Notification.ADD == notification.getEventType()) {
+ // check the parent of the associated semantic element
+ if(notification.getNewValue() instanceof View) {
+ View newView = (View)notification.getNewValue();
+ addListenerForView(newView);
+ }
+ }
+
+ }
+ }
+ }
+ }
+
+ /**
+ * Adds a listener for the specified view, if necessary.
+ * <P>
+ * It has to be added if the parent of the semantic element attached to the view is not the host semantic element.
+ * </P>
+ *
+ * @param newView
+ * the new view to check
+ */
+ protected void addListenerForView(View newView) {
+ // get semantic element attached to the host edit part
+ View hostView = (View)getHost().getModel();
+
+ // get the parent of the new view. if it is the same as current parent,
+ // does not add additional listeners
+ if(newView.getElement() != null) {
+ EObject semanticParent = newView.getElement().eContainer();
+ if(semanticParent != null) {
+ if(!semanticParent.equals(hostSemanticElement)) {
+ // add each parent of the semantic parent to the list of
+ // additional listeners
+ for(EObject parent : getElementHierarchy(semanticParent)) {
+ addAdditionalParentToListen(parent, newView);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Removes a listener for the specified view, if it exists.
+ *
+ * @param oldView
+ * the old view to check
+ */
+ protected void removeListenerForView(View oldView) {
+ // create a temp list of elements to delete (iterator concurrent
+ // modification..)
+ Map<EObject, List<View>> parentsToDelete = new HashMap<EObject, List<View>>();
+
+ for(EObject parent : additionalParentToListen.keySet()) {
+ List<View> parentViews = additionalParentToListen.get(parent);
+ if(parentViews.contains(oldView)) {
+
+ List<View> views = parentsToDelete.get(parent);
+ if(views == null) {
+ views = new ArrayList<View>();
+ }
+ views.add(oldView);
+ parentsToDelete.put(parent, views);
+ }
+ }
+ }
+
+ /**
+ * Updates the listeners for the specified semantic parent
+ */
+ protected void removeListeners(List<View> impactedViews) {
+ // create a temp list of elements to delete (iterator concurrent
+ // modification..)
+ Map<EObject, List<View>> parentsToDelete = new HashMap<EObject, List<View>>();
+
+ // collect the elements to delete
+ for(View view : impactedViews) {
+ for(EObject parent : additionalParentToListen.keySet()) {
+ List<View> parentViews = additionalParentToListen.get(parent);
+ if(parentViews.contains(view)) {
+
+ List<View> views = parentsToDelete.get(parent);
+ if(views == null) {
+ views = new ArrayList<View>();
+ }
+ views.add(view);
+ parentsToDelete.put(parent, views);
+ }
+ }
+ }
+
+ // do the job
+ for(EObject object : parentsToDelete.keySet()) {
+ List<View> views = parentsToDelete.get(object);
+ for(View view : views) {
+ removeAdditionalParentToListen(object, view);
+ }
+ }
+ }
+
+ /**
+ * Returns the list of parent for the specified element
+ *
+ * @return the list of parent for the specified element, with the element
+ * itself
+ */
+ public List<EObject> getElementHierarchy(EObject eObject) {
+ List<EObject> list = new ArrayList<EObject>();
+ EObject currentObject = eObject;
+ while(currentObject != null) {
+ list.add(currentObject);
+ currentObject = currentObject.eContainer();
+ }
+ return list;
+ }
+
+ /**
+ * Refresh the child views of the host edit part
+ *
+ * @return an empty list?
+ */
+ protected List refreshViews() {
+ // current connection views
+ Iterator<EObject> viewChildrenIterator = ((EObject)getHost().getModel()).eContents().iterator();
+
+ List<View> orphaned = findOrphanView(viewChildrenIterator);
+ //
+ // delete all the remaining views
+ deleteViews(orphaned.iterator());
+
+ // update listeners
+ removeListeners(orphaned);
+
+ // create a view for each remaining semantic element.
+ // FIXME why returning an empty list ?
+ List viewDescriptors = new ArrayList();
+
+ return viewDescriptors;
+ }
+
+ /**
+ * launch a weak synchronization. It could be useful in order to clean a
+ * diagram by an external tool.
+ */
+ public void forceRefresh() {
+ refreshViews();
+ }
+
+ /**
+ * Debug method. Displays the additionalParentToListen map correclty
+ *
+ * @param additionalParentToListen
+ * the map to display
+ * @return the pretty - print string
+ */
+ private String prettyPrint(Map<EObject, List<View>> additionalParentToListen) {
+ StringBuffer buffer = new StringBuffer();
+ if(additionalParentToListen == null) {
+ return "Empty listener for " + getHost();
+ }
+ buffer.append("addtionnal listeners for ");
+ buffer.append(getHost());
+ buffer.append("\n");
+ for(EObject object : additionalParentToListen.keySet()) {
+ buffer.append("\n");
+ buffer.append(object);
+ buffer.append("(");
+ buffer.append(additionalParentToListen.get(object).size());
+ buffer.append("):\n");
+ for(View view : additionalParentToListen.get(object)) {
+ buffer.append("- ");
+ buffer.append(view);
+ buffer.append("\n");
+ }
+ buffer.append("\n");
+ }
+
+ return buffer.toString();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/PapyrusCreationEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/PapyrusCreationEditPolicy.java
index 09c25d1cd34..9c70a604e78 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/PapyrusCreationEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/PapyrusCreationEditPolicy.java
@@ -1,105 +1,105 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RefreshConnectionsRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Specific creation edit policy for Papyrus. It checks that the view creation
- * can be done before returning the result of the getCommand
- */
-public class PapyrusCreationEditPolicy extends CreationEditPolicy {
-
- /**
- * Method getCreateElementAndViewCommand.
- *
- * @param request
- * @return Command Which creates the sematnic and the view command for the
- * given CreateViewAndElementRequest
- */
- protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
- // get the element descriptor
- CreateElementRequestAdapter requestAdapter = request.getViewAndElementDescriptor().getCreateElementRequestAdapter();
-
- // get the semantic request
- CreateElementRequest createElementRequest = (CreateElementRequest)requestAdapter.getAdapter(CreateElementRequest.class);
-
- if(createElementRequest.getContainer() == null) {
- // complete the semantic request by filling in the host's semantic
- // element as the context
- View view = (View)getHost().getModel();
- EObject hostElement = ViewUtil.resolveSemanticElement(view);
-
- if(hostElement == null && view.getElement() == null) {
- hostElement = view;
- }
-
- // Returns null if host is unresolvable so that trying to create a
- // new element in an unresolved shape will not be allowed.
- if(hostElement == null) {
- return null;
- }
- createElementRequest.setContainer(hostElement);
- }
-
- // get the create element command based on the elementdescriptor's
- // request
- Command createElementCommand = getHost().getCommand(new EditCommandRequestWrapper((CreateElementRequest)requestAdapter.getAdapter(CreateElementRequest.class), request.getExtendedData()));
-
- if(createElementCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- if(!createElementCommand.canExecute()) {
- return createElementCommand;
- }
- // create the semantic create wrapper command
- SemanticCreateCommand semanticCommand = new SemanticCreateCommand(requestAdapter, createElementCommand);
- Command viewCommand = getCreateCommand(request);
-
- if(viewCommand == null) {
- return UnexecutableCommand.INSTANCE;
- }
- if(!viewCommand.canExecute()) {
- return UnexecutableCommand.INSTANCE;
- }
-
- Command refreshConnectionCommand = getHost().getCommand(new RefreshConnectionsRequest(((List)request.getNewObject())));
-
- // form the compound command and return
- CompositeCommand cc = new CompositeCommand(semanticCommand.getLabel());
- cc.compose(semanticCommand);
- cc.compose(new CommandProxy(viewCommand));
- if(refreshConnectionCommand != null) {
- cc.compose(new CommandProxy(refreshConnectionCommand));
- }
-
- return new ICommandProxy(cc);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.SemanticCreateCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.EditCommandRequestWrapper;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RefreshConnectionsRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Specific creation edit policy for Papyrus. It checks that the view creation
+ * can be done before returning the result of the getCommand
+ */
+public class PapyrusCreationEditPolicy extends CreationEditPolicy {
+
+ /**
+ * Method getCreateElementAndViewCommand.
+ *
+ * @param request
+ * @return Command Which creates the sematnic and the view command for the
+ * given CreateViewAndElementRequest
+ */
+ protected Command getCreateElementAndViewCommand(CreateViewAndElementRequest request) {
+ // get the element descriptor
+ CreateElementRequestAdapter requestAdapter = request.getViewAndElementDescriptor().getCreateElementRequestAdapter();
+
+ // get the semantic request
+ CreateElementRequest createElementRequest = (CreateElementRequest)requestAdapter.getAdapter(CreateElementRequest.class);
+
+ if(createElementRequest.getContainer() == null) {
+ // complete the semantic request by filling in the host's semantic
+ // element as the context
+ View view = (View)getHost().getModel();
+ EObject hostElement = ViewUtil.resolveSemanticElement(view);
+
+ if(hostElement == null && view.getElement() == null) {
+ hostElement = view;
+ }
+
+ // Returns null if host is unresolvable so that trying to create a
+ // new element in an unresolved shape will not be allowed.
+ if(hostElement == null) {
+ return null;
+ }
+ createElementRequest.setContainer(hostElement);
+ }
+
+ // get the create element command based on the elementdescriptor's
+ // request
+ Command createElementCommand = getHost().getCommand(new EditCommandRequestWrapper((CreateElementRequest)requestAdapter.getAdapter(CreateElementRequest.class), request.getExtendedData()));
+
+ if(createElementCommand == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if(!createElementCommand.canExecute()) {
+ return createElementCommand;
+ }
+ // create the semantic create wrapper command
+ SemanticCreateCommand semanticCommand = new SemanticCreateCommand(requestAdapter, createElementCommand);
+ Command viewCommand = getCreateCommand(request);
+
+ if(viewCommand == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ if(!viewCommand.canExecute()) {
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ Command refreshConnectionCommand = getHost().getCommand(new RefreshConnectionsRequest(((List)request.getNewObject())));
+
+ // form the compound command and return
+ CompositeCommand cc = new CompositeCommand(semanticCommand.getLabel());
+ cc.compose(semanticCommand);
+ cc.compose(new CommandProxy(viewCommand));
+ if(refreshConnectionCommand != null) {
+ cc.compose(new CommandProxy(refreshConnectionCommand));
+ }
+
+ return new ICommandProxy(cc);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java
index 66d2111966b..260b242a978 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayEditPolicy.java
@@ -1,223 +1,223 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-import org.eclipse.papyrus.infra.emf.appearance.helper.QualifiedNameHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * this edit policy has in charge to display the qualified name of an element.
- * To display it, the editpart must be a {@link IPapyrusEditPart} and the
- * associated figure has to be a {@link NodeNamedElementFigure}
- */
-public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
-
- /** key for this edit policy */
- public final static String QUALIFIED_NAME_POLICY = "Qualified_name_editpolicy";
-
- /** host semantic element */
- protected NamedElement hostSemanticNamedElement;
-
- /**
- * The parent listeners list
- */
- protected List<Object> parentListeners;
-
- /**
- * Creates a new QualifiedNameDisplayEditPolicy
- */
- public QualifiedNameDisplayEditPolicy() {
- super();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = (View)getHost().getModel();
- if(view == null) {
- return;
- }
-
- hostSemanticNamedElement = getNamedElement();
- if(hostSemanticNamedElement != null) {
- // adds a listener on the view and the element controlled by the
- // editpart
- getDiagramEventBroker().addNotificationListener(view, this);
-
- if(hostSemanticNamedElement == null) {
- return;
- }
- getDiagramEventBroker().addNotificationListener(hostSemanticNamedElement, this);
-
- refreshQualifiedNameDisplay();
- }
- addParentListeners();
- }
-
- /**
- * refresh the qualified name
- */
- protected void refreshQualifiedNameDisplay() {
- if(getHost() instanceof IPapyrusEditPart) {
- if(((IPapyrusEditPart)getHost()).getPrimaryShape() instanceof NodeNamedElementFigure) {
- NodeNamedElementFigure nodeNamedElementFigure = (NodeNamedElementFigure)((IPapyrusEditPart)getHost()).getPrimaryShape();
- refreshQualifiedNameDepth(nodeNamedElementFigure);
- refreshQualifiedName(nodeNamedElementFigure);
- }
- }
-
- }
-
- /**
- * set the qualified name to display
- *
- * @param nodeNamedElementFigure
- * the associated figure to the editpart
- */
- protected void refreshQualifiedName(IPapyrusNodeNamedElementFigure nodeNamedElementFigure) {
- nodeNamedElementFigure.setQualifiedName(hostSemanticNamedElement.getQualifiedName());
- }
-
- /**
- * refresh the editpart with a depth for the qualified name
- *
- * @param nodeNamedElementFigure
- * the associated figure to the editpart
- */
- protected void refreshQualifiedNameDepth(NodeNamedElementFigure nodeNamedElementFigure) {
- nodeNamedElementFigure.setDepth(QualifiedNameHelper.getQualifiedNameDepth((View)getHost().getModel()));
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void deactivate() {
- // retrieve the view and the element managed by the edit part
- View view = (View)getHost().getModel();
- if(view == null) {
- return;
- }
- if(hostSemanticNamedElement != null) {
- // remove notification on element and view
- getDiagramEventBroker().removeNotificationListener(view, this);
- getDiagramEventBroker().removeNotificationListener(hostSemanticNamedElement, this);
- }
-
- // removes the reference to the semantic element
- hostSemanticNamedElement = null;
- removeParentListeners();
- }
-
- /**
- *
- * @return the associated named element to the editpart. it can return null
- * if this not a named element
- */
- protected NamedElement getNamedElement() {
- View view = (View)getHost().getModel();
- if(view == null) {
- return null;
- }
- if(view.getElement() != null && view.getElement() instanceof NamedElement) {
- return (NamedElement)view.getElement();
- }
- return null;
- }
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void notifyChanged(Notification notification) {
- if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(notification.getFeatureID(NamedElement.class)) || notification.getNotifier() instanceof EAnnotation) {
- refreshQualifiedNameDisplay();
- } else if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(notification.getFeature())) {
- if(parentListeners.contains(notification.getNotifier()) || getNamedElement().equals(notification.getNotifier())) {
- refreshQualifiedNameDisplay();
- }
- } else if(notification.getFeature() instanceof EReference) {
- EReference ref = (EReference)notification.getFeature();
- if(ref.isContainment()) {
- if(parentListeners.contains(notification.getNotifier()))
- removeParentListeners();
- addParentListeners();
- refreshQualifiedNameDisplay();
- }
- }
- }
-
- /**
- * Add listeners for all parents
- */
- private void addParentListeners() {
- DiagramEventBroker diagramEventBroker = getDiagramEventBroker();
- if(diagramEventBroker != null) {
- if(parentListeners == null) {
- parentListeners = new ArrayList<Object>();
- }
- if(getNamedElement() != null) {
- EObject parentEOBject = getNamedElement().eContainer();
- while(parentEOBject != null) {
- diagramEventBroker.addNotificationListener(parentEOBject, this);
- parentListeners.add(parentEOBject);
- parentEOBject = parentEOBject.eContainer();
- }
- }
- }
- }
-
- /**
- * Remove all parents listeners
- */
- public void removeParentListeners() {
- for(Object listener : parentListeners) {
- getDiagramEventBroker().removeNotificationListener((EObject)listener, this);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.editpolicies.GraphicalEditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
+import org.eclipse.papyrus.infra.emf.appearance.helper.QualifiedNameHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.NodeNamedElementFigure;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * this edit policy has in charge to display the qualified name of an element.
+ * To display it, the editpart must be a {@link IPapyrusEditPart} and the
+ * associated figure has to be a {@link NodeNamedElementFigure}
+ */
+public class QualifiedNameDisplayEditPolicy extends GraphicalEditPolicy implements NotificationListener, IPapyrusListener {
+
+ /** key for this edit policy */
+ public final static String QUALIFIED_NAME_POLICY = "Qualified_name_editpolicy";
+
+ /** host semantic element */
+ protected NamedElement hostSemanticNamedElement;
+
+ /**
+ * The parent listeners list
+ */
+ protected List<Object> parentListeners;
+
+ /**
+ * Creates a new QualifiedNameDisplayEditPolicy
+ */
+ public QualifiedNameDisplayEditPolicy() {
+ super();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void activate() {
+ // retrieve the view and the element managed by the edit part
+ View view = (View)getHost().getModel();
+ if(view == null) {
+ return;
+ }
+
+ hostSemanticNamedElement = getNamedElement();
+ if(hostSemanticNamedElement != null) {
+ // adds a listener on the view and the element controlled by the
+ // editpart
+ getDiagramEventBroker().addNotificationListener(view, this);
+
+ if(hostSemanticNamedElement == null) {
+ return;
+ }
+ getDiagramEventBroker().addNotificationListener(hostSemanticNamedElement, this);
+
+ refreshQualifiedNameDisplay();
+ }
+ addParentListeners();
+ }
+
+ /**
+ * refresh the qualified name
+ */
+ protected void refreshQualifiedNameDisplay() {
+ if(getHost() instanceof IPapyrusEditPart) {
+ if(((IPapyrusEditPart)getHost()).getPrimaryShape() instanceof NodeNamedElementFigure) {
+ NodeNamedElementFigure nodeNamedElementFigure = (NodeNamedElementFigure)((IPapyrusEditPart)getHost()).getPrimaryShape();
+ refreshQualifiedNameDepth(nodeNamedElementFigure);
+ refreshQualifiedName(nodeNamedElementFigure);
+ }
+ }
+
+ }
+
+ /**
+ * set the qualified name to display
+ *
+ * @param nodeNamedElementFigure
+ * the associated figure to the editpart
+ */
+ protected void refreshQualifiedName(IPapyrusNodeNamedElementFigure nodeNamedElementFigure) {
+ nodeNamedElementFigure.setQualifiedName(hostSemanticNamedElement.getQualifiedName());
+ }
+
+ /**
+ * refresh the editpart with a depth for the qualified name
+ *
+ * @param nodeNamedElementFigure
+ * the associated figure to the editpart
+ */
+ protected void refreshQualifiedNameDepth(NodeNamedElementFigure nodeNamedElementFigure) {
+ nodeNamedElementFigure.setDepth(QualifiedNameHelper.getQualifiedNameDepth((View)getHost().getModel()));
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void deactivate() {
+ // retrieve the view and the element managed by the edit part
+ View view = (View)getHost().getModel();
+ if(view == null) {
+ return;
+ }
+ if(hostSemanticNamedElement != null) {
+ // remove notification on element and view
+ getDiagramEventBroker().removeNotificationListener(view, this);
+ getDiagramEventBroker().removeNotificationListener(hostSemanticNamedElement, this);
+ }
+
+ // removes the reference to the semantic element
+ hostSemanticNamedElement = null;
+ removeParentListeners();
+ }
+
+ /**
+ *
+ * @return the associated named element to the editpart. it can return null
+ * if this not a named element
+ */
+ protected NamedElement getNamedElement() {
+ View view = (View)getHost().getModel();
+ if(view == null) {
+ return null;
+ }
+ if(view.getElement() != null && view.getElement() instanceof NamedElement) {
+ return (NamedElement)view.getElement();
+ }
+ return null;
+ }
+
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ protected DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void notifyChanged(Notification notification) {
+ if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(notification.getFeatureID(NamedElement.class)) || notification.getNotifier() instanceof EAnnotation) {
+ refreshQualifiedNameDisplay();
+ } else if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(notification.getFeature())) {
+ if(parentListeners.contains(notification.getNotifier()) || getNamedElement().equals(notification.getNotifier())) {
+ refreshQualifiedNameDisplay();
+ }
+ } else if(notification.getFeature() instanceof EReference) {
+ EReference ref = (EReference)notification.getFeature();
+ if(ref.isContainment()) {
+ if(parentListeners.contains(notification.getNotifier()))
+ removeParentListeners();
+ addParentListeners();
+ refreshQualifiedNameDisplay();
+ }
+ }
+ }
+
+ /**
+ * Add listeners for all parents
+ */
+ private void addParentListeners() {
+ DiagramEventBroker diagramEventBroker = getDiagramEventBroker();
+ if(diagramEventBroker != null) {
+ if(parentListeners == null) {
+ parentListeners = new ArrayList<Object>();
+ }
+ if(getNamedElement() != null) {
+ EObject parentEOBject = getNamedElement().eContainer();
+ while(parentEOBject != null) {
+ diagramEventBroker.addNotificationListener(parentEOBject, this);
+ parentListeners.add(parentEOBject);
+ parentEOBject = parentEOBject.eContainer();
+ }
+ }
+ }
+ }
+
+ /**
+ * Remove all parents listeners
+ */
+ public void removeParentListeners() {
+ for(Object listener : parentListeners) {
+ getDiagramEventBroker().removeNotificationListener((EObject)listener, this);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayExternalNodeEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayExternalNodeEditPolicy.java
index ef792aeecaf..f98a6dd8da6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayExternalNodeEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/QualifiedNameDisplayExternalNodeEditPolicy.java
@@ -1,153 +1,153 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.ArrayList;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.emf.appearance.helper.QualifiedNameHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure;
-
-/**
- * this edit policy has in charge to display the qualified name of an elementin a external label.
- * To display it, the editpart must be a {@link IPapyrusEditPart} and the
- * associated figure has to be a {@link NodeNamedElementFigure}
- */
-public class QualifiedNameDisplayExternalNodeEditPolicy extends QualifiedNameDisplayEditPolicy {
-
-
-
- /**
- * Creates a new QualifiedNameDisplayEditPolicy
- */
- public QualifiedNameDisplayExternalNodeEditPolicy() {
- super();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void activate() {
- // retrieve the view and the element managed by the edit part
- View view = (View)getHost().getParent().getModel();
- if(view == null) {
- return;
- }
-
- hostSemanticNamedElement = getNamedElement();
-
- if(hostSemanticNamedElement != null) {
- // adds a listener on the view and the element controlled by the
- // editpart
- getDiagramEventBroker().addNotificationListener(view, this);
-
- if(hostSemanticNamedElement == null) {
- return;
- }
- getDiagramEventBroker().addNotificationListener(hostSemanticNamedElement, this);
-
- refreshQualifiedNameDisplay();
- }
- addParentListeners();
- }
-
- /**
- * refresh the qualified name
- */
- protected void refreshQualifiedNameDisplay() {
-
- if(getHost() instanceof IPapyrusEditPart) {
- if(((IPapyrusEditPart)getHost()).getPrimaryShape() instanceof IPapyrusNodeNamedElementFigure) {
- IPapyrusNodeNamedElementFigure nodeNamedElementFigure = (IPapyrusNodeNamedElementFigure)((IPapyrusEditPart)getHost()).getPrimaryShape();
- refreshQualifiedNameDepth(nodeNamedElementFigure);
- refreshQualifiedName(nodeNamedElementFigure);
- }
- }
-
- }
-
-
- /**
- * refresh the editpart with a depth for the qualified name
- *
- * @param nodeNamedElementFigure
- * the associated figure to the editpart
- */
- protected void refreshQualifiedNameDepth(IPapyrusNodeNamedElementFigure nodeNamedElementFigure) {
- nodeNamedElementFigure.setDepth(QualifiedNameHelper.getQualifiedNameDepth((View)(getHost().getParent()).getModel()));
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void deactivate() {
- // retrieve the view and the element managed by the edit part
- View view = (View)(getHost().getParent()).getModel();
- if(view == null) {
- return;
- }
- if(hostSemanticNamedElement != null) {
- // remove notification on element and view
- getDiagramEventBroker().removeNotificationListener(view, this);
- getDiagramEventBroker().removeNotificationListener(hostSemanticNamedElement, this);
- }
-
- // removes the reference to the semantic element
- hostSemanticNamedElement = null;
- removeParentListeners();
- }
-
-
- /**
- * Gets the diagram event broker from the editing domain.
- *
- * @return the diagram event broker
- */
- protected DiagramEventBroker getDiagramEventBroker() {
- TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
- if(theEditingDomain != null) {
- return DiagramEventBroker.getInstance(theEditingDomain);
- }
- return null;
- }
-
-
- /**
- * Add listeners for all parents
- */
- private void addParentListeners() {
- DiagramEventBroker diagramEventBroker = getDiagramEventBroker();
- if(diagramEventBroker != null) {
- if(parentListeners == null) {
- parentListeners = new ArrayList<Object>();
- }
- if(getNamedElement() != null) {
- EObject parentEOBject = getNamedElement().eContainer();
- while(parentEOBject != null) {
- diagramEventBroker.addNotificationListener(parentEOBject, this);
- parentListeners.add(parentEOBject);
- parentEOBject = parentEOBject.eContainer();
- }
- }
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.ArrayList;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.appearance.helper.QualifiedNameHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpart.IPapyrusEditPart;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure;
+
+/**
+ * this edit policy has in charge to display the qualified name of an elementin a external label.
+ * To display it, the editpart must be a {@link IPapyrusEditPart} and the
+ * associated figure has to be a {@link NodeNamedElementFigure}
+ */
+public class QualifiedNameDisplayExternalNodeEditPolicy extends QualifiedNameDisplayEditPolicy {
+
+
+
+ /**
+ * Creates a new QualifiedNameDisplayEditPolicy
+ */
+ public QualifiedNameDisplayExternalNodeEditPolicy() {
+ super();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void activate() {
+ // retrieve the view and the element managed by the edit part
+ View view = (View)getHost().getParent().getModel();
+ if(view == null) {
+ return;
+ }
+
+ hostSemanticNamedElement = getNamedElement();
+
+ if(hostSemanticNamedElement != null) {
+ // adds a listener on the view and the element controlled by the
+ // editpart
+ getDiagramEventBroker().addNotificationListener(view, this);
+
+ if(hostSemanticNamedElement == null) {
+ return;
+ }
+ getDiagramEventBroker().addNotificationListener(hostSemanticNamedElement, this);
+
+ refreshQualifiedNameDisplay();
+ }
+ addParentListeners();
+ }
+
+ /**
+ * refresh the qualified name
+ */
+ protected void refreshQualifiedNameDisplay() {
+
+ if(getHost() instanceof IPapyrusEditPart) {
+ if(((IPapyrusEditPart)getHost()).getPrimaryShape() instanceof IPapyrusNodeNamedElementFigure) {
+ IPapyrusNodeNamedElementFigure nodeNamedElementFigure = (IPapyrusNodeNamedElementFigure)((IPapyrusEditPart)getHost()).getPrimaryShape();
+ refreshQualifiedNameDepth(nodeNamedElementFigure);
+ refreshQualifiedName(nodeNamedElementFigure);
+ }
+ }
+
+ }
+
+
+ /**
+ * refresh the editpart with a depth for the qualified name
+ *
+ * @param nodeNamedElementFigure
+ * the associated figure to the editpart
+ */
+ protected void refreshQualifiedNameDepth(IPapyrusNodeNamedElementFigure nodeNamedElementFigure) {
+ nodeNamedElementFigure.setDepth(QualifiedNameHelper.getQualifiedNameDepth((View)(getHost().getParent()).getModel()));
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void deactivate() {
+ // retrieve the view and the element managed by the edit part
+ View view = (View)(getHost().getParent()).getModel();
+ if(view == null) {
+ return;
+ }
+ if(hostSemanticNamedElement != null) {
+ // remove notification on element and view
+ getDiagramEventBroker().removeNotificationListener(view, this);
+ getDiagramEventBroker().removeNotificationListener(hostSemanticNamedElement, this);
+ }
+
+ // removes the reference to the semantic element
+ hostSemanticNamedElement = null;
+ removeParentListeners();
+ }
+
+
+ /**
+ * Gets the diagram event broker from the editing domain.
+ *
+ * @return the diagram event broker
+ */
+ protected DiagramEventBroker getDiagramEventBroker() {
+ TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart)getHost()).getEditingDomain();
+ if(theEditingDomain != null) {
+ return DiagramEventBroker.getInstance(theEditingDomain);
+ }
+ return null;
+ }
+
+
+ /**
+ * Add listeners for all parents
+ */
+ private void addParentListeners() {
+ DiagramEventBroker diagramEventBroker = getDiagramEventBroker();
+ if(diagramEventBroker != null) {
+ if(parentListeners == null) {
+ parentListeners = new ArrayList<Object>();
+ }
+ if(getNamedElement() != null) {
+ EObject parentEOBject = getNamedElement().eContainer();
+ while(parentEOBject != null) {
+ diagramEventBroker.addNotificationListener(parentEOBject, this);
+ parentListeners.add(parentEOBject);
+ parentEOBject = parentEOBject.eContainer();
+ }
+ }
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutDiagramEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutDiagramEditPolicy.java
index 6c0958fc2a0..520627a0246 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutDiagramEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShortCutDiagramEditPolicy.java
@@ -1,92 +1,92 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.OpenEditPolicy;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
-
-/**
- * This class is used to open a new diagram when the double click is detected.
- * It is dependent of papyrus environment
- */
-public class ShortCutDiagramEditPolicy extends OpenEditPolicy {
-
- /**
- * The Class OpenDiagramCommand.
- */
- private static class OpenDiagramCommand extends AbstractTransactionalCommand {
-
- /** The diagram to open. */
- private Diagram diagramToOpen = null;
-
- /**
- * Instantiates a new open diagram command.
- *
- * @param domain
- * the domain
- * @param diagram
- * the diagram
- */
- public OpenDiagramCommand(TransactionalEditingDomain domain, Diagram diagram) {
- super(domain, "open diagram", null);
- diagramToOpen = diagram;
- }
-
- /**
- * {@inheritedDoc}
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- try {
- IPageManager pageMngr = ServiceUtilsForEObject.getInstance().getIPageManager(diagramToOpen);
- if(pageMngr.isOpen(diagramToOpen)) {
- pageMngr.selectPage(diagramToOpen);
- } else {
- pageMngr.openPage(diagramToOpen);
- }
- return CommandResult.newOKCommandResult();
- } catch (Exception e) {
- throw new ExecutionException("Can't open diagram", e);
- }
- }
- }
-
- /**
- * {@inheritedDoc}
- */
- @Override
- protected Command getOpenCommand(Request request) {
- if(((GraphicalEditPart)getHost()).getNotationView().getElement() instanceof Diagram && ((GraphicalEditPart)getHost()).getNotationView().getElement().eResource() != null) {
- Diagram diagram = (Diagram)((GraphicalEditPart)getHost()).getNotationView().getElement();
- OpenDiagramCommand openDiagramCommand = new OpenDiagramCommand(((GraphicalEditPart)getHost()).getEditingDomain(), diagram);
- return new ICommandProxy(openDiagramCommand);
- } else {
- return UnexecutableCommand.INSTANCE;
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.OpenEditPolicy;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+
+/**
+ * This class is used to open a new diagram when the double click is detected.
+ * It is dependent of papyrus environment
+ */
+public class ShortCutDiagramEditPolicy extends OpenEditPolicy {
+
+ /**
+ * The Class OpenDiagramCommand.
+ */
+ private static class OpenDiagramCommand extends AbstractTransactionalCommand {
+
+ /** The diagram to open. */
+ private Diagram diagramToOpen = null;
+
+ /**
+ * Instantiates a new open diagram command.
+ *
+ * @param domain
+ * the domain
+ * @param diagram
+ * the diagram
+ */
+ public OpenDiagramCommand(TransactionalEditingDomain domain, Diagram diagram) {
+ super(domain, "open diagram", null);
+ diagramToOpen = diagram;
+ }
+
+ /**
+ * {@inheritedDoc}
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ try {
+ IPageManager pageMngr = ServiceUtilsForEObject.getInstance().getIPageManager(diagramToOpen);
+ if(pageMngr.isOpen(diagramToOpen)) {
+ pageMngr.selectPage(diagramToOpen);
+ } else {
+ pageMngr.openPage(diagramToOpen);
+ }
+ return CommandResult.newOKCommandResult();
+ } catch (Exception e) {
+ throw new ExecutionException("Can't open diagram", e);
+ }
+ }
+ }
+
+ /**
+ * {@inheritedDoc}
+ */
+ @Override
+ protected Command getOpenCommand(Request request) {
+ if(((GraphicalEditPart)getHost()).getNotationView().getElement() instanceof Diagram && ((GraphicalEditPart)getHost()).getNotationView().getElement().eResource() != null) {
+ Diagram diagram = (Diagram)((GraphicalEditPart)getHost()).getNotationView().getElement();
+ OpenDiagramCommand openDiagramCommand = new OpenDiagramCommand(((GraphicalEditPart)getHost()).getEditingDomain(), diagram);
+ return new ICommandProxy(openDiagramCommand);
+ } else {
+ return UnexecutableCommand.INSTANCE;
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideClassifierContentsEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideClassifierContentsEditPolicy.java
index 8ce0b8d6f06..04c55d168e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideClassifierContentsEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideClassifierContentsEditPolicy.java
@@ -1,115 +1,115 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-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.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideElementsRequest;
-
-/**
- *
- * This EditPolicy provides the same commands that {@link PropertyHandlerEditPolicy}, more the command to Show/Hide a given
- * compartment
- *
- */
-public class ShowHideClassifierContentsEditPolicy extends AbstractEditPolicy {
-
- /** key for this EditPolicy */
- public static final String SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY = "Show/Hide Classifier Contents Policy"; //$NON-NLS-1$
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.PropertyHandlerEditPolicy#getCommand(org.eclipse.gef.Request)
- *
- * @param request
- * @return
- */
- @Override
- public Command getCommand(Request request) {
- if(request.getType().equals(ShowHideElementsRequest.SHOW_HIDE_ELEMENTS)) {
- ShowHideElementsRequest req = (ShowHideElementsRequest)request;
- if(req.getHidedEditPart() != null) {
- return getDestroyViewCommand(req.getHidedEditPart());
- } else if(req.getContainer() != null && req.getSemanticElement() != null) {
- return getCreateViewCommand(req.getContainer(), req.getSemanticElement(), req.getLocation());
- }
- }
- return null;
- }
-
- /**
- * Return the command to create the view
- *
- * @param container
- * the container for the element
- * @param semanticElement
- * @return The command to create the view
- */
- protected Command getCreateViewCommand(View container, EObject semanticElement, Point location) {
-
- // creation of the node
- ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(semanticElement), Node.class, null, ViewUtil.APPEND, true, ((IGraphicalEditPart)this.getHost()).getDiagramPreferencesHint());
- CompoundCommand compositeCmd = new CompoundCommand("Create View");//$NON-NLS-1$
- CreateCommand cmd = new CreateCommand(getEditingDomain(), viewDescriptor, container);
- if(cmd.canExecute()) {
- compositeCmd.add(new ICommandProxy(cmd));
- }
- // set the location
- if(location != null) {
- SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)cmd.getCommandResult().getReturnValue(), location); //$NON-NLS-1$
- if(setBoundsCommand.canExecute()) {
- compositeCmd.add(new ICommandProxy(setBoundsCommand));
- }
- }
-
- return compositeCmd;
- }
-
- /**
- * Return the command to the EditPart
- *
- * @param hidedEditPart
- * the EditPart to hide
- * @return the command to the EditPart
- */
- protected Command getDestroyViewCommand(EditPart hidedEditPart) {
- DeleteCommand cmd = new DeleteCommand(getEditingDomain(), (View)hidedEditPart.getModel());
- return new ICommandProxy(cmd);
- }
-
- /**
- * Return the current {@link EditingDomain}
- *
- * @return the current {@link EditingDomain}
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.editpolicies.AbstractEditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+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.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideElementsRequest;
+
+/**
+ *
+ * This EditPolicy provides the same commands that {@link PropertyHandlerEditPolicy}, more the command to Show/Hide a given
+ * compartment
+ *
+ */
+public class ShowHideClassifierContentsEditPolicy extends AbstractEditPolicy {
+
+ /** key for this EditPolicy */
+ public static final String SHOW_HIDE_CLASSIFIER_CONTENTS_POLICY = "Show/Hide Classifier Contents Policy"; //$NON-NLS-1$
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.PropertyHandlerEditPolicy#getCommand(org.eclipse.gef.Request)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if(request.getType().equals(ShowHideElementsRequest.SHOW_HIDE_ELEMENTS)) {
+ ShowHideElementsRequest req = (ShowHideElementsRequest)request;
+ if(req.getHidedEditPart() != null) {
+ return getDestroyViewCommand(req.getHidedEditPart());
+ } else if(req.getContainer() != null && req.getSemanticElement() != null) {
+ return getCreateViewCommand(req.getContainer(), req.getSemanticElement(), req.getLocation());
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return the command to create the view
+ *
+ * @param container
+ * the container for the element
+ * @param semanticElement
+ * @return The command to create the view
+ */
+ protected Command getCreateViewCommand(View container, EObject semanticElement, Point location) {
+
+ // creation of the node
+ ViewDescriptor viewDescriptor = new ViewDescriptor(new EObjectAdapter(semanticElement), Node.class, null, ViewUtil.APPEND, true, ((IGraphicalEditPart)this.getHost()).getDiagramPreferencesHint());
+ CompoundCommand compositeCmd = new CompoundCommand("Create View");//$NON-NLS-1$
+ CreateCommand cmd = new CreateCommand(getEditingDomain(), viewDescriptor, container);
+ if(cmd.canExecute()) {
+ compositeCmd.add(new ICommandProxy(cmd));
+ }
+ // set the location
+ if(location != null) {
+ SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "move", (IAdaptable)cmd.getCommandResult().getReturnValue(), location); //$NON-NLS-1$
+ if(setBoundsCommand.canExecute()) {
+ compositeCmd.add(new ICommandProxy(setBoundsCommand));
+ }
+ }
+
+ return compositeCmd;
+ }
+
+ /**
+ * Return the command to the EditPart
+ *
+ * @param hidedEditPart
+ * the EditPart to hide
+ * @return the command to the EditPart
+ */
+ protected Command getDestroyViewCommand(EditPart hidedEditPart) {
+ DeleteCommand cmd = new DeleteCommand(getEditingDomain(), (View)hidedEditPart.getModel());
+ return new ICommandProxy(cmd);
+ }
+
+ /**
+ * Return the current {@link EditingDomain}
+ *
+ * @return the current {@link EditingDomain}
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideCompartmentEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideCompartmentEditPolicy.java
index 83778767290..2c4d0327da0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideCompartmentEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideCompartmentEditPolicy.java
@@ -1,114 +1,114 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-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.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.TopGraphicEditPart;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideCompartmentRequest;
-
-/**
- *
- * This EditPolicy provides the same commands that {@link PropertyHandlerEditPolicy}, more the command to Show/Hide a given
- * compartment
- *
- */
-public class ShowHideCompartmentEditPolicy extends AbstractEditPolicy {
-
- /** key for this editpolicy */
- public static final String SHOW_HIDE_COMPARTMENT_POLICY = "Show/Hide Compartment Policy"; //$NON-NLS-1$
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.PropertyHandlerEditPolicy#getCommand(org.eclipse.gef.Request)
- *
- * @param request
- * @return
- */
- @Override
- public Command getCommand(Request request) {
- if(request.getType().equals(ShowHideCompartmentRequest.SHOW_HIDE_COMPARTMENT)) {
- ShowHideCompartmentRequest req = (ShowHideCompartmentRequest)request;
- return getShowHideCompartmentCommand(req);
- }
- return null;
- }
-
- /**
- * Return the command to show/hide a compartment.
- *
- * @param request
- * the request
- * @return the command to show/hide a compartment
- */
- protected Command getShowHideCompartmentCommand(ShowHideCompartmentRequest request) {
- if(getHost() instanceof TopGraphicEditPart) {
- List<?> views = getAllNotationViews((TopGraphicEditPart)getHost());
- for(Iterator<?> iter = views.iterator(); iter.hasNext();) {
- View childView = (View)iter.next();
- if(ViewUtil.isPropertySupported(childView, request.getPropertyID())) {
- if(childView.equals(request.getCompartment())) {
- return new ICommandProxy(new SetPropertyCommand(getEditingDomain(), new EObjectAdapter(childView), request.getPropertyID(), request.getPropertyName(), request.getValue()));
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Returns all the views associated to this editpart
- *
- * @param ep
- * a {@link TopGraphicEditPart}
- * @return all the views associated to this editpart
- */
- public List<?> getAllNotationViews(TopGraphicEditPart ep) {
- View view = ep.getNotationView();
- if(view != null) {
- List<View> views = new ArrayList<View>();
- Iterator<?> childrenIterator = view.getChildren().iterator();
- while(childrenIterator.hasNext()) {
- View child = (View)childrenIterator.next();
- if(child instanceof Node) {
- views.add(child);
- }
- }
- return views;
- }
- return Collections.EMPTY_LIST;
- }
-
- /**
- * Return the current {@link EditingDomain}
- *
- * @return the current {@link EditingDomain}
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return ((IGraphicalEditPart)getHost()).getEditingDomain();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.AbstractEditPolicy;
+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.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.TopGraphicEditPart;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideCompartmentRequest;
+
+/**
+ *
+ * This EditPolicy provides the same commands that {@link PropertyHandlerEditPolicy}, more the command to Show/Hide a given
+ * compartment
+ *
+ */
+public class ShowHideCompartmentEditPolicy extends AbstractEditPolicy {
+
+ /** key for this editpolicy */
+ public static final String SHOW_HIDE_COMPARTMENT_POLICY = "Show/Hide Compartment Policy"; //$NON-NLS-1$
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.PropertyHandlerEditPolicy#getCommand(org.eclipse.gef.Request)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if(request.getType().equals(ShowHideCompartmentRequest.SHOW_HIDE_COMPARTMENT)) {
+ ShowHideCompartmentRequest req = (ShowHideCompartmentRequest)request;
+ return getShowHideCompartmentCommand(req);
+ }
+ return null;
+ }
+
+ /**
+ * Return the command to show/hide a compartment.
+ *
+ * @param request
+ * the request
+ * @return the command to show/hide a compartment
+ */
+ protected Command getShowHideCompartmentCommand(ShowHideCompartmentRequest request) {
+ if(getHost() instanceof TopGraphicEditPart) {
+ List<?> views = getAllNotationViews((TopGraphicEditPart)getHost());
+ for(Iterator<?> iter = views.iterator(); iter.hasNext();) {
+ View childView = (View)iter.next();
+ if(ViewUtil.isPropertySupported(childView, request.getPropertyID())) {
+ if(childView.equals(request.getCompartment())) {
+ return new ICommandProxy(new SetPropertyCommand(getEditingDomain(), new EObjectAdapter(childView), request.getPropertyID(), request.getPropertyName(), request.getValue()));
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns all the views associated to this editpart
+ *
+ * @param ep
+ * a {@link TopGraphicEditPart}
+ * @return all the views associated to this editpart
+ */
+ public List<?> getAllNotationViews(TopGraphicEditPart ep) {
+ View view = ep.getNotationView();
+ if(view != null) {
+ List<View> views = new ArrayList<View>();
+ Iterator<?> childrenIterator = view.getChildren().iterator();
+ while(childrenIterator.hasNext()) {
+ View child = (View)childrenIterator.next();
+ if(child instanceof Node) {
+ views.add(child);
+ }
+ }
+ return views;
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ /**
+ * Return the current {@link EditingDomain}
+ *
+ * @return the current {@link EditingDomain}
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ return ((IGraphicalEditPart)getHost()).getEditingDomain();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideLabelEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideLabelEditPolicy.java
index e7e1d246957..8e96d5700f2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideLabelEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideLabelEditPolicy.java
@@ -1,89 +1,89 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.core.commands.SetPropertyCommand;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
-import org.eclipse.gmf.runtime.diagram.ui.internal.properties.Properties;
-import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideLabelsRequest;
-
-/**
- * This EditPolicy is used to show or hide only one Label View for a connection.
- * The EditPolicy {@link ConnectionLabelsEditPolicy} provided by GMF allows only
- * show or hide all the labels for a connection (or an affixed child node!)and
- * not only some of them This EditPolicy replaces it!
- *
- *
- */
-public class ShowHideLabelEditPolicy extends ConnectionLabelsEditPolicy {
-
- /** key for this editpolicy */
- public static final String SHOW_HIDE_LABEL_ROLE = EditPolicyRoles.CONNECTION_LABELS_ROLE;
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#understandsRequest(org.eclipse.gef.Request)
- *
- * @param request
- * @return
- */
- @Override
- public boolean understandsRequest(Request request) {
- if(ShowHideLabelsRequest.SHOW_HIDE_LABELS_REQUEST_TYPE.equals(request.getType())) {
- return true;
- }
- return super.understandsRequest(request);
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#getCommand(org.eclipse.gef.Request)
- *
- * @param request
- * @return
- */
- @Override
- public Command getCommand(Request request) {
- if(ShowHideLabelsRequest.SHOW_HIDE_LABELS_REQUEST_TYPE.equals(request.getType())) {
- SetPropertyCommand cmd = new SetPropertyCommand(getEditingDomain(), new EObjectAdapter(((ShowHideLabelsRequest)request).getView()), Properties.ID_ISVISIBLE, DiagramUIMessages.Command_hideLabel_Label, Boolean.valueOf(((ShowHideLabelsRequest)request).showConnectionLabel()));
- if(cmd.canExecute()) {
- return new ICommandProxy(cmd);
- }
- } else {
- return super.getCommand(request);
- }
- return null;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
- *
- * @param request
- * @return
- */
- @Override
- public EditPart getTargetEditPart(Request request) {
- // nothing to do here!
- return super.getTargetEditPart(request);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.core.commands.SetPropertyCommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.internal.properties.Properties;
+import org.eclipse.gmf.runtime.diagram.ui.l10n.DiagramUIMessages;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.papyrus.uml.diagram.common.commands.ShowHideLabelsRequest;
+
+/**
+ * This EditPolicy is used to show or hide only one Label View for a connection.
+ * The EditPolicy {@link ConnectionLabelsEditPolicy} provided by GMF allows only
+ * show or hide all the labels for a connection (or an affixed child node!)and
+ * not only some of them This EditPolicy replaces it!
+ *
+ *
+ */
+public class ShowHideLabelEditPolicy extends ConnectionLabelsEditPolicy {
+
+ /** key for this editpolicy */
+ public static final String SHOW_HIDE_LABEL_ROLE = EditPolicyRoles.CONNECTION_LABELS_ROLE;
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#understandsRequest(org.eclipse.gef.Request)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ public boolean understandsRequest(Request request) {
+ if(ShowHideLabelsRequest.SHOW_HIDE_LABELS_REQUEST_TYPE.equals(request.getType())) {
+ return true;
+ }
+ return super.understandsRequest(request);
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#getCommand(org.eclipse.gef.Request)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ public Command getCommand(Request request) {
+ if(ShowHideLabelsRequest.SHOW_HIDE_LABELS_REQUEST_TYPE.equals(request.getType())) {
+ SetPropertyCommand cmd = new SetPropertyCommand(getEditingDomain(), new EObjectAdapter(((ShowHideLabelsRequest)request).getView()), Properties.ID_ISVISIBLE, DiagramUIMessages.Command_hideLabel_Label, Boolean.valueOf(((ShowHideLabelsRequest)request).showConnectionLabel()));
+ if(cmd.canExecute()) {
+ return new ICommandProxy(cmd);
+ }
+ } else {
+ return super.getCommand(request);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.ConnectionLabelsEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
+ *
+ * @param request
+ * @return
+ */
+ @Override
+ public EditPart getTargetEditPart(Request request) {
+ // nothing to do here!
+ return super.getTargetEditPart(request);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideRelatedContentsEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideRelatedContentsEditPolicy.java
index 580e2e7c008..8c5c5dcfc08 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideRelatedContentsEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowHideRelatedContentsEditPolicy.java
@@ -1,29 +1,29 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-
-/**
- *
- * This EditPolicy provides the same behavior that
- * ShowHideClassifierContentsEditPolicy. Currently its used in the Composite
- * Structure Diagram to Show/Hide the related Contents for the properties
- *
- */
-public class ShowHideRelatedContentsEditPolicy extends ShowHideClassifierContentsEditPolicy {
-
- /** the key for this EditPolicy */
- public static String SHOW_HIDE_RELATED_CONTENTS_POLICY = "Show/Hide Related Contents Policy";
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+
+/**
+ *
+ * This EditPolicy provides the same behavior that
+ * ShowHideClassifierContentsEditPolicy. Currently its used in the Composite
+ * Structure Diagram to Show/Hide the related Contents for the properties
+ *
+ */
+public class ShowHideRelatedContentsEditPolicy extends ShowHideClassifierContentsEditPolicy {
+
+ /** the key for this EditPolicy */
+ public static String SHOW_HIDE_RELATED_CONTENTS_POLICY = "Show/Hide Related Contents Policy";
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowViewEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowViewEditPolicy.java
index f4f5baaf6fc..49a5c5dc3b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowViewEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/ShowViewEditPolicy.java
@@ -1,65 +1,65 @@
-/*******************************************************************************
- * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat
- * de la Comunitat Valenciana . All rights reserved. This program
- * and the accompanying materials are made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Miguel Llacer San Fernando (Prodevelop) - initial API and implementation
- *
- ******************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.OpenEditPolicy;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class ShowViewEditPolicy.
- */
-public class ShowViewEditPolicy {
-
- /** The policy. */
- private static OpenEditPolicy policy = null;
-
- /**
- * Gets the open edit policy.
- *
- * @return the open edit policy
- */
- private static OpenEditPolicy getOpenEditPolicy() {
- if(policy == null) {
- policy = new OpenEditPolicy() {
-
- @Override
- protected Command getOpenCommand(Request request) {
-
- String viewId = "org.eclipse.ui.views.PropertySheet";
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(viewId);
- } catch (PartInitException e) {
- e.printStackTrace();
- }
- return null;
- }
- };
- }
- return policy;
- }
-
- /**
- * Listens to double-click event over some element of the diagram and shows
- * properties tab.
- *
- * @return the open edit policy
- */
- // @unused
- public static OpenEditPolicy createOpenEditPolicy() {
- return getOpenEditPolicy();
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Conselleria de Infraestructuras y Transporte, Generalitat
+ * de la Comunitat Valenciana . All rights reserved. This program
+ * and the accompanying materials are made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Miguel Llacer San Fernando (Prodevelop) - initial API and implementation
+ *
+ ******************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.OpenEditPolicy;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ShowViewEditPolicy.
+ */
+public class ShowViewEditPolicy {
+
+ /** The policy. */
+ private static OpenEditPolicy policy = null;
+
+ /**
+ * Gets the open edit policy.
+ *
+ * @return the open edit policy
+ */
+ private static OpenEditPolicy getOpenEditPolicy() {
+ if(policy == null) {
+ policy = new OpenEditPolicy() {
+
+ @Override
+ protected Command getOpenCommand(Request request) {
+
+ String viewId = "org.eclipse.ui.views.PropertySheet";
+ try {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(viewId);
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+ };
+ }
+ return policy;
+ }
+
+ /**
+ * Listens to double-click event over some element of the diagram and shows
+ * properties tab.
+ *
+ * @return the open edit policy
+ */
+ // @unused
+ public static OpenEditPolicy createOpenEditPolicy() {
+ return getOpenEditPolicy();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLBaseItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLBaseItemSemanticEditPolicy.java
index d22a3b242e1..7f823fe78bb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLBaseItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLBaseItemSemanticEditPolicy.java
@@ -1,34 +1,34 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-/**
- * <pre>
- * This class is currently generated for all diagram but could (for most of it)
- * be shared in common as a large part of it is diagram independent.
- * The LinkConstraints nested class should also be generated in a separate
- * class.
- * For now, in order to avoid to much changes in the generator, it only contains
- * the constant use to hold a reoriented edge in the request extended data.
- * </pre>
- */
-public abstract class UMLBaseItemSemanticEditPolicy {
-
- /**
- * Extended request data key to hold the edge view during a reconnect
- * request.
- */
- public static final String GRAPHICAL_RECONNECTED_EDGE = "graphical_edge"; //$NON-NLS-1$
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+/**
+ * <pre>
+ * This class is currently generated for all diagram but could (for most of it)
+ * be shared in common as a large part of it is diagram independent.
+ * The LinkConstraints nested class should also be generated in a separate
+ * class.
+ * For now, in order to avoid to much changes in the generator, it only contains
+ * the constant use to hold a reoriented edge in the request extended data.
+ * </pre>
+ */
+public abstract class UMLBaseItemSemanticEditPolicy {
+
+ /**
+ * Extended request data key to hold the edge view during a reconnect
+ * request.
+ */
+ public static final String GRAPHICAL_RECONNECTED_EDGE = "graphical_edge"; //$NON-NLS-1$
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextNonResizableEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextNonResizableEditPolicy.java
index 8c060524654..69018a88fe5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextNonResizableEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextNonResizableEditPolicy.java
@@ -1,237 +1,237 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
-import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * this class is a copy of generated classes that is present in each diagram
- * We have added this class because somme editpart in the common use it.
- */
-public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-
- /**
- * @generated
- */
- protected List createSelectionHandles() {
- MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
- moveHandle.setBorder(null);
- moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
- return Collections.singletonList(moveHandle);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.handles.MoveHandle;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
+import org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * this class is a copy of generated classes that is present in each diagram
+ * We have added this class because somme editpart in the common use it.
+ */
+public class UMLTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
+
+ /**
+ * @generated
+ */
+ private IFigure selectionFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private IFigure focusFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private FigureListener hostPositionListener;
+
+ /**
+ * @generated
+ */
+ protected void showPrimarySelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ showSelection();
+ showFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void showSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(false);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void showFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if(getHostFigure() instanceof Label) {
+ bounds = ((Label)getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createSelectionFeedbackFigure() {
+ if(getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ protected void updateLabel(Label target) {
+ Label source = (Label)getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshSelectionFeedback() {
+ if(selectionFeedbackFigure != null) {
+ if(selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label)selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFocusFeedback() {
+ if(focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+
+ /**
+ * @generated
+ */
+ private FigureListener getHostPositionListener() {
+ if(hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+
+ /**
+ * @generated
+ */
+ protected List createSelectionHandles() {
+ MoveHandle moveHandle = new MoveHandle((GraphicalEditPart)getHost());
+ moveHandle.setBorder(null);
+ moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
+ return Collections.singletonList(moveHandle);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextSelectionEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextSelectionEditPolicy.java
index fed0ba8912f..f6a91ca81c3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextSelectionEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/editpolicies/UMLTextSelectionEditPolicy.java
@@ -1,221 +1,221 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.editpolicies;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.editpolicies.SelectionEditPolicy;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * this class is a copy of generated classes that is present in each diagram
- * We have added this class because somme editpart in the common use it.
- */
-public class UMLTextSelectionEditPolicy extends SelectionEditPolicy {
-
- /**
- * @generated
- */
- private IFigure selectionFeedbackFigure;
-
- /**
- * @generated
- */
- private IFigure focusFeedbackFigure;
-
- /**
- * @generated
- */
- private FigureListener hostPositionListener;
-
- /**
- * @generated
- */
- protected void showPrimarySelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- showSelection();
- showFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(true);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- hideSelection();
- addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
- getHostFigure().addFigureListener(getHostPositionListener());
- refreshSelectionFeedback();
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void hideSelection() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setSelected(false);
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(selectionFeedbackFigure != null) {
- removeFeedback(selectionFeedbackFigure);
- getHostFigure().removeFigureListener(getHostPositionListener());
- selectionFeedbackFigure = null;
- }
- hideFocus();
- }
- }
-
- /**
- * @generated
- */
- protected void showFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(true);
- } else {
- hideFocus();
- addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
- refreshFocusFeedback();
- }
- }
-
- /**
- * @generated
- */
- protected void hideFocus() {
- if(getHostFigure() instanceof WrappingLabel) {
- ((WrappingLabel)getHostFigure()).setFocus(false);
- } else {
- if(focusFeedbackFigure != null) {
- removeFeedback(focusFeedbackFigure);
- focusFeedbackFigure = null;
- }
- }
- }
-
- /**
- * @generated
- */
- protected Rectangle getFeedbackBounds() {
- Rectangle bounds;
- if(getHostFigure() instanceof Label) {
- bounds = ((Label)getHostFigure()).getTextBounds();
- bounds.intersect(getHostFigure().getBounds());
- } else {
- bounds = getHostFigure().getBounds().getCopy();
- }
- getHostFigure().getParent().translateToAbsolute(bounds);
- getFeedbackLayer().translateToRelative(bounds);
- return bounds;
- }
-
- /**
- * @generated
- */
- protected IFigure createSelectionFeedbackFigure() {
- if(getHostFigure() instanceof Label) {
- Label feedbackFigure = new Label();
- feedbackFigure.setOpaque(true);
- feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
- feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
- return feedbackFigure;
- } else {
- RectangleFigure feedbackFigure = new RectangleFigure();
- feedbackFigure.setFill(false);
- return feedbackFigure;
- }
- }
-
- /**
- * @generated
- */
- protected IFigure createFocusFeedbackFigure() {
- return new Figure() {
-
- protected void paintFigure(Graphics graphics) {
- graphics.drawFocus(getBounds().getResized(-1, -1));
- }
- };
- }
-
- /**
- * @generated
- */
- protected void updateLabel(Label target) {
- Label source = (Label)getHostFigure();
- target.setText(source.getText());
- target.setTextAlignment(source.getTextAlignment());
- target.setFont(source.getFont());
- }
-
- /**
- * @generated
- */
- protected void refreshSelectionFeedback() {
- if(selectionFeedbackFigure != null) {
- if(selectionFeedbackFigure instanceof Label) {
- updateLabel((Label)selectionFeedbackFigure);
- selectionFeedbackFigure.setBounds(getFeedbackBounds());
- } else {
- selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
- }
- }
- }
-
- /**
- * @generated
- */
- protected void refreshFocusFeedback() {
- if(focusFeedbackFigure != null) {
- focusFeedbackFigure.setBounds(getFeedbackBounds());
- }
- }
-
- /**
- * @generated
- */
- public void refreshFeedback() {
- refreshSelectionFeedback();
- refreshFocusFeedback();
- }
-
- /**
- * @generated
- */
- private FigureListener getHostPositionListener() {
- if(hostPositionListener == null) {
- hostPositionListener = new FigureListener() {
-
- public void figureMoved(IFigure source) {
- refreshFeedback();
- }
- };
- }
- return hostPositionListener;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.editpolicies;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.editpolicies.SelectionEditPolicy;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * this class is a copy of generated classes that is present in each diagram
+ * We have added this class because somme editpart in the common use it.
+ */
+public class UMLTextSelectionEditPolicy extends SelectionEditPolicy {
+
+ /**
+ * @generated
+ */
+ private IFigure selectionFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private IFigure focusFeedbackFigure;
+
+ /**
+ * @generated
+ */
+ private FigureListener hostPositionListener;
+
+ /**
+ * @generated
+ */
+ protected void showPrimarySelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ showSelection();
+ showFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void showSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(true);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ hideSelection();
+ addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
+ refreshSelectionFeedback();
+ hideFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideSelection() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setSelected(false);
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(selectionFeedbackFigure != null) {
+ removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
+ selectionFeedbackFigure = null;
+ }
+ hideFocus();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void showFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(true);
+ } else {
+ hideFocus();
+ addFeedback(focusFeedbackFigure = createFocusFeedbackFigure());
+ refreshFocusFeedback();
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void hideFocus() {
+ if(getHostFigure() instanceof WrappingLabel) {
+ ((WrappingLabel)getHostFigure()).setFocus(false);
+ } else {
+ if(focusFeedbackFigure != null) {
+ removeFeedback(focusFeedbackFigure);
+ focusFeedbackFigure = null;
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected Rectangle getFeedbackBounds() {
+ Rectangle bounds;
+ if(getHostFigure() instanceof Label) {
+ bounds = ((Label)getHostFigure()).getTextBounds();
+ bounds.intersect(getHostFigure().getBounds());
+ } else {
+ bounds = getHostFigure().getBounds().getCopy();
+ }
+ getHostFigure().getParent().translateToAbsolute(bounds);
+ getFeedbackLayer().translateToRelative(bounds);
+ return bounds;
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createSelectionFeedbackFigure() {
+ if(getHostFigure() instanceof Label) {
+ Label feedbackFigure = new Label();
+ feedbackFigure.setOpaque(true);
+ feedbackFigure.setBackgroundColor(ColorConstants.menuBackgroundSelected);
+ feedbackFigure.setForegroundColor(ColorConstants.menuForegroundSelected);
+ return feedbackFigure;
+ } else {
+ RectangleFigure feedbackFigure = new RectangleFigure();
+ feedbackFigure.setFill(false);
+ return feedbackFigure;
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected IFigure createFocusFeedbackFigure() {
+ return new Figure() {
+
+ protected void paintFigure(Graphics graphics) {
+ graphics.drawFocus(getBounds().getResized(-1, -1));
+ }
+ };
+ }
+
+ /**
+ * @generated
+ */
+ protected void updateLabel(Label target) {
+ Label source = (Label)getHostFigure();
+ target.setText(source.getText());
+ target.setTextAlignment(source.getTextAlignment());
+ target.setFont(source.getFont());
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshSelectionFeedback() {
+ if(selectionFeedbackFigure != null) {
+ if(selectionFeedbackFigure instanceof Label) {
+ updateLabel((Label)selectionFeedbackFigure);
+ selectionFeedbackFigure.setBounds(getFeedbackBounds());
+ } else {
+ selectionFeedbackFigure.setBounds(getFeedbackBounds().expand(5, 5));
+ }
+ }
+ }
+
+ /**
+ * @generated
+ */
+ protected void refreshFocusFeedback() {
+ if(focusFeedbackFigure != null) {
+ focusFeedbackFigure.setBounds(getFeedbackBounds());
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public void refreshFeedback() {
+ refreshSelectionFeedback();
+ refreshFocusFeedback();
+ }
+
+ /**
+ * @generated
+ */
+ private FigureListener getHostPositionListener() {
+ if(hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/DashedEdgeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/DashedEdgeFigure.java
index c919781a9b6..a5e45b05848 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/DashedEdgeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/DashedEdgeFigure.java
@@ -1,164 +1,164 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.edge;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineDecoration;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * This is a custom figure to represents a default edge. This code was used in
- * Papyrus 1. This edge figure is painted using dashes. This is the base figure
- * for dependencies, for example
- */
-public class DashedEdgeFigure extends UMLEdgeFigure {
-
- /**
- * Dashes used to paint line.
- */
- private final int[] dashes = new int[10];
-
- /**
- * use to if the arrow will be displayed
- */
- protected boolean arrow = true;
-
- private WrappingLabel nameLabel;
-
- /**
- * Creates a new DashEdgeFigure.
- */
- public DashedEdgeFigure() {
- super();
- setStyle();
- }
-
- /**
- * @generated
- */
- public WrappingLabel getNameLabel() {
- return nameLabel;
- }
-
- /**
- * This is the constructor
- *
- * @param arrow
- * true if the arrow of the edge is displayed
- */
- public DashedEdgeFigure(Boolean arrow) {
- super();
- this.arrow = arrow;
- setStyle();
- createContents();
- }
-
- /**
- * use to display the arrow of the edge
- *
- * @param arrow
- * true if the arrow will be displayed
- */
- public void setArrow(Boolean arrow) {
- this.arrow = arrow;
- setStyle();
- }
-
- /**
- * @generated
- */
- @Override
- protected void createContents() {
- super.createContents();
- nameLabel = new WrappingLabel();
- nameLabel.setText("");
-
- this.add(nameLabel);
-
- }
-
- /**
- * Sets initial Style for the figure. It does not give any special Color for
- * Background and Foreground. This is the style used for classic arrows:
- * ------>
- */
- protected void setStyle() {
- PolylineDecoration dec = new PolylineDecoration();
- dec.setScale(15, 5);
- dec.setLineWidth(1);
- if(arrow) {
- this.setTargetDecoration(dec);
- } else {
- this.setTargetDecoration(null);
- }// arrow at target endpoint
- this.setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
-
- // set dashes
- for(int i = 0; i < 10; i++) {
- dashes[i] = 5;
- }
- setLineDash(dashes);
-
- }
-
- /**
- * Sets initial style for this figure. This is the style used for full
- * arrows: ------|>
- *
- * @param lineWidth
- * the width of the link
- */
- // @unused
- protected void setStyle(int lineWidth) {
- setStyle();
- // set link appearence
- setLineWidth(lineWidth);
- }
-
- /**
- * Sets initial style for this figure. This is the style used for full
- * arrows: ------|>
- *
- * @param lineWidth
- * the width of the link
- * @param foregroundColor
- * the foreground color of the link
- * @param backgroundColor
- * the background color of the link
- */
- // @unused
- protected void setStyle(Color backgroundColor, Color foregroundColor, int lineWidth) {
- // set the target arrow style
- PolygonDecoration dec = new PolygonDecoration();
- dec.setScale(15, 5);
- dec.setBackgroundColor(backgroundColor);
- dec.setLineWidth(1);
- if(arrow) {
- setTargetDecoration(dec);
- }
- // set link appearence
- setLineWidth(lineWidth);
- setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
- setForegroundColor(foregroundColor);
-
- // set dashes
- for(int i = 0; i < 10; i++) {
- dashes[i] = 5;
- }
- setLineDash(dashes);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.edge;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.PolygonDecoration;
+import org.eclipse.draw2d.PolylineDecoration;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * This is a custom figure to represents a default edge. This code was used in
+ * Papyrus 1. This edge figure is painted using dashes. This is the base figure
+ * for dependencies, for example
+ */
+public class DashedEdgeFigure extends UMLEdgeFigure {
+
+ /**
+ * Dashes used to paint line.
+ */
+ private final int[] dashes = new int[10];
+
+ /**
+ * use to if the arrow will be displayed
+ */
+ protected boolean arrow = true;
+
+ private WrappingLabel nameLabel;
+
+ /**
+ * Creates a new DashEdgeFigure.
+ */
+ public DashedEdgeFigure() {
+ super();
+ setStyle();
+ }
+
+ /**
+ * @generated
+ */
+ public WrappingLabel getNameLabel() {
+ return nameLabel;
+ }
+
+ /**
+ * This is the constructor
+ *
+ * @param arrow
+ * true if the arrow of the edge is displayed
+ */
+ public DashedEdgeFigure(Boolean arrow) {
+ super();
+ this.arrow = arrow;
+ setStyle();
+ createContents();
+ }
+
+ /**
+ * use to display the arrow of the edge
+ *
+ * @param arrow
+ * true if the arrow will be displayed
+ */
+ public void setArrow(Boolean arrow) {
+ this.arrow = arrow;
+ setStyle();
+ }
+
+ /**
+ * @generated
+ */
+ @Override
+ protected void createContents() {
+ super.createContents();
+ nameLabel = new WrappingLabel();
+ nameLabel.setText("");
+
+ this.add(nameLabel);
+
+ }
+
+ /**
+ * Sets initial Style for the figure. It does not give any special Color for
+ * Background and Foreground. This is the style used for classic arrows:
+ * ------>
+ */
+ protected void setStyle() {
+ PolylineDecoration dec = new PolylineDecoration();
+ dec.setScale(15, 5);
+ dec.setLineWidth(1);
+ if(arrow) {
+ this.setTargetDecoration(dec);
+ } else {
+ this.setTargetDecoration(null);
+ }// arrow at target endpoint
+ this.setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
+
+ // set dashes
+ for(int i = 0; i < 10; i++) {
+ dashes[i] = 5;
+ }
+ setLineDash(dashes);
+
+ }
+
+ /**
+ * Sets initial style for this figure. This is the style used for full
+ * arrows: ------|>
+ *
+ * @param lineWidth
+ * the width of the link
+ */
+ // @unused
+ protected void setStyle(int lineWidth) {
+ setStyle();
+ // set link appearence
+ setLineWidth(lineWidth);
+ }
+
+ /**
+ * Sets initial style for this figure. This is the style used for full
+ * arrows: ------|>
+ *
+ * @param lineWidth
+ * the width of the link
+ * @param foregroundColor
+ * the foreground color of the link
+ * @param backgroundColor
+ * the background color of the link
+ */
+ // @unused
+ protected void setStyle(Color backgroundColor, Color foregroundColor, int lineWidth) {
+ // set the target arrow style
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(15, 5);
+ dec.setBackgroundColor(backgroundColor);
+ dec.setLineWidth(1);
+ if(arrow) {
+ setTargetDecoration(dec);
+ }
+ // set link appearence
+ setLineWidth(lineWidth);
+ setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
+ setForegroundColor(foregroundColor);
+
+ // set dashes
+ for(int i = 0; i < 10; i++) {
+ dashes[i] = 5;
+ }
+ setLineDash(dashes);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
index d0025560825..ad794e547e3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/GeneralizationFigure.java
@@ -1,40 +1,40 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.edge;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.PolygonDecoration;
-
-/**
- * future code of the CGeneralizationFigure
- **/
-public class GeneralizationFigure extends UMLEdgeFigure {
-
- /**
- *
- */
- public GeneralizationFigure() {
- super();
- PolygonDecoration dec = new PolygonDecoration();
- dec.setScale(10, 8);
- dec.setBackgroundColor(ColorConstants.white);
- dec.setLineWidth(1);
- setTargetDecoration(dec); // arrow at target endpoint
- setLineStyle(Graphics.LINE_SOLID); // line drawing style
- setLineWidth(1);
- setForegroundColor(ColorConstants.black);
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.edge;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.PolygonDecoration;
+
+/**
+ * future code of the CGeneralizationFigure
+ **/
+public class GeneralizationFigure extends UMLEdgeFigure {
+
+ /**
+ *
+ */
+ public GeneralizationFigure() {
+ super();
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(10, 8);
+ dec.setBackgroundColor(ColorConstants.white);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+ setLineStyle(Graphics.LINE_SOLID); // line drawing style
+ setLineWidth(1);
+ setForegroundColor(ColorConstants.black);
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
index 282c5c995c1..491ce224ef2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/InterfaceRealizationFigure.java
@@ -1,37 +1,37 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.edge;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.PolygonDecoration;
-
-/**
- * Code of the CInterfaceRealizationFigure
- **/
-public class InterfaceRealizationFigure extends DashedEdgeFigure {
-
- public InterfaceRealizationFigure() {
- PolygonDecoration dec = new PolygonDecoration();
- dec.setScale(15, 5);
- dec.setBackgroundColor(ColorConstants.white);
- dec.setLineWidth(1);
- setTargetDecoration(dec); // arrow at target endpoint
-
- setForegroundColor(ColorConstants.black);
-
- this.setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.edge;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.PolygonDecoration;
+
+/**
+ * Code of the CInterfaceRealizationFigure
+ **/
+public class InterfaceRealizationFigure extends DashedEdgeFigure {
+
+ public InterfaceRealizationFigure() {
+ PolygonDecoration dec = new PolygonDecoration();
+ dec.setScale(15, 5);
+ dec.setBackgroundColor(ColorConstants.white);
+ dec.setLineWidth(1);
+ setTargetDecoration(dec); // arrow at target endpoint
+
+ setForegroundColor(ColorConstants.black);
+
+ this.setLineStyle(Graphics.LINE_CUSTOM); // line drawing style
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/UMLEdgeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/UMLEdgeFigure.java
index 749fe494e65..d932d843645 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/UMLEdgeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/edge/UMLEdgeFigure.java
@@ -1,95 +1,95 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.edge;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * An UML edge is an edge that owns a label to display applied stereotypes
- */
-public class UMLEdgeFigure extends PolylineConnectionEx implements IPapyrusUMLElementFigure {
-
- /** Child label that displays applied stereotypes string */
- protected WrappingLabel appliedStereotypeLabel;
-
- /**
- * get the applied stereotype label
- *
- * @return applied stereotype label
- */
- public WrappingLabel getAppliedStereotypeLabel() {
- return appliedStereotypeLabel;
- }
-
- /**
- * Creates a new UMLEdgeFigure.
- */
- public UMLEdgeFigure() {
- super();
- setAntialias(SWT.ON);
- createContents();
- }
-
- /**
- * Creates the contents of the figure, i.e. child node. This basic
- * implementation creates only a new stereotype label.
- * <p>
- * This method should be called when the parent figure is created, or when the label was removed and a string has to be displayed.
- * </p>
- */
- protected void createContents() {
- createStereotypeLabel();
- }
-
- /**
- * Creates the stereotype label for this figure.
- */
- protected void createStereotypeLabel() {
- appliedStereotypeLabel = new WrappingLabel();
- appliedStereotypeLabel.setTextWrap(true);
- appliedStereotypeLabel.setTextJustification(PositionConstants.CENTER);
- appliedStereotypeLabel.setText("");
- add(appliedStereotypeLabel);
- }
-
- /**
- * Sets the stereotypes for this figure.
- * <p>
- * This implementation checks if the specified string is null or not.
- * <ul>
- * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
- * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
- * </ul>
- * </p>
- *
- * @param stereotypes
- * the string representing the stereotypes to be displayed
- */
- public void setStereotypeDisplay(String stereotypes, Image image) {
-
- // Set stereotype text on figure
- if(!"".equals(stereotypes)) {
- appliedStereotypeLabel.setText(stereotypes);
- } else {
- appliedStereotypeLabel.setText("");
- }
-
- appliedStereotypeLabel.setIcon(image);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.edge;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * An UML edge is an edge that owns a label to display applied stereotypes
+ */
+public class UMLEdgeFigure extends PolylineConnectionEx implements IPapyrusUMLElementFigure {
+
+ /** Child label that displays applied stereotypes string */
+ protected WrappingLabel appliedStereotypeLabel;
+
+ /**
+ * get the applied stereotype label
+ *
+ * @return applied stereotype label
+ */
+ public WrappingLabel getAppliedStereotypeLabel() {
+ return appliedStereotypeLabel;
+ }
+
+ /**
+ * Creates a new UMLEdgeFigure.
+ */
+ public UMLEdgeFigure() {
+ super();
+ setAntialias(SWT.ON);
+ createContents();
+ }
+
+ /**
+ * Creates the contents of the figure, i.e. child node. This basic
+ * implementation creates only a new stereotype label.
+ * <p>
+ * This method should be called when the parent figure is created, or when the label was removed and a string has to be displayed.
+ * </p>
+ */
+ protected void createContents() {
+ createStereotypeLabel();
+ }
+
+ /**
+ * Creates the stereotype label for this figure.
+ */
+ protected void createStereotypeLabel() {
+ appliedStereotypeLabel = new WrappingLabel();
+ appliedStereotypeLabel.setTextWrap(true);
+ appliedStereotypeLabel.setTextJustification(PositionConstants.CENTER);
+ appliedStereotypeLabel.setText("");
+ add(appliedStereotypeLabel);
+ }
+
+ /**
+ * Sets the stereotypes for this figure.
+ * <p>
+ * This implementation checks if the specified string is null or not.
+ * <ul>
+ * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
+ * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
+ * </ul>
+ * </p>
+ *
+ * @param stereotypes
+ * the string representing the stereotypes to be displayed
+ */
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+
+ // Set stereotype text on figure
+ if(!"".equals(stereotypes)) {
+ appliedStereotypeLabel.setText(stereotypes);
+ } else {
+ appliedStereotypeLabel.setText("");
+ }
+
+ appliedStereotypeLabel.setIcon(image);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/AutomaticCompartmentToolBox.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/AutomaticCompartmentToolBox.java
index d8d3b84d54e..61f77d65c30 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/AutomaticCompartmentToolBox.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/AutomaticCompartmentToolBox.java
@@ -1,50 +1,50 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.layout;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.AutomaticCompartmentLayoutManager;
-
-/**
- * The Class AutomaticCompartmentToolBox.
- */
-public class AutomaticCompartmentToolBox implements ILayoutToolBox {
-
- /** The AUTOMATI c_ layout. */
- protected final String AUTOMATIC_LAYOUT = "Automatic_Layout";
-
- /**
- * {@inheritDoc}
- */
- public EditPolicy getEditPolicy() {
- return new ResizableCompartmentEditPolicy();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLayout() {
- return AUTOMATIC_LAYOUT;
- }
-
- /**
- * {@inheritDoc}
- */
- public AbstractLayout getFigureLayout() {
- return new AutomaticCompartmentLayoutManager();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.layout;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AutomaticCompartmentLayoutManager;
+
+/**
+ * The Class AutomaticCompartmentToolBox.
+ */
+public class AutomaticCompartmentToolBox implements ILayoutToolBox {
+
+ /** The AUTOMATI c_ layout. */
+ protected final String AUTOMATIC_LAYOUT = "Automatic_Layout";
+
+ /**
+ * {@inheritDoc}
+ */
+ public EditPolicy getEditPolicy() {
+ return new ResizableCompartmentEditPolicy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLayout() {
+ return AUTOMATIC_LAYOUT;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public AbstractLayout getFigureLayout() {
+ return new AutomaticCompartmentLayoutManager();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ILayoutToolBox.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ILayoutToolBox.java
index 90a37605267..00b3c162faf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ILayoutToolBox.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ILayoutToolBox.java
@@ -1,46 +1,46 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.layout;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.gef.EditPolicy;
-
-/**
- * this goal of this kind of class is to provide the good editpolicy and the
- * good layout to attach at the figure.
- */
-public interface ILayoutToolBox {
-
- /**
- * Gets the figure layout.
- *
- * @return the figure layout
- */
- public AbstractLayout getFigureLayout();
-
- /**
- * Gets the edits the policy.
- *
- * @return the edits the policy
- */
- public EditPolicy getEditPolicy();
-
- /**
- * Gets the layout, this is the constant is is put in the eannotation.
- *
- * @return the layout constant
- */
- public String getLayout();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.layout;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.gef.EditPolicy;
+
+/**
+ * this goal of this kind of class is to provide the good editpolicy and the
+ * good layout to attach at the figure.
+ */
+public interface ILayoutToolBox {
+
+ /**
+ * Gets the figure layout.
+ *
+ * @return the figure layout
+ */
+ public AbstractLayout getFigureLayout();
+
+ /**
+ * Gets the edits the policy.
+ *
+ * @return the edits the policy
+ */
+ public EditPolicy getEditPolicy();
+
+ /**
+ * Gets the layout, this is the constant is is put in the eannotation.
+ *
+ * @return the layout constant
+ */
+ public String getLayout();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ManualCompartmentToolBox.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ManualCompartmentToolBox.java
index 98fdf2ac6d7..004d8a0a177 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ManualCompartmentToolBox.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/ManualCompartmentToolBox.java
@@ -1,51 +1,51 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.layout;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.CResizableCompartmentEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.ManualCompartmentLayoutManager;
-
-/**
- * this is a tool kit to manage Manual layout.
- */
-
-public class ManualCompartmentToolBox implements ILayoutToolBox {
-
- /** The MANUA l_ layout. */
- protected final String MANUAL_LAYOUT = "Manual_Layout";
-
- /**
- * {@inheritDoc}
- */
- public EditPolicy getEditPolicy() {
- return new CResizableCompartmentEditPolicy();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLayout() {
- return MANUAL_LAYOUT;
- }
-
- /**
- * {@inheritDoc}
- */
- public AbstractLayout getFigureLayout() {
- return new ManualCompartmentLayoutManager();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.layout;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.CResizableCompartmentEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.ManualCompartmentLayoutManager;
+
+/**
+ * this is a tool kit to manage Manual layout.
+ */
+
+public class ManualCompartmentToolBox implements ILayoutToolBox {
+
+ /** The MANUA l_ layout. */
+ protected final String MANUAL_LAYOUT = "Manual_Layout";
+
+ /**
+ * {@inheritDoc}
+ */
+ public EditPolicy getEditPolicy() {
+ return new CResizableCompartmentEditPolicy();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLayout() {
+ return MANUAL_LAYOUT;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public AbstractLayout getFigureLayout() {
+ return new ManualCompartmentLayoutManager();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/PropertiesCompartmentLayoutManager.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/PropertiesCompartmentLayoutManager.java
index f1c21f62750..e961b4d4ead 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/PropertiesCompartmentLayoutManager.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/layout/PropertiesCompartmentLayoutManager.java
@@ -1,90 +1,90 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeCompartmentFigure;
-
-public class PropertiesCompartmentLayoutManager extends AbstractLayout {
-
- protected static int MARGIN_X = 5;
-
- protected static int MARGIN_Y = 10;
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
-
- int minimumWith = 0;
- int minimumHeight = 0;
- // display name
- for(int i = 0; i < container.getChildren().size(); i++) {
-
- IFigure fig=((IFigure)container.getChildren().get(i));
- if( container instanceof AppliedStereotypeCompartmentFigure){
- if(((AppliedStereotypeCompartmentFigure)container).isExpanded()){
- minimumHeight = minimumHeight + fig.getPreferredSize(hint, hint2).height + MARGIN_Y;
- minimumWith = Math.max(minimumWith, fig.getPreferredSize(hint, hint2).width);
- }
- else{
- minimumHeight = minimumHeight + fig.getPreferredSize().height + MARGIN_Y;
- minimumWith = Math.max(minimumWith, fig.getPreferredSize().width);
- }
- }
- else{
- minimumWith = Math.max(minimumWith, fig.getPreferredSize(hint, hint2).width);
- minimumHeight = minimumHeight + fig.getPreferredSize().height + MARGIN_Y;
- }
-
- }
-
- return new Dimension(minimumWith + MARGIN_X, minimumHeight + MARGIN_Y);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void layout(IFigure container) {
- List childrenList = container.getChildren();
- for(int i = 0; i < container.getChildren().size(); i++) {
- Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
-
- bound.setSize(((IFigure)childrenList.get(i)).getPreferredSize(container.getBounds().width-40,-1));
-
-
-
- if(i > 0) {
- bound.x = container.getBounds().x;
- bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y - 1;
- bound.width = container.getBounds().width;
- bound.height = bound.height + MARGIN_Y;
- } else {
- bound.x = container.getBounds().x;
- bound.y = container.getBounds().y;
- bound.width = container.getBounds().width;
- bound.height = bound.height + MARGIN_Y;
-
- }
- ((IFigure)childrenList.get(i)).setBounds(bound);
- }
-
- }
-
-}
+/*****************************************************************************
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.layout;
+
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.AppliedStereotypeCompartmentFigure;
+
+public class PropertiesCompartmentLayoutManager extends AbstractLayout {
+
+ protected static int MARGIN_X = 5;
+
+ protected static int MARGIN_Y = 10;
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
+
+ int minimumWith = 0;
+ int minimumHeight = 0;
+ // display name
+ for(int i = 0; i < container.getChildren().size(); i++) {
+
+ IFigure fig=((IFigure)container.getChildren().get(i));
+ if( container instanceof AppliedStereotypeCompartmentFigure){
+ if(((AppliedStereotypeCompartmentFigure)container).isExpanded()){
+ minimumHeight = minimumHeight + fig.getPreferredSize(hint, hint2).height + MARGIN_Y;
+ minimumWith = Math.max(minimumWith, fig.getPreferredSize(hint, hint2).width);
+ }
+ else{
+ minimumHeight = minimumHeight + fig.getPreferredSize().height + MARGIN_Y;
+ minimumWith = Math.max(minimumWith, fig.getPreferredSize().width);
+ }
+ }
+ else{
+ minimumWith = Math.max(minimumWith, fig.getPreferredSize(hint, hint2).width);
+ minimumHeight = minimumHeight + fig.getPreferredSize().height + MARGIN_Y;
+ }
+
+ }
+
+ return new Dimension(minimumWith + MARGIN_X, minimumHeight + MARGIN_Y);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void layout(IFigure container) {
+ List childrenList = container.getChildren();
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
+
+ bound.setSize(((IFigure)childrenList.get(i)).getPreferredSize(container.getBounds().width-40,-1));
+
+
+
+ if(i > 0) {
+ bound.x = container.getBounds().x;
+ bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y - 1;
+ bound.width = container.getBounds().width;
+ bound.height = bound.height + MARGIN_Y;
+ } else {
+ bound.x = container.getBounds().x;
+ bound.y = container.getBounds().y;
+ bound.width = container.getBounds().width;
+ bound.height = bound.height + MARGIN_Y;
+
+ }
+ ((IFigure)childrenList.get(i)).setBounds(bound);
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AffixedNamedElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AffixedNamedElementFigure.java
index 09cca460bb1..2f05c74dffd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AffixedNamedElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AffixedNamedElementFigure.java
@@ -1,93 +1,93 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.BorderLayout;
-import org.eclipse.draw2d.ImageFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Figure for Affixed NamedElement representation. The name label is shown as an
- * external label.
- */
-public class AffixedNamedElementFigure extends NodeNamedElementFigure {
-
- /** Container for icon (stereotype icon) */
- // protected ScalableImageFigure icon;
- protected ScaledImageFigure icon;
-
- /** Constructor */
- public AffixedNamedElementFigure() {
- super();
-
- // icon = new ScalableImageFigure(new Image(Display.getCurrent(), 2, 2));
- icon = new ScaledImageFigure();
- this.add(icon);
-
- BorderLayout layout = new BorderLayout();
- layout.setConstraint(icon, BorderLayout.CENTER);
-
- this.setLayoutManager(layout);
- }
-
- /**
- * Get the figure containing the icon (for stereotype)
- *
- * @return the image figure
- */
- protected ImageFigure getIconContainer() {
- return icon;
-
- }
-
- /**
- * Set the icon with a new image (for stereotype)
- *
- * @param image
- * the new
- */
- protected void setIcon(Image image) {
- icon.setImage(image);
- if(image == null) {
- icon.setScale(1.0);
- // icon.setImage(new Image(Display.getCurrent(), 2, 2));
- return;
- }
-
- Dimension imageDim = new Rectangle(image.getBounds()).getSize();
- int imageMax = imageDim.width;
- if(imageDim.height > imageMax) {
- imageMax = imageDim.height;
- }
- // size of enclosing box
- Dimension size = getParent().getBounds().getSize();
-
- if((imageDim.width >= size.width) || (imageDim.height >= size.height)) {
- // 5 = border width
- icon.setScale((size.width - 5.0) / imageMax);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void setAppliedStereotypeIcon(Image image) {
- setIcon(image);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.BorderLayout;
+import org.eclipse.draw2d.ImageFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Figure for Affixed NamedElement representation. The name label is shown as an
+ * external label.
+ */
+public class AffixedNamedElementFigure extends NodeNamedElementFigure {
+
+ /** Container for icon (stereotype icon) */
+ // protected ScalableImageFigure icon;
+ protected ScaledImageFigure icon;
+
+ /** Constructor */
+ public AffixedNamedElementFigure() {
+ super();
+
+ // icon = new ScalableImageFigure(new Image(Display.getCurrent(), 2, 2));
+ icon = new ScaledImageFigure();
+ this.add(icon);
+
+ BorderLayout layout = new BorderLayout();
+ layout.setConstraint(icon, BorderLayout.CENTER);
+
+ this.setLayoutManager(layout);
+ }
+
+ /**
+ * Get the figure containing the icon (for stereotype)
+ *
+ * @return the image figure
+ */
+ protected ImageFigure getIconContainer() {
+ return icon;
+
+ }
+
+ /**
+ * Set the icon with a new image (for stereotype)
+ *
+ * @param image
+ * the new
+ */
+ protected void setIcon(Image image) {
+ icon.setImage(image);
+ if(image == null) {
+ icon.setScale(1.0);
+ // icon.setImage(new Image(Display.getCurrent(), 2, 2));
+ return;
+ }
+
+ Dimension imageDim = new Rectangle(image.getBounds()).getSize();
+ int imageMax = imageDim.width;
+ if(imageDim.height > imageMax) {
+ imageMax = imageDim.height;
+ }
+ // size of enclosing box
+ Dimension size = getParent().getBounds().getSize();
+
+ if((imageDim.width >= size.width) || (imageDim.height >= size.height)) {
+ // 5 = border width
+ icon.setScale((size.width - 5.0) / imageMax);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setAppliedStereotypeIcon(Image image) {
+ setIcon(image);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeCompartmentFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeCompartmentFigure.java
index 3cdb0d6ede4..e4e1e5e5bf6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeCompartmentFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeCompartmentFigure.java
@@ -1,30 +1,30 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
-
-
-/**
- * This a specific figure to manage properties of stereotypes
- *
- */
-public class AppliedStereotypeCompartmentFigure extends ResizableCompartmentFigure {
-
- public AppliedStereotypeCompartmentFigure(String compartmentTitle, IMapMode mm) {
- super(compartmentTitle, mm);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+
+
+/**
+ * This a specific figure to manage properties of stereotypes
+ *
+ */
+public class AppliedStereotypeCompartmentFigure extends ResizableCompartmentFigure {
+
+ public AppliedStereotypeCompartmentFigure(String compartmentTitle, IMapMode mm) {
+ super(compartmentTitle, mm);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java
index 98e9f2d94b0..364e278a5e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AppliedStereotypeWrappingLabelFigure.java
@@ -1,29 +1,29 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This a WrappingLabel that can display applied stereotypes
- */
-public class AppliedStereotypeWrappingLabelFigure extends PapyrusWrappingLabel implements IPapyrusUMLElementFigure {
-
- public void setStereotypeDisplay(String stereotypes, Image image) {
- setText(stereotypes);
- setTextWrap(true);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This a WrappingLabel that can display applied stereotypes
+ */
+public class AppliedStereotypeWrappingLabelFigure extends PapyrusWrappingLabel implements IPapyrusUMLElementFigure {
+
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ setText(stereotypes);
+ setTextWrap(true);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AssociationNodeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AssociationNodeFigure.java
index 236241179a4..dda24e58bd7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AssociationNodeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AssociationNodeFigure.java
@@ -1,48 +1,48 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-
-public class AssociationNodeFigure extends DefaultSizeNodeFigure {
-
- // @unused
- public AssociationNodeFigure(Dimension defSize) {
- super(defSize);
- // TODO Auto-generated constructor stub
- }
-
- public AssociationNodeFigure(int width, int height) {
- super(width, height);
- // TODO Auto-generated constructor stub
- }
-
- // This returns as the anchoring area only the central line
- @Override
- public PointList getPolygonPoints() {
- PointList points = new PointList(5);
- Rectangle anchorableRectangle = getHandleBounds();
- points.addPoint(anchorableRectangle.x + (anchorableRectangle.width / 2), anchorableRectangle.y);
- points.addPoint(anchorableRectangle.x + anchorableRectangle.width, anchorableRectangle.y + anchorableRectangle.height / 2);
- points.addPoint(anchorableRectangle.x + (anchorableRectangle.width / 2), anchorableRectangle.y + anchorableRectangle.height);
- points.addPoint(anchorableRectangle.x, anchorableRectangle.y + anchorableRectangle.height / 2);
- points.addPoint(anchorableRectangle.x + (anchorableRectangle.width / 2), anchorableRectangle.y);
-
- return points;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+
+public class AssociationNodeFigure extends DefaultSizeNodeFigure {
+
+ // @unused
+ public AssociationNodeFigure(Dimension defSize) {
+ super(defSize);
+ // TODO Auto-generated constructor stub
+ }
+
+ public AssociationNodeFigure(int width, int height) {
+ super(width, height);
+ // TODO Auto-generated constructor stub
+ }
+
+ // This returns as the anchoring area only the central line
+ @Override
+ public PointList getPolygonPoints() {
+ PointList points = new PointList(5);
+ Rectangle anchorableRectangle = getHandleBounds();
+ points.addPoint(anchorableRectangle.x + (anchorableRectangle.width / 2), anchorableRectangle.y);
+ points.addPoint(anchorableRectangle.x + anchorableRectangle.width, anchorableRectangle.y + anchorableRectangle.height / 2);
+ points.addPoint(anchorableRectangle.x + (anchorableRectangle.width / 2), anchorableRectangle.y + anchorableRectangle.height);
+ points.addPoint(anchorableRectangle.x, anchorableRectangle.y + anchorableRectangle.height / 2);
+ points.addPoint(anchorableRectangle.x + (anchorableRectangle.width / 2), anchorableRectangle.y);
+
+ return points;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java
index f33997b98f1..8df78015a9a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java
@@ -1,304 +1,304 @@
-/****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
- * Vincent Lorenzo (CEA LIST), change layout(IFigure container)
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.ScalableCompartmentFigure;
-
-/**
- * this is the layout manager in charge to place element in compartment element.
- * A modification of the code has been done in order to manage none visible
- * compartment. if a compartment becomes invisible, its size and its height are
- * equal to 1.
- *
- */
-
-public class AutomaticCompartmentLayoutManager extends AbstractLayout {
-
- protected static final int MINIMUM_COMPARTMENT_HEIGHT = 15;
-
- // list of compartments
- protected ArrayList<IFigure> compartmentList = new ArrayList<IFigure>();
-
- // list of none compartments ex wrapping label etc...
- protected ArrayList<IFigure> notCompartmentList = new ArrayList<IFigure>();
-
- // background figure
- //protected IFigure backgroundFigure;
-
- protected boolean addExtraHeight = true;
-
- /**
- * set the distance between compartments
- *
- * @param addExtraHeight
- */
- public void setAddExtraHeight(boolean addExtraHeight) {
- this.addExtraHeight = addExtraHeight;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
- collectInformationOnChildren(container);
- int minimumWith = 0;
- int minimumHeight = 0;
- if(container instanceof CompartmentFigure) {
- // display name
- if(((CompartmentFigure)container).getNameLabel() != null) {
- if(((CompartmentFigure)container).getNameLabel().getPreferredSize().width > minimumWith) {
- minimumWith = ((CompartmentFigure)container).getNameLabel().getPreferredSize().width;
- }
- }
- }
- if(compartmentList.size() != 0) {
- for(int i = 0; i < container.getChildren().size(); i++) {
- IFigure child = (IFigure)container.getChildren().get(i);
- minimumHeight += child.getPreferredSize().height;
- minimumWith = Math.max(minimumWith, child.getPreferredSize().width);
- }
- } else {
- for(int i = 0; i < notCompartmentList.size(); i++) {
- minimumHeight += notCompartmentList.get(i).getPreferredSize().height;
- }
- }
- if(addExtraHeight)
- minimumHeight += 7;
- return new Dimension(minimumWith, minimumHeight);
- }
-
- @Override
- public Dimension getMinimumSize(IFigure container, int wHint, int hHint) {
- return new Dimension(20, 20);
- }
-
- /**
- * layout by putting label in the center of figure
- *
- * @param container
- */
- protected void layoutCenterForLabel(IFigure container) {
- int labelheight = 0;
- for(int i = 0; i < notCompartmentList.size(); i++) {
- labelheight += notCompartmentList.get(i).getPreferredSize().height;
- }
-
- for(int i = 0; i < container.getChildren().size(); i++) {
- if(notCompartmentList.contains((container.getChildren().get(i)))) {
- Rectangle bound = new Rectangle(((IFigure)container.getChildren().get(i)).getBounds());
- bound.setSize(getPreferedSize(((IFigure)container.getChildren().get(i))));
- if(i > 0) {
- bound.y = ((IFigure)container.getChildren().get(i - 1)).getBounds().getBottomLeft().y + 1;
- bound.x = container.getBounds().x + 3;
- bound.width = container.getBounds().width;
- } else {
- bound.x = container.getBounds().x + 3;
- bound.y = container.getBounds().y + ((container.getBounds().height - labelheight) / 2);
- bound.width = container.getBounds().width;
-
- }
- ((IFigure)container.getChildren().get(i)).setBounds(bound);
- } else {
- Rectangle bound = new Rectangle(((IFigure)container.getChildren().get(i)).getBounds());
- bound.y = container.getBounds().getBottomLeft().y + 1;
- bound.x = container.getBounds().x + 3;
- ((IFigure)container.getChildren().get(i)).setBounds(bound);
- }
- }
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void layout(IFigure container) {
- collectInformationOnChildren(container);
-
- // container.remove(backgroundFigure);
- // container.add(backgroundFigure, 0);
-
- // this list contains the visible compartments (that is to say :
- // notCompartmentList + compartmentsList
- List<IFigure> visibleCompartments = new ArrayList<IFigure>();
-
- visibleCompartments.addAll(notCompartmentList);
- visibleCompartments.addAll(compartmentList);
-
- // choose the good layout by taking in account if it exist GMF
- // compartment
- if(compartmentList.size() != 0) {
- // visit all compartment
- for(int i = 0; i < container.getChildren().size(); i++) {
- IFigure currentCompartment = (IFigure)container.getChildren().get(i);
- // this is a visible compartment
- if(visibleCompartments.contains(currentCompartment)) {
-
- Rectangle bound = new Rectangle(currentCompartment.getBounds());
- currentCompartment.invalidate();
- Dimension pref = currentCompartment.getPreferredSize();
- currentCompartment.invalidate();
- Dimension prefConstraint = currentCompartment.getPreferredSize(container.getBounds().width - 40, -1);
- if(pref.width < prefConstraint.width) {
- bound.setSize(pref);
- } else {
- bound.setSize(prefConstraint);
- }
- //bound.setSize(getPreferedSize(currentCompartment));
- if(visibleCompartments.indexOf(currentCompartment) > 0) {
- bound.y = (visibleCompartments.get(visibleCompartments.indexOf(currentCompartment) - 1)).getBounds().getBottomLeft().y + 1;
- bound.x = container.getBounds().x + 3;
- bound.width = container.getBounds().width;
- } else {
- bound.x = container.getBounds().x + 3;
- bound.y = container.getBounds().y + 3;
- bound.width = container.getBounds().width;
- }
- currentCompartment.setBounds(bound);
- } else {
- // this is a none visible compartment
- Rectangle bound = new Rectangle(currentCompartment.getBounds());
- bound.setSize(1, 1);
- currentCompartment.setBounds(bound);
- }
- }
- optimizeCompartmentSize(container);
- } else {
- layoutCenterForLabel(container);
- }
-
- // if(backgroundFigure!=null) {
- // Rectangle bound = new Rectangle(((IFigure)container).getBounds());
- // bound.y = container.getBounds().y + 1;
- // bound.x = container.getBounds().x + 3;
- // backgroundFigure.setBounds(bound);
- // }
- //
- }
-
- /**
- * Optimize the size of each compartment depending on the size of the
- * compartments container, and the size of each compartment. If a
- * compartment is empty, or not expanded, then a default size is applied to
- * this compartment
- *
- * @param compartmentsDimension
- * an hashmap containing each compartment dimension.
- */
- protected void optimizeCompartmentSize(IFigure container) {
- int compartmentsHeight = 0;
- int notCompartmentsHeight = 0;
- for(int i = 0; i < notCompartmentList.size(); i++) {
- notCompartmentsHeight += notCompartmentList.get(i).getBounds().height;
- }
-
- for(int i = 0; i < compartmentList.size(); i++) {
- compartmentsHeight += compartmentList.get(i).getBounds().height;
- }
- int remainingspace = container.getBounds().height - notCompartmentsHeight;
-
- // ratio between the height of all compartments and the size of the
- // compartments container.
- double ratio = new Integer(compartmentsHeight).doubleValue() / new Integer(remainingspace).doubleValue();
-
- for(int i = 0; i < compartmentList.size(); i++) {
- Rectangle bound = new Rectangle((compartmentList.get(i)).getBounds());
- int value = (int)(bound.height / ratio);
- bound.height = value;
- bound.x = container.getBounds().x;
- if(i > 0) {
- bound.y = (compartmentList.get(i - 1)).getBounds().getBottomLeft().y + 1;
-
- }
- (compartmentList.get(i)).setBounds(bound);
-
- }
-
- }
-
- /**
- * use to know what kind of element we have in order to apply the good
- * policy for the disposition
- *
- * @param container
- */
- public void collectInformationOnChildren(IFigure container) {
- compartmentList = new ArrayList<IFigure>();
- notCompartmentList = new ArrayList<IFigure>();
- for(int i = 0; i < container.getChildren().size(); i++) {
- if(isAGMFContainer(((IFigure)container.getChildren().get(i)))) {
- compartmentList.add(((IFigure)container.getChildren().get(i)));
- } else if((container.getChildren().get(i)) instanceof Label || (container.getChildren().get(i)) instanceof WrappingLabel || ((container.getChildren().get(i)) instanceof StereotypePropertiesCompartment)) {
- notCompartmentList.add(((IFigure)container.getChildren().get(i)));
- } else {
- if((container.getChildren().get(i)) instanceof ScalableCompartmentFigure) {
- compartmentList.add((IFigure)container.getChildren().get(i));
- }
-
- }
- }
- }
-
- /**
- * obtain a prefered size
- *
- * @param figure
- * that can contain a GMF compartment figure
- * @return a the size
- */
- public Dimension getPreferedSize(IFigure figure) {
- Dimension dim = figure.getPreferredSize();
- if(figure.getChildren().size() > 0) {
- Object compartment = figure.getChildren().get(0);
- if(compartment instanceof ResizableCompartmentFigure) {
- dim.height = ((ResizableCompartmentFigure)compartment).getPreferredSize().height + 10;
- if(dim.height == 0) {
- dim.height = MINIMUM_COMPARTMENT_HEIGHT;
- }
-
- }
- }
- return dim;
- }
-
- /**
- * tests is the figure contains a GMF compartment
- *
- * @param figure
- * @return true if this is the case
- */
- public boolean isAGMFContainer(IFigure figure) {
- if(figure instanceof StereotypePropertiesCompartment) {
- return false;
- }
- if(figure.getChildren().size() > 0) {
- if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) {
- return true;
- }
- }
- return false;
- }
-
-}
+/****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
+ * Vincent Lorenzo (CEA LIST), change layout(IFigure container)
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.ScalableCompartmentFigure;
+
+/**
+ * this is the layout manager in charge to place element in compartment element.
+ * A modification of the code has been done in order to manage none visible
+ * compartment. if a compartment becomes invisible, its size and its height are
+ * equal to 1.
+ *
+ */
+
+public class AutomaticCompartmentLayoutManager extends AbstractLayout {
+
+ protected static final int MINIMUM_COMPARTMENT_HEIGHT = 15;
+
+ // list of compartments
+ protected ArrayList<IFigure> compartmentList = new ArrayList<IFigure>();
+
+ // list of none compartments ex wrapping label etc...
+ protected ArrayList<IFigure> notCompartmentList = new ArrayList<IFigure>();
+
+ // background figure
+ //protected IFigure backgroundFigure;
+
+ protected boolean addExtraHeight = true;
+
+ /**
+ * set the distance between compartments
+ *
+ * @param addExtraHeight
+ */
+ public void setAddExtraHeight(boolean addExtraHeight) {
+ this.addExtraHeight = addExtraHeight;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
+ collectInformationOnChildren(container);
+ int minimumWith = 0;
+ int minimumHeight = 0;
+ if(container instanceof CompartmentFigure) {
+ // display name
+ if(((CompartmentFigure)container).getNameLabel() != null) {
+ if(((CompartmentFigure)container).getNameLabel().getPreferredSize().width > minimumWith) {
+ minimumWith = ((CompartmentFigure)container).getNameLabel().getPreferredSize().width;
+ }
+ }
+ }
+ if(compartmentList.size() != 0) {
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ IFigure child = (IFigure)container.getChildren().get(i);
+ minimumHeight += child.getPreferredSize().height;
+ minimumWith = Math.max(minimumWith, child.getPreferredSize().width);
+ }
+ } else {
+ for(int i = 0; i < notCompartmentList.size(); i++) {
+ minimumHeight += notCompartmentList.get(i).getPreferredSize().height;
+ }
+ }
+ if(addExtraHeight)
+ minimumHeight += 7;
+ return new Dimension(minimumWith, minimumHeight);
+ }
+
+ @Override
+ public Dimension getMinimumSize(IFigure container, int wHint, int hHint) {
+ return new Dimension(20, 20);
+ }
+
+ /**
+ * layout by putting label in the center of figure
+ *
+ * @param container
+ */
+ protected void layoutCenterForLabel(IFigure container) {
+ int labelheight = 0;
+ for(int i = 0; i < notCompartmentList.size(); i++) {
+ labelheight += notCompartmentList.get(i).getPreferredSize().height;
+ }
+
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ if(notCompartmentList.contains((container.getChildren().get(i)))) {
+ Rectangle bound = new Rectangle(((IFigure)container.getChildren().get(i)).getBounds());
+ bound.setSize(getPreferedSize(((IFigure)container.getChildren().get(i))));
+ if(i > 0) {
+ bound.y = ((IFigure)container.getChildren().get(i - 1)).getBounds().getBottomLeft().y + 1;
+ bound.x = container.getBounds().x + 3;
+ bound.width = container.getBounds().width;
+ } else {
+ bound.x = container.getBounds().x + 3;
+ bound.y = container.getBounds().y + ((container.getBounds().height - labelheight) / 2);
+ bound.width = container.getBounds().width;
+
+ }
+ ((IFigure)container.getChildren().get(i)).setBounds(bound);
+ } else {
+ Rectangle bound = new Rectangle(((IFigure)container.getChildren().get(i)).getBounds());
+ bound.y = container.getBounds().getBottomLeft().y + 1;
+ bound.x = container.getBounds().x + 3;
+ ((IFigure)container.getChildren().get(i)).setBounds(bound);
+ }
+ }
+
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void layout(IFigure container) {
+ collectInformationOnChildren(container);
+
+ // container.remove(backgroundFigure);
+ // container.add(backgroundFigure, 0);
+
+ // this list contains the visible compartments (that is to say :
+ // notCompartmentList + compartmentsList
+ List<IFigure> visibleCompartments = new ArrayList<IFigure>();
+
+ visibleCompartments.addAll(notCompartmentList);
+ visibleCompartments.addAll(compartmentList);
+
+ // choose the good layout by taking in account if it exist GMF
+ // compartment
+ if(compartmentList.size() != 0) {
+ // visit all compartment
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ IFigure currentCompartment = (IFigure)container.getChildren().get(i);
+ // this is a visible compartment
+ if(visibleCompartments.contains(currentCompartment)) {
+
+ Rectangle bound = new Rectangle(currentCompartment.getBounds());
+ currentCompartment.invalidate();
+ Dimension pref = currentCompartment.getPreferredSize();
+ currentCompartment.invalidate();
+ Dimension prefConstraint = currentCompartment.getPreferredSize(container.getBounds().width - 40, -1);
+ if(pref.width < prefConstraint.width) {
+ bound.setSize(pref);
+ } else {
+ bound.setSize(prefConstraint);
+ }
+ //bound.setSize(getPreferedSize(currentCompartment));
+ if(visibleCompartments.indexOf(currentCompartment) > 0) {
+ bound.y = (visibleCompartments.get(visibleCompartments.indexOf(currentCompartment) - 1)).getBounds().getBottomLeft().y + 1;
+ bound.x = container.getBounds().x + 3;
+ bound.width = container.getBounds().width;
+ } else {
+ bound.x = container.getBounds().x + 3;
+ bound.y = container.getBounds().y + 3;
+ bound.width = container.getBounds().width;
+ }
+ currentCompartment.setBounds(bound);
+ } else {
+ // this is a none visible compartment
+ Rectangle bound = new Rectangle(currentCompartment.getBounds());
+ bound.setSize(1, 1);
+ currentCompartment.setBounds(bound);
+ }
+ }
+ optimizeCompartmentSize(container);
+ } else {
+ layoutCenterForLabel(container);
+ }
+
+ // if(backgroundFigure!=null) {
+ // Rectangle bound = new Rectangle(((IFigure)container).getBounds());
+ // bound.y = container.getBounds().y + 1;
+ // bound.x = container.getBounds().x + 3;
+ // backgroundFigure.setBounds(bound);
+ // }
+ //
+ }
+
+ /**
+ * Optimize the size of each compartment depending on the size of the
+ * compartments container, and the size of each compartment. If a
+ * compartment is empty, or not expanded, then a default size is applied to
+ * this compartment
+ *
+ * @param compartmentsDimension
+ * an hashmap containing each compartment dimension.
+ */
+ protected void optimizeCompartmentSize(IFigure container) {
+ int compartmentsHeight = 0;
+ int notCompartmentsHeight = 0;
+ for(int i = 0; i < notCompartmentList.size(); i++) {
+ notCompartmentsHeight += notCompartmentList.get(i).getBounds().height;
+ }
+
+ for(int i = 0; i < compartmentList.size(); i++) {
+ compartmentsHeight += compartmentList.get(i).getBounds().height;
+ }
+ int remainingspace = container.getBounds().height - notCompartmentsHeight;
+
+ // ratio between the height of all compartments and the size of the
+ // compartments container.
+ double ratio = new Integer(compartmentsHeight).doubleValue() / new Integer(remainingspace).doubleValue();
+
+ for(int i = 0; i < compartmentList.size(); i++) {
+ Rectangle bound = new Rectangle((compartmentList.get(i)).getBounds());
+ int value = (int)(bound.height / ratio);
+ bound.height = value;
+ bound.x = container.getBounds().x;
+ if(i > 0) {
+ bound.y = (compartmentList.get(i - 1)).getBounds().getBottomLeft().y + 1;
+
+ }
+ (compartmentList.get(i)).setBounds(bound);
+
+ }
+
+ }
+
+ /**
+ * use to know what kind of element we have in order to apply the good
+ * policy for the disposition
+ *
+ * @param container
+ */
+ public void collectInformationOnChildren(IFigure container) {
+ compartmentList = new ArrayList<IFigure>();
+ notCompartmentList = new ArrayList<IFigure>();
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ if(isAGMFContainer(((IFigure)container.getChildren().get(i)))) {
+ compartmentList.add(((IFigure)container.getChildren().get(i)));
+ } else if((container.getChildren().get(i)) instanceof Label || (container.getChildren().get(i)) instanceof WrappingLabel || ((container.getChildren().get(i)) instanceof StereotypePropertiesCompartment)) {
+ notCompartmentList.add(((IFigure)container.getChildren().get(i)));
+ } else {
+ if((container.getChildren().get(i)) instanceof ScalableCompartmentFigure) {
+ compartmentList.add((IFigure)container.getChildren().get(i));
+ }
+
+ }
+ }
+ }
+
+ /**
+ * obtain a prefered size
+ *
+ * @param figure
+ * that can contain a GMF compartment figure
+ * @return a the size
+ */
+ public Dimension getPreferedSize(IFigure figure) {
+ Dimension dim = figure.getPreferredSize();
+ if(figure.getChildren().size() > 0) {
+ Object compartment = figure.getChildren().get(0);
+ if(compartment instanceof ResizableCompartmentFigure) {
+ dim.height = ((ResizableCompartmentFigure)compartment).getPreferredSize().height + 10;
+ if(dim.height == 0) {
+ dim.height = MINIMUM_COMPARTMENT_HEIGHT;
+ }
+
+ }
+ }
+ return dim;
+ }
+
+ /**
+ * tests is the figure contains a GMF compartment
+ *
+ * @param figure
+ * @return true if this is the case
+ */
+ public boolean isAGMFContainer(IFigure figure) {
+ if(figure instanceof StereotypePropertiesCompartment) {
+ return false;
+ }
+ if(figure.getChildren().size() > 0) {
+ if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CenteredWrappedLabel.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CenteredWrappedLabel.java
index 1e030af7793..4b9fe47b805 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CenteredWrappedLabel.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CenteredWrappedLabel.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-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);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+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/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ClassifierFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ClassifierFigure.java
index 4f1c45c8c11..0e27a3bd0b1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ClassifierFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ClassifierFigure.java
@@ -1,144 +1,144 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * Represents a classifier.
- */
-public class ClassifierFigure extends CompartmentFigure {
-
- protected static final int SPACE_FOR_ACTIVE_CLASS = 4;
-
- /* to present the class as an active class */
- /** The active. Default value is false */
- private boolean active = false;
-
- /** The Attribute Compartment */
- private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment";
-
- /** The Operation Compartment */
- private final static String OPERATION_COMPARTMENT = "operationCompartment";
-
- /** The NestedClassifier Compartment */
- private final static String NESTEDCLASSIFIER_COMPARTMENT = "nestedClassifierCompartment";
-
- /** The List of Compartment */
- private final static List<String> COMPARTMENT = new ArrayList<String>() {
-
- private static final long serialVersionUID = 1L;
- {
- add(ATTRIBUTE_COMPARTMENT);
- add(OPERATION_COMPARTMENT);
- add(NESTEDCLASSIFIER_COMPARTMENT);
- }
- };
-
- /**
- * Default Constructor
- */
- public ClassifierFigure() {
- this(null);
- }
-
- /**
- * Create a new Classifier figure with the given tag
- *
- * @param tagLabel
- * a String that will be displayed at the top of the figure
- */
- public ClassifierFigure(String tagLabel) {
- super(COMPARTMENT, tagLabel);
- }
-
- /**
- * {@inheritDoc}
- */
- public void paint(Graphics graphics) {
- super.paint(graphics);
- if(active) {
- Rectangle rect = this.getBounds();
- graphics.pushState();
- graphics.setForegroundColor(getForegroundColor());
- // do not forget to set line width to 1, if not the color will
- // change because of the anti-aliasing
- graphics.setLineWidth(1);
-
- graphics.drawLine(new Point(rect.x + SPACE_FOR_ACTIVE_CLASS, rect.y), new Point(rect.x + SPACE_FOR_ACTIVE_CLASS, rect.y + rect.height - 1));
- graphics.drawLine(new Point(rect.x - SPACE_FOR_ACTIVE_CLASS - 1 + rect.width, rect.y), new Point(rect.x - SPACE_FOR_ACTIVE_CLASS - 1 + rect.width, rect.y + rect.height - 1));
- graphics.setBackgroundColor(getBackgroundColor());
- graphics.setForegroundColor(getBackgroundColor());
- graphics.setLineWidth(3);
-
- graphics.drawLine(new Point(rect.x + 2, rect.y + 1), new Point(rect.x + 2, rect.y + rect.height - 2));
- graphics.drawLine(new Point(rect.x - 3 + rect.width, rect.y + 1), new Point(rect.x - 3 + rect.width, rect.y + rect.height - 2));
-
- graphics.popState();
- }
- }
-
- /**
- * Get the attribute's compartment figure
- *
- * @return
- */
- public IFigure getAttributeCompartmentFigure() {
- return getCompartment(ATTRIBUTE_COMPARTMENT);
- }
-
- /**
- * Get the Operation's compartment figure
- *
- * @return
- */
- public IFigure getOperationCompartmentFigure() {
- return getCompartment(OPERATION_COMPARTMENT);
- }
-
- /**
- * Get the NestedClassifier's compartment figure
- *
- * @return
- */
- public IFigure getNestedClassifierFigure() {
- return getCompartment(NESTEDCLASSIFIER_COMPARTMENT);
- }
-
- /**
- * Checks if is active.
- *
- * @return true, if is active
- */
- // @unused
- public boolean isActive() {
- return active;
- }
-
- /**
- * Set the active
- *
- * @param active
- */
- public void setActive(boolean active) {
- this.active = active;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * Represents a classifier.
+ */
+public class ClassifierFigure extends CompartmentFigure {
+
+ protected static final int SPACE_FOR_ACTIVE_CLASS = 4;
+
+ /* to present the class as an active class */
+ /** The active. Default value is false */
+ private boolean active = false;
+
+ /** The Attribute Compartment */
+ private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment";
+
+ /** The Operation Compartment */
+ private final static String OPERATION_COMPARTMENT = "operationCompartment";
+
+ /** The NestedClassifier Compartment */
+ private final static String NESTEDCLASSIFIER_COMPARTMENT = "nestedClassifierCompartment";
+
+ /** The List of Compartment */
+ private final static List<String> COMPARTMENT = new ArrayList<String>() {
+
+ private static final long serialVersionUID = 1L;
+ {
+ add(ATTRIBUTE_COMPARTMENT);
+ add(OPERATION_COMPARTMENT);
+ add(NESTEDCLASSIFIER_COMPARTMENT);
+ }
+ };
+
+ /**
+ * Default Constructor
+ */
+ public ClassifierFigure() {
+ this(null);
+ }
+
+ /**
+ * Create a new Classifier figure with the given tag
+ *
+ * @param tagLabel
+ * a String that will be displayed at the top of the figure
+ */
+ public ClassifierFigure(String tagLabel) {
+ super(COMPARTMENT, tagLabel);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void paint(Graphics graphics) {
+ super.paint(graphics);
+ if(active) {
+ Rectangle rect = this.getBounds();
+ graphics.pushState();
+ graphics.setForegroundColor(getForegroundColor());
+ // do not forget to set line width to 1, if not the color will
+ // change because of the anti-aliasing
+ graphics.setLineWidth(1);
+
+ graphics.drawLine(new Point(rect.x + SPACE_FOR_ACTIVE_CLASS, rect.y), new Point(rect.x + SPACE_FOR_ACTIVE_CLASS, rect.y + rect.height - 1));
+ graphics.drawLine(new Point(rect.x - SPACE_FOR_ACTIVE_CLASS - 1 + rect.width, rect.y), new Point(rect.x - SPACE_FOR_ACTIVE_CLASS - 1 + rect.width, rect.y + rect.height - 1));
+ graphics.setBackgroundColor(getBackgroundColor());
+ graphics.setForegroundColor(getBackgroundColor());
+ graphics.setLineWidth(3);
+
+ graphics.drawLine(new Point(rect.x + 2, rect.y + 1), new Point(rect.x + 2, rect.y + rect.height - 2));
+ graphics.drawLine(new Point(rect.x - 3 + rect.width, rect.y + 1), new Point(rect.x - 3 + rect.width, rect.y + rect.height - 2));
+
+ graphics.popState();
+ }
+ }
+
+ /**
+ * Get the attribute's compartment figure
+ *
+ * @return
+ */
+ public IFigure getAttributeCompartmentFigure() {
+ return getCompartment(ATTRIBUTE_COMPARTMENT);
+ }
+
+ /**
+ * Get the Operation's compartment figure
+ *
+ * @return
+ */
+ public IFigure getOperationCompartmentFigure() {
+ return getCompartment(OPERATION_COMPARTMENT);
+ }
+
+ /**
+ * Get the NestedClassifier's compartment figure
+ *
+ * @return
+ */
+ public IFigure getNestedClassifierFigure() {
+ return getCompartment(NESTEDCLASSIFIER_COMPARTMENT);
+ }
+
+ /**
+ * Checks if is active.
+ *
+ * @return true, if is active
+ */
+ // @unused
+ public boolean isActive() {
+ return active;
+ }
+
+ /**
+ * Set the active
+ *
+ * @param active
+ */
+ public void setActive(boolean active) {
+ this.active = active;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CompartmentFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CompartmentFigure.java
index 787d8cce4a5..be7b3569459 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CompartmentFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CompartmentFigure.java
@@ -1,87 +1,87 @@
-/****************************************************************************
- * 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:
- * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SubCompartmentLayoutManager;
-
-/**
- * A rectangular figure that supports compartment.
- */
-public class CompartmentFigure extends NodeNamedElementFigure {
-
- private Map<String, RectangleFigure> containerFigures;
-
- /**
- * Constructor.
- *
- * @param compartmentFigure
- */
- public CompartmentFigure(List<String> compartmentFigure) {
- this(compartmentFigure, null);
- }
-
- /**
- * Constructor with a tagged value.
- *
- * @param compartmentFigure
- * a list of id for the compartment figure
- * @param taggedLabelValue
- * the value to display as tagged value
- */
- public CompartmentFigure(List<String> compartmentFigure, String taggedLabelValue) {
- super(taggedLabelValue);
-
- setLayoutManager(new AutomaticCompartmentLayoutManager());
- setOpaque(false);
- createContentPane(compartmentFigure);
-
- }
-
- /**
- *
- * @param compartmentFigure
- */
- protected void createContentPane(List<String> compartmentFigure) {
- containerFigures = new HashMap<String, RectangleFigure>();
-
- for(String id : compartmentFigure) {
- RectangleFigure newFigure = new RectangleFigure();
- newFigure.setLayoutManager(new SubCompartmentLayoutManager());
- // to debug graphically: newFigure.setFill(true);
- newFigure.setFill(false);
- newFigure.setBorder(null);
- newFigure.setOutline(false);
- newFigure.setOpaque(false);
- this.add(newFigure);
- containerFigures.put(id, newFigure);
- }
-
- }
-
- /**
- * Get the RectangleFigure containing the wanted compartment.
- *
- * @param id
- * the id to find the right compartment
- * @return the RectangleFigure
- */
- public RectangleFigure getCompartment(String id) {
- return containerFigures.get(id);
- }
-
-}
+/****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.SubCompartmentLayoutManager;
+
+/**
+ * A rectangular figure that supports compartment.
+ */
+public class CompartmentFigure extends NodeNamedElementFigure {
+
+ private Map<String, RectangleFigure> containerFigures;
+
+ /**
+ * Constructor.
+ *
+ * @param compartmentFigure
+ */
+ public CompartmentFigure(List<String> compartmentFigure) {
+ this(compartmentFigure, null);
+ }
+
+ /**
+ * Constructor with a tagged value.
+ *
+ * @param compartmentFigure
+ * a list of id for the compartment figure
+ * @param taggedLabelValue
+ * the value to display as tagged value
+ */
+ public CompartmentFigure(List<String> compartmentFigure, String taggedLabelValue) {
+ super(taggedLabelValue);
+
+ setLayoutManager(new AutomaticCompartmentLayoutManager());
+ setOpaque(false);
+ createContentPane(compartmentFigure);
+
+ }
+
+ /**
+ *
+ * @param compartmentFigure
+ */
+ protected void createContentPane(List<String> compartmentFigure) {
+ containerFigures = new HashMap<String, RectangleFigure>();
+
+ for(String id : compartmentFigure) {
+ RectangleFigure newFigure = new RectangleFigure();
+ newFigure.setLayoutManager(new SubCompartmentLayoutManager());
+ // to debug graphically: newFigure.setFill(true);
+ newFigure.setFill(false);
+ newFigure.setBorder(null);
+ newFigure.setOutline(false);
+ newFigure.setOpaque(false);
+ this.add(newFigure);
+ containerFigures.put(id, newFigure);
+ }
+
+ }
+
+ /**
+ * Get the RectangleFigure containing the wanted compartment.
+ *
+ * @param id
+ * the id to find the right compartment
+ * @return the RectangleFigure
+ */
+ public RectangleFigure getCompartment(String id) {
+ return containerFigures.get(id);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ComponentFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ComponentFigure.java
index 1b78146feca..94206f999d1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ComponentFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ComponentFigure.java
@@ -1,28 +1,28 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-
-/**
- * Represents a component.
- */
-public class ComponentFigure extends ClassifierFigure {
-
- /**
- * Instantiates a new component figure.
- */
- public ComponentFigure() {
- super("Component");
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+
+/**
+ * Represents a component.
+ */
+public class ComponentFigure extends ClassifierFigure {
+
+ /**
+ * Instantiates a new component figure.
+ */
+ public ComponentFigure() {
+ super("Component");
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ConstraintFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ConstraintFigure.java
index 03793434951..09c2efa5f70 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ConstraintFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ConstraintFigure.java
@@ -1,321 +1,321 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.text.FlowPage;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.draw2d.ui.text.TextFlowEx;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * this class is used to display the a constraint with the possibility of
- * gradient qualified name
- *
- */
-public class ConstraintFigure extends CornerBentFigure implements IPapyrusNodeNamedElementFigure, ILabelFigure, IMultilineEditableFigure {
-
- private static final String CHEVRON = String.valueOf("\u00AB") + String.valueOf("\u00BB");
- protected static final String LEFT_BRACE = "{";
- private Label taggedLabel;
-
- protected static final String RIGHT_BRACE = "}";
-
- protected TextFlowEx textFlow;
-
- private WrappingLabel nameLabel;
-
- private Label qualifiedLabel;
-
- /** the depth of the qualified name **/
- private int depth = 0;
-
- /** main flow page */
- protected FlowPage page;
-
- /**
- * Calculate the partial qualified name with a specified depth.
- *
- * @param qualifiedName
- * the qualified name can return null
- */
- public String getQualifiedName(String qualifiedName, int depth) {
- int n = -1;
-
- int i = 0;
- if(depth <= 0) {
- return qualifiedName;
- }
-
- while(i < depth) {
- if((n = qualifiedName.indexOf("::", n + 1)) != -1) {
- i++;
- } else {
- return null;
- }
- }
-
- if(n == -1) {
- return qualifiedName;
- } else {
- return qualifiedName.substring(n + 2);
- }
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#setQualifiedName(java.lang.String)
- *
- * @param qualifiedName
- */
- public void setQualifiedName(String qualifiedName) {
- String tmpQualifiedName = getQualifiedName(qualifiedName, depth);
- // two raisons to remove label!
- // null
- // or the qualified name is equal to 1
- if(qualifiedName == null || tmpQualifiedName == null || !tmpQualifiedName.contains("::")) { // Remove
- // label
- // if
- // any
- if(this.qualifiedLabel != null) {
- this.remove(this.qualifiedLabel);
- this.qualifiedLabel = null;
- }
- return;
- }
-
- // Set the stereotype label
- if(this.qualifiedLabel == null) {
- this.createQualifiedNameLabel();
- }
- // we have to not display name.
-
- int i = tmpQualifiedName.lastIndexOf("::");
- if(i != -1) {
- tmpQualifiedName = tmpQualifiedName.substring(0, i);
- }
- this.qualifiedLabel.setText("(" + tmpQualifiedName.trim() + ")");
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#getQualifiedNameLabel()
- *
- * @return
- */
-
- public Label getQualifiedNameLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public ConstraintFigure( ) {
- this(null);
- }
- public ConstraintFigure( String tagLabel) {
- super();
-
- nameLabel = new WrappingLabel();
-
- nameLabel.setOpaque(false);
- nameLabel.setAlignment(PositionConstants.MIDDLE);
- add(nameLabel);
- initTagLabel(tagLabel);
- page = new FlowPage();
- page.setOpaque(false);
-
- this.add(page);
-
- textFlow = new TextFlowEx("");
- page.add(textFlow);
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#getTaggedLabel()
- *
- * @return
- */
- public Label getTaggedLabel() {
- return taggedLabel;
- }
-
- /**
- * Create the tag label in the figure. The tag label is created if value is
- * not null.
- *
- * @param value
- * the value to use
- */
- protected void initTagLabel(String value) {
- if(value != null && value.length() > 0) {
- taggedLabel = new Label();
- String textToDisplay = new StringBuffer(CHEVRON).insert(1, value).toString();
- taggedLabel.setText(textToDisplay);
- taggedLabel.setOpaque(false);
- taggedLabel.setForegroundColor(getNameLabel().getForegroundColor());
- taggedLabel.setFont(getNameLabel().getFont());
- this.add(taggedLabel, null, 0);
- }
- }
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#setDepth(int)
- *
- * @param depth
- */
- public void setDepth(int depth) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#getNameLabel()
- *
- * @return
- */
- public WrappingLabel getNameLabel() {
- return nameLabel;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#setNameLabelIcon(boolean)
- *
- * @param displayNameLabelIcon
- */
- public void setNameLabelIcon(boolean displayNameLabelIcon) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * create the label that contains the qualified name.
- */
- protected void createQualifiedNameLabel() {
- qualifiedLabel = new Label();
- qualifiedLabel.setOpaque(false);
- qualifiedLabel.setFont(getNameLabel().getFont());
- qualifiedLabel.setForegroundColor(getNameLabel().getForegroundColor());
- // Add the label to the figure, after the name
- this.add(qualifiedLabel, getQualifiedNameLabelPosition());
- }
-
- protected int getQualifiedNameLabelPosition() {
- int position = getStereotypePropertiesLabelPosition();
- if(stereotypePropertiesInBraceContent != null) {
- position++;
- }
- return position;
- }
-
- /**
- * use to obtain the reference of this figure (use in order to launch an
- * edit request)
- *
- * @return the constraintfigure
- */
- public ConstraintFigure getConstraintFigure() {
- return this;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
- *
- * @param text
- */
- public void setText(String text) {
- // generates new ones
- textFlow.setText(LEFT_BRACE + text + RIGHT_BRACE);
- }
-
- /**
- *
- * @return the textflow of the constraint that contain the string of the
- * specification
- */
- public TextFlowEx getTextFlow() {
- return textFlow;
- }
-
- /**
- *
- * @return the container of the text flow
- */
- public FlowPage getPageFlow() {
- return page;
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
- *
- * @return the display string that represents the specification
- */
- public String getText() {
- return textFlow.getText();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
- *
- * @param icon
- */
- public void setIcon(Image icon) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
- *
- * @return
- */
- public Image getIcon() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- *
- * @see org.eclipse.draw2d.Figure#getMinimumSize(int, int)
- *
- *
- */
- public Dimension getMinimumSize(int wHint, int hHint) {
- // TODO Auto-generated method stub
- return new Dimension(20, 20);
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure#getEditionLocation()
- *
- */
- public Point getEditionLocation() {
- return page.getLocation();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.text.FlowPage;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.draw2d.ui.text.TextFlowEx;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * this class is used to display the a constraint with the possibility of
+ * gradient qualified name
+ *
+ */
+public class ConstraintFigure extends CornerBentFigure implements IPapyrusNodeNamedElementFigure, ILabelFigure, IMultilineEditableFigure {
+
+ private static final String CHEVRON = String.valueOf("\u00AB") + String.valueOf("\u00BB");
+ protected static final String LEFT_BRACE = "{";
+ private Label taggedLabel;
+
+ protected static final String RIGHT_BRACE = "}";
+
+ protected TextFlowEx textFlow;
+
+ private WrappingLabel nameLabel;
+
+ private Label qualifiedLabel;
+
+ /** the depth of the qualified name **/
+ private int depth = 0;
+
+ /** main flow page */
+ protected FlowPage page;
+
+ /**
+ * Calculate the partial qualified name with a specified depth.
+ *
+ * @param qualifiedName
+ * the qualified name can return null
+ */
+ public String getQualifiedName(String qualifiedName, int depth) {
+ int n = -1;
+
+ int i = 0;
+ if(depth <= 0) {
+ return qualifiedName;
+ }
+
+ while(i < depth) {
+ if((n = qualifiedName.indexOf("::", n + 1)) != -1) {
+ i++;
+ } else {
+ return null;
+ }
+ }
+
+ if(n == -1) {
+ return qualifiedName;
+ } else {
+ return qualifiedName.substring(n + 2);
+ }
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#setQualifiedName(java.lang.String)
+ *
+ * @param qualifiedName
+ */
+ public void setQualifiedName(String qualifiedName) {
+ String tmpQualifiedName = getQualifiedName(qualifiedName, depth);
+ // two raisons to remove label!
+ // null
+ // or the qualified name is equal to 1
+ if(qualifiedName == null || tmpQualifiedName == null || !tmpQualifiedName.contains("::")) { // Remove
+ // label
+ // if
+ // any
+ if(this.qualifiedLabel != null) {
+ this.remove(this.qualifiedLabel);
+ this.qualifiedLabel = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label
+ if(this.qualifiedLabel == null) {
+ this.createQualifiedNameLabel();
+ }
+ // we have to not display name.
+
+ int i = tmpQualifiedName.lastIndexOf("::");
+ if(i != -1) {
+ tmpQualifiedName = tmpQualifiedName.substring(0, i);
+ }
+ this.qualifiedLabel.setText("(" + tmpQualifiedName.trim() + ")");
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#getQualifiedNameLabel()
+ *
+ * @return
+ */
+
+ public Label getQualifiedNameLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ConstraintFigure( ) {
+ this(null);
+ }
+ public ConstraintFigure( String tagLabel) {
+ super();
+
+ nameLabel = new WrappingLabel();
+
+ nameLabel.setOpaque(false);
+ nameLabel.setAlignment(PositionConstants.MIDDLE);
+ add(nameLabel);
+ initTagLabel(tagLabel);
+ page = new FlowPage();
+ page.setOpaque(false);
+
+ this.add(page);
+
+ textFlow = new TextFlowEx("");
+ page.add(textFlow);
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#getTaggedLabel()
+ *
+ * @return
+ */
+ public Label getTaggedLabel() {
+ return taggedLabel;
+ }
+
+ /**
+ * Create the tag label in the figure. The tag label is created if value is
+ * not null.
+ *
+ * @param value
+ * the value to use
+ */
+ protected void initTagLabel(String value) {
+ if(value != null && value.length() > 0) {
+ taggedLabel = new Label();
+ String textToDisplay = new StringBuffer(CHEVRON).insert(1, value).toString();
+ taggedLabel.setText(textToDisplay);
+ taggedLabel.setOpaque(false);
+ taggedLabel.setForegroundColor(getNameLabel().getForegroundColor());
+ taggedLabel.setFont(getNameLabel().getFont());
+ this.add(taggedLabel, null, 0);
+ }
+ }
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#setDepth(int)
+ *
+ * @param depth
+ */
+ public void setDepth(int depth) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#getNameLabel()
+ *
+ * @return
+ */
+ public WrappingLabel getNameLabel() {
+ return nameLabel;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusNodeNamedElementFigure#setNameLabelIcon(boolean)
+ *
+ * @param displayNameLabelIcon
+ */
+ public void setNameLabelIcon(boolean displayNameLabelIcon) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * create the label that contains the qualified name.
+ */
+ protected void createQualifiedNameLabel() {
+ qualifiedLabel = new Label();
+ qualifiedLabel.setOpaque(false);
+ qualifiedLabel.setFont(getNameLabel().getFont());
+ qualifiedLabel.setForegroundColor(getNameLabel().getForegroundColor());
+ // Add the label to the figure, after the name
+ this.add(qualifiedLabel, getQualifiedNameLabelPosition());
+ }
+
+ protected int getQualifiedNameLabelPosition() {
+ int position = getStereotypePropertiesLabelPosition();
+ if(stereotypePropertiesInBraceContent != null) {
+ position++;
+ }
+ return position;
+ }
+
+ /**
+ * use to obtain the reference of this figure (use in order to launch an
+ * edit request)
+ *
+ * @return the constraintfigure
+ */
+ public ConstraintFigure getConstraintFigure() {
+ return this;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
+ *
+ * @param text
+ */
+ public void setText(String text) {
+ // generates new ones
+ textFlow.setText(LEFT_BRACE + text + RIGHT_BRACE);
+ }
+
+ /**
+ *
+ * @return the textflow of the constraint that contain the string of the
+ * specification
+ */
+ public TextFlowEx getTextFlow() {
+ return textFlow;
+ }
+
+ /**
+ *
+ * @return the container of the text flow
+ */
+ public FlowPage getPageFlow() {
+ return page;
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
+ *
+ * @return the display string that represents the specification
+ */
+ public String getText() {
+ return textFlow.getText();
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
+ *
+ * @param icon
+ */
+ public void setIcon(Image icon) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
+ *
+ * @return
+ */
+ public Image getIcon() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.draw2d.Figure#getMinimumSize(int, int)
+ *
+ *
+ */
+ public Dimension getMinimumSize(int wHint, int hHint) {
+ // TODO Auto-generated method stub
+ return new Dimension(20, 20);
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure#getEditionLocation()
+ *
+ */
+ public Point getEditionLocation() {
+ return page.getLocation();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerBorder.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerBorder.java
index ee1adfc1929..b160e9aa447 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerBorder.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerBorder.java
@@ -1,232 +1,232 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.AbstractBorder;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Construct a border with a line at the top, and margin on the other sides.
- *
- * @author dumoulin
- */
-public class ContainerBorder extends AbstractBorder {
-
- /**
- *
- */
- private int lineWidth = 1;
-
- /**
- *
- */
- private Color color;
-
- /**
- * This border's insets. Used for Margin
- */
- protected Insets insets;
-
- /**
- * Constructs a LineBorder with the specified color and of the specified
- * width.
- *
- * @param lineWidth
- * The width of the line in pixels.
- * @param color
- * The color of the border.
- * @param marginInsets
- * The width of the margin in pixels.
- *
- * @since 2.0
- */
- public ContainerBorder(Color color, int lineWidth, Insets marginInsets) {
- setColor(color);
- setLineWidth(lineWidth);
- this.insets = marginInsets;
- // this.insets = new Insets(marginInsets);
- insets.top += lineWidth;
- }
-
- /**
- * to adapt the color of the border.
- *
- * @param color
- */
- public void setBorder(Color color) {
- this.setColor(color);
- }
-
- /**
- * Constructs a LineBorder with the specified color and of the specified
- * width.
- *
- * @param allMargin
- * The width of the margin in pixels.
- * @param lineWidth
- * The width of the line in pixels.
- * @param color
- * The color of the border.
- *
- * @since 2.0
- */
- public ContainerBorder(Color color, int lineWidth, int allMargin) {
- this(color, lineWidth, new Insets(allMargin));
- }
-
- /**
- * Constructs a LineBorder with the specified color and of the specified
- * width.
- *
- * @param lineWidth
- * The width of the line in pixels.
- * @param color
- * The color of the border.
- * @param r
- * magin at rigth
- * @param t
- * margin at top
- * @param l
- * margin at left
- * @param b
- * margin at bottom
- *
- * @since 2.0
- */
- public ContainerBorder(Color color, int lineWidth, int t, int l, int b, int r) {
- this(color, lineWidth, new Insets(t, l, b, r));
- }
-
- /**
- * Constructs a LineBorder with the specified color and a width of 1 pixel.
- *
- * @param color
- * The color of the border.
- *
- * @since 2.0
- */
- // @unused
- public ContainerBorder(Color color) {
- this(color, 1, 1);
- }
-
- /**
- * Constructs a black LineBorder with the specified width.
- *
- * @param width
- * The width of the border in pixels.
- *
- * @since 2.0
- */
- // @unused
- public ContainerBorder(int width) {
- this(null, width, width);
- }
-
- /**
- * Constructs a default black LineBorder with a width of one pixel.
- *
- * @since 2.0
- */
- // @unused
- public ContainerBorder() {
- }
-
- /**
- * Returns the line color of this border.
- *
- * @return The line color of this border
- */
- public Color getColor() {
- return color;
- }
-
- /**
- * Returns the space used by the border for the figure provided as input. In
- * this border all sides always have equal width.
- *
- * @param figure
- * The figure this border belongs to
- *
- * @return This border's insets
- */
- public Insets getInsets(IFigure figure) {
- return insets;
- }
-
- /**
- * Returns the line width of this border.
- *
- * @return The line width of this border
- */
- public int getLineWidth() {
- return lineWidth;
- }
-
- /**
- * Returns <code>true</code> since this border is opaque. Being opaque it is
- * responsible to fill in the area within its boundaries.
- *
- * @return <code>true</code> since this border is opaque
- */
- @Override
- public boolean isOpaque() {
- return true;
- }
-
- /**
- *
- *
- * @param graphics
- * @param figure
- * @param insets
- *
- * @see org.eclipse.draw2d.Border#paint(IFigure, Graphics, Insets)
- */
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- graphics.pushState();
- Rectangle bounds = figure.getBounds();
- graphics.setLineWidth(getLineWidth());
- if(getColor() != null) {
- graphics.setForegroundColor(getColor());
- }
- // graphics.drawLine(tempRect.getTopLeft(), tempRect.getTopRight());
- graphics.drawLine(bounds.getTopLeft(), bounds.getTopRight());
- graphics.popState();
- }
-
- /**
- * Sets the line color for this border.
- *
- * @param color
- * The line color
- */
- public void setColor(Color color) {
- this.color = color;
- }
-
- /**
- * Sets the line width for this border.
- *
- * @param width
- * The line width
- */
- public void setLineWidth(int width) {
- this.lineWidth = width;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.AbstractBorder;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * Construct a border with a line at the top, and margin on the other sides.
+ *
+ * @author dumoulin
+ */
+public class ContainerBorder extends AbstractBorder {
+
+ /**
+ *
+ */
+ private int lineWidth = 1;
+
+ /**
+ *
+ */
+ private Color color;
+
+ /**
+ * This border's insets. Used for Margin
+ */
+ protected Insets insets;
+
+ /**
+ * Constructs a LineBorder with the specified color and of the specified
+ * width.
+ *
+ * @param lineWidth
+ * The width of the line in pixels.
+ * @param color
+ * The color of the border.
+ * @param marginInsets
+ * The width of the margin in pixels.
+ *
+ * @since 2.0
+ */
+ public ContainerBorder(Color color, int lineWidth, Insets marginInsets) {
+ setColor(color);
+ setLineWidth(lineWidth);
+ this.insets = marginInsets;
+ // this.insets = new Insets(marginInsets);
+ insets.top += lineWidth;
+ }
+
+ /**
+ * to adapt the color of the border.
+ *
+ * @param color
+ */
+ public void setBorder(Color color) {
+ this.setColor(color);
+ }
+
+ /**
+ * Constructs a LineBorder with the specified color and of the specified
+ * width.
+ *
+ * @param allMargin
+ * The width of the margin in pixels.
+ * @param lineWidth
+ * The width of the line in pixels.
+ * @param color
+ * The color of the border.
+ *
+ * @since 2.0
+ */
+ public ContainerBorder(Color color, int lineWidth, int allMargin) {
+ this(color, lineWidth, new Insets(allMargin));
+ }
+
+ /**
+ * Constructs a LineBorder with the specified color and of the specified
+ * width.
+ *
+ * @param lineWidth
+ * The width of the line in pixels.
+ * @param color
+ * The color of the border.
+ * @param r
+ * magin at rigth
+ * @param t
+ * margin at top
+ * @param l
+ * margin at left
+ * @param b
+ * margin at bottom
+ *
+ * @since 2.0
+ */
+ public ContainerBorder(Color color, int lineWidth, int t, int l, int b, int r) {
+ this(color, lineWidth, new Insets(t, l, b, r));
+ }
+
+ /**
+ * Constructs a LineBorder with the specified color and a width of 1 pixel.
+ *
+ * @param color
+ * The color of the border.
+ *
+ * @since 2.0
+ */
+ // @unused
+ public ContainerBorder(Color color) {
+ this(color, 1, 1);
+ }
+
+ /**
+ * Constructs a black LineBorder with the specified width.
+ *
+ * @param width
+ * The width of the border in pixels.
+ *
+ * @since 2.0
+ */
+ // @unused
+ public ContainerBorder(int width) {
+ this(null, width, width);
+ }
+
+ /**
+ * Constructs a default black LineBorder with a width of one pixel.
+ *
+ * @since 2.0
+ */
+ // @unused
+ public ContainerBorder() {
+ }
+
+ /**
+ * Returns the line color of this border.
+ *
+ * @return The line color of this border
+ */
+ public Color getColor() {
+ return color;
+ }
+
+ /**
+ * Returns the space used by the border for the figure provided as input. In
+ * this border all sides always have equal width.
+ *
+ * @param figure
+ * The figure this border belongs to
+ *
+ * @return This border's insets
+ */
+ public Insets getInsets(IFigure figure) {
+ return insets;
+ }
+
+ /**
+ * Returns the line width of this border.
+ *
+ * @return The line width of this border
+ */
+ public int getLineWidth() {
+ return lineWidth;
+ }
+
+ /**
+ * Returns <code>true</code> since this border is opaque. Being opaque it is
+ * responsible to fill in the area within its boundaries.
+ *
+ * @return <code>true</code> since this border is opaque
+ */
+ @Override
+ public boolean isOpaque() {
+ return true;
+ }
+
+ /**
+ *
+ *
+ * @param graphics
+ * @param figure
+ * @param insets
+ *
+ * @see org.eclipse.draw2d.Border#paint(IFigure, Graphics, Insets)
+ */
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ graphics.pushState();
+ Rectangle bounds = figure.getBounds();
+ graphics.setLineWidth(getLineWidth());
+ if(getColor() != null) {
+ graphics.setForegroundColor(getColor());
+ }
+ // graphics.drawLine(tempRect.getTopLeft(), tempRect.getTopRight());
+ graphics.drawLine(bounds.getTopLeft(), bounds.getTopRight());
+ graphics.popState();
+ }
+
+ /**
+ * Sets the line color for this border.
+ *
+ * @param color
+ * The line color
+ */
+ public void setColor(Color color) {
+ this.color = color;
+ }
+
+ /**
+ * Sets the line width for this border.
+ *
+ * @param width
+ * The line width
+ */
+ public void setLineWidth(int width) {
+ this.lineWidth = width;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerFigure.java
index 889723f5d4b..04bdec683bb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ContainerFigure.java
@@ -1,62 +1,62 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Containe a list of element as attribute or operations.
- */
-public class ContainerFigure extends NodeNamedElementFigure {
-
- /**
- *
- */
- protected ContainerBorder border;
-
- /**
- *
- */
- // @unused
- public ContainerFigure() {
- // this only a box
- // layout:
- ToolbarLayout layout = new ToolbarLayout(ToolbarLayout.VERTICAL);// to
- // add
- // element
- // vertically
- layout.setStretchMinorAxis(true);
- layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
- int spacing = 0;
- layout.setSpacing(spacing);
- setLayoutManager(layout);
- // Add border to allow mouse over actions.
-
- border = new ContainerBorder(getBackgroundColor(), 5, 5, 5, 5, 20);
- setBorder(border);
- }
-
- /**
- *
- *
- * @param backgroundColor
- */
- @Override
- public void setBackgroundColor(Color backgroundColor) {
- super.setBackgroundColor(backgroundColor);
- border.setBorder(backgroundColor);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * Containe a list of element as attribute or operations.
+ */
+public class ContainerFigure extends NodeNamedElementFigure {
+
+ /**
+ *
+ */
+ protected ContainerBorder border;
+
+ /**
+ *
+ */
+ // @unused
+ public ContainerFigure() {
+ // this only a box
+ // layout:
+ ToolbarLayout layout = new ToolbarLayout(ToolbarLayout.VERTICAL);// to
+ // add
+ // element
+ // vertically
+ layout.setStretchMinorAxis(true);
+ layout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
+ int spacing = 0;
+ layout.setSpacing(spacing);
+ setLayoutManager(layout);
+ // Add border to allow mouse over actions.
+
+ border = new ContainerBorder(getBackgroundColor(), 5, 5, 5, 5, 20);
+ setBorder(border);
+ }
+
+ /**
+ *
+ *
+ * @param backgroundColor
+ */
+ @Override
+ public void setBackgroundColor(Color backgroundColor) {
+ super.setBackgroundColor(backgroundColor);
+ border.setBorder(backgroundColor);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CornerBentFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CornerBentFigure.java
index 0e7825cd5f0..8482eb3de1f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CornerBentFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CornerBentFigure.java
@@ -1,336 +1,336 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.StringTokenizer;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.gmf.runtime.diagram.ui.figures.NoteFigure;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * this is the custom figure of the comment
- *
- * @author Patrick Tessier
- *
- */
-public class CornerBentFigure extends NoteFigure implements IPapyrusNodeUMLElementFigure, IPapyrusNodeFigure {
-
- protected NoteShadowBorder shadowborder;
-
- protected NoteFigureBorder noteBorder = null;
-
- /**
- * Added for stereptypes properties
- */
- protected StereotypePropertiesCompartment stereotypePropertiesContent;
-
- /**
- * Added for stereotypes properties, displayed in the InBrace location
- */
- protected Label stereotypePropertiesInBraceContent;
-
- protected Label stereotypesLabel;
-
- /**
- * The icon label.
- */
- protected Label iconLabel;
-
- protected Color borderColor = ColorConstants.black;
-
- protected boolean shadow = true;
-
- public CornerBentFigure() {
- super(100, 60, new Insets(5, 5, 5, 14));
- setLayoutManager(new ToolbarLayout());
- if(this.getBorder() instanceof NoteFigureBorder) {
- noteBorder = (NoteFigureBorder)this.getBorder();
- }
- shadowborder = new NoteShadowBorder(3, getForegroundColor(), new Dimension(10, 10), noteBorder);
- setBorder(shadowborder);
- }
-
- /**
- * this method is used to create the stereotype label.
- */
- protected void createStereotypeLabel() {
- stereotypesLabel = new Label();
- stereotypesLabel.setOpaque(false);
- stereotypesLabel.setFont(getFont());
- stereotypesLabel.setForegroundColor(getForegroundColor());
- // Add the stereotype label to the figure at pos 0
- this.add(stereotypesLabel, getStereotypeLabelPosition());
- }
-
- protected void createStereotypePropertiesContent() {
- stereotypePropertiesContent = new StereotypePropertiesCompartment();
- stereotypePropertiesContent.setFill(false);
- stereotypePropertiesContent.setLineWidth(0);
- stereotypePropertiesContent.setBorder(null);
- stereotypePropertiesContent.setUpperLine(false);
- stereotypePropertiesContent.setLayoutManager(new org.eclipse.papyrus.uml.diagram.common.figure.layout.PropertiesCompartmentLayoutManager());
- this.add(stereotypePropertiesContent, getStereotypePropertiesCompartmentPosition());
- }
-
- /**
- * this method is used to create the stereotype label.
- */
- protected void createStereotypePropertiesInBraceLabel() {
- stereotypePropertiesInBraceContent = new Label();
- stereotypePropertiesInBraceContent.setOpaque(false);
- // Add the stereotype label to the figure at pos 0
- this.add(stereotypePropertiesInBraceContent, getStereotypePropertiesLabelPosition());
-
- }
-
- private void fillStereotypePropertiesInCompartment(String stereotypeProperties) {
-
- stereotypePropertiesContent.getChildren().clear();
- StringTokenizer stringTokenizer = new StringTokenizer(stereotypeProperties, ";");
- while(stringTokenizer.hasMoreElements()) {
- String tokenStereotype = stringTokenizer.nextToken();
- tokenStereotype = tokenStereotype.replace("#", "\n ");
- tokenStereotype = tokenStereotype.replace("|", "\n ");
- Label label = new Label(tokenStereotype);
- label.setLabelAlignment(PositionConstants.LEFT);
- stereotypePropertiesContent.add(label);
- }
- repaint();
- }
-
- protected int getStereotypePropertiesCompartmentPosition() {
- int position = getChildren().indexOf(stereotypesLabel);
- position++;
- return position;
- }
-
- /**
- * to obtain the stereotypePropertiesContent of the class figure
- *
- */
- public RectangleFigure getStereotypePropertiesContent() {
- return this.stereotypePropertiesContent;
- }
-
- /**
- * Returns the position of the stereotype properties location. this is just
- * after stereotype position
- *
- * @return the position of the stereotype properties label in the figure
- */
- protected int getStereotypePropertiesLabelPosition() {
- int position = getStereotypeLabelPosition();
- if(this.stereotypesLabel != null) {
- position++;
- }
- return position;
- }
-
- public Label getStereotypesLabel() {
- return this.stereotypesLabel;
- }
-
- public void setStereotypeDisplay(String stereotypes, Image image) {
- // Set stereotype text on figure
- if(!"".equals(stereotypes)) {
- setStereotypes(stereotypes);
- } else {
- setStereotypes(null);
- }
-
- setAppliedStereotypeIcon(image);
-
- }
-
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if(stereotypeProperties == null) {
- // Remove label if any
- if(this.stereotypePropertiesInBraceContent != null) {
- this.remove(this.stereotypePropertiesInBraceContent);
- this.stereotypePropertiesInBraceContent = null;
- }
- return;
- }
-
- // Set the stereotype label if it does not already exist
- if(this.stereotypePropertiesInBraceContent == null) {
- this.createStereotypePropertiesInBraceLabel();
- }
-
- // Set stereotype text on figure
- if(!"".equals(stereotypeProperties)) {
- this.stereotypePropertiesInBraceContent.setText("{" + stereotypeProperties + "}");
- } else {
- this.stereotypePropertiesInBraceContent.setText("");
- }
-
- }
-
- /**
- * displays the new string corresponding to the list of stereotypes.
- *
- * if the string is <code>null</code>, then the figure that displays the
- * stereotype label is removed from the NodeNamedElementFigure.
- *
- * @param stereotypeProperties
- * the string to be displayed.
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- if(stereotypeProperties == null || stereotypeProperties == "") {
- // remove figure of stereotype properties compartment
- if(this.stereotypePropertiesContent != null) {
- this.remove(this.stereotypePropertiesContent);
- this.stereotypePropertiesContent = null;
- }
- return;
- }
-
- // set stereotype properties content
- if(stereotypePropertiesContent == null) {
- this.createStereotypePropertiesContent();
- }
-
- fillStereotypePropertiesInCompartment(stereotypeProperties);
-
- }
-
- /**
- * Sets the stereotypes for this figure.
- * <p>
- * This implementation checks if the specified string is null or not.
- * <ul>
- * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
- * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
- * </ul>
- * </p>
- *
- * @param stereotypes
- * the string representing the stereotypes to be displayed
- */
- public void setStereotypes(String stereotypes) {
- if(stereotypes == null) {
- // Remove label if any
- if(this.stereotypesLabel != null) {
- this.remove(this.stereotypesLabel);
- this.stereotypesLabel = null;
- }
- return;
- }
-
- // Set the stereotype label if it does not already exist
- if(this.stereotypesLabel == null) {
- this.createStereotypeLabel();
- }
-
- // Set stereotype text on figure
- if(!"".equals(stereotypes)) {
- this.stereotypesLabel.setText(stereotypes);
- } else {
- this.stereotypesLabel.setText("");
- }
- }
-
- /**
- *
- *
- * @return the position of the stereotype label in the figure
- */
- protected int getStereotypeLabelPosition() {
- int position = getIconLabelPosition();
- if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
- position++;
- }
- return position;
- }
-
- /**
- *
- *
- * @return
- */
- protected int getIconLabelPosition() {
- return 0;
- }
-
- /**
- * Sets the stereotype icon for this figure.
- *
- * @param stereotypes
- * the image representing the stereotype
- */
- public void setAppliedStereotypeIcon(Image image) {
- if(image == null) {
- // Remove label if any
- if(this.iconLabel != null) {
- this.remove(this.iconLabel);
- this.iconLabel = null;
- }
- return;
- }
-
- // Set the stereotype label if it does not already exist
- if(this.iconLabel == null) {
- this.createIconLabel();
- }
-
- // Set stereotype icon on figure
- this.iconLabel.setIcon(image);
- }
-
- /**
- * used to create a label that contains the icon.
- */
- protected void createIconLabel() {
- iconLabel = new Label();
- // Add the label to the figure, at pos 0
- add(iconLabel, getIconLabelPosition());
- iconLabel.setLabelAlignment(PositionConstants.LEFT);
- }
-
- public Color getBorderColor() {
- return borderColor;
- }
-
- public void setBorderColor(Color borderColor) {
- // this.borderColor = borderColor;
- // super.setBorder(new LineBorder(borderColor));
-
- }
-
- public boolean isShadow() {
- return shadow;
- }
-
- public void setShadow(boolean shadow) {
- this.shadow = shadow;
- if(shadow == true) {
- this.setBorder(shadowborder);
- } else {
- if(noteBorder != null) {
- this.setBorder(noteBorder);
- }
- }
- revalidate();
- repaint();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.StringTokenizer;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.gmf.runtime.diagram.ui.figures.NoteFigure;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * this is the custom figure of the comment
+ *
+ * @author Patrick Tessier
+ *
+ */
+public class CornerBentFigure extends NoteFigure implements IPapyrusNodeUMLElementFigure, IPapyrusNodeFigure {
+
+ protected NoteShadowBorder shadowborder;
+
+ protected NoteFigureBorder noteBorder = null;
+
+ /**
+ * Added for stereptypes properties
+ */
+ protected StereotypePropertiesCompartment stereotypePropertiesContent;
+
+ /**
+ * Added for stereotypes properties, displayed in the InBrace location
+ */
+ protected Label stereotypePropertiesInBraceContent;
+
+ protected Label stereotypesLabel;
+
+ /**
+ * The icon label.
+ */
+ protected Label iconLabel;
+
+ protected Color borderColor = ColorConstants.black;
+
+ protected boolean shadow = true;
+
+ public CornerBentFigure() {
+ super(100, 60, new Insets(5, 5, 5, 14));
+ setLayoutManager(new ToolbarLayout());
+ if(this.getBorder() instanceof NoteFigureBorder) {
+ noteBorder = (NoteFigureBorder)this.getBorder();
+ }
+ shadowborder = new NoteShadowBorder(3, getForegroundColor(), new Dimension(10, 10), noteBorder);
+ setBorder(shadowborder);
+ }
+
+ /**
+ * this method is used to create the stereotype label.
+ */
+ protected void createStereotypeLabel() {
+ stereotypesLabel = new Label();
+ stereotypesLabel.setOpaque(false);
+ stereotypesLabel.setFont(getFont());
+ stereotypesLabel.setForegroundColor(getForegroundColor());
+ // Add the stereotype label to the figure at pos 0
+ this.add(stereotypesLabel, getStereotypeLabelPosition());
+ }
+
+ protected void createStereotypePropertiesContent() {
+ stereotypePropertiesContent = new StereotypePropertiesCompartment();
+ stereotypePropertiesContent.setFill(false);
+ stereotypePropertiesContent.setLineWidth(0);
+ stereotypePropertiesContent.setBorder(null);
+ stereotypePropertiesContent.setUpperLine(false);
+ stereotypePropertiesContent.setLayoutManager(new org.eclipse.papyrus.uml.diagram.common.figure.layout.PropertiesCompartmentLayoutManager());
+ this.add(stereotypePropertiesContent, getStereotypePropertiesCompartmentPosition());
+ }
+
+ /**
+ * this method is used to create the stereotype label.
+ */
+ protected void createStereotypePropertiesInBraceLabel() {
+ stereotypePropertiesInBraceContent = new Label();
+ stereotypePropertiesInBraceContent.setOpaque(false);
+ // Add the stereotype label to the figure at pos 0
+ this.add(stereotypePropertiesInBraceContent, getStereotypePropertiesLabelPosition());
+
+ }
+
+ private void fillStereotypePropertiesInCompartment(String stereotypeProperties) {
+
+ stereotypePropertiesContent.getChildren().clear();
+ StringTokenizer stringTokenizer = new StringTokenizer(stereotypeProperties, ";");
+ while(stringTokenizer.hasMoreElements()) {
+ String tokenStereotype = stringTokenizer.nextToken();
+ tokenStereotype = tokenStereotype.replace("#", "\n ");
+ tokenStereotype = tokenStereotype.replace("|", "\n ");
+ Label label = new Label(tokenStereotype);
+ label.setLabelAlignment(PositionConstants.LEFT);
+ stereotypePropertiesContent.add(label);
+ }
+ repaint();
+ }
+
+ protected int getStereotypePropertiesCompartmentPosition() {
+ int position = getChildren().indexOf(stereotypesLabel);
+ position++;
+ return position;
+ }
+
+ /**
+ * to obtain the stereotypePropertiesContent of the class figure
+ *
+ */
+ public RectangleFigure getStereotypePropertiesContent() {
+ return this.stereotypePropertiesContent;
+ }
+
+ /**
+ * Returns the position of the stereotype properties location. this is just
+ * after stereotype position
+ *
+ * @return the position of the stereotype properties label in the figure
+ */
+ protected int getStereotypePropertiesLabelPosition() {
+ int position = getStereotypeLabelPosition();
+ if(this.stereotypesLabel != null) {
+ position++;
+ }
+ return position;
+ }
+
+ public Label getStereotypesLabel() {
+ return this.stereotypesLabel;
+ }
+
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ // Set stereotype text on figure
+ if(!"".equals(stereotypes)) {
+ setStereotypes(stereotypes);
+ } else {
+ setStereotypes(null);
+ }
+
+ setAppliedStereotypeIcon(image);
+
+ }
+
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ if(stereotypeProperties == null) {
+ // Remove label if any
+ if(this.stereotypePropertiesInBraceContent != null) {
+ this.remove(this.stereotypePropertiesInBraceContent);
+ this.stereotypePropertiesInBraceContent = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label if it does not already exist
+ if(this.stereotypePropertiesInBraceContent == null) {
+ this.createStereotypePropertiesInBraceLabel();
+ }
+
+ // Set stereotype text on figure
+ if(!"".equals(stereotypeProperties)) {
+ this.stereotypePropertiesInBraceContent.setText("{" + stereotypeProperties + "}");
+ } else {
+ this.stereotypePropertiesInBraceContent.setText("");
+ }
+
+ }
+
+ /**
+ * displays the new string corresponding to the list of stereotypes.
+ *
+ * if the string is <code>null</code>, then the figure that displays the
+ * stereotype label is removed from the NodeNamedElementFigure.
+ *
+ * @param stereotypeProperties
+ * the string to be displayed.
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ if(stereotypeProperties == null || stereotypeProperties == "") {
+ // remove figure of stereotype properties compartment
+ if(this.stereotypePropertiesContent != null) {
+ this.remove(this.stereotypePropertiesContent);
+ this.stereotypePropertiesContent = null;
+ }
+ return;
+ }
+
+ // set stereotype properties content
+ if(stereotypePropertiesContent == null) {
+ this.createStereotypePropertiesContent();
+ }
+
+ fillStereotypePropertiesInCompartment(stereotypeProperties);
+
+ }
+
+ /**
+ * Sets the stereotypes for this figure.
+ * <p>
+ * This implementation checks if the specified string is null or not.
+ * <ul>
+ * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
+ * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
+ * </ul>
+ * </p>
+ *
+ * @param stereotypes
+ * the string representing the stereotypes to be displayed
+ */
+ public void setStereotypes(String stereotypes) {
+ if(stereotypes == null) {
+ // Remove label if any
+ if(this.stereotypesLabel != null) {
+ this.remove(this.stereotypesLabel);
+ this.stereotypesLabel = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label if it does not already exist
+ if(this.stereotypesLabel == null) {
+ this.createStereotypeLabel();
+ }
+
+ // Set stereotype text on figure
+ if(!"".equals(stereotypes)) {
+ this.stereotypesLabel.setText(stereotypes);
+ } else {
+ this.stereotypesLabel.setText("");
+ }
+ }
+
+ /**
+ *
+ *
+ * @return the position of the stereotype label in the figure
+ */
+ protected int getStereotypeLabelPosition() {
+ int position = getIconLabelPosition();
+ if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
+ position++;
+ }
+ return position;
+ }
+
+ /**
+ *
+ *
+ * @return
+ */
+ protected int getIconLabelPosition() {
+ return 0;
+ }
+
+ /**
+ * Sets the stereotype icon for this figure.
+ *
+ * @param stereotypes
+ * the image representing the stereotype
+ */
+ public void setAppliedStereotypeIcon(Image image) {
+ if(image == null) {
+ // Remove label if any
+ if(this.iconLabel != null) {
+ this.remove(this.iconLabel);
+ this.iconLabel = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label if it does not already exist
+ if(this.iconLabel == null) {
+ this.createIconLabel();
+ }
+
+ // Set stereotype icon on figure
+ this.iconLabel.setIcon(image);
+ }
+
+ /**
+ * used to create a label that contains the icon.
+ */
+ protected void createIconLabel() {
+ iconLabel = new Label();
+ // Add the label to the figure, at pos 0
+ add(iconLabel, getIconLabelPosition());
+ iconLabel.setLabelAlignment(PositionConstants.LEFT);
+ }
+
+ public Color getBorderColor() {
+ return borderColor;
+ }
+
+ public void setBorderColor(Color borderColor) {
+ // this.borderColor = borderColor;
+ // super.setBorder(new LineBorder(borderColor));
+
+ }
+
+ public boolean isShadow() {
+ return shadow;
+ }
+
+ public void setShadow(boolean shadow) {
+ this.shadow = shadow;
+ if(shadow == true) {
+ this.setBorder(shadowborder);
+ } else {
+ if(noteBorder != null) {
+ this.setBorder(noteBorder);
+ }
+ }
+ revalidate();
+ repaint();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CustomAbstractFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CustomAbstractFigure.java
index 37aa7d0a439..3a34a984630 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CustomAbstractFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/CustomAbstractFigure.java
@@ -1,41 +1,41 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-
-/**
- * This is the more abstract figure to manage custom figure for papyrus.
- *
- * @author Patrick Tessier
- *
- */
-public abstract class CustomAbstractFigure extends Figure {
-
- /**
- * get the subfigure at the given index
- *
- * @param index
- * of the sub figure
- * @return null or the figure at this index
- */
- // @unused
- public IFigure getSubFigure(int index) {
- if(getChildren().size() > index) {
- return (IFigure)getChildren().get(index);
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.IFigure;
+
+/**
+ * This is the more abstract figure to manage custom figure for papyrus.
+ *
+ * @author Patrick Tessier
+ *
+ */
+public abstract class CustomAbstractFigure extends Figure {
+
+ /**
+ * get the subfigure at the given index
+ *
+ * @param index
+ * of the sub figure
+ * @return null or the figure at this index
+ */
+ // @unused
+ public IFigure getSubFigure(int index) {
+ if(getChildren().size() > index) {
+ return (IFigure)getChildren().get(index);
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DataTypeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DataTypeFigure.java
index 3ce682ae751..c24eb88128d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DataTypeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DataTypeFigure.java
@@ -1,67 +1,67 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-
-/**
- * Represents a datatype
- */
-public class DataTypeFigure extends CompartmentFigure {
-
- /** Attribute Compartment */
- private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment";
-
- /** Operation Compartment */
- private final static String OPERATION_COMPARTMENT = "operationCompartment";
-
- /** List of compartment */
- private final static List<String> COMPARTMENT = new ArrayList<String>() {
-
- private static final long serialVersionUID = -2841645169151618170L;
-
- {
- add(ATTRIBUTE_COMPARTMENT);
- add(OPERATION_COMPARTMENT);
- }
- };
-
- /**
- * Default Constructor
- */
- public DataTypeFigure() {
- super(COMPARTMENT, "DataType");
- }
-
- /**
- * Get the attribute's compartment figure
- *
- * @return
- */
- public IFigure getAttributeCompartmentFigure() {
- return getCompartment(ATTRIBUTE_COMPARTMENT);
- }
-
- /**
- * Get the operation's compartment figure
- *
- * @return
- */
- public IFigure getOperationCompartmentFigure() {
- return getCompartment(OPERATION_COMPARTMENT);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+
+/**
+ * Represents a datatype
+ */
+public class DataTypeFigure extends CompartmentFigure {
+
+ /** Attribute Compartment */
+ private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment";
+
+ /** Operation Compartment */
+ private final static String OPERATION_COMPARTMENT = "operationCompartment";
+
+ /** List of compartment */
+ private final static List<String> COMPARTMENT = new ArrayList<String>() {
+
+ private static final long serialVersionUID = -2841645169151618170L;
+
+ {
+ add(ATTRIBUTE_COMPARTMENT);
+ add(OPERATION_COMPARTMENT);
+ }
+ };
+
+ /**
+ * Default Constructor
+ */
+ public DataTypeFigure() {
+ super(COMPARTMENT, "DataType");
+ }
+
+ /**
+ * Get the attribute's compartment figure
+ *
+ * @return
+ */
+ public IFigure getAttributeCompartmentFigure() {
+ return getCompartment(ATTRIBUTE_COMPARTMENT);
+ }
+
+ /**
+ * Get the operation's compartment figure
+ *
+ * @return
+ */
+ public IFigure getOperationCompartmentFigure() {
+ return getCompartment(OPERATION_COMPARTMENT);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiagramNodeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiagramNodeFigure.java
index 2484d97b9a1..afc0561b219 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiagramNodeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiagramNodeFigure.java
@@ -1,123 +1,123 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-public class DiagramNodeFigure extends RectangleFigure {
-
- /**
- * @deprecated use org.eclipse.papyrus.uml.diagram.common.figure.layout.
- * PropertiesCompartmentLayoutManager instead
- */
- private class PropertiesCompatmentLayoutManager extends AbstractLayout {
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
-
- int minimumWith = 0;
- int minimumHeight = 0;
- // display name
- for(int i = 0; i < container.getChildren().size(); i++) {
- minimumHeight = minimumHeight + ((IFigure)container.getChildren().get(i)).getPreferredSize().height;
- }
-
- return new Dimension(minimumWith, minimumHeight);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void layout(IFigure container) {
- List childrenList = container.getChildren();
- for(int i = 0; i < container.getChildren().size(); i++) {
- Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
- bound.setSize(((IFigure)childrenList.get(i)).getPreferredSize());
- if(i > 0) {
- bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y - 1;
- bound.x = getBounds().x;
- bound.width = container.getBounds().width;
-
- } else {
- bound.x = container.getBounds().x + 2;
- bound.y = container.getBounds().y + 2;
- bound.width = container.getBounds().width;
-
- }
- ((IFigure)childrenList.get(i)).setBounds(bound);
- }
-
- }
-
- }
-
- protected WrappingLabel iconLabel;
-
- public DiagramNodeFigure() {
- super();
- FontData[] fontdata2 = { new FontData("Arial", 10, SWT.BOLD) };
-
- Font font2 = Activator.getFontManager().get(fontdata2);
-
- this.iconLabel = new WrappingLabel("");
- this.iconLabel.setForegroundColor(ColorConstants.red);
- this.iconLabel.setBackgroundColor(ColorConstants.red);
- this.iconLabel.setFont(font2);
- this.iconLabel.setOpaque(false);
- this.add(this.iconLabel);
- ToolbarLayout toolbarLayout = new ToolbarLayout();
- toolbarLayout.setSpacing(5);
- toolbarLayout.setVertical(false);
- this.setLayoutManager(new PropertiesCompatmentLayoutManager());
- }
-
- public WrappingLabel getIconContainer() {
- return iconLabel;
- }
-
- public void setIcon(Image image) {
- Image initialImage = image;
- ImageDescriptor visDesc = AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.papyrus.uml.diagram.common", "/icons/obj16/call.gif");
-
- // Overlay custom image over base image
- // OverlayVisibilityIcon overlayIcon = new
- // OverlayVisibilityIcon(initialImage, visDesc);
- // image = overlayIcon.getImage();
-
- getIconContainer().setIcon(image, 0);
- getIconContainer().setIcon(visDesc.createImage(), 1);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+public class DiagramNodeFigure extends RectangleFigure {
+
+ /**
+ * @deprecated use org.eclipse.papyrus.uml.diagram.common.figure.layout.
+ * PropertiesCompartmentLayoutManager instead
+ */
+ private class PropertiesCompatmentLayoutManager extends AbstractLayout {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
+
+ int minimumWith = 0;
+ int minimumHeight = 0;
+ // display name
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ minimumHeight = minimumHeight + ((IFigure)container.getChildren().get(i)).getPreferredSize().height;
+ }
+
+ return new Dimension(minimumWith, minimumHeight);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void layout(IFigure container) {
+ List childrenList = container.getChildren();
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
+ bound.setSize(((IFigure)childrenList.get(i)).getPreferredSize());
+ if(i > 0) {
+ bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y - 1;
+ bound.x = getBounds().x;
+ bound.width = container.getBounds().width;
+
+ } else {
+ bound.x = container.getBounds().x + 2;
+ bound.y = container.getBounds().y + 2;
+ bound.width = container.getBounds().width;
+
+ }
+ ((IFigure)childrenList.get(i)).setBounds(bound);
+ }
+
+ }
+
+ }
+
+ protected WrappingLabel iconLabel;
+
+ public DiagramNodeFigure() {
+ super();
+ FontData[] fontdata2 = { new FontData("Arial", 10, SWT.BOLD) };
+
+ Font font2 = Activator.getFontManager().get(fontdata2);
+
+ this.iconLabel = new WrappingLabel("");
+ this.iconLabel.setForegroundColor(ColorConstants.red);
+ this.iconLabel.setBackgroundColor(ColorConstants.red);
+ this.iconLabel.setFont(font2);
+ this.iconLabel.setOpaque(false);
+ this.add(this.iconLabel);
+ ToolbarLayout toolbarLayout = new ToolbarLayout();
+ toolbarLayout.setSpacing(5);
+ toolbarLayout.setVertical(false);
+ this.setLayoutManager(new PropertiesCompatmentLayoutManager());
+ }
+
+ public WrappingLabel getIconContainer() {
+ return iconLabel;
+ }
+
+ public void setIcon(Image image) {
+ Image initialImage = image;
+ ImageDescriptor visDesc = AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.papyrus.uml.diagram.common", "/icons/obj16/call.gif");
+
+ // Overlay custom image over base image
+ // OverlayVisibilityIcon overlayIcon = new
+ // OverlayVisibilityIcon(initialImage, visDesc);
+ // image = overlayIcon.getImage();
+
+ getIconContainer().setIcon(image, 0);
+ getIconContainer().setIcon(visDesc.createImage(), 1);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiamondNode.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiamondNode.java
index 59770bed178..37db96a03c7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiamondNode.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/DiamondNode.java
@@ -1,102 +1,102 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * this figure is used to display a diamond
- *
- */
-public class DiamondNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
-/**
- *
- * {@inheritDoc}
- */
- @Override
- public Dimension getPreferredSize(int wHint, int hHint) {
- // TODO Auto-generated method stub
- return new Dimension(20,20);
- }
-
-/**
- *
- * {@inheritDoc}
- */
- protected Border getDefaultBorder(Color borderColor) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public void paintFigure(Graphics graphics) {
- graphics.pushState();
- Rectangle r = getBounds().getCopy().crop(new Insets(0,0,1,1));
- PointList ptList= new PointList();
- ptList.addPoint(r.x+(r.width/2), r.y);
- ptList.addPoint(r.x+r.width, r.y+(r.height/2));
- ptList.addPoint(r.x+(r.width/2), r.y+(r.height));
- ptList.addPoint(r.x, r.y+(r.height/2));
-
- if(isUsingGradient()) {
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- // graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- } else {
- graphics.setBackgroundColor(getBackgroundColor());
- // graphics.setForegroundColor(getBackgroundColor);
- }
- graphics.fillPolygon(ptList);
- graphics.setLineWidth(1);
- graphics.setBackgroundColor(getForegroundColor());
- graphics.drawPolygon(ptList);
- graphics.popState();
-
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypeDisplay(String stereotypes, Image image) {
- // TODO Auto-generated method stub
-
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- // TODO Auto-generated method stub
-
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- // TODO Auto-generated method stub
-
- }
- /**
- * {@inheritDoc}
- */
- public Label getStereotypesLabel() {
- return new Label();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * this figure is used to display a diamond
+ *
+ */
+public class DiamondNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
+/**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ // TODO Auto-generated method stub
+ return new Dimension(20,20);
+ }
+
+/**
+ *
+ * {@inheritDoc}
+ */
+ protected Border getDefaultBorder(Color borderColor) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void paintFigure(Graphics graphics) {
+ graphics.pushState();
+ Rectangle r = getBounds().getCopy().crop(new Insets(0,0,1,1));
+ PointList ptList= new PointList();
+ ptList.addPoint(r.x+(r.width/2), r.y);
+ ptList.addPoint(r.x+r.width, r.y+(r.height/2));
+ ptList.addPoint(r.x+(r.width/2), r.y+(r.height));
+ ptList.addPoint(r.x, r.y+(r.height/2));
+
+ if(isUsingGradient()) {
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ // graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ } else {
+ graphics.setBackgroundColor(getBackgroundColor());
+ // graphics.setForegroundColor(getBackgroundColor);
+ }
+ graphics.fillPolygon(ptList);
+ graphics.setLineWidth(1);
+ graphics.setBackgroundColor(getForegroundColor());
+ graphics.drawPolygon(ptList);
+ graphics.popState();
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ // TODO Auto-generated method stub
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ // TODO Auto-generated method stub
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ // TODO Auto-generated method stub
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public Label getStereotypesLabel() {
+ return new Label();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EditingFlowPage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EditingFlowPage.java
index 83d4c2df5d9..8e773abc1f1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EditingFlowPage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EditingFlowPage.java
@@ -1,108 +1,108 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.text.FlowPage;
-import org.eclipse.gmf.runtime.draw2d.ui.text.TextFlowEx;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * this is a label that can be etited as multiline
- *
- */
-public class EditingFlowPage extends FlowPage implements ILabelFigure, IMultilineEditableFigure {
-
- protected TextFlowEx textFlow;
-
-
-
- public EditingFlowPage() {
- this.setOpaque(false);
-
- textFlow = new TextFlowEx("");
- this.add(textFlow);
- }
-
-
- /**
- *
- * @return the textflow of the constraint that contain the string of the specification
- */
- public TextFlowEx getTextFlow() {
- return textFlow;
- }
-
- /**
- *
- * @return the container of the text flow
- */
- public FlowPage getPageFlow() {
- return this;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
- *
- * @return the display string that represents the specification
- */
- public String getText() {
- return textFlow.getText();
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
- *
- * @param text
- */
- public void setText(String text) {
- // generates new ones
- textFlow.setText(text);
- }
-
-
- public EditingFlowPage getTemplateBindingFigure() {
- return this;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
- *
- */
- public void setIcon(Image icon) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
- *
- */
- public Image getIcon() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure#getEditionLocation()
- *
- */
- public Point getEditionLocation() {
- return this.getLocation();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.text.FlowPage;
+import org.eclipse.gmf.runtime.draw2d.ui.text.TextFlowEx;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * this is a label that can be etited as multiline
+ *
+ */
+public class EditingFlowPage extends FlowPage implements ILabelFigure, IMultilineEditableFigure {
+
+ protected TextFlowEx textFlow;
+
+
+
+ public EditingFlowPage() {
+ this.setOpaque(false);
+
+ textFlow = new TextFlowEx("");
+ this.add(textFlow);
+ }
+
+
+ /**
+ *
+ * @return the textflow of the constraint that contain the string of the specification
+ */
+ public TextFlowEx getTextFlow() {
+ return textFlow;
+ }
+
+ /**
+ *
+ * @return the container of the text flow
+ */
+ public FlowPage getPageFlow() {
+ return this;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
+ *
+ * @return the display string that represents the specification
+ */
+ public String getText() {
+ return textFlow.getText();
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
+ *
+ * @param text
+ */
+ public void setText(String text) {
+ // generates new ones
+ textFlow.setText(text);
+ }
+
+
+ public EditingFlowPage getTemplateBindingFigure() {
+ return this;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
+ *
+ */
+ public void setIcon(Image icon) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
+ *
+ */
+ public Image getIcon() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure#getEditionLocation()
+ *
+ */
+ public Point getEditionLocation() {
+ return this.getLocation();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EnumerationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EnumerationFigure.java
index 034f356ba1d..824c7feb460 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EnumerationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/EnumerationFigure.java
@@ -1,55 +1,55 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-
-/**
- * Represents an enumeration
- */
-public class EnumerationFigure extends CompartmentFigure {
-
- /** The Literals Compartment */
- private static final String LITERALS_COMPARTMENT = "literalsCompartment";
-
- /** The list of compartments */
- private static final List<String> COMPARTMENT = new ArrayList<String>() {
-
- private static final long serialVersionUID = -3949666242905478564L;
-
- {
- add(LITERALS_COMPARTMENT);
- }
- };
-
- /**
- * Default Constructor
- */
- public EnumerationFigure() {
- super(COMPARTMENT, "Enumeration");
- }
-
- /**
- * Get the EnumerationLiteral's compartment figure.
- *
- * @return
- */
- public IFigure getEnumerationLiteralCompartmentFigure() {
- return getCompartment(LITERALS_COMPARTMENT);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+
+/**
+ * Represents an enumeration
+ */
+public class EnumerationFigure extends CompartmentFigure {
+
+ /** The Literals Compartment */
+ private static final String LITERALS_COMPARTMENT = "literalsCompartment";
+
+ /** The list of compartments */
+ private static final List<String> COMPARTMENT = new ArrayList<String>() {
+
+ private static final long serialVersionUID = -3949666242905478564L;
+
+ {
+ add(LITERALS_COMPARTMENT);
+ }
+ };
+
+ /**
+ * Default Constructor
+ */
+ public EnumerationFigure() {
+ super(COMPARTMENT, "Enumeration");
+ }
+
+ /**
+ * Get the EnumerationLiteral's compartment figure.
+ *
+ * @return
+ */
+ public IFigure getEnumerationLiteralCompartmentFigure() {
+ return getCompartment(LITERALS_COMPARTMENT);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FinalNode.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FinalNode.java
index 5d16d9fbaf5..49507a2896f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FinalNode.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FinalNode.java
@@ -1,90 +1,90 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * this figure is a final node a circle into a circle
- *
- */
-public class FinalNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
-
- /**
- * {@inheritDoc}
- */
- protected Border getDefaultBorder(Color borderColor) {
- return null;
- }
- /**
- * {@inheritDoc}
- */
- @Override
- public Dimension getPreferredSize(int wHint, int hHint) {
- // TODO Auto-generated method stub
- return new Dimension(20,20);
- }
- /**
- * {@inheritDoc}
- */
- public void paintFigure(Graphics graphics) {
-
- final int space = 5;
- Rectangle f = Rectangle.SINGLETON;
- // to be in adequation with the figure node plate
- Rectangle r = getBounds().getCopy().crop(new Insets(0,0,1,1));
- graphics.setBackgroundColor(getForegroundColor());
- graphics.drawOval(r);
- f.x = r.x + space;
- f.y = r.y + space;
- f.width = r.width - space * 2;
- f.height = r.height - space * 2;
- graphics.setBackgroundColor(getForegroundColor());
- graphics.fillOval(f);
-
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypeDisplay(String stereotypes, Image image) {
- // TODO Auto-generated method stub
-
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- // TODO Auto-generated method stub
-
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- // TODO Auto-generated method stub
-
- }
- /**
- * {@inheritDoc}
- */
- public Label getStereotypesLabel() {
- return new Label();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * this figure is a final node a circle into a circle
+ *
+ */
+public class FinalNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Border getDefaultBorder(Color borderColor) {
+ return null;
+ }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ // TODO Auto-generated method stub
+ return new Dimension(20,20);
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void paintFigure(Graphics graphics) {
+
+ final int space = 5;
+ Rectangle f = Rectangle.SINGLETON;
+ // to be in adequation with the figure node plate
+ Rectangle r = getBounds().getCopy().crop(new Insets(0,0,1,1));
+ graphics.setBackgroundColor(getForegroundColor());
+ graphics.drawOval(r);
+ f.x = r.x + space;
+ f.y = r.y + space;
+ f.width = r.width - space * 2;
+ f.height = r.height - space * 2;
+ graphics.setBackgroundColor(getForegroundColor());
+ graphics.fillOval(f);
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ // TODO Auto-generated method stub
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ // TODO Auto-generated method stub
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ // TODO Auto-generated method stub
+
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public Label getStereotypesLabel() {
+ return new Label();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FlowFinalNode.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FlowFinalNode.java
index 5e5485038a6..717e17e3e47 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FlowFinalNode.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/FlowFinalNode.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- *
- * this figure is a circle with cross
- */
-public class FlowFinalNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
- /**
- * {@inheritDoc}
- */
- protected Border getDefaultBorder(Color borderColor) {
- return null;
- }
- /**
- * {@inheritDoc}
- */
- @Override
- public Dimension getPreferredSize(int wHint, int hHint) {
- return new Dimension(20,20);
- }
- /**
- * {@inheritDoc}
- */
- public void paintFigure(Graphics graphics) {
-
- graphics.setForegroundColor(getForegroundColor());
- Rectangle r = getBounds().getCopy().crop(new Insets(0, 0, 1, 1));
- if(isUsingGradient()) {
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- // graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- } else {
- graphics.setBackgroundColor(getBackgroundColor());
- // graphics.setForegroundColor(getForegroundColor());
- }
- graphics.setLineWidth(1);
- graphics.drawOval(r);
- // intersection coordinates.
- int x = (int)(r.width / (2 * Math.sqrt(2)));
- int y = (int)(r.height / (2 * Math.sqrt(2)));
-
- // cross.
- graphics.drawLine(r.getCenter().translate(x, -y), r.getCenter().translate(-x, y));
- graphics.drawLine(r.getCenter().translate(-x, -y), r.getCenter().translate(x, y));
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypeDisplay(String stereotypes, Image image) {
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- }
- /**
- * {@inheritDoc}
- */
- public Label getStereotypesLabel() {
- return new Label();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ *
+ * this figure is a circle with cross
+ */
+public class FlowFinalNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
+ /**
+ * {@inheritDoc}
+ */
+ protected Border getDefaultBorder(Color borderColor) {
+ return null;
+ }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ return new Dimension(20,20);
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void paintFigure(Graphics graphics) {
+
+ graphics.setForegroundColor(getForegroundColor());
+ Rectangle r = getBounds().getCopy().crop(new Insets(0, 0, 1, 1));
+ if(isUsingGradient()) {
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ // graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ } else {
+ graphics.setBackgroundColor(getBackgroundColor());
+ // graphics.setForegroundColor(getForegroundColor());
+ }
+ graphics.setLineWidth(1);
+ graphics.drawOval(r);
+ // intersection coordinates.
+ int x = (int)(r.width / (2 * Math.sqrt(2)));
+ int y = (int)(r.height / (2 * Math.sqrt(2)));
+
+ // cross.
+ graphics.drawLine(r.getCenter().translate(x, -y), r.getCenter().translate(-x, y));
+ graphics.drawLine(r.getCenter().translate(-x, -y), r.getCenter().translate(x, y));
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public Label getStereotypesLabel() {
+ return new Label();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ForkNode.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ForkNode.java
index ff46e906e53..06bdec50f9f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ForkNode.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ForkNode.java
@@ -1,83 +1,83 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- *this figure is small rectangle
- *
- */
-public class ForkNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
-
- /**
- * {@inheritDoc}
- */
- protected Border getDefaultBorder(Color borderColor) {
- return null;
- }
- /**
- * {@inheritDoc}
- */
- @Override
- public Dimension getPreferredSize(int wHint, int hHint) {
- return new Dimension(10,10);
- }
- /**
- * {@inheritDoc}
- */
- public void paintFigure(Graphics graphics) {
- Rectangle r = getBounds().getCopy().crop(new Insets(0,0,1,1));
- if(isUsingGradient()) {
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- // graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- } else {
- graphics.setBackgroundColor(getBackgroundColor());
- // graphics.setForegroundColor(getForegroundColor());
- }
- graphics.fillRectangle(r);
- graphics.setLineWidth(1);
- graphics.drawRectangle(r);
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypeDisplay(String stereotypes, Image image) {
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- }
-
- /**
- * {@inheritDoc}
- */
- public Label getStereotypesLabel() {
- return new Label();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ *this figure is small rectangle
+ *
+ */
+public class ForkNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Border getDefaultBorder(Color borderColor) {
+ return null;
+ }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ return new Dimension(10,10);
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void paintFigure(Graphics graphics) {
+ Rectangle r = getBounds().getCopy().crop(new Insets(0,0,1,1));
+ if(isUsingGradient()) {
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ // graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ } else {
+ graphics.setBackgroundColor(getBackgroundColor());
+ // graphics.setForegroundColor(getForegroundColor());
+ }
+ graphics.fillRectangle(r);
+ graphics.setLineWidth(1);
+ graphics.drawRectangle(r);
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Label getStereotypesLabel() {
+ return new Label();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCommentParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCommentParser.java
index 26d1da626f5..c45a2e119d9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCommentParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCommentParser.java
@@ -1,96 +1,96 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.parser.HTMLCleaner;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.EntityResolver;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.ext.DefaultHandler2;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * Parser for simple html comments
- */
-public class HTMLCommentParser {
-
- /**
- * Parse the given text
- *
- * @param text
- * the string to parse
- *
- * @return the nodes result of the parsing of the text
- */
- public static NodeList parse(String text) {
- NodeList nodelist = null;
- try {
- DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
- String cleandText = HTMLCleaner.preClean(text);
- // fail silently. if not set, default error handler will print an error message in the console
- documentBuilder.setErrorHandler(new DefaultHandler());
- Document document = documentBuilder.parse(new InputSource(new StringReader(cleandText)));
- nodelist = document.getChildNodes();
- } catch (ParserConfigurationException e) {
- Activator.log.error(e);
- nodelist = new EmptyNodeList();
- } catch (IOException e) {
- Activator.log.error(e);
- nodelist = new EmptyNodeList();
- } catch (SAXException e) {
- // fail silently
- // Activator.log.debug(e.getMessage());
- nodelist = new EmptyNodeList();
- } catch (Exception e) {
- Activator.log.error(e);
- nodelist = new EmptyNodeList();
- }
- return nodelist;
- }
-
- /**
- * empty node list implementation
- */
- public static class EmptyNodeList implements NodeList {
-
- /**
- * {@inheritDoc}
- */
- public int getLength() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
- public Node item(int index) {
- return null;
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.parser.HTMLCleaner;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.ext.DefaultHandler2;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * Parser for simple html comments
+ */
+public class HTMLCommentParser {
+
+ /**
+ * Parse the given text
+ *
+ * @param text
+ * the string to parse
+ *
+ * @return the nodes result of the parsing of the text
+ */
+ public static NodeList parse(String text) {
+ NodeList nodelist = null;
+ try {
+ DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+ documentBuilderFactory.setNamespaceAware(true);
+ DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+ String cleandText = HTMLCleaner.preClean(text);
+ // fail silently. if not set, default error handler will print an error message in the console
+ documentBuilder.setErrorHandler(new DefaultHandler());
+ Document document = documentBuilder.parse(new InputSource(new StringReader(cleandText)));
+ nodelist = document.getChildNodes();
+ } catch (ParserConfigurationException e) {
+ Activator.log.error(e);
+ nodelist = new EmptyNodeList();
+ } catch (IOException e) {
+ Activator.log.error(e);
+ nodelist = new EmptyNodeList();
+ } catch (SAXException e) {
+ // fail silently
+ // Activator.log.debug(e.getMessage());
+ nodelist = new EmptyNodeList();
+ } catch (Exception e) {
+ Activator.log.error(e);
+ nodelist = new EmptyNodeList();
+ }
+ return nodelist;
+ }
+
+ /**
+ * empty node list implementation
+ */
+ public static class EmptyNodeList implements NodeList {
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getLength() {
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Node item(int index) {
+ return null;
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentBodyFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentBodyFigure.java
index 19049f5d1a1..d5902bf1f0e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentBodyFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentBodyFigure.java
@@ -1,84 +1,84 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.text.FlowPage;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Flow Page that accept a text formatted in html, and displays it under a
- * styled form
- */
-public class HTMLCornerBentBodyFigure extends Figure implements ILabelFigure {
-
- /** text displayed by this figure */
- private String text;
-
- /** icon displayed by this figure */
- private Image icon;
-
- /** main flow page for this figure */
- private FlowPage flowPage;
-
- /**
- * Creates a new HTMLCornerBentBodyFigure.
- */
- public HTMLCornerBentBodyFigure() {
- // flowPage = new FlowPage();
- // flowPage.setBackgroundColor(new Color(Display.getCurrent(), new
- // RGB(100, 100, 100)));
- // this.add(flowPage);
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
- *
- * @param text
- * the text to display
- */
- public void setText(String text) {
- this.text = text;
-
- // TextFlowEx textFlow1 = new TextFlowEx();
- // textFlow1.setText("textFlow1 ");
- // this.add(textFlow1);
-
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
- *
- * @return the text displayed by this figure
- */
- public String getText() {
- return text;
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
- *
- * @return
- */
- public Image getIcon() {
- return icon;
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
- *
- * @param icon
- */
- public void setIcon(Image icon) {
- this.icon = icon;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.text.FlowPage;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Flow Page that accept a text formatted in html, and displays it under a
+ * styled form
+ */
+public class HTMLCornerBentBodyFigure extends Figure implements ILabelFigure {
+
+ /** text displayed by this figure */
+ private String text;
+
+ /** icon displayed by this figure */
+ private Image icon;
+
+ /** main flow page for this figure */
+ private FlowPage flowPage;
+
+ /**
+ * Creates a new HTMLCornerBentBodyFigure.
+ */
+ public HTMLCornerBentBodyFigure() {
+ // flowPage = new FlowPage();
+ // flowPage.setBackgroundColor(new Color(Display.getCurrent(), new
+ // RGB(100, 100, 100)));
+ // this.add(flowPage);
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
+ *
+ * @param text
+ * the text to display
+ */
+ public void setText(String text) {
+ this.text = text;
+
+ // TextFlowEx textFlow1 = new TextFlowEx();
+ // textFlow1.setText("textFlow1 ");
+ // this.add(textFlow1);
+
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
+ *
+ * @return the text displayed by this figure
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
+ *
+ * @return
+ */
+ public Image getIcon() {
+ return icon;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
+ *
+ * @param icon
+ */
+ public void setIcon(Image icon) {
+ this.icon = icon;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentFigure.java
index 58d0c690f5e..81067617b97 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/HTMLCornerBentFigure.java
@@ -1,686 +1,686 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.text.BlockFlow;
-import org.eclipse.draw2d.text.FlowPage;
-import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
-import org.eclipse.gmf.runtime.draw2d.ui.text.TextFlowEx;
-import org.eclipse.jface.resource.FontDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.papyrus.uml.diagram.common.parser.HTMLCleaner;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Corner bend figure able to display styled text formatted in html
- */
-public class HTMLCornerBentFigure extends CornerBentFigure implements ILabelFigure, IMultilineEditableFigure {
-
- /** indicates if the figure should use local coordinates or not */
- protected boolean useLocalCoordinates = false;
-
- /** background color for this figure */
- static final Color THIS_BACK = new Color(null, 248, 249, 214);
-
- /** font used by default by this figure */
- static final Font FCORNERBENTCONTENTLABEL_FONT = new Font(Display.getCurrent(), "Arial", 8, SWT.NORMAL);
-
- /** key for the font style, corresponding to the type of font */
- private static final String FONT_NAME = "face";
-
- /** key for the font style, corresponding to the type of font */
- private static final String FONT_SIZE = "size";
-
- /** main flow page */
- protected FlowPage page;
-
- /** properties stack to store which format to apply */
- protected Stack<Styles> textProperties = new Stack<Styles>();
-
- /** font used for the figure */
- private FontData currentFontData;
-
- private String text = ""; //Used as the default text (instead of null)
-
- /**
- * set of font datas used by this comment. It will be cleaned juste after
- * the creation of the comment
- */
- private Set<FontData> cachedFontDatas = new HashSet<FontData>();
-
- /**
- * Creates a new HTMLCornerBentFigure.
- */
- public HTMLCornerBentFigure() {
- super();
- this.setBackgroundColor(THIS_BACK);
- createContents();
-
- }
-
- /**
- * return the label thath contains the icon.
- *
- * @return the label that contains the icon
- */
- public Label getIconLabel() {
- return this.iconLabel;
- }
-
- /**
- * Generates the basic contents for this figure
- */
- protected void createContents() {
- // simply creates a Flow page, that will contains BlockFlows
- // representing the html content
- page = new FlowPage();
- page.setForegroundColor(getForegroundColor());
- this.add(page);
- }
-
- /**
- * @see org.eclipse.draw2d.Figure#useLocalCoordinates()
- *
- * @return <code>true</code> if this Figure uses local coordinates
- */
- @Override
- protected boolean useLocalCoordinates() {
- return useLocalCoordinates;
- }
-
- /**
- * Returns the current instance of this class
- *
- * @return the current instance of this class
- */
- public HTMLCornerBentFigure getCornerBentFigure() {
- return this;
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
- *
- * @return
- */
-
- public Image getIcon() {
- return null;
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
- *
- * @return
- */
-
- public String getText() {
- return text;
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
- *
- * @param icon
- */
-
- public void setIcon(Image icon) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
- *
- * @param text
- */
-
- public void setText(String text) {
- if(equals(text, this.text)) {
- return;
- }
-
- this.text = text;
-
- // remove all children from page.
- page.removeAll();
-
- // init the first font data
- currentFontData = new FontData("Wingdings", 8, SWT.NORMAL);
-
- // generates new ones
- generateBlockForText(text, page);
- }
-
- private static boolean equals(String s1, String s2) {
- if(s1 == null && s2 == null) {
- return true;
- }
-
- if(s1 != null) {
- return s1.equals(s2);
- } else {
- return s2.equals(s1);
- }
- }
-
- /**
- * Generates block list for the given text, and adds it to the root flow
- * page
- *
- * @param text
- * the string to display
- */
- protected void generateBlockForText(String text, FlowPage page) {
- // parse the HMTL text and transforms it into a tree. "Body" tags
- // enforce the character chain to be a valid xml chain
- NodeList nodeList = generateNodeList("<body>" + text + "</body>");
-
- // generate blocks from this list and adds it to the flow page children
- if(nodeList.getLength() > 0) {
- generateBlocksFromNodeList(nodeList, page);
- } else {
- // problem during parsing
- // return only one text flow with the content of the text
- TextFlowEx textFlow = new TextFlowEx(text);
- page.add(textFlow);
- }
-
- }
-
- /**
- * Builds the structure and content of block flows for a given list of nodes
- *
- * @param nodeList
- * the list of nodes from which to generates the blockflows
- */
- protected void generateBlocksFromNodeList(NodeList nodeList, BlockFlow parentFlow) {
- // for each element in the list, generates the corresponding blocks
- for(int i = 0; i < nodeList.getLength(); i++) {
- Node node = nodeList.item(i);
-
- String nodeName = node.getNodeName();
-
- short nodeType = node.getNodeType();
- if(nodeType == Node.TEXT_NODE) {
- generateTextFromTextNode(node, parentFlow);
- } else {
- switch(HTMLTags.valueOf(nodeName)) {
- case body: // main tag for the comment body
- // create a block for the body
- generateBlocksFromBodyNode(node, parentFlow);
- break;
- case h3:
- generateBlocksFromH3Node(node, parentFlow);
- break;
- case h4: // sub section heading
- generateBlocksFromH4Node(node, parentFlow);
- break;
- case h5: // sub sub section heading
- generateBlocksFromH5Node(node, parentFlow);
- break;
- case strong: // bold character
- generateBlocksFromStrongNode(node, parentFlow);
- break;
- case em: // italic
- generateBlocksFromItalicNode(node, parentFlow);
- break;
- case u: // underline
- generateBlocksFromUnderlineNode(node, parentFlow);
- break;
- case sub: // subscript
- break;
- case sup: // superscript
- break;
- case blockquote: // indent left or right
- break;
- case table: // table
- break;
- case p: // paragraph
- generateBlocksFromParagraphNode(node, parentFlow);
- break;
- case br:
- generateBlocksFromBRNode(node, parentFlow);
- break;
- case font:
- generateBlocksForFontNode(node, parentFlow);
- default:
- break;
- }
- }
- }
-
- }
-
- /**
- * Generates code from a node representing an underlined text.
- *
- * @param node
- * the node from which to generate belowk flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromUnderlineNode(Node node, BlockFlow parentFlow) {
- NodeList childrenNodes = node.getChildNodes();
-
- textProperties.push(Styles.underline);
- generateBlocksFromNodeList(childrenNodes, parentFlow);
- textProperties.pop();
- }
-
- /**
- * Generates code from a node representing a text.
- *
- * @param node
- * the node from which to generate belowk flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateTextFromTextNode(Node node, BlockFlow parentFlow) {
- // node has type: TEXT_NODE
- String text = HTMLCleaner.cleanHTMLTags(node.getNodeValue());
- TextFlowEx textFlow = new TextFlowEx(text);
- textFlow.setTextUnderline(false);
-
- boolean italic = false;
- boolean strong = false;
- boolean quote = false;
- boolean codeSample = false;
- String fontName = "Arial";
- int fontSize = 2;
-
- // calculate the font to apply
- for(Styles style : textProperties) {
- switch(style) {
- case italic:
- italic = true;
- break;
- case strong:
- strong = true;
- break;
- case underline:
- textFlow.setTextUnderline(true);
- break;
- case quote:
- quote = true;
- break;
- case code:
- codeSample = true;
- break;
- case font:
- fontName = (Styles.font.getData().get(FONT_NAME) != null) ? (String)Styles.font.getData().get(FONT_NAME) : "Arial";
- fontSize = (Styles.font.getData().get(FONT_SIZE) != null) ? ((Integer)Styles.font.getData().get(FONT_SIZE)) : 2;
- break;
- default:
- break;
- }
-
- }
-
- int style = SWT.NORMAL;
-
- if(italic) {
- style = style | SWT.ITALIC;
- }
-
- if(strong) {
- style = style | SWT.BOLD;
- }
-
- FontData fontData;
- if(codeSample) {
- fontData = new FontData("Lucida Console", 8, style);
- } else if(quote) {
- fontData = new FontData("Monotype Corsiva", 10, style);
- textFlow.setBackgroundColor(DisplayUtils.getDisplay().getSystemColor(SWT.COLOR_RED));
- } else {
- // font size = [1..7] in html, but does not correspond to system
- // size... 2 by default => 8 in real size.
- // so: real size = (html font size)+6
- fontData = new FontData(fontName, 2 * fontSize + 4, style);
- }
-
- Font font = (Font)JFaceResources.getResources().get(FontDescriptor.createFrom(fontData));
- textFlow.setFont(font);
-
- parentFlow.add(textFlow);
- }
-
- /**
- * Generates code from a node representing a bolded text.
- *
- * @param node
- * the node from which to generate block flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromStrongNode(Node node, BlockFlow parentFlow) {
- NodeList childrenNodes = node.getChildNodes();
-
- textProperties.push(Styles.strong);
- generateBlocksFromNodeList(childrenNodes, parentFlow);
- textProperties.pop();
- }
-
- /**
- * Generates code from a node representing an italic styled text.
- *
- * @param node
- * the node from which to generate belowk flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromItalicNode(Node node, BlockFlow parentFlow) {
- NodeList childrenNodes = node.getChildNodes();
-
- textProperties.push(Styles.italic);
- generateBlocksFromNodeList(childrenNodes, parentFlow);
- textProperties.pop();
- }
-
- /**
- * Generates code from a node with new Font.
- *
- * @param node
- * the node from which to generate belowk flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksForFontNode(Node node, BlockFlow parentFlow) {
- // retrieves the font to apply
- Node fontNameNode = node.getAttributes().getNamedItem("face");
- Node fontSizeNode = node.getAttributes().getNamedItem("size");
- String oldFont = "";
- int oldSize = 8;
-
- if(fontNameNode != null) {
- String fontName = fontNameNode.getNodeValue();
- oldFont = (Styles.font.getData().get(FONT_NAME) != null) ? (String)Styles.font.getData().get(FONT_NAME) : "Arial";
- Styles.font.getData().put(FONT_NAME, fontName);
- textProperties.push(Styles.font);
- }
- if(fontSizeNode != null) {
- int fontSize = Integer.parseInt(fontSizeNode.getNodeValue());
- oldSize = (Styles.font.getData().get(FONT_SIZE) != null) ? ((Integer)Styles.font.getData().get(FONT_SIZE)) : 2;
- Styles.font.getData().put(FONT_SIZE, fontSize);
- textProperties.push(Styles.font);
- }
-
- NodeList childrenNodes = node.getChildNodes();
-
- generateBlocksFromNodeList(childrenNodes, parentFlow);
-
- if(fontNameNode != null) {
- Styles.font.getData().put(FONT_NAME, oldFont);
- textProperties.pop();
- }
- if(fontSizeNode != null) {
- Styles.font.getData().put(FONT_SIZE, oldSize);
- textProperties.pop();
- }
- }
-
- /**
- * Generates code from a node representing a H3 section (header section).
- *
- * @param node
- * the node from which to generate belowk flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromH3Node(Node node, BlockFlow parentFlow) {
- BlockFlow blockFlow = new BlockFlow();
- NodeList childrenNodes = node.getChildNodes();
-
- textProperties.push(Styles.header3);
- generateBlocksFromNodeList(childrenNodes, blockFlow);
- textProperties.pop();
- parentFlow.add(blockFlow);
- }
-
- /**
- * Generates code from a node representing a H3 section (header section).
- *
- * @param node
- * the node from which to generate belowk flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromH4Node(Node node, BlockFlow parentFlow) {
- BlockFlow blockFlow = new BlockFlow();
- NodeList childrenNodes = node.getChildNodes();
-
- textProperties.push(Styles.header4);
- generateBlocksFromNodeList(childrenNodes, blockFlow);
- textProperties.pop();
- parentFlow.add(blockFlow);
- }
-
- /**
- * Generates code from a node representing a H3 section (header section).
- *
- * @param node
- * the node from which to generate belowk flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromH5Node(Node node, BlockFlow parentFlow) {
- BlockFlow blockFlow = new BlockFlow();
- NodeList childrenNodes = node.getChildNodes();
-
- textProperties.push(Styles.header5);
- generateBlocksFromNodeList(childrenNodes, blockFlow);
- textProperties.pop();
- parentFlow.add(blockFlow);
- }
-
- /**
- * Pretty prints the list of child nodes
- *
- * @param childNodes
- */
- @SuppressWarnings("unused")
- private void debug(NodeList childNodes) {
- for(int i = 0; i < childNodes.getLength(); i++) {
- System.err.println("[" + i + "] " + childNodes.item(i).getNodeName());
- }
- }
-
- /**
- * Generates code from a node representing a body.
- *
- * @param node
- * the node from which to generate block flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromBodyNode(Node node, BlockFlow parentFlow) {
- BlockFlow blockFlow = new BlockFlow();
- NodeList childrenNodes = node.getChildNodes();
-
- generateBlocksFromNodeList(childrenNodes, blockFlow);
-
- parentFlow.add(blockFlow);
- }
-
- /**
- * Generates code from a node representing a paragraph.
- *
- * @param node
- * the node from which to generate block flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromParagraphNode(Node node, BlockFlow parentFlow) {
- BlockFlow blockFlow = new BlockFlow();
-
- // perhaps a style is associated to the paragraph (class="code sample"
- // for example)
- NamedNodeMap attributes = node.getAttributes();
- Node classNode = attributes.getNamedItem("class");
- boolean hasToPop = false;
- if(classNode != null) {
- String classNodeValue = classNode.getNodeValue();
-
- if("codeSample".equals(classNodeValue)) {
- hasToPop = true;
- textProperties.push(Styles.code);
- } else if("quote".equals(classNodeValue)) {
- textProperties.push(Styles.quote);
- hasToPop = true;
- }
- }
-
- NodeList childrenNodes = node.getChildNodes();
-
- generateBlocksFromNodeList(childrenNodes, blockFlow);
-
- if(hasToPop) {
- textProperties.pop();
- }
- parentFlow.add(blockFlow);
- }
-
- /**
- * Generates code from a node representing a carraige return.
- *
- * @param node
- * the node from which to generate block flows
- * @param parentFlow
- * the parent block flow which will contain the block created
- */
- protected void generateBlocksFromBRNode(Node node, BlockFlow parentFlow) {
- BlockFlow blockFlow = new BlockFlow();
- parentFlow.add(blockFlow);
- }
-
- /**
- * Generates a list of nodes from the parse of an html text
- *
- * @param text
- * the text to parse
- * @return the parsed text under the form of a list of nodes
- */
- protected NodeList generateNodeList(String text) {
- return HTMLCommentParser.parse(text);
- }
-
- /**
- * Valid HTML tags enumeration
- */
- protected enum HTMLTags {
-
- body(""), // main tag for the comment body
- h3(""), // section heading
- h4(""), // sub section heading
- h5(""), // sub sub section heading
- strong(""), // bold character
- em(""), // italic
- u(""), // underline
- sub(""), // subscript
- sup(""), // superscript
- blockquote(""), // indent left or right
- table(""), // table
- p(""), // paragraph
- br(""), // new line
- font(""); // specific font
-
- /** additional data for this enum */
- protected String data;
-
- HTMLTags(String data) {
- this.data = data;
- }
-
- /**
- * Sets the data for this enum
- *
- * @param data
- * the data to set
- */
- public void setData(String data) {
- this.data = data;
- }
-
- /**
- * Returns the data associated to this enum
- *
- * @return the data associated to this enum
- */
- public String getData() {
- return data;
- }
-
- }
-
- /**
- * Styles to apply to the text
- */
- protected enum Styles {
- strong, header3, header4, header5, underline, italic, code, subscript, supscript, quote, font(new HashMap<String, Object>());
-
- /** additional data */
- private Map<String, Object> data;
-
- Styles() {
- this.data = null;
- }
-
- Styles(Map<String, Object> data) {
- this.data = data;
- }
-
- /**
- * sets the data associated to this enum
- *
- * @param data
- * the data to set
- */
- public void setData(Map<String, Object> data) {
- this.data = data;
- }
-
- /**
- * Returns the data for this enum
- *
- * @return the data for this enum
- */
- public Map<String, Object> getData() {
- return data;
- }
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure#getEditionLocation()
- *
- */
- public Point getEditionLocation() {
- return getBounds().getTopLeft();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.text.BlockFlow;
+import org.eclipse.draw2d.text.FlowPage;
+import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
+import org.eclipse.gmf.runtime.draw2d.ui.text.TextFlowEx;
+import org.eclipse.jface.resource.FontDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.papyrus.uml.diagram.common.parser.HTMLCleaner;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Corner bend figure able to display styled text formatted in html
+ */
+public class HTMLCornerBentFigure extends CornerBentFigure implements ILabelFigure, IMultilineEditableFigure {
+
+ /** indicates if the figure should use local coordinates or not */
+ protected boolean useLocalCoordinates = false;
+
+ /** background color for this figure */
+ static final Color THIS_BACK = new Color(null, 248, 249, 214);
+
+ /** font used by default by this figure */
+ static final Font FCORNERBENTCONTENTLABEL_FONT = new Font(Display.getCurrent(), "Arial", 8, SWT.NORMAL);
+
+ /** key for the font style, corresponding to the type of font */
+ private static final String FONT_NAME = "face";
+
+ /** key for the font style, corresponding to the type of font */
+ private static final String FONT_SIZE = "size";
+
+ /** main flow page */
+ protected FlowPage page;
+
+ /** properties stack to store which format to apply */
+ protected Stack<Styles> textProperties = new Stack<Styles>();
+
+ /** font used for the figure */
+ private FontData currentFontData;
+
+ private String text = ""; //Used as the default text (instead of null)
+
+ /**
+ * set of font datas used by this comment. It will be cleaned juste after
+ * the creation of the comment
+ */
+ private Set<FontData> cachedFontDatas = new HashSet<FontData>();
+
+ /**
+ * Creates a new HTMLCornerBentFigure.
+ */
+ public HTMLCornerBentFigure() {
+ super();
+ this.setBackgroundColor(THIS_BACK);
+ createContents();
+
+ }
+
+ /**
+ * return the label thath contains the icon.
+ *
+ * @return the label that contains the icon
+ */
+ public Label getIconLabel() {
+ return this.iconLabel;
+ }
+
+ /**
+ * Generates the basic contents for this figure
+ */
+ protected void createContents() {
+ // simply creates a Flow page, that will contains BlockFlows
+ // representing the html content
+ page = new FlowPage();
+ page.setForegroundColor(getForegroundColor());
+ this.add(page);
+ }
+
+ /**
+ * @see org.eclipse.draw2d.Figure#useLocalCoordinates()
+ *
+ * @return <code>true</code> if this Figure uses local coordinates
+ */
+ @Override
+ protected boolean useLocalCoordinates() {
+ return useLocalCoordinates;
+ }
+
+ /**
+ * Returns the current instance of this class
+ *
+ * @return the current instance of this class
+ */
+ public HTMLCornerBentFigure getCornerBentFigure() {
+ return this;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getIcon()
+ *
+ * @return
+ */
+
+ public Image getIcon() {
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#getText()
+ *
+ * @return
+ */
+
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setIcon(org.eclipse.swt.graphics.Image)
+ *
+ * @param icon
+ */
+
+ public void setIcon(Image icon) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.ILabelFigure#setText(java.lang.String)
+ *
+ * @param text
+ */
+
+ public void setText(String text) {
+ if(equals(text, this.text)) {
+ return;
+ }
+
+ this.text = text;
+
+ // remove all children from page.
+ page.removeAll();
+
+ // init the first font data
+ currentFontData = new FontData("Wingdings", 8, SWT.NORMAL);
+
+ // generates new ones
+ generateBlockForText(text, page);
+ }
+
+ private static boolean equals(String s1, String s2) {
+ if(s1 == null && s2 == null) {
+ return true;
+ }
+
+ if(s1 != null) {
+ return s1.equals(s2);
+ } else {
+ return s2.equals(s1);
+ }
+ }
+
+ /**
+ * Generates block list for the given text, and adds it to the root flow
+ * page
+ *
+ * @param text
+ * the string to display
+ */
+ protected void generateBlockForText(String text, FlowPage page) {
+ // parse the HMTL text and transforms it into a tree. "Body" tags
+ // enforce the character chain to be a valid xml chain
+ NodeList nodeList = generateNodeList("<body>" + text + "</body>");
+
+ // generate blocks from this list and adds it to the flow page children
+ if(nodeList.getLength() > 0) {
+ generateBlocksFromNodeList(nodeList, page);
+ } else {
+ // problem during parsing
+ // return only one text flow with the content of the text
+ TextFlowEx textFlow = new TextFlowEx(text);
+ page.add(textFlow);
+ }
+
+ }
+
+ /**
+ * Builds the structure and content of block flows for a given list of nodes
+ *
+ * @param nodeList
+ * the list of nodes from which to generates the blockflows
+ */
+ protected void generateBlocksFromNodeList(NodeList nodeList, BlockFlow parentFlow) {
+ // for each element in the list, generates the corresponding blocks
+ for(int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+
+ String nodeName = node.getNodeName();
+
+ short nodeType = node.getNodeType();
+ if(nodeType == Node.TEXT_NODE) {
+ generateTextFromTextNode(node, parentFlow);
+ } else {
+ switch(HTMLTags.valueOf(nodeName)) {
+ case body: // main tag for the comment body
+ // create a block for the body
+ generateBlocksFromBodyNode(node, parentFlow);
+ break;
+ case h3:
+ generateBlocksFromH3Node(node, parentFlow);
+ break;
+ case h4: // sub section heading
+ generateBlocksFromH4Node(node, parentFlow);
+ break;
+ case h5: // sub sub section heading
+ generateBlocksFromH5Node(node, parentFlow);
+ break;
+ case strong: // bold character
+ generateBlocksFromStrongNode(node, parentFlow);
+ break;
+ case em: // italic
+ generateBlocksFromItalicNode(node, parentFlow);
+ break;
+ case u: // underline
+ generateBlocksFromUnderlineNode(node, parentFlow);
+ break;
+ case sub: // subscript
+ break;
+ case sup: // superscript
+ break;
+ case blockquote: // indent left or right
+ break;
+ case table: // table
+ break;
+ case p: // paragraph
+ generateBlocksFromParagraphNode(node, parentFlow);
+ break;
+ case br:
+ generateBlocksFromBRNode(node, parentFlow);
+ break;
+ case font:
+ generateBlocksForFontNode(node, parentFlow);
+ default:
+ break;
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Generates code from a node representing an underlined text.
+ *
+ * @param node
+ * the node from which to generate belowk flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromUnderlineNode(Node node, BlockFlow parentFlow) {
+ NodeList childrenNodes = node.getChildNodes();
+
+ textProperties.push(Styles.underline);
+ generateBlocksFromNodeList(childrenNodes, parentFlow);
+ textProperties.pop();
+ }
+
+ /**
+ * Generates code from a node representing a text.
+ *
+ * @param node
+ * the node from which to generate belowk flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateTextFromTextNode(Node node, BlockFlow parentFlow) {
+ // node has type: TEXT_NODE
+ String text = HTMLCleaner.cleanHTMLTags(node.getNodeValue());
+ TextFlowEx textFlow = new TextFlowEx(text);
+ textFlow.setTextUnderline(false);
+
+ boolean italic = false;
+ boolean strong = false;
+ boolean quote = false;
+ boolean codeSample = false;
+ String fontName = "Arial";
+ int fontSize = 2;
+
+ // calculate the font to apply
+ for(Styles style : textProperties) {
+ switch(style) {
+ case italic:
+ italic = true;
+ break;
+ case strong:
+ strong = true;
+ break;
+ case underline:
+ textFlow.setTextUnderline(true);
+ break;
+ case quote:
+ quote = true;
+ break;
+ case code:
+ codeSample = true;
+ break;
+ case font:
+ fontName = (Styles.font.getData().get(FONT_NAME) != null) ? (String)Styles.font.getData().get(FONT_NAME) : "Arial";
+ fontSize = (Styles.font.getData().get(FONT_SIZE) != null) ? ((Integer)Styles.font.getData().get(FONT_SIZE)) : 2;
+ break;
+ default:
+ break;
+ }
+
+ }
+
+ int style = SWT.NORMAL;
+
+ if(italic) {
+ style = style | SWT.ITALIC;
+ }
+
+ if(strong) {
+ style = style | SWT.BOLD;
+ }
+
+ FontData fontData;
+ if(codeSample) {
+ fontData = new FontData("Lucida Console", 8, style);
+ } else if(quote) {
+ fontData = new FontData("Monotype Corsiva", 10, style);
+ textFlow.setBackgroundColor(DisplayUtils.getDisplay().getSystemColor(SWT.COLOR_RED));
+ } else {
+ // font size = [1..7] in html, but does not correspond to system
+ // size... 2 by default => 8 in real size.
+ // so: real size = (html font size)+6
+ fontData = new FontData(fontName, 2 * fontSize + 4, style);
+ }
+
+ Font font = (Font)JFaceResources.getResources().get(FontDescriptor.createFrom(fontData));
+ textFlow.setFont(font);
+
+ parentFlow.add(textFlow);
+ }
+
+ /**
+ * Generates code from a node representing a bolded text.
+ *
+ * @param node
+ * the node from which to generate block flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromStrongNode(Node node, BlockFlow parentFlow) {
+ NodeList childrenNodes = node.getChildNodes();
+
+ textProperties.push(Styles.strong);
+ generateBlocksFromNodeList(childrenNodes, parentFlow);
+ textProperties.pop();
+ }
+
+ /**
+ * Generates code from a node representing an italic styled text.
+ *
+ * @param node
+ * the node from which to generate belowk flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromItalicNode(Node node, BlockFlow parentFlow) {
+ NodeList childrenNodes = node.getChildNodes();
+
+ textProperties.push(Styles.italic);
+ generateBlocksFromNodeList(childrenNodes, parentFlow);
+ textProperties.pop();
+ }
+
+ /**
+ * Generates code from a node with new Font.
+ *
+ * @param node
+ * the node from which to generate belowk flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksForFontNode(Node node, BlockFlow parentFlow) {
+ // retrieves the font to apply
+ Node fontNameNode = node.getAttributes().getNamedItem("face");
+ Node fontSizeNode = node.getAttributes().getNamedItem("size");
+ String oldFont = "";
+ int oldSize = 8;
+
+ if(fontNameNode != null) {
+ String fontName = fontNameNode.getNodeValue();
+ oldFont = (Styles.font.getData().get(FONT_NAME) != null) ? (String)Styles.font.getData().get(FONT_NAME) : "Arial";
+ Styles.font.getData().put(FONT_NAME, fontName);
+ textProperties.push(Styles.font);
+ }
+ if(fontSizeNode != null) {
+ int fontSize = Integer.parseInt(fontSizeNode.getNodeValue());
+ oldSize = (Styles.font.getData().get(FONT_SIZE) != null) ? ((Integer)Styles.font.getData().get(FONT_SIZE)) : 2;
+ Styles.font.getData().put(FONT_SIZE, fontSize);
+ textProperties.push(Styles.font);
+ }
+
+ NodeList childrenNodes = node.getChildNodes();
+
+ generateBlocksFromNodeList(childrenNodes, parentFlow);
+
+ if(fontNameNode != null) {
+ Styles.font.getData().put(FONT_NAME, oldFont);
+ textProperties.pop();
+ }
+ if(fontSizeNode != null) {
+ Styles.font.getData().put(FONT_SIZE, oldSize);
+ textProperties.pop();
+ }
+ }
+
+ /**
+ * Generates code from a node representing a H3 section (header section).
+ *
+ * @param node
+ * the node from which to generate belowk flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromH3Node(Node node, BlockFlow parentFlow) {
+ BlockFlow blockFlow = new BlockFlow();
+ NodeList childrenNodes = node.getChildNodes();
+
+ textProperties.push(Styles.header3);
+ generateBlocksFromNodeList(childrenNodes, blockFlow);
+ textProperties.pop();
+ parentFlow.add(blockFlow);
+ }
+
+ /**
+ * Generates code from a node representing a H3 section (header section).
+ *
+ * @param node
+ * the node from which to generate belowk flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromH4Node(Node node, BlockFlow parentFlow) {
+ BlockFlow blockFlow = new BlockFlow();
+ NodeList childrenNodes = node.getChildNodes();
+
+ textProperties.push(Styles.header4);
+ generateBlocksFromNodeList(childrenNodes, blockFlow);
+ textProperties.pop();
+ parentFlow.add(blockFlow);
+ }
+
+ /**
+ * Generates code from a node representing a H3 section (header section).
+ *
+ * @param node
+ * the node from which to generate belowk flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromH5Node(Node node, BlockFlow parentFlow) {
+ BlockFlow blockFlow = new BlockFlow();
+ NodeList childrenNodes = node.getChildNodes();
+
+ textProperties.push(Styles.header5);
+ generateBlocksFromNodeList(childrenNodes, blockFlow);
+ textProperties.pop();
+ parentFlow.add(blockFlow);
+ }
+
+ /**
+ * Pretty prints the list of child nodes
+ *
+ * @param childNodes
+ */
+ @SuppressWarnings("unused")
+ private void debug(NodeList childNodes) {
+ for(int i = 0; i < childNodes.getLength(); i++) {
+ System.err.println("[" + i + "] " + childNodes.item(i).getNodeName());
+ }
+ }
+
+ /**
+ * Generates code from a node representing a body.
+ *
+ * @param node
+ * the node from which to generate block flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromBodyNode(Node node, BlockFlow parentFlow) {
+ BlockFlow blockFlow = new BlockFlow();
+ NodeList childrenNodes = node.getChildNodes();
+
+ generateBlocksFromNodeList(childrenNodes, blockFlow);
+
+ parentFlow.add(blockFlow);
+ }
+
+ /**
+ * Generates code from a node representing a paragraph.
+ *
+ * @param node
+ * the node from which to generate block flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromParagraphNode(Node node, BlockFlow parentFlow) {
+ BlockFlow blockFlow = new BlockFlow();
+
+ // perhaps a style is associated to the paragraph (class="code sample"
+ // for example)
+ NamedNodeMap attributes = node.getAttributes();
+ Node classNode = attributes.getNamedItem("class");
+ boolean hasToPop = false;
+ if(classNode != null) {
+ String classNodeValue = classNode.getNodeValue();
+
+ if("codeSample".equals(classNodeValue)) {
+ hasToPop = true;
+ textProperties.push(Styles.code);
+ } else if("quote".equals(classNodeValue)) {
+ textProperties.push(Styles.quote);
+ hasToPop = true;
+ }
+ }
+
+ NodeList childrenNodes = node.getChildNodes();
+
+ generateBlocksFromNodeList(childrenNodes, blockFlow);
+
+ if(hasToPop) {
+ textProperties.pop();
+ }
+ parentFlow.add(blockFlow);
+ }
+
+ /**
+ * Generates code from a node representing a carraige return.
+ *
+ * @param node
+ * the node from which to generate block flows
+ * @param parentFlow
+ * the parent block flow which will contain the block created
+ */
+ protected void generateBlocksFromBRNode(Node node, BlockFlow parentFlow) {
+ BlockFlow blockFlow = new BlockFlow();
+ parentFlow.add(blockFlow);
+ }
+
+ /**
+ * Generates a list of nodes from the parse of an html text
+ *
+ * @param text
+ * the text to parse
+ * @return the parsed text under the form of a list of nodes
+ */
+ protected NodeList generateNodeList(String text) {
+ return HTMLCommentParser.parse(text);
+ }
+
+ /**
+ * Valid HTML tags enumeration
+ */
+ protected enum HTMLTags {
+
+ body(""), // main tag for the comment body
+ h3(""), // section heading
+ h4(""), // sub section heading
+ h5(""), // sub sub section heading
+ strong(""), // bold character
+ em(""), // italic
+ u(""), // underline
+ sub(""), // subscript
+ sup(""), // superscript
+ blockquote(""), // indent left or right
+ table(""), // table
+ p(""), // paragraph
+ br(""), // new line
+ font(""); // specific font
+
+ /** additional data for this enum */
+ protected String data;
+
+ HTMLTags(String data) {
+ this.data = data;
+ }
+
+ /**
+ * Sets the data for this enum
+ *
+ * @param data
+ * the data to set
+ */
+ public void setData(String data) {
+ this.data = data;
+ }
+
+ /**
+ * Returns the data associated to this enum
+ *
+ * @return the data associated to this enum
+ */
+ public String getData() {
+ return data;
+ }
+
+ }
+
+ /**
+ * Styles to apply to the text
+ */
+ protected enum Styles {
+ strong, header3, header4, header5, underline, italic, code, subscript, supscript, quote, font(new HashMap<String, Object>());
+
+ /** additional data */
+ private Map<String, Object> data;
+
+ Styles() {
+ this.data = null;
+ }
+
+ Styles(Map<String, Object> data) {
+ this.data = data;
+ }
+
+ /**
+ * sets the data associated to this enum
+ *
+ * @param data
+ * the data to set
+ */
+ public void setData(Map<String, Object> data) {
+ this.data = data;
+ }
+
+ /**
+ * Returns the data for this enum
+ *
+ * @return the data for this enum
+ */
+ public Map<String, Object> getData() {
+ return data;
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IMultilineEditableFigure#getEditionLocation()
+ *
+ */
+ public Point getEditionLocation() {
+ return getBounds().getTopLeft();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IAbstractElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IAbstractElementFigure.java
index 6aace6b9bd7..738c49e3222 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IAbstractElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IAbstractElementFigure.java
@@ -1,201 +1,201 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This is the interface that all figures of Papyrus have to implement.
- *
- * @author Patrick Tessier
- * @since 12 september 2006
- * @deprecated tlandre : not used anymore. Use GMF mechanism directly instead
- */
-@Deprecated
-// @unused
-public interface IAbstractElementFigure extends IFigure {
-
- /**
- * in order to obtain the background colord of the figure.
- *
- * @return the background color of the figure
- */
- public Color getBackgroundColor();
-
- /**
- * set the backgound color of the figure.
- *
- * @param backgroundColor
- * the color in the background
- */
- public void setBackgroundColor(Color backgroundColor);
-
- /**
- * in order to set the border color of the figure.
- *
- * @return the border color of the figure
- */
- public Color getBorderColor();
-
- /**
- * set the border coler of the figure.
- *
- * @param borderColor
- * the color of the border of the figure
- */
- public void setBorderColor(Color borderColor);
-
- /**
- * in order to set the icon in the figure this method is used in the case
- * where the stereotype has got an image (icon).
- *
- * @param img
- * the icon that we want to display
- */
- public void setAppliedStereotypeIcon(Image img);
-
- /**
- * get the font of the figure.
- *
- * @return return the font of the figure
- */
- // @unused
- public String getfigureFont();
-
- /**
- * set the font of the figure.
- *
- * @param font
- * the font of the figure that we want to see. For instance,
- * "Arial"
- */
- public void setfigureFont(String font);
-
- /**
- * get the font size of the figure.
- *
- * @return int the font size
- */
- public int getFontSize();
-
- /**
- * set the text fontsize of the figure.
- *
- * @param fontSize
- * that we want to see
- */
- public void setFontSize(int fontSize);
-
- /**
- * get the foreground color of the figure.
- *
- * @return Color the ForeGround color of the figure
- */
- public Color getForeGroundColor();
-
- /**
- * set the Foreground of the figure.
- *
- * @param foreGroundColor
- * the color that we want ot see
- */
- public void setForeGroundColor(Color foreGroundColor);
-
- /**
- * get the font color of the text in the figure.
- *
- * @return the font Color of the text in the figure
- */
- public Color getFontColor();
-
- /**
- * set the fontColor of the text in the figure.
- *
- * @param fontColor
- * of the text in the figure
- */
- public void setFontColor(Color fontColor);
-
- /**
- * Refresh list of stereotypes of current EditPart if required either with
- * or without the first stereotype.
- *
- * @param presentation
- * type of presentation
- * @param hasIcon
- * the has icon
- * @param hasShape
- * the has shape
- * @param stereotypes
- * String thaht contains Stereotype name
- */
- public void refreshStereotypes(String stereotypes, String presentation, boolean hasIcon, boolean hasShape);
-
- /**
- * set the name of the figure.
- *
- * @param name
- * na me of the figure
- */
- public void setName(String name);
-
- /**
- * get the label that contains name of the figure.
- *
- * @return label the name Label.
- */
- public WrappingLabel getNameLabel();
-
- /**
- * get the label that contains stereotype name.
- *
- * @return Label that contains all stereotype names
- */
- public Label getStereotypesLabel();
-
- /**
- * set the qaulified name of the figure.
- *
- * @param qualifiedName
- * qulified name of the figure
- */
- public void setQualifiedName(String qualifiedName);
-
- /**
- * get the label that contains the qualified name.
- *
- * @return Label that contains the qualifed name of the figure
- */
- public Label getQualifiedNameLabel();
-
- /**
- *
- * @return the minimum witdh of the figure to see all containment
- */
- public Dimension getMinimumDimension();
-
- /**
- * Set the stereotype value. If param is null, remove the label.
- *
- * @param stereotypes
- * String that contains list of stereotypes
- */
- public void setStereotypes(String stereotypes);
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This is the interface that all figures of Papyrus have to implement.
+ *
+ * @author Patrick Tessier
+ * @since 12 september 2006
+ * @deprecated tlandre : not used anymore. Use GMF mechanism directly instead
+ */
+@Deprecated
+// @unused
+public interface IAbstractElementFigure extends IFigure {
+
+ /**
+ * in order to obtain the background colord of the figure.
+ *
+ * @return the background color of the figure
+ */
+ public Color getBackgroundColor();
+
+ /**
+ * set the backgound color of the figure.
+ *
+ * @param backgroundColor
+ * the color in the background
+ */
+ public void setBackgroundColor(Color backgroundColor);
+
+ /**
+ * in order to set the border color of the figure.
+ *
+ * @return the border color of the figure
+ */
+ public Color getBorderColor();
+
+ /**
+ * set the border coler of the figure.
+ *
+ * @param borderColor
+ * the color of the border of the figure
+ */
+ public void setBorderColor(Color borderColor);
+
+ /**
+ * in order to set the icon in the figure this method is used in the case
+ * where the stereotype has got an image (icon).
+ *
+ * @param img
+ * the icon that we want to display
+ */
+ public void setAppliedStereotypeIcon(Image img);
+
+ /**
+ * get the font of the figure.
+ *
+ * @return return the font of the figure
+ */
+ // @unused
+ public String getfigureFont();
+
+ /**
+ * set the font of the figure.
+ *
+ * @param font
+ * the font of the figure that we want to see. For instance,
+ * "Arial"
+ */
+ public void setfigureFont(String font);
+
+ /**
+ * get the font size of the figure.
+ *
+ * @return int the font size
+ */
+ public int getFontSize();
+
+ /**
+ * set the text fontsize of the figure.
+ *
+ * @param fontSize
+ * that we want to see
+ */
+ public void setFontSize(int fontSize);
+
+ /**
+ * get the foreground color of the figure.
+ *
+ * @return Color the ForeGround color of the figure
+ */
+ public Color getForeGroundColor();
+
+ /**
+ * set the Foreground of the figure.
+ *
+ * @param foreGroundColor
+ * the color that we want ot see
+ */
+ public void setForeGroundColor(Color foreGroundColor);
+
+ /**
+ * get the font color of the text in the figure.
+ *
+ * @return the font Color of the text in the figure
+ */
+ public Color getFontColor();
+
+ /**
+ * set the fontColor of the text in the figure.
+ *
+ * @param fontColor
+ * of the text in the figure
+ */
+ public void setFontColor(Color fontColor);
+
+ /**
+ * Refresh list of stereotypes of current EditPart if required either with
+ * or without the first stereotype.
+ *
+ * @param presentation
+ * type of presentation
+ * @param hasIcon
+ * the has icon
+ * @param hasShape
+ * the has shape
+ * @param stereotypes
+ * String thaht contains Stereotype name
+ */
+ public void refreshStereotypes(String stereotypes, String presentation, boolean hasIcon, boolean hasShape);
+
+ /**
+ * set the name of the figure.
+ *
+ * @param name
+ * na me of the figure
+ */
+ public void setName(String name);
+
+ /**
+ * get the label that contains name of the figure.
+ *
+ * @return label the name Label.
+ */
+ public WrappingLabel getNameLabel();
+
+ /**
+ * get the label that contains stereotype name.
+ *
+ * @return Label that contains all stereotype names
+ */
+ public Label getStereotypesLabel();
+
+ /**
+ * set the qaulified name of the figure.
+ *
+ * @param qualifiedName
+ * qulified name of the figure
+ */
+ public void setQualifiedName(String qualifiedName);
+
+ /**
+ * get the label that contains the qualified name.
+ *
+ * @return Label that contains the qualifed name of the figure
+ */
+ public Label getQualifiedNameLabel();
+
+ /**
+ *
+ * @return the minimum witdh of the figure to see all containment
+ */
+ public Dimension getMinimumDimension();
+
+ /**
+ * Set the stereotype value. If param is null, remove the label.
+ *
+ * @param stereotypes
+ * String that contains list of stereotypes
+ */
+ public void setStereotypes(String stereotypes);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IEllipseFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IEllipseFigure.java
index 245529497e4..162febb374a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IEllipseFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IEllipseFigure.java
@@ -1,22 +1,22 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-
-/**
- * this interface is used to inform that the figure display an ellipse (in the case where the class do not extends {@link Ellipse}
- *
- */
-public interface IEllipseFigure {
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+
+/**
+ * this interface is used to inform that the figure display an ellipse (in the case where the class do not extends {@link Ellipse}
+ *
+ */
+public interface IEllipseFigure {
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ILabelFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ILabelFigure.java
index 3bbcdfb3f2d..2e07e6f2c4d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ILabelFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ILabelFigure.java
@@ -1,52 +1,52 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Standard interface for custom figures displaying text and icon
- */
-public interface ILabelFigure {
-
- /**
- * Sets the text for this figure
- *
- * @param text
- * the text to display
- * @return the text to display
- */
- public void setText(String text);
-
- /**
- * Returns the text of this figure
- *
- * @return the text displayed by this figure
- */
- public String getText();
-
- /**
- * Sets the icon for this figure
- *
- * @param icon
- * the image to display
- * @return the image to display
- */
- public void setIcon(Image icon);
-
- /**
- * Returns the image of this figure
- *
- * @return the image displayed by this figure
- */
- public Image getIcon();
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Standard interface for custom figures displaying text and icon
+ */
+public interface ILabelFigure {
+
+ /**
+ * Sets the text for this figure
+ *
+ * @param text
+ * the text to display
+ * @return the text to display
+ */
+ public void setText(String text);
+
+ /**
+ * Returns the text of this figure
+ *
+ * @return the text displayed by this figure
+ */
+ public String getText();
+
+ /**
+ * Sets the icon for this figure
+ *
+ * @param icon
+ * the image to display
+ * @return the image to display
+ */
+ public void setIcon(Image icon);
+
+ /**
+ * Returns the image of this figure
+ *
+ * @return the image displayed by this figure
+ */
+ public Image getIcon();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IMultilineEditableFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IMultilineEditableFigure.java
index 9654e706056..f08a7652b23 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IMultilineEditableFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IMultilineEditableFigure.java
@@ -1,41 +1,41 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-
-/**
- * This interface is used to indicate that this kind of figure contains a
- * multiline field. It provides method to edit and the position to edit this
- * field.
- */
-public interface IMultilineEditableFigure extends IFigure {
-
- /**
- * Gets the text of the multi-line field
- *
- * @return the text
- */
- public String getText();
-
- /**
- * Gets the location of the multi-line field
- *
- * @return the edition location
- */
- public Point getEditionLocation();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+
+/**
+ * This interface is used to indicate that this kind of figure contains a
+ * multiline field. It provides method to edit and the position to edit this
+ * field.
+ */
+public interface IMultilineEditableFigure extends IFigure {
+
+ /**
+ * Gets the text of the multi-line field
+ *
+ * @return the text
+ */
+ public String getText();
+
+ /**
+ * Gets the location of the multi-line field
+ *
+ * @return the edition location
+ */
+ public Point getEditionLocation();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeNamedElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeNamedElementFigure.java
index bb6e5012744..bfbdd12385b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeNamedElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeNamedElementFigure.java
@@ -1,66 +1,66 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-public interface IPapyrusNodeNamedElementFigure extends IPapyrusNodeUMLElementFigure {
-
- /**
- * Sets the qualified name.
- *
- * @param qualifiedName
- * the qualified name
- */
- public void setQualifiedName(String qualifiedName);
-
- /**
- * return the label that contains the qualified name.
- *
- * @return the label that contains the qualified name
- */
- public Label getQualifiedNameLabel();
-
- /**
- * Get the label containing the tagged value
- *
- * @return
- */
- public Label getTaggedLabel();
-
- /**
- * Sets the depth.
- *
- * @param depth
- * the new depth
- */
- public void setDepth(int depth);
-
- /**
- * Gets the name label.
- *
- * @return the name label
- */
- public WrappingLabel getNameLabel();
-
- /**
- * display or not the icon associated to the label
- *
- * @param displayNameLabelIcon
- */
-
- public void setNameLabelIcon(boolean displayNameLabelIcon);
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+public interface IPapyrusNodeNamedElementFigure extends IPapyrusNodeUMLElementFigure {
+
+ /**
+ * Sets the qualified name.
+ *
+ * @param qualifiedName
+ * the qualified name
+ */
+ public void setQualifiedName(String qualifiedName);
+
+ /**
+ * return the label that contains the qualified name.
+ *
+ * @return the label that contains the qualified name
+ */
+ public Label getQualifiedNameLabel();
+
+ /**
+ * Get the label containing the tagged value
+ *
+ * @return
+ */
+ public Label getTaggedLabel();
+
+ /**
+ * Sets the depth.
+ *
+ * @param depth
+ * the new depth
+ */
+ public void setDepth(int depth);
+
+ /**
+ * Gets the name label.
+ *
+ * @return the name label
+ */
+ public WrappingLabel getNameLabel();
+
+ /**
+ * display or not the icon associated to the label
+ *
+ * @param displayNameLabelIcon
+ */
+
+ public void setNameLabelIcon(boolean displayNameLabelIcon);
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeUMLElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeUMLElementFigure.java
index 0e1bbfbb5a6..60b5f1fc3ff 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeUMLElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusNodeUMLElementFigure.java
@@ -1,57 +1,57 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Label;
-
-/**
- * declaration of figure that can manage stereotype display
- */
-public interface IPapyrusNodeUMLElementFigure extends IPapyrusUMLElementFigure {
-
- /**
- * Sets the stereotypes properties for this figure.
- * <p>
- * This implementation checks if the specified string is null or not.
- * <ul>
- * <li>if the string is <code>null</code>, it removes the label representing the stereotypes properties with brace.</li>
- * <li>if this is not <code>null</code>, it creates the stereotype properties label if needed and displays the specified string.</li>
- * </ul>
- * </p>
- *
- * @param stereotypeProperties
- * the string representing the stereotype properties to be
- * displayed
- */
- public void setStereotypePropertiesInBrace(String stereotypeProperties);
-
- /**
- * displays the new string corresponding to the list of stereotypes.
- *
- * if the string is <code>null</code>, then the figure that displays the
- * stereotype label is removed from the NodeNamedElementFigure.
- *
- * @param stereotypeProperties
- * the string to be displayed.
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties);
-
- /**
- * Gets the stereotypes label.
- *
- * @return the stereotypes label
- */
- public Label getStereotypesLabel();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Label;
+
+/**
+ * declaration of figure that can manage stereotype display
+ */
+public interface IPapyrusNodeUMLElementFigure extends IPapyrusUMLElementFigure {
+
+ /**
+ * Sets the stereotypes properties for this figure.
+ * <p>
+ * This implementation checks if the specified string is null or not.
+ * <ul>
+ * <li>if the string is <code>null</code>, it removes the label representing the stereotypes properties with brace.</li>
+ * <li>if this is not <code>null</code>, it creates the stereotype properties label if needed and displays the specified string.</li>
+ * </ul>
+ * </p>
+ *
+ * @param stereotypeProperties
+ * the string representing the stereotype properties to be
+ * displayed
+ */
+ public void setStereotypePropertiesInBrace(String stereotypeProperties);
+
+ /**
+ * displays the new string corresponding to the list of stereotypes.
+ *
+ * if the string is <code>null</code>, then the figure that displays the
+ * stereotype label is removed from the NodeNamedElementFigure.
+ *
+ * @param stereotypeProperties
+ * the string to be displayed.
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties);
+
+ /**
+ * Gets the stereotypes label.
+ *
+ * @return the stereotypes label
+ */
+ public Label getStereotypesLabel();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusUMLElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusUMLElementFigure.java
index 53029dd7b13..60358404a7e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusUMLElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/IPapyrusUMLElementFigure.java
@@ -1,38 +1,38 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * declaration of figure that can manage stereotype display
- */
-public interface IPapyrusUMLElementFigure {
-
- /**
- * Sets the stereotypes for this figure.
- * <p>
- * This implementation checks if the specified string is null or not.
- * <ul>
- * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
- * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
- * </ul>
- * </p>
- *
- * @param stereotypes
- * the string representing the stereotypes to be displayed
- **/
- public void setStereotypeDisplay(String stereotypes, Image image);
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * declaration of figure that can manage stereotype display
+ */
+public interface IPapyrusUMLElementFigure {
+
+ /**
+ * Sets the stereotypes for this figure.
+ * <p>
+ * This implementation checks if the specified string is null or not.
+ * <ul>
+ * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
+ * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
+ * </ul>
+ * </p>
+ *
+ * @param stereotypes
+ * the string representing the stereotypes to be displayed
+ **/
+ public void setStereotypeDisplay(String stereotypes, Image image);
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InitialNode.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InitialNode.java
index e956f37c0cb..fc757afd9e6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InitialNode.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InitialNode.java
@@ -1,73 +1,73 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * this figure is fill circle
- */
-public class InitialNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
-
- /**
- * {@inheritDoc}
- */
- protected Border getDefaultBorder(Color borderColor) {
- return null;
- }
- /**
- * {@inheritDoc}
- */
- @Override
- public Dimension getPreferredSize(int wHint, int hHint) {
- return new Dimension(20,20);
- }
-
- /**
- * {@inheritDoc}
- */
- public void paintFigure(Graphics graphics) {
- Rectangle r = getBounds().getCopy();
- graphics.setBackgroundColor(getForegroundColor());
- graphics.fillOval(r);
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypeDisplay(String stereotypes, Image image) {
- }
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- }
-
- /**
- * {@inheritDoc}
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- }
-
- /**
- * {@inheritDoc}
- */
- public Label getStereotypesLabel() {
- return new Label();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * this figure is fill circle
+ */
+public class InitialNode extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure{
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Border getDefaultBorder(Color borderColor) {
+ return null;
+ }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ return new Dimension(20,20);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void paintFigure(Graphics graphics) {
+ Rectangle r = getBounds().getCopy();
+ graphics.setBackgroundColor(getForegroundColor());
+ graphics.fillOval(r);
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ }
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Label getStereotypesLabel() {
+ return new Label();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InstanceSpecificationFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InstanceSpecificationFigure.java
index bc1071a53df..31681e0d0c3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InstanceSpecificationFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InstanceSpecificationFigure.java
@@ -1,55 +1,55 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.RectangleFigure;
-
-/**
- * Represents an InstanceSpecification.
- */
-public class InstanceSpecificationFigure extends CompartmentFigure {
-
- /** Slot Compartment */
- private static final String SLOT_COMPARTMENT = "slotCompartment";
-
- /** List of compartment */
- private static final List<String> COMPARTMENT = new ArrayList<String>() {
-
- private static final long serialVersionUID = -5999996890220382272L;
-
- {
- add(SLOT_COMPARTMENT);
- }
- };
-
- /**
- * Default Constructor
- */
- public InstanceSpecificationFigure() {
- super(COMPARTMENT);
- }
-
- /**
- * Get the slot's compartment figure
- *
- * @return
- */
- public RectangleFigure getSlotCompartmentFigure() {
- return getCompartment(SLOT_COMPARTMENT);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.RectangleFigure;
+
+/**
+ * Represents an InstanceSpecification.
+ */
+public class InstanceSpecificationFigure extends CompartmentFigure {
+
+ /** Slot Compartment */
+ private static final String SLOT_COMPARTMENT = "slotCompartment";
+
+ /** List of compartment */
+ private static final List<String> COMPARTMENT = new ArrayList<String>() {
+
+ private static final long serialVersionUID = -5999996890220382272L;
+
+ {
+ add(SLOT_COMPARTMENT);
+ }
+ };
+
+ /**
+ * Default Constructor
+ */
+ public InstanceSpecificationFigure() {
+ super(COMPARTMENT);
+ }
+
+ /**
+ * Get the slot's compartment figure
+ *
+ * @return
+ */
+ public RectangleFigure getSlotCompartmentFigure() {
+ return getCompartment(SLOT_COMPARTMENT);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InteractionRectangleFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InteractionRectangleFigure.java
index 8421bf7747c..eb9fac9a2c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InteractionRectangleFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InteractionRectangleFigure.java
@@ -1,104 +1,104 @@
-/*****************************************************************************
- * Copyright (c) 2009 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.BorderLayout;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.uml.diagram.common.draw2d.InteractionFigure;
-import org.eclipse.papyrus.uml.diagram.common.draw2d.LeftToolbarLayout;
-
-public class InteractionRectangleFigure extends NodeNamedElementFigure {
-
- protected InteractionFigure interactionLabelContainer;
-
- protected RectangleFigure interactionContentPane;
-
- protected WrappingLabel interactionLabel;
-
- private boolean myUseLocalCoordinates = false;
-
- /**
- * @param marginBorder
- *
- */
- public InteractionRectangleFigure() {
- setLayoutManager(new BorderLayout());
- createContents();
- }
-
- /**
- * @generated
- */
-
- protected void createContents() {
- add(createHeader(), BorderLayout.TOP);
- add(createContentPane(), BorderLayout.CENTER);
- }
-
- protected RectangleFigure createContentPane() {
- interactionContentPane = new RectangleFigure();
- // Margin allow to add message easily
- interactionContentPane.setBorder(new MarginBorder(5, 5, 5, 5));
- interactionContentPane.setFill(false);
- interactionContentPane.setOutline(true);
-
- return interactionContentPane;
- }
-
- protected RectangleFigure createHeader() {
- interactionLabel = new WrappingLabel();
-
- interactionLabelContainer = new InteractionFigure();
- interactionLabelContainer.setBorder(new MarginBorder(3, 3, 3, 3));
- interactionLabelContainer.setLayoutManager(new LeftToolbarLayout());
-
- interactionLabelContainer.add(interactionLabel);
-
- RectangleFigure container = new RectangleFigure();
- container.setOutline(false);
- container.setFill(false);
- container.setLayoutManager(new ToolbarLayout(false));
- container.add(interactionLabelContainer, ToolbarLayout.ALIGN_CENTER);
- return container;
- }
-
- /**
- * @generated
- */
- protected boolean useLocalCoordinates() {
- return myUseLocalCoordinates;
- }
-
- /**
- * @generated
- */
- protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
- myUseLocalCoordinates = useLocalCoordinates;
- }
-
- /**
- * @generated
- */
- public WrappingLabel getHeaderLabel() {
- return interactionLabel;
- }
-
- public RectangleFigure getCompartmentFigure() {
- return interactionContentPane;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.BorderLayout;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.diagram.common.draw2d.InteractionFigure;
+import org.eclipse.papyrus.uml.diagram.common.draw2d.LeftToolbarLayout;
+
+public class InteractionRectangleFigure extends NodeNamedElementFigure {
+
+ protected InteractionFigure interactionLabelContainer;
+
+ protected RectangleFigure interactionContentPane;
+
+ protected WrappingLabel interactionLabel;
+
+ private boolean myUseLocalCoordinates = false;
+
+ /**
+ * @param marginBorder
+ *
+ */
+ public InteractionRectangleFigure() {
+ setLayoutManager(new BorderLayout());
+ createContents();
+ }
+
+ /**
+ * @generated
+ */
+
+ protected void createContents() {
+ add(createHeader(), BorderLayout.TOP);
+ add(createContentPane(), BorderLayout.CENTER);
+ }
+
+ protected RectangleFigure createContentPane() {
+ interactionContentPane = new RectangleFigure();
+ // Margin allow to add message easily
+ interactionContentPane.setBorder(new MarginBorder(5, 5, 5, 5));
+ interactionContentPane.setFill(false);
+ interactionContentPane.setOutline(true);
+
+ return interactionContentPane;
+ }
+
+ protected RectangleFigure createHeader() {
+ interactionLabel = new WrappingLabel();
+
+ interactionLabelContainer = new InteractionFigure();
+ interactionLabelContainer.setBorder(new MarginBorder(3, 3, 3, 3));
+ interactionLabelContainer.setLayoutManager(new LeftToolbarLayout());
+
+ interactionLabelContainer.add(interactionLabel);
+
+ RectangleFigure container = new RectangleFigure();
+ container.setOutline(false);
+ container.setFill(false);
+ container.setLayoutManager(new ToolbarLayout(false));
+ container.add(interactionLabelContainer, ToolbarLayout.ALIGN_CENTER);
+ return container;
+ }
+
+ /**
+ * @generated
+ */
+ protected boolean useLocalCoordinates() {
+ return myUseLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ protected void setUseLocalCoordinates(boolean useLocalCoordinates) {
+ myUseLocalCoordinates = useLocalCoordinates;
+ }
+
+ /**
+ * @generated
+ */
+ public WrappingLabel getHeaderLabel() {
+ return interactionLabel;
+ }
+
+ public RectangleFigure getCompartmentFigure() {
+ return interactionContentPane;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InterfaceFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InterfaceFigure.java
index 24b0a4b618c..788ed2d4e91 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InterfaceFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/InterfaceFigure.java
@@ -1,28 +1,28 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-
-/**
- * Represents an interface
- */
-public class InterfaceFigure extends ClassifierFigure {
-
- /**
- * Default Constructor
- */
- public InterfaceFigure() {
- super("Interface");
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+
+/**
+ * Represents an interface
+ */
+public class InterfaceFigure extends ClassifierFigure {
+
+ /**
+ * Default Constructor
+ */
+ public InterfaceFigure() {
+ super("Interface");
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ManualCompartmentLayoutManager.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ManualCompartmentLayoutManager.java
index e989506f233..1aa53a02721 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ManualCompartmentLayoutManager.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ManualCompartmentLayoutManager.java
@@ -1,229 +1,229 @@
-/****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * this is the layout manager in charge to place element in compartment element
- *
- */
-
-public class ManualCompartmentLayoutManager extends AbstractLayout {
-
- // @unused
- protected static final int MINIMUM_COMPARTMENT_HEIGHT = 15;
-
- // list of compartments
- protected ArrayList<IFigure> compartmentList = new ArrayList<IFigure>();
-
- // list of none compartments ex wrapping label etc...
- protected ArrayList<IFigure> notCompartmentList = new ArrayList<IFigure>();
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
- collectInformationOnChildren(container);
- int minimumWith = 0;
- int minimumHeight = 0;
- if(container instanceof CompartmentFigure) {
- // display name
- if(((CompartmentFigure)container).getNameLabel() != null) {
- if(((CompartmentFigure)container).getNameLabel().getPreferredSize().width > minimumWith) {
- minimumWith = ((CompartmentFigure)container).getNameLabel().getPreferredSize().width;
- }
- }
- }
- if(compartmentList.size() != 0) {
- for(int i = 0; i < container.getChildren().size(); i++) {
- minimumHeight += ((IFigure)container.getChildren().get(i)).getPreferredSize().height;
- }
- } else {
- for(int i = 0; i < notCompartmentList.size(); i++) {
- minimumHeight += notCompartmentList.get(i).getPreferredSize().height;
- }
- }
- minimumHeight += 7;
- return new Dimension(minimumWith, minimumHeight);
- }
-
- /**
- * layout by putting label in the center of figure
- *
- * @param container
- */
- protected void layoutCenterForLabel(IFigure container) {
- int labelheight = 0;
- for(int i = 0; i < notCompartmentList.size(); i++) {
- labelheight += notCompartmentList.get(i).getPreferredSize().height;
- }
-
- for(int i = 0; i < container.getChildren().size(); i++) {
- if(notCompartmentList.contains((container.getChildren().get(i)))) {
- Rectangle bound = new Rectangle(((IFigure)container.getChildren().get(i)).getBounds());
- bound.setSize(getPreferedSize(((IFigure)container.getChildren().get(i))));
- if(i > 0) {
- bound.y = ((IFigure)container.getChildren().get(i - 1)).getBounds().getBottomLeft().y + 1;
- bound.x = container.getBounds().x + 3;
- bound.width = container.getBounds().width;
- } else {
- bound.x = container.getBounds().x + 3;
- bound.y = container.getBounds().y + ((container.getBounds().height - labelheight) / 2);
- bound.width = container.getBounds().width;
- }
- ((IFigure)container.getChildren().get(i)).setBounds(bound);
- } else {
- Rectangle bound = new Rectangle(((IFigure)container.getChildren().get(i)).getBounds());
- bound.y = container.getBounds().getBottomLeft().y + 1;
- bound.x = container.getBounds().x + 3;
- ((IFigure)container.getChildren().get(i)).setBounds(bound);
- }
- }
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void layout(IFigure container) {
- collectInformationOnChildren(container);
- int containersize = container.getChildren().size();
- // choose the good layout by taking in account if it exist GMF
- // compartment
- if(compartmentList.size() != 0) {
- List childrenList = container.getChildren();
- for(int i = 0; i < container.getChildren().size(); i++) {
- Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
- bound.setSize(getPreferedSize(((IFigure)childrenList.get(i))));
- if(i > 0) {
- bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y + 1;
- if(compartmentList.contains((childrenList.get(i)))) {
- bound.x = container.getBounds().x;
- } else {
-
- }
- bound.width = container.getBounds().width;
- } else {
- bound.x = container.getBounds().x + 3;
- bound.y = container.getBounds().y;
- bound.width = container.getBounds().width;
-
- }
- ((IFigure)childrenList.get(i)).setBounds(bound);
- }
- optimizeCompartmentSize(container);
- // container
- Rectangle lastRectangle = ((IFigure)container.getChildren().get(containersize - 1)).getBounds();
- lastRectangle.height = container.getBounds().y + container.getBounds().height - lastRectangle.y;
- lastRectangle.width = container.getBounds().width;
- ((IFigure)container.getChildren().get(containersize - 1)).setBounds(lastRectangle);
- } else {
- layoutCenterForLabel(container);
- }
- }
-
- /**
- * Optimize the size of each compartment depending on the size of the
- * compartments container, and the size of each compartment. If a
- * compartment is empty, or not expanded, then a default size is applied to
- * this compartment
- *
- * @param compartmentsDimension
- * an hashmap containing each compartment dimension.
- */
- protected void optimizeCompartmentSize(IFigure container) {
- int compartmentsHeight = 0;
- int notCompartmentsHeight = 0;
- for(int i = 0; i < notCompartmentList.size(); i++) {
- notCompartmentsHeight += notCompartmentList.get(i).getBounds().height;
- }
-
- for(int i = 0; i < compartmentList.size(); i++) {
- compartmentsHeight += compartmentList.get(i).getBounds().height;
- }
- int remainingspace = container.getBounds().height - notCompartmentsHeight;
-
- // ratio between the height of all compartments and the size of the
- // compartments container.
- double ratio = new Integer(compartmentsHeight).doubleValue() / new Integer(remainingspace).doubleValue();
-
- for(int i = 0; i < compartmentList.size(); i++) {
- Rectangle bound = new Rectangle((compartmentList.get(i)).getBounds());
- int value = (int)(bound.height / ratio);
- bound.height = value;
- bound.x = container.getBounds().x;
- if(i > 0) {
- bound.y = (compartmentList.get(i - 1)).getBounds().getBottomLeft().y + 1;
-
- }
-
- }
-
- }
-
- public void collectInformationOnChildren(IFigure container) {
- compartmentList = new ArrayList<IFigure>();
- notCompartmentList = new ArrayList<IFigure>();
- for(int i = 0; i < container.getChildren().size(); i++) {
- if(isAGMFContainer(((IFigure)container.getChildren().get(i)))) {
- compartmentList.add(((IFigure)container.getChildren().get(i)));
- } else {
- if((container.getChildren().get(i)) instanceof Label || (container.getChildren().get(i)) instanceof WrappingLabel) {
- notCompartmentList.add(((IFigure)container.getChildren().get(i)));
- }
- }
-
- }
- }
-
- /**
- * obtain a prefered size
- *
- * @param figure
- * that can contain a GMF compartment figure
- * @return a the size
- */
- public Dimension getPreferedSize(IFigure figure) {
- Dimension dim = figure.getPreferredSize();
- return dim;
- }
-
- /**
- * tests is the figure contains a GMF compartment
- *
- * @param figure
- * @return true if this is the case
- */
- public boolean isAGMFContainer(IFigure figure) {
- if(figure.getChildren().size() > 0) {
- if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) {
- return true;
- }
- }
- return false;
- }
-
-}
+/****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * this is the layout manager in charge to place element in compartment element
+ *
+ */
+
+public class ManualCompartmentLayoutManager extends AbstractLayout {
+
+ // @unused
+ protected static final int MINIMUM_COMPARTMENT_HEIGHT = 15;
+
+ // list of compartments
+ protected ArrayList<IFigure> compartmentList = new ArrayList<IFigure>();
+
+ // list of none compartments ex wrapping label etc...
+ protected ArrayList<IFigure> notCompartmentList = new ArrayList<IFigure>();
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
+ collectInformationOnChildren(container);
+ int minimumWith = 0;
+ int minimumHeight = 0;
+ if(container instanceof CompartmentFigure) {
+ // display name
+ if(((CompartmentFigure)container).getNameLabel() != null) {
+ if(((CompartmentFigure)container).getNameLabel().getPreferredSize().width > minimumWith) {
+ minimumWith = ((CompartmentFigure)container).getNameLabel().getPreferredSize().width;
+ }
+ }
+ }
+ if(compartmentList.size() != 0) {
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ minimumHeight += ((IFigure)container.getChildren().get(i)).getPreferredSize().height;
+ }
+ } else {
+ for(int i = 0; i < notCompartmentList.size(); i++) {
+ minimumHeight += notCompartmentList.get(i).getPreferredSize().height;
+ }
+ }
+ minimumHeight += 7;
+ return new Dimension(minimumWith, minimumHeight);
+ }
+
+ /**
+ * layout by putting label in the center of figure
+ *
+ * @param container
+ */
+ protected void layoutCenterForLabel(IFigure container) {
+ int labelheight = 0;
+ for(int i = 0; i < notCompartmentList.size(); i++) {
+ labelheight += notCompartmentList.get(i).getPreferredSize().height;
+ }
+
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ if(notCompartmentList.contains((container.getChildren().get(i)))) {
+ Rectangle bound = new Rectangle(((IFigure)container.getChildren().get(i)).getBounds());
+ bound.setSize(getPreferedSize(((IFigure)container.getChildren().get(i))));
+ if(i > 0) {
+ bound.y = ((IFigure)container.getChildren().get(i - 1)).getBounds().getBottomLeft().y + 1;
+ bound.x = container.getBounds().x + 3;
+ bound.width = container.getBounds().width;
+ } else {
+ bound.x = container.getBounds().x + 3;
+ bound.y = container.getBounds().y + ((container.getBounds().height - labelheight) / 2);
+ bound.width = container.getBounds().width;
+ }
+ ((IFigure)container.getChildren().get(i)).setBounds(bound);
+ } else {
+ Rectangle bound = new Rectangle(((IFigure)container.getChildren().get(i)).getBounds());
+ bound.y = container.getBounds().getBottomLeft().y + 1;
+ bound.x = container.getBounds().x + 3;
+ ((IFigure)container.getChildren().get(i)).setBounds(bound);
+ }
+ }
+
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void layout(IFigure container) {
+ collectInformationOnChildren(container);
+ int containersize = container.getChildren().size();
+ // choose the good layout by taking in account if it exist GMF
+ // compartment
+ if(compartmentList.size() != 0) {
+ List childrenList = container.getChildren();
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
+ bound.setSize(getPreferedSize(((IFigure)childrenList.get(i))));
+ if(i > 0) {
+ bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y + 1;
+ if(compartmentList.contains((childrenList.get(i)))) {
+ bound.x = container.getBounds().x;
+ } else {
+
+ }
+ bound.width = container.getBounds().width;
+ } else {
+ bound.x = container.getBounds().x + 3;
+ bound.y = container.getBounds().y;
+ bound.width = container.getBounds().width;
+
+ }
+ ((IFigure)childrenList.get(i)).setBounds(bound);
+ }
+ optimizeCompartmentSize(container);
+ // container
+ Rectangle lastRectangle = ((IFigure)container.getChildren().get(containersize - 1)).getBounds();
+ lastRectangle.height = container.getBounds().y + container.getBounds().height - lastRectangle.y;
+ lastRectangle.width = container.getBounds().width;
+ ((IFigure)container.getChildren().get(containersize - 1)).setBounds(lastRectangle);
+ } else {
+ layoutCenterForLabel(container);
+ }
+ }
+
+ /**
+ * Optimize the size of each compartment depending on the size of the
+ * compartments container, and the size of each compartment. If a
+ * compartment is empty, or not expanded, then a default size is applied to
+ * this compartment
+ *
+ * @param compartmentsDimension
+ * an hashmap containing each compartment dimension.
+ */
+ protected void optimizeCompartmentSize(IFigure container) {
+ int compartmentsHeight = 0;
+ int notCompartmentsHeight = 0;
+ for(int i = 0; i < notCompartmentList.size(); i++) {
+ notCompartmentsHeight += notCompartmentList.get(i).getBounds().height;
+ }
+
+ for(int i = 0; i < compartmentList.size(); i++) {
+ compartmentsHeight += compartmentList.get(i).getBounds().height;
+ }
+ int remainingspace = container.getBounds().height - notCompartmentsHeight;
+
+ // ratio between the height of all compartments and the size of the
+ // compartments container.
+ double ratio = new Integer(compartmentsHeight).doubleValue() / new Integer(remainingspace).doubleValue();
+
+ for(int i = 0; i < compartmentList.size(); i++) {
+ Rectangle bound = new Rectangle((compartmentList.get(i)).getBounds());
+ int value = (int)(bound.height / ratio);
+ bound.height = value;
+ bound.x = container.getBounds().x;
+ if(i > 0) {
+ bound.y = (compartmentList.get(i - 1)).getBounds().getBottomLeft().y + 1;
+
+ }
+
+ }
+
+ }
+
+ public void collectInformationOnChildren(IFigure container) {
+ compartmentList = new ArrayList<IFigure>();
+ notCompartmentList = new ArrayList<IFigure>();
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ if(isAGMFContainer(((IFigure)container.getChildren().get(i)))) {
+ compartmentList.add(((IFigure)container.getChildren().get(i)));
+ } else {
+ if((container.getChildren().get(i)) instanceof Label || (container.getChildren().get(i)) instanceof WrappingLabel) {
+ notCompartmentList.add(((IFigure)container.getChildren().get(i)));
+ }
+ }
+
+ }
+ }
+
+ /**
+ * obtain a prefered size
+ *
+ * @param figure
+ * that can contain a GMF compartment figure
+ * @return a the size
+ */
+ public Dimension getPreferedSize(IFigure figure) {
+ Dimension dim = figure.getPreferredSize();
+ return dim;
+ }
+
+ /**
+ * tests is the figure contains a GMF compartment
+ *
+ * @param figure
+ * @return true if this is the case
+ */
+ public boolean isAGMFContainer(IFigure figure) {
+ if(figure.getChildren().size() > 0) {
+ if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
index 71ee185ec35..38e7b4b1a1f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NodeNamedElementFigure.java
@@ -1,1041 +1,1041 @@
-/*****************************************************************************
-< * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Atos Origin - Enable extending with a composite figure, by adding overrideable methods.
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.Iterator;
-import java.util.StringTokenizer;
-
-import org.eclipse.draw2d.FigureListener;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.figure.layout.PropertiesCompartmentLayoutManager;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This class is top graphNode figure. It contains: 1 icon label + 1 stereotype
- * label + 1 qualified name label + 1 name label
- */
-public class NodeNamedElementFigure extends PapyrusNodeFigure implements IPapyrusNodeNamedElementFigure, IPapyrusNodeUMLElementFigure {
-
- private static final String CHEVRON = String.valueOf("\u00AB") + String.valueOf("\u00BB");
-
- private Label taggedLabel;
-
- /** the depth of the qualified name **/
- private int depth = 0;
-
- /**
- * The icon label.
- */
- protected Label iconLabel;
-
- /**
- * The name label.
- */
- protected WrappingLabel nameLabel;
-
- protected Image nameLabelIcon = null;
-
- /**
- * The qualified label.
- */
- protected Label qualifiedLabel;
-
- /**
- * Added for stereptypes properties
- */
- private RectangleFigure stereotypePropertiesContent;
-
- /**
- * Added for stereotypes properties, displayed in the InBrace location
- */
- protected Label stereotypePropertiesInBraceContent;
-
- /**
- * The stereotypes label.
- */
- protected Label stereotypesLabel;
-
- /**
- * Create a basic figure.
- */
- public NodeNamedElementFigure() {
- this(null);
- }
-
-
-
- @Override
- public void remove(IFigure figure) {
- if(figure instanceof AppliedStereotypeCompartmentFigure){
- if(stereotypePropertiesContent == null) {
- this.createStereotypePropertiesContent();
- }
- stereotypePropertiesContent.remove(figure);
- }
- else{
-
- super.remove(figure);
- }
-
- }
- @Override
- public void add(IFigure figure, Object constraint, int index) {
- if(figure instanceof AppliedStereotypeCompartmentFigure){
- if(stereotypePropertiesContent == null) {
- this.createStereotypePropertiesContent();
- }
- stereotypePropertiesContent.add(figure);
- }
- else{
-
- super.add(figure, constraint, index);
- }
- }
-
-
- public void setStereotypeDisplay(String stereotypes, Image image) {
-
- // Set stereotype text on figure
- if(!"".equals(stereotypes)) {
- setStereotypes(stereotypes);
- } else {
- setStereotypes(null);
- }
-
- setAppliedStereotypeIcon(image);
- }
-
- public NodeNamedElementFigure(String taggedLabelValue) {
- super();
-
- // creation of the nameLabel
- createNameLabel();
-
- initTagLabel(taggedLabelValue);
- }
-
- /**
- * Create a label that contains the name of the element.
- */
- protected void createNameLabel() {
- nameLabel = new WrappingLabel();
-
- nameLabel.setOpaque(false);
- nameLabel.setAlignment(PositionConstants.MIDDLE);
- getNameLabelContainer().add(nameLabel, getNameLabelConstraint(), -1);
- }
-
- /**
- * Get the constraint for adding the name label. Children should override
- * and implement this method in case the label must be drawn with a specific
- * constraint.
- *
- * @return figure containing the name label
- * @see #getNameLabelContainer()
- * @see #getDefaultLabelsConstraint()
- */
- protected Object getNameLabelConstraint() {
- return getDefaultLabelsConstraint();
- }
-
- /**
- * Get the constraint for adding the icon label. Children should override
- * and implement this method in case the label must be drawn with a specific
- * constraint.
- *
- * @return figure containing the icon label
- * @see #getIconLabelContainer()
- * @see #getDefaultLabelsConstraint()
- */
- protected Object getIconLabelConstraint() {
- return getDefaultLabelsConstraint();
- }
-
- /**
- * Get the constraint for adding the qualified name label. Children should
- * override and implement this method in case the label must be drawn with a
- * specific constraint.
- *
- * @return figure containing the qualified name label
- * @see #getQualifiedNameLabelContainer()
- * @see #getDefaultLabelsConstraint()
- */
- protected Object getQualifiedNameLabelConstraint() {
- return getDefaultLabelsConstraint();
- }
-
- /**
- * Get the constraint for adding the stereotype label. Children should
- * override and implement this method in case the label must be drawn with a
- * specific constraint.
- *
- * @return figure containing the qualified name label
- * @see #getStereotypeLabelContainer()
- * @see #getDefaultLabelsConstraint()
- */
- protected Object getStereotypeLabelConstraint() {
- return getDefaultLabelsConstraint();
- }
-
- /**
- * Get the constraint for adding the stereotype properties in brace label.
- * Children should override and implement this method in case the label must
- * be drawn with a specific constraint.
- *
- * @return figure containing the stereotype properties in brace label
- * @see #getStereotypePropertiesInBraceLabelContainer()
- * @see #getDefaultLabelsConstraint()
- */
- protected Object getStereotypePropertiesInBraceLabelConstraint() {
- return getDefaultLabelsConstraint();
- }
-
- /**
- * Get the constraint for adding the stereotype properties compartment.
- * Children should override and implement this method in case the label must
- * be drawn with a specific constraint.
- *
- * @return figure containing the stereotype properties compartment
- * @see #getStereotypePropertiesCompartmentContainer()
- * @see #getDefaultLabelsConstraint()
- */
- protected Object getStereotypePropertiesCompartmentConstraint() {
- return getDefaultLabelsConstraint();
- }
-
- /**
- * Get the constraint for adding the tag label. Children should override and
- * implement this method in case the label must be drawn with a specific
- * constraint.
- *
- * @return figure containing the qualified name label
- * @see #getTagLabelContainer()
- * @see #getDefaultLabelsConstraint()
- */
- protected Object getTagLabelConstraint() {
- return getDefaultLabelsConstraint();
- }
-
- /**
- * Get the default constraint for all labels. Children should override and
- * implement this method in case the label must be drawn with a specific
- * constraint.
- *
- * @return constraint for all labels by default
- * @see #getDefaultLabelsContainer()
- */
- protected Object getDefaultLabelsConstraint() {
- return null;
- }
-
- /**
- * Get the container for the name label. Children should override and
- * implement this method in case the label must not be drawn in the overall
- * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
- *
- * @return figure containing the name label
- * @see #getDefaultLabelsContainer()
- */
- protected IFigure getNameLabelContainer() {
- return getDefaultLabelsContainer();
- }
-
- /**
- * Get the container for the icon label. Children should override and
- * implement this method in case the label must not be drawn in the overall
- * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
- *
- * @return figure containing the icon label
- * @see #getDefaultLabelsContainer()
- */
- protected IFigure getIconLabelContainer() {
- return getDefaultLabelsContainer();
- }
-
- /**
- * Get the container for the qualified name label. Children should override
- * and implement this method in case the label must not be drawn in the
- * overall figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
- *
- * @return figure containing the qualified name label
- * @see #getDefaultLabelsContainer()
- */
- protected IFigure getQualifiedNameLabelContainer() {
- return getDefaultLabelsContainer();
- }
-
- /**
- * Get the container for the stereotype label. Children should override and
- * implement this method in case the label must not be drawn in the overall
- * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
- *
- * @return figure containing the qualified name label
- * @see #getDefaultLabelsContainer()
- */
- protected IFigure getStereotypeLabelContainer() {
- return getDefaultLabelsContainer();
- }
-
- /**
- * Get the container for the stereotype properties in brace label. Children
- * should override and implement this method in case the label must not be
- * drawn in the overall figure. The returned figure shall be created in the
- * method {@link #createCompositeFigureStructure()}.
- *
- * @return figure containing the stereotype properties in brace label
- * @see #getDefaultLabelsContainer()
- */
- protected IFigure getStereotypePropertiesInBraceLabelContainer() {
- return getDefaultLabelsContainer();
- }
-
- /**
- * Get the container for the stereotype properties compartment. Children
- * should override and implement this method in case the compartment must
- * not be drawn in the overall figure. The returned figure shall be created
- * in the method {@link #createCompositeFigureStructure()}.
- *
- * @return figure containing the stereotype properties compartment
- * @see #getDefaultLabelsContainer()
- */
- protected IFigure getStereotypePropertiesCompartmentContainer() {
- return getDefaultLabelsContainer();
- }
-
- /**
- * Get the container for the tag label. Children should override and
- * implement this method in case the label must not be drawn in the overall
- * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
- *
- * @return figure containing the qualified name label
- * @see #getDefaultLabelsContainer()
- */
- protected IFigure getTagLabelContainer() {
- return getDefaultLabelsContainer();
- }
-
- /**
- * Get the default container for all labels. Children should override and
- * implement this method in case the label must not be drawn in the overall
- * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
- *
- * @return figure containing labels by default
- */
- protected IFigure getDefaultLabelsContainer() {
- return this;
- }
-
- /**
- * Copy context to.
- *
- * @param fig
- * the fig
- */
- // @unused
- public void copyContextTo(IFigure fig) {
- Iterator it = this.getListeners(FigureListener.class);
- while(it.hasNext()) {
- fig.addFigureListener((FigureListener)it.next());
- }
-
- }
-
- /**
- * used to create a label that contains the icon.
- */
- protected void createIconLabel() {
- iconLabel = new LabelWithScalableIcons();
- // Add the label to the figure, at pos 0
- getIconLabelContainer().add(iconLabel, getIconLabelConstraint(), getIconLabelPosition());
- iconLabel.setLabelAlignment(PositionConstants.LEFT);
- }
-
- /**
- * Creates the icon label.
- *
- * @param position
- * the position
- */
- protected void createIconLabel(int position) {
- iconLabel = new LabelWithScalableIcons();
- getIconLabelContainer().add(iconLabel, getIconLabelConstraint(), getIconLabelPosition());
- iconLabel.setLabelAlignment(position);
- }
-
- /**
- * create the label that contains the qualified name.
- */
- protected void createQualifiedNameLabel() {
- qualifiedLabel = new Label();
- qualifiedLabel.setOpaque(false);
- qualifiedLabel.setFont(getNameLabel().getFont());
- qualifiedLabel.setForegroundColor(getNameLabel().getForegroundColor());
- // Add the label to the figure, after the name
- getQualifiedNameLabelContainer().add(qualifiedLabel, getQualifiedNameLabelConstraint(), getQualifiedNameLabelPosition());
- }
-
- /**
- * this method is used to create the stereotype label.
- */
- protected void createStereotypeLabel() {
- stereotypesLabel = new Label();
- stereotypesLabel.setOpaque(false);
- stereotypesLabel.setFont(getNameLabel().getFont());
- stereotypesLabel.setForegroundColor(getNameLabel().getForegroundColor());
- // Add the stereotype label to the figure at pos 0
- getStereotypeLabelContainer().add(stereotypesLabel, getStereotypeLabelConstraint(), getStereotypeLabelPosition());
- }
-
- /**
- * this method is used to create the stereotype label.
- */
- protected void createStereotypePropertiesInBraceLabel() {
- stereotypePropertiesInBraceContent = new Label();
- stereotypePropertiesInBraceContent.setOpaque(false);
- // Add the stereotype label to the figure at pos 0
- getStereotypePropertiesInBraceLabelContainer().add(stereotypePropertiesInBraceContent, getStereotypePropertiesInBraceLabelConstraint(), getStereotypePropertiesLabelPosition());
- }
-
- protected void createStereotypePropertiesContent() {
- stereotypePropertiesContent = new StereotypePropertiesCompartment();
- stereotypePropertiesContent.setFill(false);
- stereotypePropertiesContent.setLineWidth(0);
- stereotypePropertiesContent.setBorder(null);
- stereotypePropertiesContent.setLayoutManager(getPropertiesCompartmentLayout());
- getStereotypePropertiesCompartmentContainer().add(stereotypePropertiesContent, getStereotypePropertiesCompartmentConstraint(), getStereotypePropertiesCompartmentPosition());
- }
-
- /**
- * Get layout to display content of properties compartment. Children may
- * override this method.
- *
- * @return the layout
- */
- protected LayoutManager getPropertiesCompartmentLayout() {
- return new PropertiesCompartmentLayoutManager();
- }
-
- private void fillStereotypePropertiesInCompartment(String stereotypeProperties) {
-
- stereotypePropertiesContent.getChildren().clear();
- StringTokenizer stringTokenizer = new StringTokenizer(stereotypeProperties, ";");
- while(stringTokenizer.hasMoreElements()) {
- String tokenStereotype = stringTokenizer.nextToken();
- tokenStereotype = tokenStereotype.replace("#", "\n ");
- tokenStereotype = tokenStereotype.replace("|", "\n ");
- Label label = new Label(tokenStereotype);
- label.setLabelAlignment(PositionConstants.LEFT);
- label.setBorder(null);
- stereotypePropertiesContent.add(label);
- }
-
- }
-
- /**
- * Get the label containing the tagged value
- *
- * @return
- */
- public Label getTaggedLabel() {
- return taggedLabel;
- }
-
- /**
- * Gets the depth.
- *
- * @return the depth
- */
- // @unused
- public int getDepth() {
- return depth;
- }
-
- /**
- * return the label thath contains the icon.
- *
- * @return the label that contains the icon
- */
- public Label getIconLabel() {
- return this.iconLabel;
- }
-
- /**
- * Create the tag label in the figure. The tag label is created if value is
- * not null.
- *
- * @param value
- * the value to use
- */
- protected void initTagLabel(String value) {
- if(value != null && value.length() > 0) {
- taggedLabel = new Label();
- String textToDisplay = new StringBuffer(CHEVRON).insert(1, value).toString();
- taggedLabel.setText(textToDisplay);
- taggedLabel.setOpaque(false);
- taggedLabel.setForegroundColor(getNameLabel().getForegroundColor());
- taggedLabel.setFont(getNameLabel().getFont());
- getTagLabelContainer().add(taggedLabel, getTagLabelConstraint(), 0);
- }
- }
-
- public Dimension getMinimumDimension() {
- int width = getNameLabel().getTextBounds().width + 10;
- int height = getNameLabel().getTextBounds().height + 10;
- int temporysize = 0;
- if(getStereotypesLabel() != null) {
- temporysize = getStereotypesLabel().getTextBounds().width + 10;
- height = height + getStereotypesLabel().getTextBounds().height;
- if(width < temporysize) {
- width = temporysize;
- }
- }
- if(getQualifiedNameLabel() != null) {
- temporysize = getQualifiedNameLabel().getTextBounds().width + 10;
- height = height + getQualifiedNameLabel().getTextBounds().height;
- if(width < temporysize) {
- width = temporysize;
- }
- }
- return new Dimension(width, height);
- }
-
- /**
- * Helper method to calculate the height of name
- */
- protected int getNameHeight() {
- int nameHeight = this.getNameLabel().getPreferredSize().height;
-
- if(this.getIconLabel() != null && getIconLabelContainer().equals(getNameLabelContainer())) {
- nameHeight += this.getIconLabel().getPreferredSize().height;
- }
- if(this.getStereotypesLabel() != null && getStereotypeLabelContainer().equals(getNameLabelContainer())) {
- nameHeight += this.getStereotypesLabel().getPreferredSize().height;
- }
- if(this.getQualifiedNameLabel() != null && getQualifiedNameLabelContainer().equals(getNameLabelContainer())) {
- nameHeight += this.getQualifiedNameLabel().getPreferredSize().height;
- }
- nameHeight += 5;
-
- return nameHeight;
-
- }
-
- /**
- * Gets the name label.
- *
- * @return the name label
- */
- public WrappingLabel getNameLabel() {
- return this.nameLabel;
- }
-
- // @unused
- public Image getNameLabelIcon() {
- return nameLabelIcon;
- }
-
- /**
- * Calculate the partial qualified name with a specified depth.
- *
- * @param qualifiedName
- * the qualified name can return null
- */
- public String getQualifiedName(String qualifiedName, int depth) {
- int n = -1;
- if(qualifiedName == null) {
- return null;
- }
- int i = 0;
- if(depth <= 0) {
- return qualifiedName;
- }
-
- while(i < depth) {
- if((n = qualifiedName.indexOf("::", n + 1)) != -1) {
- i++;
- } else {
- return null;
- }
- }
-
- if(n == -1) {
- return qualifiedName;
- } else {
- return qualifiedName.substring(n + 2);
- }
-
- }
-
- /**
- * return the label that contains the qualified name.
- *
- * @return the label that contains the qualified name
- */
- public Label getQualifiedNameLabel() {
- return this.qualifiedLabel;
- }
-
- /**
- * @return the position of the icon label
- */
- protected int getIconLabelPosition() {
- return 0;
- }
-
- /**
- * @return the position of the stereotype label
- */
- protected int getStereotypeLabelPosition() {
- int position = 0;
- if(getStereotypeLabelContainer().equals(getIconLabelContainer())) {
- // located after icon label
- position = getIconLabelPosition();
- if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
- position++;
- }
- }
- return position;
-
- }
-
- /**
- * Returns the position of the stereotype properties location. this is just
- * after stereotype position
- *
- * @return the position of the stereotype properties in brace label
- */
- protected int getStereotypePropertiesLabelPosition() {
- int position = 0;
- if(getStereotypePropertiesInBraceLabelContainer().equals(getStereotypeLabelContainer())) {
- // located after stereotype label
- position = getStereotypeLabelPosition();
- if(this.stereotypesLabel != null) {
- position++;
- }
- } else if(getStereotypePropertiesInBraceLabelContainer().equals(getIconLabelContainer())) {
- // located after icon label
- position = getIconLabelPosition();
- if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
- position++;
- }
- }
- return position;
- }
-
- /**
- * @return the position of the qualified name label
- */
- protected int getQualifiedNameLabelPosition() {
- int position = 0;
- if(getQualifiedNameLabelContainer().equals(getStereotypePropertiesInBraceLabelContainer())) {
- // located after stereotype properties in brace label
- position = getStereotypePropertiesLabelPosition();
- if(this.stereotypePropertiesInBraceContent != null) {
- position++;
- }
- } else if(getQualifiedNameLabelContainer().equals(getStereotypeLabelContainer())) {
- // located after stereotype label
- position = getStereotypeLabelPosition();
- if(this.stereotypesLabel != null) {
- position++;
- }
- } else if(getQualifiedNameLabelContainer().equals(getIconLabelContainer())) {
- // located after icon label
- position = getIconLabelPosition();
- if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
- position++;
- }
- }
- return position;
- }
-
- /**
- * @return the position of the name label
- */
- // @unused
- protected int getNameLabelPosition() {
- int position = 0;
- if(getNameLabelContainer().equals(getQualifiedNameLabelContainer())) {
- // located after qualifed name label
- position = getQualifiedNameLabelPosition();
- if(this.qualifiedLabel != null) {
- position++;
- }
- } else if(getQualifiedNameLabelContainer().equals(getStereotypePropertiesInBraceLabelContainer())) {
- // located after stereotype properties in brace label
- position = getStereotypePropertiesLabelPosition();
- if(this.stereotypePropertiesInBraceContent != null) {
- position++;
- }
- } else if(getQualifiedNameLabelContainer().equals(getStereotypeLabelContainer())) {
- // located after stereotype label
- position = getStereotypeLabelPosition();
- if(this.stereotypesLabel != null) {
- position++;
- }
- } else if(getQualifiedNameLabelContainer().equals(getIconLabelContainer())) {
- // located after icon label
- position = getIconLabelPosition();
- if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
- position++;
- }
- }
- return position;
- }
-
- /**
- * @return the position of the stereotype properties compartment
- */
- protected int getStereotypePropertiesCompartmentPosition() {
- int position = 0;
- if(getStereotypePropertiesCompartmentContainer().equals(getNameLabelContainer())) {
- // locate after name label (which is never removed)
- position = getNameLabelContainer().getChildren().indexOf(nameLabel);
- position++;
- } else if(getNameLabelContainer().equals(getQualifiedNameLabelContainer())) {
- // located after qualifed name label
- position = getQualifiedNameLabelPosition();
- if(this.qualifiedLabel != null) {
- position++;
- }
- } else if(getQualifiedNameLabelContainer().equals(getStereotypePropertiesInBraceLabelContainer())) {
- // located after stereotype properties in brace label
- position = getStereotypePropertiesLabelPosition();
- if(this.stereotypePropertiesInBraceContent != null) {
- position++;
- }
- } else if(getQualifiedNameLabelContainer().equals(getStereotypeLabelContainer())) {
- // located after stereotype label
- position = getStereotypeLabelPosition();
- if(this.stereotypesLabel != null) {
- position++;
- }
- } else if(getQualifiedNameLabelContainer().equals(getIconLabelContainer())) {
- // located after icon label
- position = getIconLabelPosition();
- if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
- position++;
- }
- }
- return position;
- }
-
- /**
- * to obtain the stereotypePropertiesContent of the class figure
- *
- */
- public RectangleFigure getStereotypePropertiesContent() {
- return this.stereotypePropertiesContent;
- }
-
- /**
- * Gets the stereotypes label.
- *
- * @return the stereotypes label
- */
- public Label getStereotypesLabel() {
- return this.stereotypesLabel;
- }
-
- /**
- * return true inf the label in localized at the point pt.
- *
- * @param label
- * the label that we look for
- * @param pt
- * the point that we test
- *
- * @return true if the point is on the label
- */
- // @unused
- protected boolean labelContainsPoint(Label label, Point pt) {
- Rectangle rc;
-
- rc = new PrecisionRectangle(label.getBounds());
- label.translateToAbsolute(rc);
- if(rc.contains(pt)) {
- return true;
- }
- return false;
- }
-
- /**
- * Refresh stereotypes.
- *
- * @param presentation
- * the presentation
- * @param hasIcon
- * the has icon
- * @param hasShape
- * the has shape
- * @param stereotypes
- * the stereotypes
- */
- public void refreshStereotypes(String stereotypes, String presentation, boolean hasIcon, boolean hasShape) {
-
- if(stereotypes.equals("")) {
- this.setStereotypes(null);
- return;
- }
-
- if(presentation.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) && hasIcon) {
- this.setStereotypes(null);
- return;
- } else if(presentation.equals(UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION) && hasShape) {
- this.setStereotypes(null);
- return;
- }
-
- this.setStereotypes(stereotypes);// add stereotypes on the class figure
- return;
- }
-
- /**
- * Sets the depth.
- *
- * @param depth
- * the new depth
- */
- public void setDepth(int depth) {
- this.depth = depth;
- }
-
- /**
- * Sets the name.
- *
- * @param name
- * the name
- */
- // @unused
- public void setName(String name) {
- this.nameLabel.setText(name);
- }
-
- public void setNameLabelIcon(boolean displayNameLabelIcon) {
- if(getNameLabel().getIcon() != null) {
- nameLabelIcon = getNameLabel().getIcon();
- }
- if(displayNameLabelIcon) {
- getNameLabel().setIcon(nameLabelIcon);
- } else {
- getNameLabel().setIcon(null);
- }
- }
-
- // @unused
- public void setNameLabelIcon(Image nameLabelIcon) {
- this.nameLabelIcon = nameLabelIcon;
- }
-
- /**
- * Sets the qualified name.
- *
- * @param qualifiedName
- * the qualified name
- */
- public void setQualifiedName(String qualifiedName) {
- String tmpQualifiedName = getQualifiedName(qualifiedName, depth);
- // two raisons to remove label!
- // null
- // or the qualified name is equal to 1
- if(qualifiedName == null || tmpQualifiedName == null || !tmpQualifiedName.contains("::")) { // Remove
- // label
- // if
- // any
- if(this.qualifiedLabel != null) {
- getQualifiedNameLabelContainer().remove(this.qualifiedLabel);
- this.qualifiedLabel = null;
- }
- return;
- }
-
- // Set the stereotype label
- if(this.qualifiedLabel == null) {
- this.createQualifiedNameLabel();
- }
- // we have to not display name.
-
- int i = tmpQualifiedName.lastIndexOf("::");
- if(i != -1) {
- tmpQualifiedName = tmpQualifiedName.substring(0, i);
- }
- this.qualifiedLabel.setText("(" + tmpQualifiedName.trim() + ")");
-
- }
-
- /**
- * Sets the stereotypes properties for this figure.
- * <p>
- * This implementation checks if the specified string is null or not.
- * <ul>
- * <li>if the string is <code>null</code>, it removes the label representing the stereotypes properties with brace.</li>
- * <li>if this is not <code>null</code>, it creates the stereotype properties label if needed and displays the specified string.</li>
- * </ul>
- * </p>
- *
- * @param stereotypeProperties
- * the string representing the stereotype properties to be
- * displayed
- */
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if(stereotypeProperties == null) {
- // Remove label if any
- if(this.stereotypePropertiesInBraceContent != null) {
- getStereotypePropertiesInBraceLabelContainer().remove(this.stereotypePropertiesInBraceContent);
- this.stereotypePropertiesInBraceContent = null;
- }
- return;
- }
-
- // Set the stereotype label if it does not already exist
- if(this.stereotypePropertiesInBraceContent == null) {
- this.createStereotypePropertiesInBraceLabel();
- }
-
- // Set stereotype text on figure
- if(!"".equals(stereotypeProperties)) {
- this.stereotypePropertiesInBraceContent.setText("{" + stereotypeProperties + "}");
- } else {
- this.stereotypePropertiesInBraceContent.setText("");
- }
- }
-
- /**
- * displays the new string corresponding to the list of stereotypes.
- *
- * if the string is <code>null</code>, then the figure that displays the
- * stereotype label is removed from the NodeNamedElementFigure.
- *
- * @param stereotypeProperties
- * the string to be displayed.
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- if(stereotypeProperties == null || stereotypeProperties.trim() == "") {
- // remove figure of stereotype properties compartment
- if(this.stereotypePropertiesContent != null) {
- getStereotypePropertiesCompartmentContainer().remove(this.stereotypePropertiesContent);
- this.stereotypePropertiesContent = null;
- }
- return;
- }
-
- // set stereotype properties content
- if(stereotypePropertiesContent == null) {
- this.createStereotypePropertiesContent();
- }
-
- fillStereotypePropertiesInCompartment(stereotypeProperties);
- }
-
- /**
- * Sets the stereotypes for this figure.
- * <p>
- * This implementation checks if the specified string is null or not.
- * <ul>
- * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
- * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
- * </ul>
- * </p>
- *
- * @param stereotypes
- * the string representing the stereotypes to be displayed
- */
- public void setStereotypes(String stereotypes) {
- if(stereotypes == null) {
- // Remove label if any
- if(this.stereotypesLabel != null) {
- getStereotypeLabelContainer().remove(this.stereotypesLabel);
- this.stereotypesLabel = null;
- }
- return;
- }
-
- // Set the stereotype label if it does not already exist
- if(this.stereotypesLabel == null) {
- this.createStereotypeLabel();
- }
-
- // Set stereotype text on figure
- if(!"".equals(stereotypes)) {
- this.stereotypesLabel.setText(stereotypes);
- } else {
- this.stereotypesLabel.setText("");
- }
- }
-
- /**
- * Sets the stereotype icon for this figure.
- *
- * @param stereotypes
- * the image representing the stereotype
- */
- public void setAppliedStereotypeIcon(Image image) {
- if(image == null) {
- // Remove label if any
- if(this.iconLabel != null) {
- getIconLabelContainer().remove(this.iconLabel);
- this.iconLabel = null;
- }
- return;
- }
-
- // Set the stereotype label if it does not already exist
- if(this.iconLabel == null) {
- this.createIconLabel();
- }
-
- // Set stereotype icon on figure
- this.iconLabel.setIcon(image);
- }
-
- /**
- * Sets the applied stereotype icon.
- *
- * @param image
- * the image
- * @param position
- * the position
- */
- public void setAppliedStereotypeIcon(Image image, int position) {
- if(image == null) {
- // Remove label if any
- if(this.iconLabel != null) {
- getIconLabelContainer().remove(this.iconLabel);
- this.iconLabel = null;
- }
- return;
- }
-
- // Set the stereotype label with position parameter if it does not
- // already exist
- if(this.iconLabel == null) {
- this.createIconLabel(position);
- }
-
- // Set stereotype icon on figure
- this.iconLabel.setIcon(image);
- }
-
-}
+/*****************************************************************************
+< * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Atos Origin - Enable extending with a composite figure, by adding overrideable methods.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+import org.eclipse.draw2d.FigureListener;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.LayoutManager;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.figure.layout.PropertiesCompartmentLayoutManager;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This class is top graphNode figure. It contains: 1 icon label + 1 stereotype
+ * label + 1 qualified name label + 1 name label
+ */
+public class NodeNamedElementFigure extends PapyrusNodeFigure implements IPapyrusNodeNamedElementFigure, IPapyrusNodeUMLElementFigure {
+
+ private static final String CHEVRON = String.valueOf("\u00AB") + String.valueOf("\u00BB");
+
+ private Label taggedLabel;
+
+ /** the depth of the qualified name **/
+ private int depth = 0;
+
+ /**
+ * The icon label.
+ */
+ protected Label iconLabel;
+
+ /**
+ * The name label.
+ */
+ protected WrappingLabel nameLabel;
+
+ protected Image nameLabelIcon = null;
+
+ /**
+ * The qualified label.
+ */
+ protected Label qualifiedLabel;
+
+ /**
+ * Added for stereptypes properties
+ */
+ private RectangleFigure stereotypePropertiesContent;
+
+ /**
+ * Added for stereotypes properties, displayed in the InBrace location
+ */
+ protected Label stereotypePropertiesInBraceContent;
+
+ /**
+ * The stereotypes label.
+ */
+ protected Label stereotypesLabel;
+
+ /**
+ * Create a basic figure.
+ */
+ public NodeNamedElementFigure() {
+ this(null);
+ }
+
+
+
+ @Override
+ public void remove(IFigure figure) {
+ if(figure instanceof AppliedStereotypeCompartmentFigure){
+ if(stereotypePropertiesContent == null) {
+ this.createStereotypePropertiesContent();
+ }
+ stereotypePropertiesContent.remove(figure);
+ }
+ else{
+
+ super.remove(figure);
+ }
+
+ }
+ @Override
+ public void add(IFigure figure, Object constraint, int index) {
+ if(figure instanceof AppliedStereotypeCompartmentFigure){
+ if(stereotypePropertiesContent == null) {
+ this.createStereotypePropertiesContent();
+ }
+ stereotypePropertiesContent.add(figure);
+ }
+ else{
+
+ super.add(figure, constraint, index);
+ }
+ }
+
+
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+
+ // Set stereotype text on figure
+ if(!"".equals(stereotypes)) {
+ setStereotypes(stereotypes);
+ } else {
+ setStereotypes(null);
+ }
+
+ setAppliedStereotypeIcon(image);
+ }
+
+ public NodeNamedElementFigure(String taggedLabelValue) {
+ super();
+
+ // creation of the nameLabel
+ createNameLabel();
+
+ initTagLabel(taggedLabelValue);
+ }
+
+ /**
+ * Create a label that contains the name of the element.
+ */
+ protected void createNameLabel() {
+ nameLabel = new WrappingLabel();
+
+ nameLabel.setOpaque(false);
+ nameLabel.setAlignment(PositionConstants.MIDDLE);
+ getNameLabelContainer().add(nameLabel, getNameLabelConstraint(), -1);
+ }
+
+ /**
+ * Get the constraint for adding the name label. Children should override
+ * and implement this method in case the label must be drawn with a specific
+ * constraint.
+ *
+ * @return figure containing the name label
+ * @see #getNameLabelContainer()
+ * @see #getDefaultLabelsConstraint()
+ */
+ protected Object getNameLabelConstraint() {
+ return getDefaultLabelsConstraint();
+ }
+
+ /**
+ * Get the constraint for adding the icon label. Children should override
+ * and implement this method in case the label must be drawn with a specific
+ * constraint.
+ *
+ * @return figure containing the icon label
+ * @see #getIconLabelContainer()
+ * @see #getDefaultLabelsConstraint()
+ */
+ protected Object getIconLabelConstraint() {
+ return getDefaultLabelsConstraint();
+ }
+
+ /**
+ * Get the constraint for adding the qualified name label. Children should
+ * override and implement this method in case the label must be drawn with a
+ * specific constraint.
+ *
+ * @return figure containing the qualified name label
+ * @see #getQualifiedNameLabelContainer()
+ * @see #getDefaultLabelsConstraint()
+ */
+ protected Object getQualifiedNameLabelConstraint() {
+ return getDefaultLabelsConstraint();
+ }
+
+ /**
+ * Get the constraint for adding the stereotype label. Children should
+ * override and implement this method in case the label must be drawn with a
+ * specific constraint.
+ *
+ * @return figure containing the qualified name label
+ * @see #getStereotypeLabelContainer()
+ * @see #getDefaultLabelsConstraint()
+ */
+ protected Object getStereotypeLabelConstraint() {
+ return getDefaultLabelsConstraint();
+ }
+
+ /**
+ * Get the constraint for adding the stereotype properties in brace label.
+ * Children should override and implement this method in case the label must
+ * be drawn with a specific constraint.
+ *
+ * @return figure containing the stereotype properties in brace label
+ * @see #getStereotypePropertiesInBraceLabelContainer()
+ * @see #getDefaultLabelsConstraint()
+ */
+ protected Object getStereotypePropertiesInBraceLabelConstraint() {
+ return getDefaultLabelsConstraint();
+ }
+
+ /**
+ * Get the constraint for adding the stereotype properties compartment.
+ * Children should override and implement this method in case the label must
+ * be drawn with a specific constraint.
+ *
+ * @return figure containing the stereotype properties compartment
+ * @see #getStereotypePropertiesCompartmentContainer()
+ * @see #getDefaultLabelsConstraint()
+ */
+ protected Object getStereotypePropertiesCompartmentConstraint() {
+ return getDefaultLabelsConstraint();
+ }
+
+ /**
+ * Get the constraint for adding the tag label. Children should override and
+ * implement this method in case the label must be drawn with a specific
+ * constraint.
+ *
+ * @return figure containing the qualified name label
+ * @see #getTagLabelContainer()
+ * @see #getDefaultLabelsConstraint()
+ */
+ protected Object getTagLabelConstraint() {
+ return getDefaultLabelsConstraint();
+ }
+
+ /**
+ * Get the default constraint for all labels. Children should override and
+ * implement this method in case the label must be drawn with a specific
+ * constraint.
+ *
+ * @return constraint for all labels by default
+ * @see #getDefaultLabelsContainer()
+ */
+ protected Object getDefaultLabelsConstraint() {
+ return null;
+ }
+
+ /**
+ * Get the container for the name label. Children should override and
+ * implement this method in case the label must not be drawn in the overall
+ * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
+ *
+ * @return figure containing the name label
+ * @see #getDefaultLabelsContainer()
+ */
+ protected IFigure getNameLabelContainer() {
+ return getDefaultLabelsContainer();
+ }
+
+ /**
+ * Get the container for the icon label. Children should override and
+ * implement this method in case the label must not be drawn in the overall
+ * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
+ *
+ * @return figure containing the icon label
+ * @see #getDefaultLabelsContainer()
+ */
+ protected IFigure getIconLabelContainer() {
+ return getDefaultLabelsContainer();
+ }
+
+ /**
+ * Get the container for the qualified name label. Children should override
+ * and implement this method in case the label must not be drawn in the
+ * overall figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
+ *
+ * @return figure containing the qualified name label
+ * @see #getDefaultLabelsContainer()
+ */
+ protected IFigure getQualifiedNameLabelContainer() {
+ return getDefaultLabelsContainer();
+ }
+
+ /**
+ * Get the container for the stereotype label. Children should override and
+ * implement this method in case the label must not be drawn in the overall
+ * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
+ *
+ * @return figure containing the qualified name label
+ * @see #getDefaultLabelsContainer()
+ */
+ protected IFigure getStereotypeLabelContainer() {
+ return getDefaultLabelsContainer();
+ }
+
+ /**
+ * Get the container for the stereotype properties in brace label. Children
+ * should override and implement this method in case the label must not be
+ * drawn in the overall figure. The returned figure shall be created in the
+ * method {@link #createCompositeFigureStructure()}.
+ *
+ * @return figure containing the stereotype properties in brace label
+ * @see #getDefaultLabelsContainer()
+ */
+ protected IFigure getStereotypePropertiesInBraceLabelContainer() {
+ return getDefaultLabelsContainer();
+ }
+
+ /**
+ * Get the container for the stereotype properties compartment. Children
+ * should override and implement this method in case the compartment must
+ * not be drawn in the overall figure. The returned figure shall be created
+ * in the method {@link #createCompositeFigureStructure()}.
+ *
+ * @return figure containing the stereotype properties compartment
+ * @see #getDefaultLabelsContainer()
+ */
+ protected IFigure getStereotypePropertiesCompartmentContainer() {
+ return getDefaultLabelsContainer();
+ }
+
+ /**
+ * Get the container for the tag label. Children should override and
+ * implement this method in case the label must not be drawn in the overall
+ * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
+ *
+ * @return figure containing the qualified name label
+ * @see #getDefaultLabelsContainer()
+ */
+ protected IFigure getTagLabelContainer() {
+ return getDefaultLabelsContainer();
+ }
+
+ /**
+ * Get the default container for all labels. Children should override and
+ * implement this method in case the label must not be drawn in the overall
+ * figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
+ *
+ * @return figure containing labels by default
+ */
+ protected IFigure getDefaultLabelsContainer() {
+ return this;
+ }
+
+ /**
+ * Copy context to.
+ *
+ * @param fig
+ * the fig
+ */
+ // @unused
+ public void copyContextTo(IFigure fig) {
+ Iterator it = this.getListeners(FigureListener.class);
+ while(it.hasNext()) {
+ fig.addFigureListener((FigureListener)it.next());
+ }
+
+ }
+
+ /**
+ * used to create a label that contains the icon.
+ */
+ protected void createIconLabel() {
+ iconLabel = new LabelWithScalableIcons();
+ // Add the label to the figure, at pos 0
+ getIconLabelContainer().add(iconLabel, getIconLabelConstraint(), getIconLabelPosition());
+ iconLabel.setLabelAlignment(PositionConstants.LEFT);
+ }
+
+ /**
+ * Creates the icon label.
+ *
+ * @param position
+ * the position
+ */
+ protected void createIconLabel(int position) {
+ iconLabel = new LabelWithScalableIcons();
+ getIconLabelContainer().add(iconLabel, getIconLabelConstraint(), getIconLabelPosition());
+ iconLabel.setLabelAlignment(position);
+ }
+
+ /**
+ * create the label that contains the qualified name.
+ */
+ protected void createQualifiedNameLabel() {
+ qualifiedLabel = new Label();
+ qualifiedLabel.setOpaque(false);
+ qualifiedLabel.setFont(getNameLabel().getFont());
+ qualifiedLabel.setForegroundColor(getNameLabel().getForegroundColor());
+ // Add the label to the figure, after the name
+ getQualifiedNameLabelContainer().add(qualifiedLabel, getQualifiedNameLabelConstraint(), getQualifiedNameLabelPosition());
+ }
+
+ /**
+ * this method is used to create the stereotype label.
+ */
+ protected void createStereotypeLabel() {
+ stereotypesLabel = new Label();
+ stereotypesLabel.setOpaque(false);
+ stereotypesLabel.setFont(getNameLabel().getFont());
+ stereotypesLabel.setForegroundColor(getNameLabel().getForegroundColor());
+ // Add the stereotype label to the figure at pos 0
+ getStereotypeLabelContainer().add(stereotypesLabel, getStereotypeLabelConstraint(), getStereotypeLabelPosition());
+ }
+
+ /**
+ * this method is used to create the stereotype label.
+ */
+ protected void createStereotypePropertiesInBraceLabel() {
+ stereotypePropertiesInBraceContent = new Label();
+ stereotypePropertiesInBraceContent.setOpaque(false);
+ // Add the stereotype label to the figure at pos 0
+ getStereotypePropertiesInBraceLabelContainer().add(stereotypePropertiesInBraceContent, getStereotypePropertiesInBraceLabelConstraint(), getStereotypePropertiesLabelPosition());
+ }
+
+ protected void createStereotypePropertiesContent() {
+ stereotypePropertiesContent = new StereotypePropertiesCompartment();
+ stereotypePropertiesContent.setFill(false);
+ stereotypePropertiesContent.setLineWidth(0);
+ stereotypePropertiesContent.setBorder(null);
+ stereotypePropertiesContent.setLayoutManager(getPropertiesCompartmentLayout());
+ getStereotypePropertiesCompartmentContainer().add(stereotypePropertiesContent, getStereotypePropertiesCompartmentConstraint(), getStereotypePropertiesCompartmentPosition());
+ }
+
+ /**
+ * Get layout to display content of properties compartment. Children may
+ * override this method.
+ *
+ * @return the layout
+ */
+ protected LayoutManager getPropertiesCompartmentLayout() {
+ return new PropertiesCompartmentLayoutManager();
+ }
+
+ private void fillStereotypePropertiesInCompartment(String stereotypeProperties) {
+
+ stereotypePropertiesContent.getChildren().clear();
+ StringTokenizer stringTokenizer = new StringTokenizer(stereotypeProperties, ";");
+ while(stringTokenizer.hasMoreElements()) {
+ String tokenStereotype = stringTokenizer.nextToken();
+ tokenStereotype = tokenStereotype.replace("#", "\n ");
+ tokenStereotype = tokenStereotype.replace("|", "\n ");
+ Label label = new Label(tokenStereotype);
+ label.setLabelAlignment(PositionConstants.LEFT);
+ label.setBorder(null);
+ stereotypePropertiesContent.add(label);
+ }
+
+ }
+
+ /**
+ * Get the label containing the tagged value
+ *
+ * @return
+ */
+ public Label getTaggedLabel() {
+ return taggedLabel;
+ }
+
+ /**
+ * Gets the depth.
+ *
+ * @return the depth
+ */
+ // @unused
+ public int getDepth() {
+ return depth;
+ }
+
+ /**
+ * return the label thath contains the icon.
+ *
+ * @return the label that contains the icon
+ */
+ public Label getIconLabel() {
+ return this.iconLabel;
+ }
+
+ /**
+ * Create the tag label in the figure. The tag label is created if value is
+ * not null.
+ *
+ * @param value
+ * the value to use
+ */
+ protected void initTagLabel(String value) {
+ if(value != null && value.length() > 0) {
+ taggedLabel = new Label();
+ String textToDisplay = new StringBuffer(CHEVRON).insert(1, value).toString();
+ taggedLabel.setText(textToDisplay);
+ taggedLabel.setOpaque(false);
+ taggedLabel.setForegroundColor(getNameLabel().getForegroundColor());
+ taggedLabel.setFont(getNameLabel().getFont());
+ getTagLabelContainer().add(taggedLabel, getTagLabelConstraint(), 0);
+ }
+ }
+
+ public Dimension getMinimumDimension() {
+ int width = getNameLabel().getTextBounds().width + 10;
+ int height = getNameLabel().getTextBounds().height + 10;
+ int temporysize = 0;
+ if(getStereotypesLabel() != null) {
+ temporysize = getStereotypesLabel().getTextBounds().width + 10;
+ height = height + getStereotypesLabel().getTextBounds().height;
+ if(width < temporysize) {
+ width = temporysize;
+ }
+ }
+ if(getQualifiedNameLabel() != null) {
+ temporysize = getQualifiedNameLabel().getTextBounds().width + 10;
+ height = height + getQualifiedNameLabel().getTextBounds().height;
+ if(width < temporysize) {
+ width = temporysize;
+ }
+ }
+ return new Dimension(width, height);
+ }
+
+ /**
+ * Helper method to calculate the height of name
+ */
+ protected int getNameHeight() {
+ int nameHeight = this.getNameLabel().getPreferredSize().height;
+
+ if(this.getIconLabel() != null && getIconLabelContainer().equals(getNameLabelContainer())) {
+ nameHeight += this.getIconLabel().getPreferredSize().height;
+ }
+ if(this.getStereotypesLabel() != null && getStereotypeLabelContainer().equals(getNameLabelContainer())) {
+ nameHeight += this.getStereotypesLabel().getPreferredSize().height;
+ }
+ if(this.getQualifiedNameLabel() != null && getQualifiedNameLabelContainer().equals(getNameLabelContainer())) {
+ nameHeight += this.getQualifiedNameLabel().getPreferredSize().height;
+ }
+ nameHeight += 5;
+
+ return nameHeight;
+
+ }
+
+ /**
+ * Gets the name label.
+ *
+ * @return the name label
+ */
+ public WrappingLabel getNameLabel() {
+ return this.nameLabel;
+ }
+
+ // @unused
+ public Image getNameLabelIcon() {
+ return nameLabelIcon;
+ }
+
+ /**
+ * Calculate the partial qualified name with a specified depth.
+ *
+ * @param qualifiedName
+ * the qualified name can return null
+ */
+ public String getQualifiedName(String qualifiedName, int depth) {
+ int n = -1;
+ if(qualifiedName == null) {
+ return null;
+ }
+ int i = 0;
+ if(depth <= 0) {
+ return qualifiedName;
+ }
+
+ while(i < depth) {
+ if((n = qualifiedName.indexOf("::", n + 1)) != -1) {
+ i++;
+ } else {
+ return null;
+ }
+ }
+
+ if(n == -1) {
+ return qualifiedName;
+ } else {
+ return qualifiedName.substring(n + 2);
+ }
+
+ }
+
+ /**
+ * return the label that contains the qualified name.
+ *
+ * @return the label that contains the qualified name
+ */
+ public Label getQualifiedNameLabel() {
+ return this.qualifiedLabel;
+ }
+
+ /**
+ * @return the position of the icon label
+ */
+ protected int getIconLabelPosition() {
+ return 0;
+ }
+
+ /**
+ * @return the position of the stereotype label
+ */
+ protected int getStereotypeLabelPosition() {
+ int position = 0;
+ if(getStereotypeLabelContainer().equals(getIconLabelContainer())) {
+ // located after icon label
+ position = getIconLabelPosition();
+ if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
+ position++;
+ }
+ }
+ return position;
+
+ }
+
+ /**
+ * Returns the position of the stereotype properties location. this is just
+ * after stereotype position
+ *
+ * @return the position of the stereotype properties in brace label
+ */
+ protected int getStereotypePropertiesLabelPosition() {
+ int position = 0;
+ if(getStereotypePropertiesInBraceLabelContainer().equals(getStereotypeLabelContainer())) {
+ // located after stereotype label
+ position = getStereotypeLabelPosition();
+ if(this.stereotypesLabel != null) {
+ position++;
+ }
+ } else if(getStereotypePropertiesInBraceLabelContainer().equals(getIconLabelContainer())) {
+ // located after icon label
+ position = getIconLabelPosition();
+ if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
+ position++;
+ }
+ }
+ return position;
+ }
+
+ /**
+ * @return the position of the qualified name label
+ */
+ protected int getQualifiedNameLabelPosition() {
+ int position = 0;
+ if(getQualifiedNameLabelContainer().equals(getStereotypePropertiesInBraceLabelContainer())) {
+ // located after stereotype properties in brace label
+ position = getStereotypePropertiesLabelPosition();
+ if(this.stereotypePropertiesInBraceContent != null) {
+ position++;
+ }
+ } else if(getQualifiedNameLabelContainer().equals(getStereotypeLabelContainer())) {
+ // located after stereotype label
+ position = getStereotypeLabelPosition();
+ if(this.stereotypesLabel != null) {
+ position++;
+ }
+ } else if(getQualifiedNameLabelContainer().equals(getIconLabelContainer())) {
+ // located after icon label
+ position = getIconLabelPosition();
+ if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
+ position++;
+ }
+ }
+ return position;
+ }
+
+ /**
+ * @return the position of the name label
+ */
+ // @unused
+ protected int getNameLabelPosition() {
+ int position = 0;
+ if(getNameLabelContainer().equals(getQualifiedNameLabelContainer())) {
+ // located after qualifed name label
+ position = getQualifiedNameLabelPosition();
+ if(this.qualifiedLabel != null) {
+ position++;
+ }
+ } else if(getQualifiedNameLabelContainer().equals(getStereotypePropertiesInBraceLabelContainer())) {
+ // located after stereotype properties in brace label
+ position = getStereotypePropertiesLabelPosition();
+ if(this.stereotypePropertiesInBraceContent != null) {
+ position++;
+ }
+ } else if(getQualifiedNameLabelContainer().equals(getStereotypeLabelContainer())) {
+ // located after stereotype label
+ position = getStereotypeLabelPosition();
+ if(this.stereotypesLabel != null) {
+ position++;
+ }
+ } else if(getQualifiedNameLabelContainer().equals(getIconLabelContainer())) {
+ // located after icon label
+ position = getIconLabelPosition();
+ if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
+ position++;
+ }
+ }
+ return position;
+ }
+
+ /**
+ * @return the position of the stereotype properties compartment
+ */
+ protected int getStereotypePropertiesCompartmentPosition() {
+ int position = 0;
+ if(getStereotypePropertiesCompartmentContainer().equals(getNameLabelContainer())) {
+ // locate after name label (which is never removed)
+ position = getNameLabelContainer().getChildren().indexOf(nameLabel);
+ position++;
+ } else if(getNameLabelContainer().equals(getQualifiedNameLabelContainer())) {
+ // located after qualifed name label
+ position = getQualifiedNameLabelPosition();
+ if(this.qualifiedLabel != null) {
+ position++;
+ }
+ } else if(getQualifiedNameLabelContainer().equals(getStereotypePropertiesInBraceLabelContainer())) {
+ // located after stereotype properties in brace label
+ position = getStereotypePropertiesLabelPosition();
+ if(this.stereotypePropertiesInBraceContent != null) {
+ position++;
+ }
+ } else if(getQualifiedNameLabelContainer().equals(getStereotypeLabelContainer())) {
+ // located after stereotype label
+ position = getStereotypeLabelPosition();
+ if(this.stereotypesLabel != null) {
+ position++;
+ }
+ } else if(getQualifiedNameLabelContainer().equals(getIconLabelContainer())) {
+ // located after icon label
+ position = getIconLabelPosition();
+ if((this.iconLabel != null) && (this.iconLabel.getIcon() != null)) {
+ position++;
+ }
+ }
+ return position;
+ }
+
+ /**
+ * to obtain the stereotypePropertiesContent of the class figure
+ *
+ */
+ public RectangleFigure getStereotypePropertiesContent() {
+ return this.stereotypePropertiesContent;
+ }
+
+ /**
+ * Gets the stereotypes label.
+ *
+ * @return the stereotypes label
+ */
+ public Label getStereotypesLabel() {
+ return this.stereotypesLabel;
+ }
+
+ /**
+ * return true inf the label in localized at the point pt.
+ *
+ * @param label
+ * the label that we look for
+ * @param pt
+ * the point that we test
+ *
+ * @return true if the point is on the label
+ */
+ // @unused
+ protected boolean labelContainsPoint(Label label, Point pt) {
+ Rectangle rc;
+
+ rc = new PrecisionRectangle(label.getBounds());
+ label.translateToAbsolute(rc);
+ if(rc.contains(pt)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Refresh stereotypes.
+ *
+ * @param presentation
+ * the presentation
+ * @param hasIcon
+ * the has icon
+ * @param hasShape
+ * the has shape
+ * @param stereotypes
+ * the stereotypes
+ */
+ public void refreshStereotypes(String stereotypes, String presentation, boolean hasIcon, boolean hasShape) {
+
+ if(stereotypes.equals("")) {
+ this.setStereotypes(null);
+ return;
+ }
+
+ if(presentation.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) && hasIcon) {
+ this.setStereotypes(null);
+ return;
+ } else if(presentation.equals(UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION) && hasShape) {
+ this.setStereotypes(null);
+ return;
+ }
+
+ this.setStereotypes(stereotypes);// add stereotypes on the class figure
+ return;
+ }
+
+ /**
+ * Sets the depth.
+ *
+ * @param depth
+ * the new depth
+ */
+ public void setDepth(int depth) {
+ this.depth = depth;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name
+ * the name
+ */
+ // @unused
+ public void setName(String name) {
+ this.nameLabel.setText(name);
+ }
+
+ public void setNameLabelIcon(boolean displayNameLabelIcon) {
+ if(getNameLabel().getIcon() != null) {
+ nameLabelIcon = getNameLabel().getIcon();
+ }
+ if(displayNameLabelIcon) {
+ getNameLabel().setIcon(nameLabelIcon);
+ } else {
+ getNameLabel().setIcon(null);
+ }
+ }
+
+ // @unused
+ public void setNameLabelIcon(Image nameLabelIcon) {
+ this.nameLabelIcon = nameLabelIcon;
+ }
+
+ /**
+ * Sets the qualified name.
+ *
+ * @param qualifiedName
+ * the qualified name
+ */
+ public void setQualifiedName(String qualifiedName) {
+ String tmpQualifiedName = getQualifiedName(qualifiedName, depth);
+ // two raisons to remove label!
+ // null
+ // or the qualified name is equal to 1
+ if(qualifiedName == null || tmpQualifiedName == null || !tmpQualifiedName.contains("::")) { // Remove
+ // label
+ // if
+ // any
+ if(this.qualifiedLabel != null) {
+ getQualifiedNameLabelContainer().remove(this.qualifiedLabel);
+ this.qualifiedLabel = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label
+ if(this.qualifiedLabel == null) {
+ this.createQualifiedNameLabel();
+ }
+ // we have to not display name.
+
+ int i = tmpQualifiedName.lastIndexOf("::");
+ if(i != -1) {
+ tmpQualifiedName = tmpQualifiedName.substring(0, i);
+ }
+ this.qualifiedLabel.setText("(" + tmpQualifiedName.trim() + ")");
+
+ }
+
+ /**
+ * Sets the stereotypes properties for this figure.
+ * <p>
+ * This implementation checks if the specified string is null or not.
+ * <ul>
+ * <li>if the string is <code>null</code>, it removes the label representing the stereotypes properties with brace.</li>
+ * <li>if this is not <code>null</code>, it creates the stereotype properties label if needed and displays the specified string.</li>
+ * </ul>
+ * </p>
+ *
+ * @param stereotypeProperties
+ * the string representing the stereotype properties to be
+ * displayed
+ */
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ if(stereotypeProperties == null) {
+ // Remove label if any
+ if(this.stereotypePropertiesInBraceContent != null) {
+ getStereotypePropertiesInBraceLabelContainer().remove(this.stereotypePropertiesInBraceContent);
+ this.stereotypePropertiesInBraceContent = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label if it does not already exist
+ if(this.stereotypePropertiesInBraceContent == null) {
+ this.createStereotypePropertiesInBraceLabel();
+ }
+
+ // Set stereotype text on figure
+ if(!"".equals(stereotypeProperties)) {
+ this.stereotypePropertiesInBraceContent.setText("{" + stereotypeProperties + "}");
+ } else {
+ this.stereotypePropertiesInBraceContent.setText("");
+ }
+ }
+
+ /**
+ * displays the new string corresponding to the list of stereotypes.
+ *
+ * if the string is <code>null</code>, then the figure that displays the
+ * stereotype label is removed from the NodeNamedElementFigure.
+ *
+ * @param stereotypeProperties
+ * the string to be displayed.
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ if(stereotypeProperties == null || stereotypeProperties.trim() == "") {
+ // remove figure of stereotype properties compartment
+ if(this.stereotypePropertiesContent != null) {
+ getStereotypePropertiesCompartmentContainer().remove(this.stereotypePropertiesContent);
+ this.stereotypePropertiesContent = null;
+ }
+ return;
+ }
+
+ // set stereotype properties content
+ if(stereotypePropertiesContent == null) {
+ this.createStereotypePropertiesContent();
+ }
+
+ fillStereotypePropertiesInCompartment(stereotypeProperties);
+ }
+
+ /**
+ * Sets the stereotypes for this figure.
+ * <p>
+ * This implementation checks if the specified string is null or not.
+ * <ul>
+ * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
+ * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
+ * </ul>
+ * </p>
+ *
+ * @param stereotypes
+ * the string representing the stereotypes to be displayed
+ */
+ public void setStereotypes(String stereotypes) {
+ if(stereotypes == null) {
+ // Remove label if any
+ if(this.stereotypesLabel != null) {
+ getStereotypeLabelContainer().remove(this.stereotypesLabel);
+ this.stereotypesLabel = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label if it does not already exist
+ if(this.stereotypesLabel == null) {
+ this.createStereotypeLabel();
+ }
+
+ // Set stereotype text on figure
+ if(!"".equals(stereotypes)) {
+ this.stereotypesLabel.setText(stereotypes);
+ } else {
+ this.stereotypesLabel.setText("");
+ }
+ }
+
+ /**
+ * Sets the stereotype icon for this figure.
+ *
+ * @param stereotypes
+ * the image representing the stereotype
+ */
+ public void setAppliedStereotypeIcon(Image image) {
+ if(image == null) {
+ // Remove label if any
+ if(this.iconLabel != null) {
+ getIconLabelContainer().remove(this.iconLabel);
+ this.iconLabel = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label if it does not already exist
+ if(this.iconLabel == null) {
+ this.createIconLabel();
+ }
+
+ // Set stereotype icon on figure
+ this.iconLabel.setIcon(image);
+ }
+
+ /**
+ * Sets the applied stereotype icon.
+ *
+ * @param image
+ * the image
+ * @param position
+ * the position
+ */
+ public void setAppliedStereotypeIcon(Image image, int position) {
+ if(image == null) {
+ // Remove label if any
+ if(this.iconLabel != null) {
+ getIconLabelContainer().remove(this.iconLabel);
+ this.iconLabel = null;
+ }
+ return;
+ }
+
+ // Set the stereotype label with position parameter if it does not
+ // already exist
+ if(this.iconLabel == null) {
+ this.createIconLabel(position);
+ }
+
+ // Set stereotype icon on figure
+ this.iconLabel.setIcon(image);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NoteShadowBorder.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NoteShadowBorder.java
index 69785fed42c..34720687bcf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NoteShadowBorder.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/NoteShadowBorder.java
@@ -1,89 +1,89 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.NoteFigure.NoteFigureBorder;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * this class is used to test the shadow for a a note figure
- *
- */
-
-public class NoteShadowBorder extends RectangularShadowBorder {
-
- protected Dimension cornerDim;
-
- private NoteFigureBorder noteBorder;
-
- public NoteShadowBorder(int borderwidth, Color color, Dimension cornerDim, NoteFigureBorder noteBorder) {
- super(borderwidth, color);
- this.cornerDim = cornerDim;
- this.noteBorder = noteBorder;
- // TODO Auto-generated constructor stub
- }
-
- /**
- * Returns margin for this border
- *
- * @return margin as Insets
- */
- public Insets getMargin() {
- return noteBorder.getMargin();
- }
-
- public Insets getInsets(IFigure figure) {
- return noteBorder.getInsets(figure);
- }
-
- /**
- * @see org.eclipse.draw2d.Border#paint(IFigure, Graphics, Insets)
- */
- @Override
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- graphics.pushState();
- noteBorder.paint(figure, graphics, insets);
-
- // draw the shadow
- // first expand the clip rectangle
- Rectangle newRect = new Rectangle(figure.getBounds());
- Rectangle figureRect = new Rectangle(figure.getBounds());
- newRect.width = newRect.width + borderwidth;
- newRect.height = newRect.height + borderwidth;
- graphics.setClip(newRect);
- // paint the shadow
- PointList plt = new PointList();
- plt.addPoint(figureRect.x + figureRect.width, figureRect.y + borderwidth + cornerDim.height);
- plt.addPoint(figureRect.x + figureRect.width, figureRect.y + figureRect.height);
- plt.addPoint(figureRect.x + borderwidth, figureRect.y + figureRect.height);
- plt.addPoint(figureRect.x + borderwidth, figureRect.y + figureRect.height + borderwidth);
- plt.addPoint(figureRect.x + figureRect.width + borderwidth, figureRect.y + figureRect.height + borderwidth);
- plt.addPoint(figureRect.x + figureRect.width + borderwidth, figureRect.y + borderwidth + cornerDim.height + borderwidth);
- plt.addPoint(figureRect.x + figureRect.width, figureRect.y + borderwidth + cornerDim.height);
- if(getColor() != null) {
- graphics.setBackgroundColor(getColor());
- } else {
- graphics.setBackgroundColor(ColorConstants.black);
- }
- graphics.fillPolygon(plt);
- graphics.popState();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.NoteFigure.NoteFigureBorder;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * this class is used to test the shadow for a a note figure
+ *
+ */
+
+public class NoteShadowBorder extends RectangularShadowBorder {
+
+ protected Dimension cornerDim;
+
+ private NoteFigureBorder noteBorder;
+
+ public NoteShadowBorder(int borderwidth, Color color, Dimension cornerDim, NoteFigureBorder noteBorder) {
+ super(borderwidth, color);
+ this.cornerDim = cornerDim;
+ this.noteBorder = noteBorder;
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * Returns margin for this border
+ *
+ * @return margin as Insets
+ */
+ public Insets getMargin() {
+ return noteBorder.getMargin();
+ }
+
+ public Insets getInsets(IFigure figure) {
+ return noteBorder.getInsets(figure);
+ }
+
+ /**
+ * @see org.eclipse.draw2d.Border#paint(IFigure, Graphics, Insets)
+ */
+ @Override
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ graphics.pushState();
+ noteBorder.paint(figure, graphics, insets);
+
+ // draw the shadow
+ // first expand the clip rectangle
+ Rectangle newRect = new Rectangle(figure.getBounds());
+ Rectangle figureRect = new Rectangle(figure.getBounds());
+ newRect.width = newRect.width + borderwidth;
+ newRect.height = newRect.height + borderwidth;
+ graphics.setClip(newRect);
+ // paint the shadow
+ PointList plt = new PointList();
+ plt.addPoint(figureRect.x + figureRect.width, figureRect.y + borderwidth + cornerDim.height);
+ plt.addPoint(figureRect.x + figureRect.width, figureRect.y + figureRect.height);
+ plt.addPoint(figureRect.x + borderwidth, figureRect.y + figureRect.height);
+ plt.addPoint(figureRect.x + borderwidth, figureRect.y + figureRect.height + borderwidth);
+ plt.addPoint(figureRect.x + figureRect.width + borderwidth, figureRect.y + figureRect.height + borderwidth);
+ plt.addPoint(figureRect.x + figureRect.width + borderwidth, figureRect.y + borderwidth + cornerDim.height + borderwidth);
+ plt.addPoint(figureRect.x + figureRect.width, figureRect.y + borderwidth + cornerDim.height);
+ if(getColor() != null) {
+ graphics.setBackgroundColor(getColor());
+ } else {
+ graphics.setBackgroundColor(ColorConstants.black);
+ }
+ graphics.fillPolygon(plt);
+ graphics.popState();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/OLDCompartmentFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/OLDCompartmentFigure.java
index b4bfef75d6c..5f3450a1fe6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/OLDCompartmentFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/OLDCompartmentFigure.java
@@ -1,269 +1,269 @@
-/****************************************************************************
- * 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:
- * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-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.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-
-/**
- * A rectangular figure that supports compartment.
- *
- * @deprecated use CompartmentFigure instead.
- */
-@Deprecated
-public class OLDCompartmentFigure extends NodeNamedElementFigure {
-
- private Map<String, RectangleFigure> containerFigures;
-
- private final List<String> compartmentID;
-
- private IFigure contentPane;
-
- private static final int MINIMUM_COMPARTMENT_HEIGHT = 15;
-
- /**
- * Constructor.
- *
- * @param compartmentFigure
- */
- // @unused
- public OLDCompartmentFigure(List<String> compartmentFigure) {
- this(compartmentFigure, null);
- }
-
- /**
- * Constructor with a tagged value.
- *
- * @param compartmentFigure
- * a list of id for the compartment figure
- * @param taggedLabelValue
- * the value to display as tagged value
- */
- public OLDCompartmentFigure(List<String> compartmentFigure, String taggedLabelValue) {
- super(taggedLabelValue);
-
- setLayoutManager(new CompartmentLayoutManager());
- setOpaque(true);
- compartmentID = compartmentFigure;
- createContentPane(compartmentFigure);
-
- }
-
- /**
- *
- * @param compartmentFigure
- */
- protected void createContentPane(List<String> compartmentFigure) {
- contentPane = new Figure();
- contentPane.setOpaque(false);
-
- add(contentPane);
-
- containerFigures = new HashMap<String, RectangleFigure>();
-
- for(String id : compartmentFigure) {
- RectangleFigure newFigure = new RectangleFigure();
- newFigure.setFill(false);
- newFigure.setBorder(null);
- newFigure.setOutline(false);
- contentPane.add(newFigure);
- containerFigures.put(id, newFigure);
- }
-
- }
-
- /**
- * Get the content pane
- *
- * @return
- */
- public IFigure getContentPane() {
- return contentPane;
- }
-
- /**
- * Get the RectangleFigure containing the wanted compartment.
- *
- * @param id
- * the id to find the right compartment
- * @return the RectangleFigure
- */
- // @unused
- public RectangleFigure getCompartment(String id) {
- return containerFigures.get(id);
- }
-
- /**
- * A Specific layout manager to handle compartment in the content pane
- */
- private class CompartmentLayoutManager extends AbstractLayout {
-
- // TODO : replace this value by the size of the incriminated label
- private static final int wrappedLabelSize = 18;
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
- int minimumWith = 0;
- int minimumHeight = 0;
- // display name
- if(getNameLabel() != null) {
- if(getNameLabel().getPreferredSize().width > minimumWith) {
- minimumWith = getNameLabel().getPreferredSize().width;
- }
- minimumHeight += getNameLabel().getPreferredSize().height;
- }
-
- return new Dimension(minimumWith, minimumHeight);
- }
-
- /**
- * {@inheritDoc}
- */
- public void layout(IFigure container) {
- // Header
- List childrenList = container.getChildren();
- for(int i = 0; i < childrenList.size(); i++) {
- Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
- bound.setSize(((IFigure)childrenList.get(i)).getPreferredSize());
- bound.width = getBounds().width;
- bound.x = getBounds().x;
- if(i > 0) {
- bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y + 1;
- } else {
- bound.y = getBounds().y;
- }
- ((IFigure)childrenList.get(i)).setBounds(bound);
- }
-
- HashMap<String, Dimension> compartmentsDimension = new HashMap<String, Dimension>(compartmentID.size());
- for(String compartment : compartmentID) {
- RectangleFigure rectangleFigure = containerFigures.get(compartment);
- if(rectangleFigure.getChildren().size() > 0) {
- ResizableCompartmentFigure rcf = (ResizableCompartmentFigure)rectangleFigure.getChildren().get(0);
- if(rcf != null) {
- Dimension dimensionCompartment = getDimension(rcf);
- compartmentsDimension.put(compartment, dimensionCompartment);
- }
- }
-
- }
-
- optimizeCompartmentSize(compartmentsDimension);
-
- for(int i = 0; i < compartmentID.size(); i++) {
- RectangleFigure rectangleFigure = containerFigures.get(compartmentID.get(i));
- if(rectangleFigure.getChildren().size() > 0) {
- ResizableCompartmentFigure rcf = (ResizableCompartmentFigure)rectangleFigure.getChildren().get(0);
- if(rcf != null) {
- Point point = getPosition(i);
- Rectangle rect = new Rectangle(point, compartmentsDimension.get(compartmentID.get(i)));
- rcf.getParent().setBounds(rect);
- rcf.setBounds(rect);
- }
- }
-
- }
-
- contentPane.getBounds().setSize(getBounds().width, getBounds().y + getBounds().height - contentPane.getBounds().y);
- }
-
- /**
- * Get the dimension of the compartment depending on its content.
- *
- * @param rcf
- * the ResizableCompartmentFigure which will be displayed
- * @return the dimension of the compartment
- */
- private Dimension getDimension(ResizableCompartmentFigure rcf) {
- Dimension dimensionCompartment = new Dimension(getBounds().width, 0);
- if(rcf.isExpanded()) {
- dimensionCompartment.height += wrappedLabelSize * (rcf.getContentPane().getChildren().size());
- }
-
- return dimensionCompartment;
- }
-
- /**
- * Calculate the location of the compartment. It depends on its previous
- * compartment location and size if it has any. Otherwise it is the
- * location of the contentPane
- *
- * @param index
- * the index of the compartment in the containerFigures list
- * @return the position of the compartment
- */
- private Point getPosition(int index) {
- // By default, it is the position of the contentPane
- Point point = new Point(getContentPane().getBounds().x, getContentPane().getBounds().y);
- // If it has a compartment before, calculate a new position
- if(index > 0) {
- RectangleFigure previousRectangle = containerFigures.get(compartmentID.get(index - 1));
- ResizableCompartmentFigure rcf = (ResizableCompartmentFigure)previousRectangle.getChildren().get(0);
- point.y = rcf.getParent().getBounds().y + rcf.getParent().getBounds().height;
- }
- return point;
- }
-
- /**
- * Optimize the size of each compartment depending on the size of the
- * compartments container, and the size of each compartment. If a
- * compartment is empty, or not expanded, then a default size is applied
- * to this compartment
- *
- * @param compartmentsDimension
- * an hashmap containing each compartment dimension.
- */
- private void optimizeCompartmentSize(HashMap<String, Dimension> compartmentsDimension) {
- int compartmentsHeight = 0;
-
- // Calculate the height of all compartments
- for(Dimension dimension : compartmentsDimension.values()) {
- if(dimension.height == 0) {
- compartmentsHeight += MINIMUM_COMPARTMENT_HEIGHT;
- } else {
- compartmentsHeight += dimension.height;
- }
- }
-
- if(getContentPane().getBounds().height > 0) {
-
- // ratio between the height of all compartments and the size of
- // the compartments container.
- double ratio = new Integer(compartmentsHeight).doubleValue() / new Integer(getContentPane().getBounds().height).doubleValue();
-
- for(Dimension dimension : compartmentsDimension.values()) {
- dimension.height = (int)(dimension.height / ratio);
- if(dimension.height == 0) {
- dimension.height = MINIMUM_COMPARTMENT_HEIGHT;
- }
-
- }
-
- }
-
- }
- }
-}
+/****************************************************************************
+ * 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:
+ * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.IFigure;
+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.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+
+/**
+ * A rectangular figure that supports compartment.
+ *
+ * @deprecated use CompartmentFigure instead.
+ */
+@Deprecated
+public class OLDCompartmentFigure extends NodeNamedElementFigure {
+
+ private Map<String, RectangleFigure> containerFigures;
+
+ private final List<String> compartmentID;
+
+ private IFigure contentPane;
+
+ private static final int MINIMUM_COMPARTMENT_HEIGHT = 15;
+
+ /**
+ * Constructor.
+ *
+ * @param compartmentFigure
+ */
+ // @unused
+ public OLDCompartmentFigure(List<String> compartmentFigure) {
+ this(compartmentFigure, null);
+ }
+
+ /**
+ * Constructor with a tagged value.
+ *
+ * @param compartmentFigure
+ * a list of id for the compartment figure
+ * @param taggedLabelValue
+ * the value to display as tagged value
+ */
+ public OLDCompartmentFigure(List<String> compartmentFigure, String taggedLabelValue) {
+ super(taggedLabelValue);
+
+ setLayoutManager(new CompartmentLayoutManager());
+ setOpaque(true);
+ compartmentID = compartmentFigure;
+ createContentPane(compartmentFigure);
+
+ }
+
+ /**
+ *
+ * @param compartmentFigure
+ */
+ protected void createContentPane(List<String> compartmentFigure) {
+ contentPane = new Figure();
+ contentPane.setOpaque(false);
+
+ add(contentPane);
+
+ containerFigures = new HashMap<String, RectangleFigure>();
+
+ for(String id : compartmentFigure) {
+ RectangleFigure newFigure = new RectangleFigure();
+ newFigure.setFill(false);
+ newFigure.setBorder(null);
+ newFigure.setOutline(false);
+ contentPane.add(newFigure);
+ containerFigures.put(id, newFigure);
+ }
+
+ }
+
+ /**
+ * Get the content pane
+ *
+ * @return
+ */
+ public IFigure getContentPane() {
+ return contentPane;
+ }
+
+ /**
+ * Get the RectangleFigure containing the wanted compartment.
+ *
+ * @param id
+ * the id to find the right compartment
+ * @return the RectangleFigure
+ */
+ // @unused
+ public RectangleFigure getCompartment(String id) {
+ return containerFigures.get(id);
+ }
+
+ /**
+ * A Specific layout manager to handle compartment in the content pane
+ */
+ private class CompartmentLayoutManager extends AbstractLayout {
+
+ // TODO : replace this value by the size of the incriminated label
+ private static final int wrappedLabelSize = 18;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
+ int minimumWith = 0;
+ int minimumHeight = 0;
+ // display name
+ if(getNameLabel() != null) {
+ if(getNameLabel().getPreferredSize().width > minimumWith) {
+ minimumWith = getNameLabel().getPreferredSize().width;
+ }
+ minimumHeight += getNameLabel().getPreferredSize().height;
+ }
+
+ return new Dimension(minimumWith, minimumHeight);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void layout(IFigure container) {
+ // Header
+ List childrenList = container.getChildren();
+ for(int i = 0; i < childrenList.size(); i++) {
+ Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
+ bound.setSize(((IFigure)childrenList.get(i)).getPreferredSize());
+ bound.width = getBounds().width;
+ bound.x = getBounds().x;
+ if(i > 0) {
+ bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y + 1;
+ } else {
+ bound.y = getBounds().y;
+ }
+ ((IFigure)childrenList.get(i)).setBounds(bound);
+ }
+
+ HashMap<String, Dimension> compartmentsDimension = new HashMap<String, Dimension>(compartmentID.size());
+ for(String compartment : compartmentID) {
+ RectangleFigure rectangleFigure = containerFigures.get(compartment);
+ if(rectangleFigure.getChildren().size() > 0) {
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure)rectangleFigure.getChildren().get(0);
+ if(rcf != null) {
+ Dimension dimensionCompartment = getDimension(rcf);
+ compartmentsDimension.put(compartment, dimensionCompartment);
+ }
+ }
+
+ }
+
+ optimizeCompartmentSize(compartmentsDimension);
+
+ for(int i = 0; i < compartmentID.size(); i++) {
+ RectangleFigure rectangleFigure = containerFigures.get(compartmentID.get(i));
+ if(rectangleFigure.getChildren().size() > 0) {
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure)rectangleFigure.getChildren().get(0);
+ if(rcf != null) {
+ Point point = getPosition(i);
+ Rectangle rect = new Rectangle(point, compartmentsDimension.get(compartmentID.get(i)));
+ rcf.getParent().setBounds(rect);
+ rcf.setBounds(rect);
+ }
+ }
+
+ }
+
+ contentPane.getBounds().setSize(getBounds().width, getBounds().y + getBounds().height - contentPane.getBounds().y);
+ }
+
+ /**
+ * Get the dimension of the compartment depending on its content.
+ *
+ * @param rcf
+ * the ResizableCompartmentFigure which will be displayed
+ * @return the dimension of the compartment
+ */
+ private Dimension getDimension(ResizableCompartmentFigure rcf) {
+ Dimension dimensionCompartment = new Dimension(getBounds().width, 0);
+ if(rcf.isExpanded()) {
+ dimensionCompartment.height += wrappedLabelSize * (rcf.getContentPane().getChildren().size());
+ }
+
+ return dimensionCompartment;
+ }
+
+ /**
+ * Calculate the location of the compartment. It depends on its previous
+ * compartment location and size if it has any. Otherwise it is the
+ * location of the contentPane
+ *
+ * @param index
+ * the index of the compartment in the containerFigures list
+ * @return the position of the compartment
+ */
+ private Point getPosition(int index) {
+ // By default, it is the position of the contentPane
+ Point point = new Point(getContentPane().getBounds().x, getContentPane().getBounds().y);
+ // If it has a compartment before, calculate a new position
+ if(index > 0) {
+ RectangleFigure previousRectangle = containerFigures.get(compartmentID.get(index - 1));
+ ResizableCompartmentFigure rcf = (ResizableCompartmentFigure)previousRectangle.getChildren().get(0);
+ point.y = rcf.getParent().getBounds().y + rcf.getParent().getBounds().height;
+ }
+ return point;
+ }
+
+ /**
+ * Optimize the size of each compartment depending on the size of the
+ * compartments container, and the size of each compartment. If a
+ * compartment is empty, or not expanded, then a default size is applied
+ * to this compartment
+ *
+ * @param compartmentsDimension
+ * an hashmap containing each compartment dimension.
+ */
+ private void optimizeCompartmentSize(HashMap<String, Dimension> compartmentsDimension) {
+ int compartmentsHeight = 0;
+
+ // Calculate the height of all compartments
+ for(Dimension dimension : compartmentsDimension.values()) {
+ if(dimension.height == 0) {
+ compartmentsHeight += MINIMUM_COMPARTMENT_HEIGHT;
+ } else {
+ compartmentsHeight += dimension.height;
+ }
+ }
+
+ if(getContentPane().getBounds().height > 0) {
+
+ // ratio between the height of all compartments and the size of
+ // the compartments container.
+ double ratio = new Integer(compartmentsHeight).doubleValue() / new Integer(getContentPane().getBounds().height).doubleValue();
+
+ for(Dimension dimension : compartmentsDimension.values()) {
+ dimension.height = (int)(dimension.height / ratio);
+ if(dimension.height == 0) {
+ dimension.height = MINIMUM_COMPARTMENT_HEIGHT;
+ }
+
+ }
+
+ }
+
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageFigure.java
index 3db500dccf1..2c91da0a3cd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageFigure.java
@@ -1,243 +1,243 @@
-/*******************************************************************************
- * Copyright (c) 2006 CEA List.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA List - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.notation.GradientStyle;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Figure for a package element
- */
-public class PackageFigure extends NodeNamedElementFigure {
-
- private final RectangleFigure shapeCompartment;
-
- /**
- * gap in x to display name stereotypes and qualified name
- */
- protected final int GAP_X = 10;
-
- /**
- * gap in y to display the first label at the top of the package
- */
- protected final int GAP_Y = 5;
-
- /**
- * this is the layout manager in charge to place element in the enumeration
- *
- */
- private class PackageLayoutManager extends AbstractLayout {
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
-
- int minimumWith = 0;
- int minimumHeight = 0;
- // display name
- if(getNameLabel() != null) {
- if(getNameLabel().getPreferredSize().width > minimumWith) {
- minimumWith = getNameLabel().getPreferredSize().width;
- }
- minimumHeight += getNameLabel().getPreferredSize().height;
- }
-
- return new Dimension(minimumWith, minimumHeight);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void layout(IFigure container) {
- List childrenList = container.getChildren();
- for(int i = 0; i < container.getChildren().size(); i++) {
- Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
- IFigure fig=((IFigure)childrenList.get(i));
- fig.invalidate();
- Dimension pref=((IFigure)childrenList.get(i)).getPreferredSize();
- fig.invalidate();
- Dimension prefConstraint=((IFigure)childrenList.get(i)).getPreferredSize(container.getBounds().width-40,-1);
- if( pref.width<prefConstraint.width){
- bound.setSize(pref);
- }
- else{
- bound.setSize(prefConstraint);
- }
- if(((IFigure)childrenList.get(i)).equals(iconPackage)) {
- Rectangle boundName = getNameLabel().getBounds().getCopy();
- boundName.x += GAP_X / 2;
- iconPackage.setBounds(new Rectangle(boundName.getTopRight(), new Dimension(16, 16)));
- } else {
- if(i > 0) {
- bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y + 1;
- bound.x = getBounds().x + GAP_X;
- } else {
- bound.x = getBounds().x + GAP_X;
- bound.y = getBounds().y + GAP_Y;
-
- }
- ((IFigure)childrenList.get(i)).setBounds(bound);
- }
- }
- // container
- Rectangle lastRectangle = getPackageableElementFigure().getBounds();
- lastRectangle.height = getBounds().y + getBounds().height - lastRectangle.y;
- lastRectangle.x = container.getBounds().x;
- lastRectangle.width = getBounds().width;
- //getPackageableElementFigure().setBounds(lastRectangle);
- if(getGMFPackageableElementContainer() != null) {
- //getGMFPackageableElementContainer().setBounds(lastRectangle);
- }
- }
-
- }
-
- /** this is a label used to display a specific icon for this element **/
- protected Label iconPackage = null;
-
- /**
- * Creates a new PackageFigure.
- */
- public PackageFigure() {
- super();
-
- setLayoutManager(new PackageLayoutManager());
- setOpaque(false);
-
- shapeCompartment = new RectangleFigure();
- add(shapeCompartment);
-
- setBorder(null);
- getPackageableElementFigure().setFill(false);
-
- }
-
- /**
- * this method is used to display a symabol image for an element package as
- * triangle for the model
- *
- * @param image
- */
- public void setTagIcon(Image image) {
- iconPackage = new Label();
- iconPackage.setIcon(image);
- add(iconPackage);
-
- }
-
- /**
- * get the gmf container figure of the package
- *
- * @return the gmf container
- */
- public ShapeCompartmentFigure getGMFPackageableElementContainer() {
- if(shapeCompartment.getChildren().size() > 0) {
- return (ShapeCompartmentFigure)shapeCompartment.getChildren().get(0);
- }
- return null;
- }
-
- public RectangleFigure getPackageableElementFigure() {
- return shapeCompartment;
- }
-
- /**
- * use to obtain the coordinates of the package header
- *
- * @return coordinate of the package header, maybe null if the figure has
- * never be painted.
- */
- public Rectangle getHeader() {
- // the index of the shape container
- int indexShapeContainer = getChildren().indexOf(shapeCompartment);
- Rectangle headerBound = new Rectangle(0, 0, 0, 0);
- for(int i = 0; i < indexShapeContainer; i++) {
- IFigure currentchild = (IFigure)this.getChildren().get(i);
- if(currentchild.getSize().width + 2 * GAP_X > headerBound.width) {
- headerBound.width = currentchild.getSize().width + 2 * GAP_X;
- }
- headerBound.height += currentchild.getSize().height;
- }
- headerBound.height += 1;
-
- headerBound.x = this.getBounds().x;
- headerBound.y = this.getBounds().y;
- headerBound.height = getPackageableElementFigure().getBounds().y - headerBound.y;
- if(iconPackage != null) {
- headerBound.width += iconPackage.getBounds().width;
- }
- return headerBound;
- }
-
- // @unused
- public Color getGradientColor() {
- return getForegroundColor();
- }
-
- @Override
- public void setShadow(boolean shadow) {
- // FIXME : set the outline border of the figure ?
- }
-
- @Override
- public void setLineWidth(int w) {
- getHeader().setWidth(w);
- getPackageableElementFigure().setLineWidth(w);
- super.setLineWidth(w);
- }
-
- @Override
- protected void paintBorder(Graphics graphics) {
- graphics.drawRectangle(getHeader());
- super.paintBorder(graphics);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected void paintBackground(Graphics graphics, Rectangle rectangle) {
- if(isUsingGradient()) {
- applyTransparency(graphics);
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillRectangle(getHeader());
- boolean isVertical = (getGradientStyle() == GradientStyle.VERTICAL) ? true : false;
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillGradient(getPackageableElementFigure().getBounds(), isVertical);
- } else {
- graphics.setBackgroundColor(getBackgroundColor());
- graphics.setForegroundColor(getBorderColor());
- graphics.fillRectangle(getHeader());
- graphics.fillRectangle(getPackageableElementFigure().getBounds());
- }
- graphics.setForegroundColor(getBorderColor());
- graphics.setLineWidth(getLineWidth());
- graphics.drawRectangle(getHeader());
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2006 CEA List.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA List - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.List;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ShapeCompartmentFigure;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.notation.GradientStyle;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Figure for a package element
+ */
+public class PackageFigure extends NodeNamedElementFigure {
+
+ private final RectangleFigure shapeCompartment;
+
+ /**
+ * gap in x to display name stereotypes and qualified name
+ */
+ protected final int GAP_X = 10;
+
+ /**
+ * gap in y to display the first label at the top of the package
+ */
+ protected final int GAP_Y = 5;
+
+ /**
+ * this is the layout manager in charge to place element in the enumeration
+ *
+ */
+ private class PackageLayoutManager extends AbstractLayout {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
+
+ int minimumWith = 0;
+ int minimumHeight = 0;
+ // display name
+ if(getNameLabel() != null) {
+ if(getNameLabel().getPreferredSize().width > minimumWith) {
+ minimumWith = getNameLabel().getPreferredSize().width;
+ }
+ minimumHeight += getNameLabel().getPreferredSize().height;
+ }
+
+ return new Dimension(minimumWith, minimumHeight);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void layout(IFigure container) {
+ List childrenList = container.getChildren();
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ Rectangle bound = new Rectangle(((IFigure)childrenList.get(i)).getBounds());
+ IFigure fig=((IFigure)childrenList.get(i));
+ fig.invalidate();
+ Dimension pref=((IFigure)childrenList.get(i)).getPreferredSize();
+ fig.invalidate();
+ Dimension prefConstraint=((IFigure)childrenList.get(i)).getPreferredSize(container.getBounds().width-40,-1);
+ if( pref.width<prefConstraint.width){
+ bound.setSize(pref);
+ }
+ else{
+ bound.setSize(prefConstraint);
+ }
+ if(((IFigure)childrenList.get(i)).equals(iconPackage)) {
+ Rectangle boundName = getNameLabel().getBounds().getCopy();
+ boundName.x += GAP_X / 2;
+ iconPackage.setBounds(new Rectangle(boundName.getTopRight(), new Dimension(16, 16)));
+ } else {
+ if(i > 0) {
+ bound.y = ((IFigure)childrenList.get(i - 1)).getBounds().getBottomLeft().y + 1;
+ bound.x = getBounds().x + GAP_X;
+ } else {
+ bound.x = getBounds().x + GAP_X;
+ bound.y = getBounds().y + GAP_Y;
+
+ }
+ ((IFigure)childrenList.get(i)).setBounds(bound);
+ }
+ }
+ // container
+ Rectangle lastRectangle = getPackageableElementFigure().getBounds();
+ lastRectangle.height = getBounds().y + getBounds().height - lastRectangle.y;
+ lastRectangle.x = container.getBounds().x;
+ lastRectangle.width = getBounds().width;
+ //getPackageableElementFigure().setBounds(lastRectangle);
+ if(getGMFPackageableElementContainer() != null) {
+ //getGMFPackageableElementContainer().setBounds(lastRectangle);
+ }
+ }
+
+ }
+
+ /** this is a label used to display a specific icon for this element **/
+ protected Label iconPackage = null;
+
+ /**
+ * Creates a new PackageFigure.
+ */
+ public PackageFigure() {
+ super();
+
+ setLayoutManager(new PackageLayoutManager());
+ setOpaque(false);
+
+ shapeCompartment = new RectangleFigure();
+ add(shapeCompartment);
+
+ setBorder(null);
+ getPackageableElementFigure().setFill(false);
+
+ }
+
+ /**
+ * this method is used to display a symabol image for an element package as
+ * triangle for the model
+ *
+ * @param image
+ */
+ public void setTagIcon(Image image) {
+ iconPackage = new Label();
+ iconPackage.setIcon(image);
+ add(iconPackage);
+
+ }
+
+ /**
+ * get the gmf container figure of the package
+ *
+ * @return the gmf container
+ */
+ public ShapeCompartmentFigure getGMFPackageableElementContainer() {
+ if(shapeCompartment.getChildren().size() > 0) {
+ return (ShapeCompartmentFigure)shapeCompartment.getChildren().get(0);
+ }
+ return null;
+ }
+
+ public RectangleFigure getPackageableElementFigure() {
+ return shapeCompartment;
+ }
+
+ /**
+ * use to obtain the coordinates of the package header
+ *
+ * @return coordinate of the package header, maybe null if the figure has
+ * never be painted.
+ */
+ public Rectangle getHeader() {
+ // the index of the shape container
+ int indexShapeContainer = getChildren().indexOf(shapeCompartment);
+ Rectangle headerBound = new Rectangle(0, 0, 0, 0);
+ for(int i = 0; i < indexShapeContainer; i++) {
+ IFigure currentchild = (IFigure)this.getChildren().get(i);
+ if(currentchild.getSize().width + 2 * GAP_X > headerBound.width) {
+ headerBound.width = currentchild.getSize().width + 2 * GAP_X;
+ }
+ headerBound.height += currentchild.getSize().height;
+ }
+ headerBound.height += 1;
+
+ headerBound.x = this.getBounds().x;
+ headerBound.y = this.getBounds().y;
+ headerBound.height = getPackageableElementFigure().getBounds().y - headerBound.y;
+ if(iconPackage != null) {
+ headerBound.width += iconPackage.getBounds().width;
+ }
+ return headerBound;
+ }
+
+ // @unused
+ public Color getGradientColor() {
+ return getForegroundColor();
+ }
+
+ @Override
+ public void setShadow(boolean shadow) {
+ // FIXME : set the outline border of the figure ?
+ }
+
+ @Override
+ public void setLineWidth(int w) {
+ getHeader().setWidth(w);
+ getPackageableElementFigure().setLineWidth(w);
+ super.setLineWidth(w);
+ }
+
+ @Override
+ protected void paintBorder(Graphics graphics) {
+ graphics.drawRectangle(getHeader());
+ super.paintBorder(graphics);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected void paintBackground(Graphics graphics, Rectangle rectangle) {
+ if(isUsingGradient()) {
+ applyTransparency(graphics);
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillRectangle(getHeader());
+ boolean isVertical = (getGradientStyle() == GradientStyle.VERTICAL) ? true : false;
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillGradient(getPackageableElementFigure().getBounds(), isVertical);
+ } else {
+ graphics.setBackgroundColor(getBackgroundColor());
+ graphics.setForegroundColor(getBorderColor());
+ graphics.fillRectangle(getHeader());
+ graphics.fillRectangle(getPackageableElementFigure().getBounds());
+ }
+ graphics.setForegroundColor(getBorderColor());
+ graphics.setLineWidth(getLineWidth());
+ graphics.drawRectangle(getHeader());
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageNodePlateFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageNodePlateFigure.java
index 863a66d1e9c..1bcde8b27df 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageNodePlateFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PackageNodePlateFigure.java
@@ -1,79 +1,79 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
-
-/**
- * this figure is used to display at the good positionn acnhor on the
- * packageable element
- *
- * @author PT202707
- *
- */
-public class PackageNodePlateFigure extends DefaultSizeNodeFigure {
-
- // @unused
- public PackageNodePlateFigure(Dimension defSize) {
- super(defSize);
- // TODO Auto-generated constructor stub
- }
-
- public PackageNodePlateFigure(int width, int height) {
- super(width, height);
- // TODO Auto-generated constructor stub
- }
-
- /**
- * Gets the package figure, it's a child of PackageNodePlateFigure
- *
- * @return the package figure
- */
- public PackageFigure getPackageFigure() {
- if(getChildren().size() > 0 && getChildren().get(0) instanceof PackageFigure) {
- return (PackageFigure)getChildren().get(0);
-
- }
- return null;
- }
-
- // This returns as the anchoring area only the central line
- @Override
- public PointList getPolygonPoints() {
- PointList points = new PointList(5);
- Rectangle anchorableRectangle = getHandleBounds();
- points.addPoint(anchorableRectangle.x, anchorableRectangle.y);
-
- PackageFigure packageFigure = getPackageFigure();
-
- if(packageFigure != null) {
- // take in account the header of the package
- points.addPoint(anchorableRectangle.x + packageFigure.getHeader().width, anchorableRectangle.y);
- points.addPoint(anchorableRectangle.x + packageFigure.getHeader().width, anchorableRectangle.y + packageFigure.getHeader().height);
- points.addPoint(anchorableRectangle.x + anchorableRectangle.width, anchorableRectangle.y + packageFigure.getHeader().height);
- }// no header
- else {
- points.addPoint(anchorableRectangle.x + anchorableRectangle.width, anchorableRectangle.y);
- }
-
- points.addPoint(anchorableRectangle.x + anchorableRectangle.width, anchorableRectangle.y + anchorableRectangle.height);
- points.addPoint(anchorableRectangle.x, anchorableRectangle.y + anchorableRectangle.height);
- points.addPoint(anchorableRectangle.x, anchorableRectangle.y);
- return points;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
+
+/**
+ * this figure is used to display at the good positionn acnhor on the
+ * packageable element
+ *
+ * @author PT202707
+ *
+ */
+public class PackageNodePlateFigure extends DefaultSizeNodeFigure {
+
+ // @unused
+ public PackageNodePlateFigure(Dimension defSize) {
+ super(defSize);
+ // TODO Auto-generated constructor stub
+ }
+
+ public PackageNodePlateFigure(int width, int height) {
+ super(width, height);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * Gets the package figure, it's a child of PackageNodePlateFigure
+ *
+ * @return the package figure
+ */
+ public PackageFigure getPackageFigure() {
+ if(getChildren().size() > 0 && getChildren().get(0) instanceof PackageFigure) {
+ return (PackageFigure)getChildren().get(0);
+
+ }
+ return null;
+ }
+
+ // This returns as the anchoring area only the central line
+ @Override
+ public PointList getPolygonPoints() {
+ PointList points = new PointList(5);
+ Rectangle anchorableRectangle = getHandleBounds();
+ points.addPoint(anchorableRectangle.x, anchorableRectangle.y);
+
+ PackageFigure packageFigure = getPackageFigure();
+
+ if(packageFigure != null) {
+ // take in account the header of the package
+ points.addPoint(anchorableRectangle.x + packageFigure.getHeader().width, anchorableRectangle.y);
+ points.addPoint(anchorableRectangle.x + packageFigure.getHeader().width, anchorableRectangle.y + packageFigure.getHeader().height);
+ points.addPoint(anchorableRectangle.x + anchorableRectangle.width, anchorableRectangle.y + packageFigure.getHeader().height);
+ }// no header
+ else {
+ points.addPoint(anchorableRectangle.x + anchorableRectangle.width, anchorableRectangle.y);
+ }
+
+ points.addPoint(anchorableRectangle.x + anchorableRectangle.width, anchorableRectangle.y + anchorableRectangle.height);
+ points.addPoint(anchorableRectangle.x, anchorableRectangle.y + anchorableRectangle.height);
+ points.addPoint(anchorableRectangle.x, anchorableRectangle.y);
+ return points;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusNodeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusNodeFigure.java
index 06536bf69a0..69727c0233b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusNodeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusNodeFigure.java
@@ -1,268 +1,268 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Atos Origin - Enable extending with a composite figure, by adding overrideable methods.
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
-import org.eclipse.gmf.runtime.notation.GradientStyle;
-import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * Common node figure. In charge of background, font, gradient, foreground,
- * border, shadow
- */
-public class PapyrusNodeFigure extends NodeFigure implements IPapyrusNodeFigure {
-
- /**
- * The border color.
- */
- private Color borderColor = ColorConstants.black;
-
- /**
- * The shadow
- */
- private boolean shadow = true;
-
- /** Default custom dash values */
- public static final int[] DEFAULT_CUSTOM_DASH = { 5, 5 };
-
- /** Table used to draw figure border as dashed line. */
- protected int[] customDash = null;
-
- /** Get custom dash values */
- public int[] getCustomDash() {
- if(customDash == null) {
- // Initialize dash property for dashed border representation.
- customDash = DEFAULT_CUSTOM_DASH;
- }
- return customDash;
- }
-
- /** Set custom dash values */
- public void setCustomDash(int[] dash) {
- this.customDash = dash;
- }
-
- protected LineBorder shadowborder;
-
- public PapyrusNodeFigure() {
- super();
- createCompositeFigureStructure();
-
- shadowborder = new RectangularShadowBorder(3, getForegroundColor());
- setBorder(getBorderedFigure(), shadowborder);
- }
-
- /**
- * Create the composite structure of this figure, by adding it its necessary
- * children. Children should override and implement this method in case they
- * have a composite figure, to add children forming the overall structure.
- */
- protected void createCompositeFigureStructure() {
- // By default, do nothing : the figure is not composite
- }
-
- /**
- * Get the figure on which the border must be drawn. Children should
- * override and implement this method in case the border must not be drawn
- * on the overall figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
- *
- * @return the figure to draw the border on
- * @see #createCompositeFigureStructure()
- */
- protected IFigure getBorderedFigure() {
- // by default, border is drawn on the overall figure
- return this;
- }
-
- /**
- * Sets the border to the bordered figure. This method is not intended to be
- * overridden. Override {@link #getBorderedFigure()} instead.
- *
- * @param borderedFigure
- * the figure on which the border shall be drawn (or null for
- * this figure)
- * @param border
- * The new border
- * @see IFigure#setBorder(Border)
- */
- protected void setBorder(IFigure borderedFigure, Border border) {
- if(borderedFigure == null) {
- super.setBorder(border);
- } else {
- borderedFigure.setBorder(border);
- }
- }
-
- public boolean isShadow() {
- return shadow;
- }
-
- public void setShadow(boolean shadow) {
- this.shadow = shadow;
- if(shadow == true) {
- setBorder(getBorderedFigure(), shadowborder);
- } else {
- setBorder(getBorderedFigure(), getDefaultBorder(null));
- }
- }
-
- /**
- * Sets the border color.
- *
- * @param borderColor
- * the border color
- */
- public void setBorderColor(Color borderColor) {
- this.borderColor = borderColor;
- setBorder(getBorderedFigure(), getDefaultBorder(borderColor));
- }
-
- /**
- * Get the default non shadow border to use. Children can override and
- * implement this method if necessary, taking care not to fail if
- * borderColor is null
- *
- * @param borderColor
- * the color of the border to take if possible or null
- * @return a non shadow border
- */
- protected Border getDefaultBorder(Color borderColor) {
-
- // Default border is line border
- LineBorder lineBorder = null;
- if(borderColor != null) {
- lineBorder = new LineBorder(borderColor);
- } else {
- lineBorder = new LineBorder();
- }
-
- // Set border style and width
- lineBorder.setStyle(getLineStyle());
- lineBorder.setWidth(getLineWidth());
-
- return lineBorder;
- }
-
- /**
- * Gets the border color.
- *
- * @return the border color
- */
- public Color getBorderColor() {
- return this.borderColor;
- }
-
- /**
- * Paint figure.
- *
- * @param graphics
- * the graphics
- */
- @Override
- public void paintFigure(Graphics graphics) {
- super.paintFigure(graphics);
-
- paintBackground(graphics, getBounds());
-
- shadowborder.setColor(getForegroundColor());
-
- }
-
- /**
- * Paint the background of the figure. If this figure uses gradient, then it
- * will paint the background with the gradient informations. Otherwise it
- * will use the background color.
- *
- * @param graphics
- * the graphics
- * @param rectangle
- * the rectangle where the background needs to be fill.
- */
- protected void paintBackground(Graphics graphics, Rectangle rectangle) {
- if(isUsingGradient()) {
- applyTransparency(graphics);
- boolean isVertical = (getGradientStyle() == GradientStyle.VERTICAL) ? true : false;
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillGradient(rectangle, isVertical);
- } else {
- graphics.setBackgroundColor(getBackgroundColor());
- graphics.setForegroundColor(getForegroundColor());
- graphics.fillRectangle(rectangle);
- }
- }
-
- /**
- * <pre>
- * This figure manages the border representation with custom dashes.
- *
- * {@inheritDoc}
- * </pre>
- */
- @Override
- protected void paintBorder(Graphics graphics) {
-
- if(getLineStyle() == Graphics.LINE_CUSTOM) {
- graphics.setLineDash(getCustomDash());
- }
- super.paintBorder(graphics);
- }
-
- /**
- * <pre>
- * This method propagates the new line style to the border
- *
- * @see org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure#setLineStyle(int)
- * </pre>
- *
- * @param s
- * the new line style value
- */
- @Override
- public void setLineStyle(int s) {
- if((getBorder() != null) && (getBorder() instanceof LineBorder)) {
- ((LineBorder)getBorder()).setStyle(s);
- }
-
- super.setLineStyle(s);
- }
-
- /**
- * <pre>
- * This method propagates the new line width to the border
- *
- * @see org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure#setLineWidth(int)
- * </pre>
- *
- * @param w
- * the new line width value
- */
- @Override
- public void setLineWidth(int w) {
- if((getBorder() != null) && (getBorder() instanceof LineBorder)) {
- ((LineBorder)getBorder()).setWidth(w);
- }
-
- super.setLineWidth(w);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Atos Origin - Enable extending with a composite figure, by adding overrideable methods.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
+import org.eclipse.gmf.runtime.notation.GradientStyle;
+import org.eclipse.papyrus.infra.gmfdiag.common.figure.node.IPapyrusNodeFigure;
+import org.eclipse.swt.graphics.Color;
+
+/**
+ * Common node figure. In charge of background, font, gradient, foreground,
+ * border, shadow
+ */
+public class PapyrusNodeFigure extends NodeFigure implements IPapyrusNodeFigure {
+
+ /**
+ * The border color.
+ */
+ private Color borderColor = ColorConstants.black;
+
+ /**
+ * The shadow
+ */
+ private boolean shadow = true;
+
+ /** Default custom dash values */
+ public static final int[] DEFAULT_CUSTOM_DASH = { 5, 5 };
+
+ /** Table used to draw figure border as dashed line. */
+ protected int[] customDash = null;
+
+ /** Get custom dash values */
+ public int[] getCustomDash() {
+ if(customDash == null) {
+ // Initialize dash property for dashed border representation.
+ customDash = DEFAULT_CUSTOM_DASH;
+ }
+ return customDash;
+ }
+
+ /** Set custom dash values */
+ public void setCustomDash(int[] dash) {
+ this.customDash = dash;
+ }
+
+ protected LineBorder shadowborder;
+
+ public PapyrusNodeFigure() {
+ super();
+ createCompositeFigureStructure();
+
+ shadowborder = new RectangularShadowBorder(3, getForegroundColor());
+ setBorder(getBorderedFigure(), shadowborder);
+ }
+
+ /**
+ * Create the composite structure of this figure, by adding it its necessary
+ * children. Children should override and implement this method in case they
+ * have a composite figure, to add children forming the overall structure.
+ */
+ protected void createCompositeFigureStructure() {
+ // By default, do nothing : the figure is not composite
+ }
+
+ /**
+ * Get the figure on which the border must be drawn. Children should
+ * override and implement this method in case the border must not be drawn
+ * on the overall figure. The returned figure shall be created in the method {@link #createCompositeFigureStructure()}.
+ *
+ * @return the figure to draw the border on
+ * @see #createCompositeFigureStructure()
+ */
+ protected IFigure getBorderedFigure() {
+ // by default, border is drawn on the overall figure
+ return this;
+ }
+
+ /**
+ * Sets the border to the bordered figure. This method is not intended to be
+ * overridden. Override {@link #getBorderedFigure()} instead.
+ *
+ * @param borderedFigure
+ * the figure on which the border shall be drawn (or null for
+ * this figure)
+ * @param border
+ * The new border
+ * @see IFigure#setBorder(Border)
+ */
+ protected void setBorder(IFigure borderedFigure, Border border) {
+ if(borderedFigure == null) {
+ super.setBorder(border);
+ } else {
+ borderedFigure.setBorder(border);
+ }
+ }
+
+ public boolean isShadow() {
+ return shadow;
+ }
+
+ public void setShadow(boolean shadow) {
+ this.shadow = shadow;
+ if(shadow == true) {
+ setBorder(getBorderedFigure(), shadowborder);
+ } else {
+ setBorder(getBorderedFigure(), getDefaultBorder(null));
+ }
+ }
+
+ /**
+ * Sets the border color.
+ *
+ * @param borderColor
+ * the border color
+ */
+ public void setBorderColor(Color borderColor) {
+ this.borderColor = borderColor;
+ setBorder(getBorderedFigure(), getDefaultBorder(borderColor));
+ }
+
+ /**
+ * Get the default non shadow border to use. Children can override and
+ * implement this method if necessary, taking care not to fail if
+ * borderColor is null
+ *
+ * @param borderColor
+ * the color of the border to take if possible or null
+ * @return a non shadow border
+ */
+ protected Border getDefaultBorder(Color borderColor) {
+
+ // Default border is line border
+ LineBorder lineBorder = null;
+ if(borderColor != null) {
+ lineBorder = new LineBorder(borderColor);
+ } else {
+ lineBorder = new LineBorder();
+ }
+
+ // Set border style and width
+ lineBorder.setStyle(getLineStyle());
+ lineBorder.setWidth(getLineWidth());
+
+ return lineBorder;
+ }
+
+ /**
+ * Gets the border color.
+ *
+ * @return the border color
+ */
+ public Color getBorderColor() {
+ return this.borderColor;
+ }
+
+ /**
+ * Paint figure.
+ *
+ * @param graphics
+ * the graphics
+ */
+ @Override
+ public void paintFigure(Graphics graphics) {
+ super.paintFigure(graphics);
+
+ paintBackground(graphics, getBounds());
+
+ shadowborder.setColor(getForegroundColor());
+
+ }
+
+ /**
+ * Paint the background of the figure. If this figure uses gradient, then it
+ * will paint the background with the gradient informations. Otherwise it
+ * will use the background color.
+ *
+ * @param graphics
+ * the graphics
+ * @param rectangle
+ * the rectangle where the background needs to be fill.
+ */
+ protected void paintBackground(Graphics graphics, Rectangle rectangle) {
+ if(isUsingGradient()) {
+ applyTransparency(graphics);
+ boolean isVertical = (getGradientStyle() == GradientStyle.VERTICAL) ? true : false;
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillGradient(rectangle, isVertical);
+ } else {
+ graphics.setBackgroundColor(getBackgroundColor());
+ graphics.setForegroundColor(getForegroundColor());
+ graphics.fillRectangle(rectangle);
+ }
+ }
+
+ /**
+ * <pre>
+ * This figure manages the border representation with custom dashes.
+ *
+ * {@inheritDoc}
+ * </pre>
+ */
+ @Override
+ protected void paintBorder(Graphics graphics) {
+
+ if(getLineStyle() == Graphics.LINE_CUSTOM) {
+ graphics.setLineDash(getCustomDash());
+ }
+ super.paintBorder(graphics);
+ }
+
+ /**
+ * <pre>
+ * This method propagates the new line style to the border
+ *
+ * @see org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure#setLineStyle(int)
+ * </pre>
+ *
+ * @param s
+ * the new line style value
+ */
+ @Override
+ public void setLineStyle(int s) {
+ if((getBorder() != null) && (getBorder() instanceof LineBorder)) {
+ ((LineBorder)getBorder()).setStyle(s);
+ }
+
+ super.setLineStyle(s);
+ }
+
+ /**
+ * <pre>
+ * This method propagates the new line width to the border
+ *
+ * @see org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure#setLineWidth(int)
+ * </pre>
+ *
+ * @param w
+ * the new line width value
+ */
+ @Override
+ public void setLineWidth(int w) {
+ if((getBorder() != null) && (getBorder() instanceof LineBorder)) {
+ ((LineBorder)getBorder()).setWidth(w);
+ }
+
+ super.setLineWidth(w);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusReceiveNodeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusReceiveNodeFigure.java
index f516fbcc4fa..74e0420fa5c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusReceiveNodeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusReceiveNodeFigure.java
@@ -1,115 +1,115 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.AbstractBackground;
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.RoundedRectangleBorder;
-import org.eclipse.gmf.runtime.notation.GradientStyle;
-import org.eclipse.swt.graphics.Color;
-/**
- * this class is used to display a rounded rectangle with gradient and intherits
- * from the hierarchy of papyrus nodes
- *
- */
-
-public class PapyrusReceiveNodeFigure extends NodeNamedElementFigure {
-
- public PapyrusReceiveNodeFigure(){
- super();
- corner=15;
- this.shadowborder= new RoundedRectangleBorder(corner, corner);
- setBorder(this.shadowborder);
- }
- public int corner=15;
-
- @Override
- protected Border getDefaultBorder(Color borderColor) {
- return new RoundedRectangleBorder(corner, corner);
- }
- /**
- * Paint figure.
- *
- * @param graphics
- * the graphics
- */
- @Override
- public void paintFigure(Graphics graphics) {
- if (isOpaque() && getBorder() != null) {
- Rectangle tempRect = new Rectangle(getBounds());
- tempRect.crop(getBorder().getInsets(this));
- graphics.fillRoundRectangle(tempRect, corner, corner);
- return;
- }
- if (isOpaque())
- graphics.fillRoundRectangle(getBounds(), corner, corner);
-
- if (getBorder() instanceof AbstractBackground)
- ((AbstractBackground) getBorder()).paintBackground(this, graphics,
- NO_INSETS);
-
- paintBackground(graphics, getBounds());
-
- shadowborder.setColor(getForegroundColor());
-
- }
-
- protected void paintBackground(Graphics graphics, Rectangle rectangle) {
- if(isUsingGradient()) {
- applyTransparency(graphics);
- boolean isVertical = (getGradientStyle() == GradientStyle.VERTICAL) ? true : false;
- if(isVertical && rectangle.height>((3*corner)/2)){
- Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(rectangle.width,corner));
- Rectangle rect2= new Rectangle(rectangle.x,rectangle.y+rectangle.height-corner,rectangle.width,corner);;
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillRoundRectangle(rect1,corner,corner);
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.fillRoundRectangle(rect2,corner,corner);
-
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- Rectangle rect= new Rectangle(rectangle.x,rectangle.y+corner/2,rectangle.width,rectangle.height-corner);
- graphics.fillGradient(rect, true);
- }
- else if(!isVertical && rectangle.width>((3*corner)/2)){
- Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(corner,rectangle.height));
- Rectangle rect2= new Rectangle(rectangle.x+rectangle.width-corner,rectangle.y,corner,rectangle.height);
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillRoundRectangle(rect1,corner,corner);
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.fillRoundRectangle(rect2,corner,corner);
-
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- Rectangle rect= new Rectangle(rectangle.x+corner/2, rectangle.y,rectangle.width-corner,rectangle.height);
- graphics.fillGradient(rect, false);
- }
- else{
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillRoundRectangle(rectangle,corner,corner);
- }
- }
- else {
- graphics.setBackgroundColor(getBackgroundColor());
- graphics.setForegroundColor(getForegroundColor());
- graphics.fillRoundRectangle(rectangle,corner,corner);
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.AbstractBackground;
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.RoundedRectangleBorder;
+import org.eclipse.gmf.runtime.notation.GradientStyle;
+import org.eclipse.swt.graphics.Color;
+/**
+ * this class is used to display a rounded rectangle with gradient and intherits
+ * from the hierarchy of papyrus nodes
+ *
+ */
+
+public class PapyrusReceiveNodeFigure extends NodeNamedElementFigure {
+
+ public PapyrusReceiveNodeFigure(){
+ super();
+ corner=15;
+ this.shadowborder= new RoundedRectangleBorder(corner, corner);
+ setBorder(this.shadowborder);
+ }
+ public int corner=15;
+
+ @Override
+ protected Border getDefaultBorder(Color borderColor) {
+ return new RoundedRectangleBorder(corner, corner);
+ }
+ /**
+ * Paint figure.
+ *
+ * @param graphics
+ * the graphics
+ */
+ @Override
+ public void paintFigure(Graphics graphics) {
+ if (isOpaque() && getBorder() != null) {
+ Rectangle tempRect = new Rectangle(getBounds());
+ tempRect.crop(getBorder().getInsets(this));
+ graphics.fillRoundRectangle(tempRect, corner, corner);
+ return;
+ }
+ if (isOpaque())
+ graphics.fillRoundRectangle(getBounds(), corner, corner);
+
+ if (getBorder() instanceof AbstractBackground)
+ ((AbstractBackground) getBorder()).paintBackground(this, graphics,
+ NO_INSETS);
+
+ paintBackground(graphics, getBounds());
+
+ shadowborder.setColor(getForegroundColor());
+
+ }
+
+ protected void paintBackground(Graphics graphics, Rectangle rectangle) {
+ if(isUsingGradient()) {
+ applyTransparency(graphics);
+ boolean isVertical = (getGradientStyle() == GradientStyle.VERTICAL) ? true : false;
+ if(isVertical && rectangle.height>((3*corner)/2)){
+ Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(rectangle.width,corner));
+ Rectangle rect2= new Rectangle(rectangle.x,rectangle.y+rectangle.height-corner,rectangle.width,corner);;
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillRoundRectangle(rect1,corner,corner);
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.fillRoundRectangle(rect2,corner,corner);
+
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ Rectangle rect= new Rectangle(rectangle.x,rectangle.y+corner/2,rectangle.width,rectangle.height-corner);
+ graphics.fillGradient(rect, true);
+ }
+ else if(!isVertical && rectangle.width>((3*corner)/2)){
+ Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(corner,rectangle.height));
+ Rectangle rect2= new Rectangle(rectangle.x+rectangle.width-corner,rectangle.y,corner,rectangle.height);
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillRoundRectangle(rect1,corner,corner);
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.fillRoundRectangle(rect2,corner,corner);
+
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ Rectangle rect= new Rectangle(rectangle.x+corner/2, rectangle.y,rectangle.width-corner,rectangle.height);
+ graphics.fillGradient(rect, false);
+ }
+ else{
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillRoundRectangle(rectangle,corner,corner);
+ }
+ }
+ else {
+ graphics.setBackgroundColor(getBackgroundColor());
+ graphics.setForegroundColor(getForegroundColor());
+ graphics.fillRoundRectangle(rectangle,corner,corner);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusRoundedNodeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusRoundedNodeFigure.java
index 7d3e50a4e10..b356bd0edae 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusRoundedNodeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusRoundedNodeFigure.java
@@ -1,115 +1,115 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.AbstractBackground;
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.RoundedRectangleBorder;
-import org.eclipse.gmf.runtime.notation.GradientStyle;
-import org.eclipse.swt.graphics.Color;
-/**
- * this class is used to display a rounded rectangle with gradient and intherits
- * from the hierarchy of papyrus nodes
- *
- */
-
-public class PapyrusRoundedNodeFigure extends NodeNamedElementFigure {
-
- public PapyrusRoundedNodeFigure(){
- super();
- corner=15;
- this.shadowborder= new RoundedRectangleBorder(corner, corner);
- setBorder(this.shadowborder);
- }
- public int corner=15;
-
- @Override
- protected Border getDefaultBorder(Color borderColor) {
- return new RoundedRectangleBorder(corner, corner);
- }
- /**
- * Paint figure.
- *
- * @param graphics
- * the graphics
- */
- @Override
- public void paintFigure(Graphics graphics) {
- if (isOpaque() && getBorder() != null) {
- Rectangle tempRect = new Rectangle(getBounds());
- tempRect.crop(getBorder().getInsets(this));
- graphics.fillRoundRectangle(tempRect, corner, corner);
- return;
- }
- if (isOpaque())
- graphics.fillRoundRectangle(getBounds(), corner, corner);
-
- if (getBorder() instanceof AbstractBackground)
- ((AbstractBackground) getBorder()).paintBackground(this, graphics,
- NO_INSETS);
-
- paintBackground(graphics, getBounds());
-
- shadowborder.setColor(getForegroundColor());
-
- }
-
- protected void paintBackground(Graphics graphics, Rectangle rectangle) {
- if(isUsingGradient()) {
- applyTransparency(graphics);
- boolean isVertical = (getGradientStyle() == GradientStyle.VERTICAL) ? true : false;
- if(isVertical && rectangle.height>((3*corner)/2)){
- Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(rectangle.width,corner));
- Rectangle rect2= new Rectangle(rectangle.x,rectangle.y+rectangle.height-corner,rectangle.width,corner);;
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillRoundRectangle(rect1,corner,corner);
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.fillRoundRectangle(rect2,corner,corner);
-
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- Rectangle rect= new Rectangle(rectangle.x,rectangle.y+corner/2,rectangle.width,rectangle.height-corner);
- graphics.fillGradient(rect, true);
- }
- else if(!isVertical && rectangle.width>((3*corner)/2)){
- Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(corner,rectangle.height));
- Rectangle rect2= new Rectangle(rectangle.x+rectangle.width-corner,rectangle.y,corner,rectangle.height);
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillRoundRectangle(rect1,corner,corner);
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.fillRoundRectangle(rect2,corner,corner);
-
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- Rectangle rect= new Rectangle(rectangle.x+corner/2, rectangle.y,rectangle.width-corner,rectangle.height);
- graphics.fillGradient(rect, false);
- }
- else{
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillRoundRectangle(rectangle,corner,corner);
- }
- }
- else {
- graphics.setBackgroundColor(getBackgroundColor());
- graphics.setForegroundColor(getForegroundColor());
- graphics.fillRoundRectangle(rectangle,corner,corner);
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.AbstractBackground;
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.RoundedRectangleBorder;
+import org.eclipse.gmf.runtime.notation.GradientStyle;
+import org.eclipse.swt.graphics.Color;
+/**
+ * this class is used to display a rounded rectangle with gradient and intherits
+ * from the hierarchy of papyrus nodes
+ *
+ */
+
+public class PapyrusRoundedNodeFigure extends NodeNamedElementFigure {
+
+ public PapyrusRoundedNodeFigure(){
+ super();
+ corner=15;
+ this.shadowborder= new RoundedRectangleBorder(corner, corner);
+ setBorder(this.shadowborder);
+ }
+ public int corner=15;
+
+ @Override
+ protected Border getDefaultBorder(Color borderColor) {
+ return new RoundedRectangleBorder(corner, corner);
+ }
+ /**
+ * Paint figure.
+ *
+ * @param graphics
+ * the graphics
+ */
+ @Override
+ public void paintFigure(Graphics graphics) {
+ if (isOpaque() && getBorder() != null) {
+ Rectangle tempRect = new Rectangle(getBounds());
+ tempRect.crop(getBorder().getInsets(this));
+ graphics.fillRoundRectangle(tempRect, corner, corner);
+ return;
+ }
+ if (isOpaque())
+ graphics.fillRoundRectangle(getBounds(), corner, corner);
+
+ if (getBorder() instanceof AbstractBackground)
+ ((AbstractBackground) getBorder()).paintBackground(this, graphics,
+ NO_INSETS);
+
+ paintBackground(graphics, getBounds());
+
+ shadowborder.setColor(getForegroundColor());
+
+ }
+
+ protected void paintBackground(Graphics graphics, Rectangle rectangle) {
+ if(isUsingGradient()) {
+ applyTransparency(graphics);
+ boolean isVertical = (getGradientStyle() == GradientStyle.VERTICAL) ? true : false;
+ if(isVertical && rectangle.height>((3*corner)/2)){
+ Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(rectangle.width,corner));
+ Rectangle rect2= new Rectangle(rectangle.x,rectangle.y+rectangle.height-corner,rectangle.width,corner);;
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillRoundRectangle(rect1,corner,corner);
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.fillRoundRectangle(rect2,corner,corner);
+
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ Rectangle rect= new Rectangle(rectangle.x,rectangle.y+corner/2,rectangle.width,rectangle.height-corner);
+ graphics.fillGradient(rect, true);
+ }
+ else if(!isVertical && rectangle.width>((3*corner)/2)){
+ Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(corner,rectangle.height));
+ Rectangle rect2= new Rectangle(rectangle.x+rectangle.width-corner,rectangle.y,corner,rectangle.height);
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillRoundRectangle(rect1,corner,corner);
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.fillRoundRectangle(rect2,corner,corner);
+
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ Rectangle rect= new Rectangle(rectangle.x+corner/2, rectangle.y,rectangle.width-corner,rectangle.height);
+ graphics.fillGradient(rect, false);
+ }
+ else{
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillRoundRectangle(rectangle,corner,corner);
+ }
+ }
+ else {
+ graphics.setBackgroundColor(getBackgroundColor());
+ graphics.setForegroundColor(getForegroundColor());
+ graphics.fillRoundRectangle(rectangle,corner,corner);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeFigure.java
index 785efc4604b..95b299644a8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeFigure.java
@@ -1,97 +1,97 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.AbstractBackground;
-import org.eclipse.draw2d.Border;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.swt.graphics.Color;
-/**
- * this class is used to display a sendNodeFigure, the gradient can be only
- * horizontal
- *
- */
-
-public class PapyrusSendNodeFigure extends NodeNamedElementFigure {
-
- public PapyrusSendNodeFigure(){
- super();
- widthArrow=15;
- this.shadowborder=new PapyrusSendNodeShadowBorder(1, getBorderColor(),widthArrow);
- setBorder(this.shadowborder);
- }
- public int widthArrow=15;
-
- @Override
- protected Border getDefaultBorder(Color borderColor) {
- return new PapyrusSendNodeShadowBorder(1, borderColor,widthArrow);
- }
- /**
- * Paint figure.
- *
- * @param graphics
- * the graphics
- */
- @Override
- public void paintFigure(Graphics graphics) {
- if (isOpaque() && getBorder() != null) {
- Rectangle tempRect = new Rectangle(getBounds());
- tempRect.crop(getBorder().getInsets(this));
- graphics.fillRoundRectangle(tempRect, widthArrow, widthArrow);
- return;
- }
- if (isOpaque())
- graphics.fillRoundRectangle(getBounds(), widthArrow, widthArrow);
-
- if (getBorder() instanceof AbstractBackground)
- ((AbstractBackground) getBorder()).paintBackground(this, graphics,
- NO_INSETS);
-
- paintBackground(graphics, getBounds());
-
- shadowborder.setColor(getForegroundColor());
-
- }
-
- protected void paintBackground(Graphics graphics, Rectangle rectangle) {
- PointList ptList= new PointList();
- ptList.addPoint(getBounds().getLocation());
- ptList.addPoint(getBounds().x+getBounds().width-widthArrow, getBounds().y);
- ptList.addPoint(getBounds().x+getBounds().width, getBounds().y+(getBounds().height/2));
- ptList.addPoint(getBounds().x+getBounds().width-widthArrow, getBounds().y+(getBounds().height));
- ptList.addPoint(getBounds().getBottomLeft());
- if(isUsingGradient()) {
- applyTransparency(graphics);
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(getForegroundColor());
- graphics.fillPolygon(ptList);
-
- Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(getBounds().width-widthArrow,rectangle.height));
- graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
- graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
- graphics.fillGradient(rect1, false);
-
- }
- else{
- graphics.setBackgroundColor(getBackgroundColor());
- graphics.setForegroundColor(getForegroundColor());
- graphics.fillPolygon(ptList);
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.AbstractBackground;
+import org.eclipse.draw2d.Border;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.swt.graphics.Color;
+/**
+ * this class is used to display a sendNodeFigure, the gradient can be only
+ * horizontal
+ *
+ */
+
+public class PapyrusSendNodeFigure extends NodeNamedElementFigure {
+
+ public PapyrusSendNodeFigure(){
+ super();
+ widthArrow=15;
+ this.shadowborder=new PapyrusSendNodeShadowBorder(1, getBorderColor(),widthArrow);
+ setBorder(this.shadowborder);
+ }
+ public int widthArrow=15;
+
+ @Override
+ protected Border getDefaultBorder(Color borderColor) {
+ return new PapyrusSendNodeShadowBorder(1, borderColor,widthArrow);
+ }
+ /**
+ * Paint figure.
+ *
+ * @param graphics
+ * the graphics
+ */
+ @Override
+ public void paintFigure(Graphics graphics) {
+ if (isOpaque() && getBorder() != null) {
+ Rectangle tempRect = new Rectangle(getBounds());
+ tempRect.crop(getBorder().getInsets(this));
+ graphics.fillRoundRectangle(tempRect, widthArrow, widthArrow);
+ return;
+ }
+ if (isOpaque())
+ graphics.fillRoundRectangle(getBounds(), widthArrow, widthArrow);
+
+ if (getBorder() instanceof AbstractBackground)
+ ((AbstractBackground) getBorder()).paintBackground(this, graphics,
+ NO_INSETS);
+
+ paintBackground(graphics, getBounds());
+
+ shadowborder.setColor(getForegroundColor());
+
+ }
+
+ protected void paintBackground(Graphics graphics, Rectangle rectangle) {
+ PointList ptList= new PointList();
+ ptList.addPoint(getBounds().getLocation());
+ ptList.addPoint(getBounds().x+getBounds().width-widthArrow, getBounds().y);
+ ptList.addPoint(getBounds().x+getBounds().width, getBounds().y+(getBounds().height/2));
+ ptList.addPoint(getBounds().x+getBounds().width-widthArrow, getBounds().y+(getBounds().height));
+ ptList.addPoint(getBounds().getBottomLeft());
+ if(isUsingGradient()) {
+ applyTransparency(graphics);
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(getForegroundColor());
+ graphics.fillPolygon(ptList);
+
+ Rectangle rect1= new Rectangle(rectangle.getLocation(),new Dimension(getBounds().width-widthArrow,rectangle.height));
+ graphics.setBackgroundColor(FigureUtilities.integerToColor(getGradientColor1()));
+ graphics.setForegroundColor(FigureUtilities.integerToColor(getGradientColor2()));
+ graphics.fillGradient(rect1, false);
+
+ }
+ else{
+ graphics.setBackgroundColor(getBackgroundColor());
+ graphics.setForegroundColor(getForegroundColor());
+ graphics.fillPolygon(ptList);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeShadowBorder.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeShadowBorder.java
index 9e523b52645..78370451b29 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeShadowBorder.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusSendNodeShadowBorder.java
@@ -1,71 +1,71 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.swt.graphics.Color;
-
-public class PapyrusSendNodeShadowBorder extends RectangularShadowBorder {
-
- /** the width of the widthArrow */
- protected int widthArrow;
-
- /**
- * Creates an instance of this class with the given arc width and arc height
- * in pixels
- *
- * @param borderwidth
- * the width of the border line
- * @param color
- * the color or the line
- * @param arcWidth
- * the width of the corner arc
- * @param arcHeight
- * the height of the corner arc
- */
- public PapyrusSendNodeShadowBorder(int borderwidth, Color color, int corner) {
- super(borderwidth, color);
- this.widthArrow = corner;
- setWidth(1);
- }
-
- /**
- * @see org.eclipse.draw2d.Border#paint(IFigure, Graphics, Insets)
- */
- @Override
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- graphics.pushState();
- // draw the normal line border
- tempRect.setBounds(getPaintRectangle(figure, insets));
-
- PointList ptList= new PointList();
- ptList.addPoint(tempRect.getLocation());
- ptList.addPoint(tempRect.x+tempRect.width-widthArrow, tempRect.y);
- ptList.addPoint(tempRect.x+tempRect.width, tempRect.y+(tempRect.height/2));
- ptList.addPoint(tempRect.x+tempRect.width-widthArrow, tempRect.y+(tempRect.height));
- ptList.addPoint(tempRect.getBottomLeft());
- if(getColor() != null) {
- graphics.setBackgroundColor(getColor());
- } else {
- graphics.setBackgroundColor(ColorConstants.black);
- }
- graphics.drawPolygon(ptList);
- graphics.popState();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.swt.graphics.Color;
+
+public class PapyrusSendNodeShadowBorder extends RectangularShadowBorder {
+
+ /** the width of the widthArrow */
+ protected int widthArrow;
+
+ /**
+ * Creates an instance of this class with the given arc width and arc height
+ * in pixels
+ *
+ * @param borderwidth
+ * the width of the border line
+ * @param color
+ * the color or the line
+ * @param arcWidth
+ * the width of the corner arc
+ * @param arcHeight
+ * the height of the corner arc
+ */
+ public PapyrusSendNodeShadowBorder(int borderwidth, Color color, int corner) {
+ super(borderwidth, color);
+ this.widthArrow = corner;
+ setWidth(1);
+ }
+
+ /**
+ * @see org.eclipse.draw2d.Border#paint(IFigure, Graphics, Insets)
+ */
+ @Override
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ graphics.pushState();
+ // draw the normal line border
+ tempRect.setBounds(getPaintRectangle(figure, insets));
+
+ PointList ptList= new PointList();
+ ptList.addPoint(tempRect.getLocation());
+ ptList.addPoint(tempRect.x+tempRect.width-widthArrow, tempRect.y);
+ ptList.addPoint(tempRect.x+tempRect.width, tempRect.y+(tempRect.height/2));
+ ptList.addPoint(tempRect.x+tempRect.width-widthArrow, tempRect.y+(tempRect.height));
+ ptList.addPoint(tempRect.getBottomLeft());
+ if(getColor() != null) {
+ graphics.setBackgroundColor(getColor());
+ } else {
+ graphics.setBackgroundColor(ColorConstants.black);
+ }
+ graphics.drawPolygon(ptList);
+ graphics.popState();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java
index 3dc1f4beba2..29b7a390ef0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PapyrusWrappingLabel.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * 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
- * Arthur Daussy - Bug 354622 - [ActivityDiagram] Object Flows selection prevent selecting other close elements.
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-
-/**
- * This correct the bug where invisible label can be selected
- *
- * @author arthur daussy
- * @deprecated use org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel
- *
- */
-public class PapyrusWrappingLabel extends WrappingLabel {
-
- /**
- * Bug 354622 - [ActivityDiagram] Object Flows selection prevent selecting other close elements.
- * On this bug bug come from that invisible label return true containsPoint(int, int) even if there invisible
- *
- * This is a temporary fix until the real issue described in Bug 363362
- * (https://bugs.eclipse.org/bugs/show_bug.cgi?id=363362) is fixed by GMF.
- *
- * @see org.eclipse.draw2d.Figure#containsPoint(int, int)
- *
- * @param x
- * @param y
- * @return
- */
- @Override
- public boolean containsPoint(int x, int y) {
- if(isVisible()) {
- return super.containsPoint(x, y);
- }
- return false;
- }
-
-}
+/*****************************************************************************
+ * 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
+ * Arthur Daussy - Bug 354622 - [ActivityDiagram] Object Flows selection prevent selecting other close elements.
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * This correct the bug where invisible label can be selected
+ *
+ * @author arthur daussy
+ * @deprecated use org.eclipse.papyrus.infra.gmfdiag.common.figure.node.PapyrusWrappingLabel
+ *
+ */
+public class PapyrusWrappingLabel extends WrappingLabel {
+
+ /**
+ * Bug 354622 - [ActivityDiagram] Object Flows selection prevent selecting other close elements.
+ * On this bug bug come from that invisible label return true containsPoint(int, int) even if there invisible
+ *
+ * This is a temporary fix until the real issue described in Bug 363362
+ * (https://bugs.eclipse.org/bugs/show_bug.cgi?id=363362) is fixed by GMF.
+ *
+ * @see org.eclipse.draw2d.Figure#containsPoint(int, int)
+ *
+ * @param x
+ * @param y
+ * @return
+ */
+ @Override
+ public boolean containsPoint(int x, int y) {
+ if(isVisible()) {
+ return super.containsPoint(x, y);
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PrimitiveTypeFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PrimitiveTypeFigure.java
index 93425d9406d..1cbaac14f0b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PrimitiveTypeFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/PrimitiveTypeFigure.java
@@ -1,68 +1,68 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA List - initial API and implementation
- * Nizar GUEDIDI (CEA LIST) - Bug 345889 - [ClassDiagram] Compartment for properties and operations are not implemented yet for primitive type
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-
-/**
- * Represents a Primitive Type
- */
-public class PrimitiveTypeFigure extends CompartmentFigure {
-
- /** Attribute Compartment */
- private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment";
-
- /** Operation Compartment */
- private final static String OPERATION_COMPARTMENT = "operationCompartment";
-
- /** List of compartment */
- private final static List<String> COMPARTMENT = new ArrayList<String>() {
-
- private static final long serialVersionUID = -6373359195626265958L;
-
- {
- add(ATTRIBUTE_COMPARTMENT);
- add(OPERATION_COMPARTMENT);
- }
- };
-
- /**
- * Default Constructor
- */
- public PrimitiveTypeFigure() {
- super(COMPARTMENT, "PrimitiveType");
- }
-
- /**
- * Get the attribute's compartment figure
- *
- * @return
- */
- public IFigure getAttributeCompartmentFigure() {
- return getCompartment(ATTRIBUTE_COMPARTMENT);
- }
-
- /**
- * Get the operation's compartment figure
- *
- * @return
- */
- public IFigure getOperationCompartmentFigure() {
- return getCompartment(OPERATION_COMPARTMENT);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA List - initial API and implementation
+ * Nizar GUEDIDI (CEA LIST) - Bug 345889 - [ClassDiagram] Compartment for properties and operations are not implemented yet for primitive type
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+
+/**
+ * Represents a Primitive Type
+ */
+public class PrimitiveTypeFigure extends CompartmentFigure {
+
+ /** Attribute Compartment */
+ private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment";
+
+ /** Operation Compartment */
+ private final static String OPERATION_COMPARTMENT = "operationCompartment";
+
+ /** List of compartment */
+ private final static List<String> COMPARTMENT = new ArrayList<String>() {
+
+ private static final long serialVersionUID = -6373359195626265958L;
+
+ {
+ add(ATTRIBUTE_COMPARTMENT);
+ add(OPERATION_COMPARTMENT);
+ }
+ };
+
+ /**
+ * Default Constructor
+ */
+ public PrimitiveTypeFigure() {
+ super(COMPARTMENT, "PrimitiveType");
+ }
+
+ /**
+ * Get the attribute's compartment figure
+ *
+ * @return
+ */
+ public IFigure getAttributeCompartmentFigure() {
+ return getCompartment(ATTRIBUTE_COMPARTMENT);
+ }
+
+ /**
+ * Get the operation's compartment figure
+ *
+ * @return
+ */
+ public IFigure getOperationCompartmentFigure() {
+ return getCompartment(OPERATION_COMPARTMENT);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ProfileFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ProfileFigure.java
index a6f22e557ae..2adbf5f4b3a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ProfileFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ProfileFigure.java
@@ -1,29 +1,29 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-
-public class ProfileFigure extends PackageFigure {
-
- protected static final String PROFILE_TAG = "Profile"; //$NON-NLS-1$
-
- /**
- * Instantiates a new profile figure.
- */
- public ProfileFigure() {
- super();
- initTagLabel(PROFILE_TAG);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+
+public class ProfileFigure extends PackageFigure {
+
+ protected static final String PROFILE_TAG = "Profile"; //$NON-NLS-1$
+
+ /**
+ * Instantiates a new profile figure.
+ */
+ public ProfileFigure() {
+ super();
+ initTagLabel(PROFILE_TAG);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/QualifiedNameWrappingLabelFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/QualifiedNameWrappingLabelFigure.java
index ea9f23d43ee..90b0fa9bedc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/QualifiedNameWrappingLabelFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/QualifiedNameWrappingLabelFigure.java
@@ -1,106 +1,106 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Label;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This a WrappingLabel that can display applied stereotypes
- */
-public class QualifiedNameWrappingLabelFigure extends PapyrusWrappingLabel implements IPapyrusNodeNamedElementFigure {
-
- /** the depth of the qualified name **/
- private int depth = 0;
-
-
- public Label getStereotypesLabel() {
- return null;
- }
- /**
- * Calculate the partial qualified name with a specified depth.
- *
- * @param qualifiedName
- * the qualified name can return null
- */
- public String getQualifiedName(String qualifiedName, int depth) {
- int n = -1;
- if(qualifiedName == null) {
- return null;
- }
- int i = 0;
- if(depth <= 0) {
- return qualifiedName;
- }
-
- while(i < depth) {
- if((n = qualifiedName.indexOf("::", n + 1)) != -1) {
- i++;
- } else {
- return null;
- }
- }
-
- if(n == -1) {
- return qualifiedName;
- } else {
- return qualifiedName.substring(n + 2);
- }
-
- }
-
- public void setQualifiedName(String qualifiedName) {
- String tmpQualifiedName = getQualifiedName(qualifiedName, depth);
- // two raisons to remove label!
- // null
- // or the qualified name is equal to 1
- if(qualifiedName == null || tmpQualifiedName == null || !tmpQualifiedName.contains("::")) { // Remove
- setText("");
- setTextWrap(true);
- return;
- }
-
- // we have to not display name.
-
- int i = tmpQualifiedName.lastIndexOf("::");
- if(i != -1) {
- tmpQualifiedName = tmpQualifiedName.substring(0, i);
- }
- this.setText("(" + tmpQualifiedName.trim() + ")");
- setTextWrap(true);
-
- }
-
- /**
- * Sets the depth.
- *
- * @param depth
- * the new depth
- */
- public void setDepth(int depth) {
- this.depth = depth;
- }
-
- //unused Method
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {}
- public void setStereotypePropertiesInCompartment(String stereotypeProperties){}
- public Label getQualifiedNameLabel() {return null;}
- public Label getTaggedLabel() { return null;}
- public void setStereotypeDisplay(String stereotypes, Image image) {}
- public void setNameLabelIcon(boolean displayNameLabelIcon) {}
- public WrappingLabel getNameLabel() {return null;}
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Label;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This a WrappingLabel that can display applied stereotypes
+ */
+public class QualifiedNameWrappingLabelFigure extends PapyrusWrappingLabel implements IPapyrusNodeNamedElementFigure {
+
+ /** the depth of the qualified name **/
+ private int depth = 0;
+
+
+ public Label getStereotypesLabel() {
+ return null;
+ }
+ /**
+ * Calculate the partial qualified name with a specified depth.
+ *
+ * @param qualifiedName
+ * the qualified name can return null
+ */
+ public String getQualifiedName(String qualifiedName, int depth) {
+ int n = -1;
+ if(qualifiedName == null) {
+ return null;
+ }
+ int i = 0;
+ if(depth <= 0) {
+ return qualifiedName;
+ }
+
+ while(i < depth) {
+ if((n = qualifiedName.indexOf("::", n + 1)) != -1) {
+ i++;
+ } else {
+ return null;
+ }
+ }
+
+ if(n == -1) {
+ return qualifiedName;
+ } else {
+ return qualifiedName.substring(n + 2);
+ }
+
+ }
+
+ public void setQualifiedName(String qualifiedName) {
+ String tmpQualifiedName = getQualifiedName(qualifiedName, depth);
+ // two raisons to remove label!
+ // null
+ // or the qualified name is equal to 1
+ if(qualifiedName == null || tmpQualifiedName == null || !tmpQualifiedName.contains("::")) { // Remove
+ setText("");
+ setTextWrap(true);
+ return;
+ }
+
+ // we have to not display name.
+
+ int i = tmpQualifiedName.lastIndexOf("::");
+ if(i != -1) {
+ tmpQualifiedName = tmpQualifiedName.substring(0, i);
+ }
+ this.setText("(" + tmpQualifiedName.trim() + ")");
+ setTextWrap(true);
+
+ }
+
+ /**
+ * Sets the depth.
+ *
+ * @param depth
+ * the new depth
+ */
+ public void setDepth(int depth) {
+ this.depth = depth;
+ }
+
+ //unused Method
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {}
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties){}
+ public Label getQualifiedNameLabel() {return null;}
+ public Label getTaggedLabel() { return null;}
+ public void setStereotypeDisplay(String stereotypes, Image image) {}
+ public void setNameLabelIcon(boolean displayNameLabelIcon) {}
+ public WrappingLabel getNameLabel() {return null;}
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/RoundedRectangleDashedShadowBorder.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/RoundedRectangleDashedShadowBorder.java
index 6067afb78dd..4838b076ee7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/RoundedRectangleDashedShadowBorder.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/RoundedRectangleDashedShadowBorder.java
@@ -1,100 +1,100 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-
-public class RoundedRectangleDashedShadowBorder extends RectangularShadowBorder {
-
- /** the width of the rounded corner */
- protected int cornerWidth;
-
- /** the height of the rounded corner */
- protected int cornerHeight;
-
- /**
- * Creates an instance of this class with the given arc width and arc height
- * in pixels
- *
- * @param borderwidth
- * the width of the border line
- * @param color
- * the color or the line
- * @param arcWidth
- * the width of the corner arc
- * @param arcHeight
- * the height of the corner arc
- */
- public RoundedRectangleDashedShadowBorder(int borderwidth, Color color, int arcWidth, int arcHeight) {
- super(borderwidth, color);
- cornerWidth = arcWidth;
- cornerHeight = arcHeight;
- setWidth(1);
- }
-
- /**
- * @see org.eclipse.draw2d.Border#paint(IFigure, Graphics, Insets)
- */
- @Override
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- graphics.setLineStyle(SWT.LINE_DASH);
- graphics.pushState();
- // draw the normal line border
- tempRect.setBounds(getPaintRectangle(figure, insets));
-
- if(getWidth() % 2 == 1) {
- tempRect.width--;
- tempRect.height--;
- }
-
- tempRect.shrink(getWidth() / 2, getWidth() / 2);
- graphics.setLineWidth(getWidth());
- if(getColor() != null)
- graphics.setForegroundColor(getColor());
- graphics.drawRoundRectangle(tempRect, cornerWidth, cornerHeight);
-
- // draw the shadow
- // first expand the clip rectangle
- Rectangle newRect = new Rectangle(tempRect);
- newRect.width = newRect.width + borderwidth;
- newRect.height = newRect.height + borderwidth;
- graphics.setClip(newRect);
- // paint the shadow, a nice rectangular one with soft corners
- PointList plt = new PointList();
- plt.addPoint(tempRect.x + tempRect.width, tempRect.y + cornerHeight / 2);
- plt.addPoint(tempRect.x + tempRect.width, tempRect.y + tempRect.height - cornerHeight / 2);
- plt.addPoint(tempRect.x + tempRect.width - cornerWidth / 2, tempRect.y + tempRect.height);
- plt.addPoint(tempRect.x + cornerWidth / 2, tempRect.y + tempRect.height);
- plt.addPoint(tempRect.x + cornerWidth, tempRect.y + tempRect.height + borderwidth);
- plt.addPoint(tempRect.x + tempRect.width, tempRect.y + tempRect.height + borderwidth);
- plt.addPoint(tempRect.x + tempRect.width + borderwidth, tempRect.y + tempRect.height);
- plt.addPoint(tempRect.x + tempRect.width + borderwidth, tempRect.y + cornerHeight);
- plt.addPoint(tempRect.x + tempRect.width, tempRect.y + cornerHeight / 2);
- if(getColor() != null) {
- graphics.setBackgroundColor(getColor());
- } else {
- graphics.setBackgroundColor(ColorConstants.black);
- }
- graphics.fillPolygon(plt);
- graphics.popState();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+
+public class RoundedRectangleDashedShadowBorder extends RectangularShadowBorder {
+
+ /** the width of the rounded corner */
+ protected int cornerWidth;
+
+ /** the height of the rounded corner */
+ protected int cornerHeight;
+
+ /**
+ * Creates an instance of this class with the given arc width and arc height
+ * in pixels
+ *
+ * @param borderwidth
+ * the width of the border line
+ * @param color
+ * the color or the line
+ * @param arcWidth
+ * the width of the corner arc
+ * @param arcHeight
+ * the height of the corner arc
+ */
+ public RoundedRectangleDashedShadowBorder(int borderwidth, Color color, int arcWidth, int arcHeight) {
+ super(borderwidth, color);
+ cornerWidth = arcWidth;
+ cornerHeight = arcHeight;
+ setWidth(1);
+ }
+
+ /**
+ * @see org.eclipse.draw2d.Border#paint(IFigure, Graphics, Insets)
+ */
+ @Override
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ graphics.setLineStyle(SWT.LINE_DASH);
+ graphics.pushState();
+ // draw the normal line border
+ tempRect.setBounds(getPaintRectangle(figure, insets));
+
+ if(getWidth() % 2 == 1) {
+ tempRect.width--;
+ tempRect.height--;
+ }
+
+ tempRect.shrink(getWidth() / 2, getWidth() / 2);
+ graphics.setLineWidth(getWidth());
+ if(getColor() != null)
+ graphics.setForegroundColor(getColor());
+ graphics.drawRoundRectangle(tempRect, cornerWidth, cornerHeight);
+
+ // draw the shadow
+ // first expand the clip rectangle
+ Rectangle newRect = new Rectangle(tempRect);
+ newRect.width = newRect.width + borderwidth;
+ newRect.height = newRect.height + borderwidth;
+ graphics.setClip(newRect);
+ // paint the shadow, a nice rectangular one with soft corners
+ PointList plt = new PointList();
+ plt.addPoint(tempRect.x + tempRect.width, tempRect.y + cornerHeight / 2);
+ plt.addPoint(tempRect.x + tempRect.width, tempRect.y + tempRect.height - cornerHeight / 2);
+ plt.addPoint(tempRect.x + tempRect.width - cornerWidth / 2, tempRect.y + tempRect.height);
+ plt.addPoint(tempRect.x + cornerWidth / 2, tempRect.y + tempRect.height);
+ plt.addPoint(tempRect.x + cornerWidth, tempRect.y + tempRect.height + borderwidth);
+ plt.addPoint(tempRect.x + tempRect.width, tempRect.y + tempRect.height + borderwidth);
+ plt.addPoint(tempRect.x + tempRect.width + borderwidth, tempRect.y + tempRect.height);
+ plt.addPoint(tempRect.x + tempRect.width + borderwidth, tempRect.y + cornerHeight);
+ plt.addPoint(tempRect.x + tempRect.width, tempRect.y + cornerHeight / 2);
+ if(getColor() != null) {
+ graphics.setBackgroundColor(getColor());
+ } else {
+ graphics.setBackgroundColor(ColorConstants.black);
+ }
+ graphics.fillPolygon(plt);
+ graphics.popState();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ShapeNamedElementFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ShapeNamedElementFigure.java
index 7f805439083..dbb24b5c70e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ShapeNamedElementFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/ShapeNamedElementFigure.java
@@ -1,299 +1,299 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.StringTokenizer;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.draw2d.ui.render.factory.RenderedImageFactory;
-import org.eclipse.gmf.runtime.draw2d.ui.render.figures.ScalableImageFigure;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.figure.layout.PropertiesCompartmentLayoutManager;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-
-public class ShapeNamedElementFigure extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure {
-
- public class ShapeLayoutManager extends AbstractLayout {
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
-
- int minimumWith = 50;
- int minimumHeight = 50;
-
- return new Dimension(minimumWith, minimumHeight);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public void layout(IFigure container) {
- Rectangle imageBound = new Rectangle(container.getBounds());
- Rectangle compartmentBound = new Rectangle(container.getBounds());
-
- if(stereotypePropertiesContent != null && stereotypePropertiesContent.getChildren().size() > 0) {
- Dimension dim = stereotypePropertiesContent.getPreferredSize();
- imageBound.height = imageBound.height - dim.height;
- compartmentBound.y = compartmentBound.y + compartmentBound.height - dim.height;
- compartmentBound.height = dim.height;
- stereotypePropertiesContent.setBounds(compartmentBound);
- }
-
- if(stereotypePropertiesBrace != null && stereotypePropertiesBrace.getChildren().size() > 0) {
- Dimension dim = stereotypePropertiesBrace.getPreferredSize();
- imageBound.height = imageBound.height - dim.height;
- compartmentBound.y = compartmentBound.y + compartmentBound.height - dim.height;
- compartmentBound.height = dim.height;
- stereotypePropertiesBrace.setBounds(compartmentBound);
- }
- if(scalableImageFigure != null) {
- scalableImageFigure.setBounds(imageBound);
- } else if(originalimage != null) {
-
- label.setBounds(imageBound);
- String key = "icon" + this.hashCode();
- ImageData imdata = null;
- imdata = (ImageData)originalimage.getImageData().scaledTo(imageBound.width, imageBound.height).clone();
- Image imm = Activator.getDefault().getImageRegistry().get(key);
-
- // no image in the registry
- if(imm == null) {
- Activator.getDefault().getImageRegistry().put(key, ImageDescriptor.createFromImageData(imdata));
- imm = Activator.getDefault().getImageRegistry().get(key);
- }
- // there is an image but we would like replace it by our new
- // image
- else {
- // imm.dispose();
- Activator.getDefault().getImageRegistry().remove(key);
- Activator.getDefault().getImageRegistry().put(key, ImageDescriptor.createFromImageData(imdata));
- imm = Activator.getDefault().getImageRegistry().get(key);
- }
- // in the case where the image was not disposed
- if(adaptedImage != null) {
- adaptedImage.dispose();
- adaptedImage = null;
- }
- // set new image
- adaptedImage = imm;
- label.setIcon(adaptedImage);
- }
-
- }
- }
-
- protected Label label = null;
-
- /**
- *
- */
-
- protected String name = "";
-
- protected ScalableImageFigure scalableImageFigure = null;
-
- /**
- * Added for stereptypes properties
- */
- private RectangleFigure stereotypePropertiesContent;
-
- /**
- * Added for stereptypes properties
- */
- private RectangleFigure stereotypePropertiesBrace;
-
- /**
- *
- */
- protected Image originalimage;
-
- /**
- *
- */
- protected Image adaptedImage;
-
- /**
- *
- */
- protected int numerNode;
-
- /**
- * create an icon figure.
- *
- * @param numberNode
- * is used to spcify a unique identfier tha t is associated to
- * the image thanks to the graphNode.hashCode()
- * @param image
- * the image (GIF) that we want to see
- */
- public ShapeNamedElementFigure(Image image) {
- super();
-
- this.originalimage = image;
- label = new Label("");
- label.setIconAlignment(PositionConstants.CENTER);
- label.setTextAlignment(PositionConstants.CENTER);
- label.setIconTextGap(2);
- this.add(label);
- // the image can be null, if we display a SVG file
- if(image != null) {
- label.setIcon(image);
- }
- this.setLayoutManager(new ShapeLayoutManager());
-
- }
-
- public ShapeNamedElementFigure() {
- this(null);
- }
-
- /**
- * display image from a svg file
- *
- * @param path
- * of the svg file
- * @throws MalformedURLException
- */
- public void setIcon(String path) throws MalformedURLException {
- this.originalimage = null;
- URL url = new URL(path);//$NON-NLS-1$
- scalableImageFigure = new ScalableImageFigure(RenderedImageFactory.getInstance(url), true, true, true);
- this.add(scalableImageFigure);
- }
-
- /**
- * display icon from an image
- *
- * @param image
- */
- public void setIcon(Image image) {
- if(scalableImageFigure != null) {
- this.remove(scalableImageFigure);
- scalableImageFigure = null;
- }
- this.originalimage = image;
- label.setIcon(originalimage);
- }
-
- public void setStereotypeDisplay(String stereotypes, Image image) {
- // do nothing
-
- }
-
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if(stereotypeProperties == null) {
- // remove figure of stereotype properties compartment
- if(this.stereotypePropertiesBrace != null) {
- this.remove(this.stereotypePropertiesBrace);
- this.stereotypePropertiesBrace = null;
- }
- return;
- }
-
- // set stereotype properties content
- if(stereotypePropertiesBrace == null) {
- this.createStereotypePropertiesBrace();
- }
-
- fillStereotypePropertiesInBrace(stereotypeProperties);
- }
-
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- if(stereotypeProperties == null) {
- // remove figure of stereotype properties compartment
- if(this.stereotypePropertiesContent != null) {
- this.remove(this.stereotypePropertiesContent);
- this.stereotypePropertiesContent = null;
- }
- return;
- }
-
- // set stereotype properties content
- if(stereotypePropertiesContent == null) {
- this.createStereotypePropertiesContent();
- }
-
- fillStereotypePropertiesInCompartment(stereotypeProperties);
-
- }
-
- public Label getStereotypesLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- private void fillStereotypePropertiesInCompartment(String stereotypeProperties) {
-
- stereotypePropertiesContent.getChildren().clear();
- StringTokenizer stringTokenizer = new StringTokenizer(stereotypeProperties, ";");
- while(stringTokenizer.hasMoreElements()) {
- String tokenStereotype = stringTokenizer.nextToken();
- tokenStereotype = tokenStereotype.replace("#", "\n ");
- tokenStereotype = tokenStereotype.replace("|", "\n ");
- Label label = new Label(tokenStereotype);
- label.setLabelAlignment(PositionConstants.LEFT);
- label.setBorder(null);
- stereotypePropertiesContent.add(label);
- }
-
- }
-
- private void fillStereotypePropertiesInBrace(String stereotypeProperties) {
- stereotypePropertiesBrace.getChildren().clear();
- Label label = new Label("{" + stereotypeProperties + "}");
- label.setLabelAlignment(PositionConstants.CENTER);
- label.setBorder(null);
- stereotypePropertiesBrace.add(label);
-
- }
-
- protected int getStereotypePropertiesCompartmentPosition() {
-
- return 1;
- }
-
- protected void createStereotypePropertiesContent() {
- stereotypePropertiesContent = new StereotypePropertiesCompartment();
- stereotypePropertiesContent.setFill(false);
- stereotypePropertiesContent.setLineWidth(0);
- stereotypePropertiesContent.setBorder(null);
- stereotypePropertiesContent.setLayoutManager(new PropertiesCompartmentLayoutManager());
- this.add(stereotypePropertiesContent, getStereotypePropertiesCompartmentPosition());
- }
-
- protected void createStereotypePropertiesBrace() {
- stereotypePropertiesBrace = new StereotypePropertiesCompartment();
- stereotypePropertiesBrace.setFill(false);
- stereotypePropertiesBrace.setLineWidth(0);
- stereotypePropertiesBrace.setBorder(null);
- stereotypePropertiesBrace.setLayoutManager(new PropertiesCompartmentLayoutManager());
- this.add(stereotypePropertiesBrace, getStereotypePropertiesCompartmentPosition());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.StringTokenizer;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.draw2d.ui.render.factory.RenderedImageFactory;
+import org.eclipse.gmf.runtime.draw2d.ui.render.figures.ScalableImageFigure;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.figure.layout.PropertiesCompartmentLayoutManager;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+
+public class ShapeNamedElementFigure extends PapyrusNodeFigure implements IPapyrusNodeUMLElementFigure {
+
+ public class ShapeLayoutManager extends AbstractLayout {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ protected Dimension calculatePreferredSize(IFigure container, int hint, int hint2) {
+
+ int minimumWith = 50;
+ int minimumHeight = 50;
+
+ return new Dimension(minimumWith, minimumHeight);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void layout(IFigure container) {
+ Rectangle imageBound = new Rectangle(container.getBounds());
+ Rectangle compartmentBound = new Rectangle(container.getBounds());
+
+ if(stereotypePropertiesContent != null && stereotypePropertiesContent.getChildren().size() > 0) {
+ Dimension dim = stereotypePropertiesContent.getPreferredSize();
+ imageBound.height = imageBound.height - dim.height;
+ compartmentBound.y = compartmentBound.y + compartmentBound.height - dim.height;
+ compartmentBound.height = dim.height;
+ stereotypePropertiesContent.setBounds(compartmentBound);
+ }
+
+ if(stereotypePropertiesBrace != null && stereotypePropertiesBrace.getChildren().size() > 0) {
+ Dimension dim = stereotypePropertiesBrace.getPreferredSize();
+ imageBound.height = imageBound.height - dim.height;
+ compartmentBound.y = compartmentBound.y + compartmentBound.height - dim.height;
+ compartmentBound.height = dim.height;
+ stereotypePropertiesBrace.setBounds(compartmentBound);
+ }
+ if(scalableImageFigure != null) {
+ scalableImageFigure.setBounds(imageBound);
+ } else if(originalimage != null) {
+
+ label.setBounds(imageBound);
+ String key = "icon" + this.hashCode();
+ ImageData imdata = null;
+ imdata = (ImageData)originalimage.getImageData().scaledTo(imageBound.width, imageBound.height).clone();
+ Image imm = Activator.getDefault().getImageRegistry().get(key);
+
+ // no image in the registry
+ if(imm == null) {
+ Activator.getDefault().getImageRegistry().put(key, ImageDescriptor.createFromImageData(imdata));
+ imm = Activator.getDefault().getImageRegistry().get(key);
+ }
+ // there is an image but we would like replace it by our new
+ // image
+ else {
+ // imm.dispose();
+ Activator.getDefault().getImageRegistry().remove(key);
+ Activator.getDefault().getImageRegistry().put(key, ImageDescriptor.createFromImageData(imdata));
+ imm = Activator.getDefault().getImageRegistry().get(key);
+ }
+ // in the case where the image was not disposed
+ if(adaptedImage != null) {
+ adaptedImage.dispose();
+ adaptedImage = null;
+ }
+ // set new image
+ adaptedImage = imm;
+ label.setIcon(adaptedImage);
+ }
+
+ }
+ }
+
+ protected Label label = null;
+
+ /**
+ *
+ */
+
+ protected String name = "";
+
+ protected ScalableImageFigure scalableImageFigure = null;
+
+ /**
+ * Added for stereptypes properties
+ */
+ private RectangleFigure stereotypePropertiesContent;
+
+ /**
+ * Added for stereptypes properties
+ */
+ private RectangleFigure stereotypePropertiesBrace;
+
+ /**
+ *
+ */
+ protected Image originalimage;
+
+ /**
+ *
+ */
+ protected Image adaptedImage;
+
+ /**
+ *
+ */
+ protected int numerNode;
+
+ /**
+ * create an icon figure.
+ *
+ * @param numberNode
+ * is used to spcify a unique identfier tha t is associated to
+ * the image thanks to the graphNode.hashCode()
+ * @param image
+ * the image (GIF) that we want to see
+ */
+ public ShapeNamedElementFigure(Image image) {
+ super();
+
+ this.originalimage = image;
+ label = new Label("");
+ label.setIconAlignment(PositionConstants.CENTER);
+ label.setTextAlignment(PositionConstants.CENTER);
+ label.setIconTextGap(2);
+ this.add(label);
+ // the image can be null, if we display a SVG file
+ if(image != null) {
+ label.setIcon(image);
+ }
+ this.setLayoutManager(new ShapeLayoutManager());
+
+ }
+
+ public ShapeNamedElementFigure() {
+ this(null);
+ }
+
+ /**
+ * display image from a svg file
+ *
+ * @param path
+ * of the svg file
+ * @throws MalformedURLException
+ */
+ public void setIcon(String path) throws MalformedURLException {
+ this.originalimage = null;
+ URL url = new URL(path);//$NON-NLS-1$
+ scalableImageFigure = new ScalableImageFigure(RenderedImageFactory.getInstance(url), true, true, true);
+ this.add(scalableImageFigure);
+ }
+
+ /**
+ * display icon from an image
+ *
+ * @param image
+ */
+ public void setIcon(Image image) {
+ if(scalableImageFigure != null) {
+ this.remove(scalableImageFigure);
+ scalableImageFigure = null;
+ }
+ this.originalimage = image;
+ label.setIcon(originalimage);
+ }
+
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ // do nothing
+
+ }
+
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ if(stereotypeProperties == null) {
+ // remove figure of stereotype properties compartment
+ if(this.stereotypePropertiesBrace != null) {
+ this.remove(this.stereotypePropertiesBrace);
+ this.stereotypePropertiesBrace = null;
+ }
+ return;
+ }
+
+ // set stereotype properties content
+ if(stereotypePropertiesBrace == null) {
+ this.createStereotypePropertiesBrace();
+ }
+
+ fillStereotypePropertiesInBrace(stereotypeProperties);
+ }
+
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ if(stereotypeProperties == null) {
+ // remove figure of stereotype properties compartment
+ if(this.stereotypePropertiesContent != null) {
+ this.remove(this.stereotypePropertiesContent);
+ this.stereotypePropertiesContent = null;
+ }
+ return;
+ }
+
+ // set stereotype properties content
+ if(stereotypePropertiesContent == null) {
+ this.createStereotypePropertiesContent();
+ }
+
+ fillStereotypePropertiesInCompartment(stereotypeProperties);
+
+ }
+
+ public Label getStereotypesLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ private void fillStereotypePropertiesInCompartment(String stereotypeProperties) {
+
+ stereotypePropertiesContent.getChildren().clear();
+ StringTokenizer stringTokenizer = new StringTokenizer(stereotypeProperties, ";");
+ while(stringTokenizer.hasMoreElements()) {
+ String tokenStereotype = stringTokenizer.nextToken();
+ tokenStereotype = tokenStereotype.replace("#", "\n ");
+ tokenStereotype = tokenStereotype.replace("|", "\n ");
+ Label label = new Label(tokenStereotype);
+ label.setLabelAlignment(PositionConstants.LEFT);
+ label.setBorder(null);
+ stereotypePropertiesContent.add(label);
+ }
+
+ }
+
+ private void fillStereotypePropertiesInBrace(String stereotypeProperties) {
+ stereotypePropertiesBrace.getChildren().clear();
+ Label label = new Label("{" + stereotypeProperties + "}");
+ label.setLabelAlignment(PositionConstants.CENTER);
+ label.setBorder(null);
+ stereotypePropertiesBrace.add(label);
+
+ }
+
+ protected int getStereotypePropertiesCompartmentPosition() {
+
+ return 1;
+ }
+
+ protected void createStereotypePropertiesContent() {
+ stereotypePropertiesContent = new StereotypePropertiesCompartment();
+ stereotypePropertiesContent.setFill(false);
+ stereotypePropertiesContent.setLineWidth(0);
+ stereotypePropertiesContent.setBorder(null);
+ stereotypePropertiesContent.setLayoutManager(new PropertiesCompartmentLayoutManager());
+ this.add(stereotypePropertiesContent, getStereotypePropertiesCompartmentPosition());
+ }
+
+ protected void createStereotypePropertiesBrace() {
+ stereotypePropertiesBrace = new StereotypePropertiesCompartment();
+ stereotypePropertiesBrace.setFill(false);
+ stereotypePropertiesBrace.setLineWidth(0);
+ stereotypePropertiesBrace.setBorder(null);
+ stereotypePropertiesBrace.setLayoutManager(new PropertiesCompartmentLayoutManager());
+ this.add(stereotypePropertiesBrace, getStereotypePropertiesCompartmentPosition());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SignalFigure.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SignalFigure.java
index 4bb1f9e73d0..b8ac3d8356e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SignalFigure.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SignalFigure.java
@@ -1,57 +1,57 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-
-/**
- * Represents a signal.
- */
-public class SignalFigure extends CompartmentFigure {
-
- /** Attribute Compartment */
- private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment";
-
- /** List of compartment */
- private final static List<String> COMPARTMENT = new ArrayList<String>() {
-
- /**
- *
- */
- private static final long serialVersionUID = 4239966810860044927L;
-
- {
- add(ATTRIBUTE_COMPARTMENT);
- }
- };
-
- /**
- * Default Constructor
- */
- public SignalFigure() {
- super(COMPARTMENT, "Signal");
- }
-
- /**
- * Get the attribute's compartment figure
- *
- * @return
- */
- public IFigure getAttributeCompartmentFigure() {
- return getCompartment(ATTRIBUTE_COMPARTMENT);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+
+/**
+ * Represents a signal.
+ */
+public class SignalFigure extends CompartmentFigure {
+
+ /** Attribute Compartment */
+ private final static String ATTRIBUTE_COMPARTMENT = "attributeCompartment";
+
+ /** List of compartment */
+ private final static List<String> COMPARTMENT = new ArrayList<String>() {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 4239966810860044927L;
+
+ {
+ add(ATTRIBUTE_COMPARTMENT);
+ }
+ };
+
+ /**
+ * Default Constructor
+ */
+ public SignalFigure() {
+ super(COMPARTMENT, "Signal");
+ }
+
+ /**
+ * Get the attribute's compartment figure
+ *
+ * @return
+ */
+ public IFigure getAttributeCompartmentFigure() {
+ return getCompartment(ATTRIBUTE_COMPARTMENT);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/StereotypePropertiesCompartment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/StereotypePropertiesCompartment.java
index f0e54af3927..05ac8dd9aa8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/StereotypePropertiesCompartment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/StereotypePropertiesCompartment.java
@@ -1,74 +1,74 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-
-/**
- * Figure for the display of the properties of stereotypes
- */
-public class StereotypePropertiesCompartment extends RectangleFigure {
-
- protected boolean upperLine = true;
-
- public Dimension getPreferredSize(int wHint, int hHint) {
- //the calculus of the prefered size is contextual
- prefSize=null;
- return super.getPreferredSize(wHint,hHint);
- }
-
- /**
- * {@inheritDoc}
- */
- public void paint(Graphics graphics) {
- paintChildren(graphics);
- IFigure parentFigure = getParent();
- if(parentFigure instanceof PapyrusNodeFigure) {
- graphics.setForegroundColor(((PapyrusNodeFigure)parentFigure).getBorderColor());
- graphics.setBackgroundColor(((PapyrusNodeFigure)parentFigure).getBorderColor());
- }
- if(upperLine) {
- for(int i = 0; i < getChildren().size(); i++) {
- Point source = new Point(parentFigure.getBounds().x, ((IFigure)getChildren().get(i)).getBounds().getTopLeft().y);
- Point target = null;
- if(parentFigure instanceof PackageFigure) {
- target = new Point(((PackageFigure)(parentFigure)).getHeader().x + ((PackageFigure)(parentFigure)).getHeader().width, ((IFigure)getChildren().get(i)).getBounds().getTopRight().y);
-
- } else {
- target = new Point(parentFigure.getBounds().x + parentFigure.getBounds().width, ((IFigure)getChildren().get(i)).getBounds().getTopRight().y);
- }
- // graphics.setForegroundColor(ColorConstants.black);
- graphics.setLineWidth(1);
- if(!( parentFigure instanceof IEllipseFigure)){
- graphics.drawLine(source, target);
- }
- }
- }
- }
-
- /**
- * used to display or not line upper the compartment stereotype
- *
- * @param upperLine
- * true if we want to display
- */
- public void setUpperLine(boolean upperLine) {
- this.upperLine = upperLine;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+
+/**
+ * Figure for the display of the properties of stereotypes
+ */
+public class StereotypePropertiesCompartment extends RectangleFigure {
+
+ protected boolean upperLine = true;
+
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ //the calculus of the prefered size is contextual
+ prefSize=null;
+ return super.getPreferredSize(wHint,hHint);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void paint(Graphics graphics) {
+ paintChildren(graphics);
+ IFigure parentFigure = getParent();
+ if(parentFigure instanceof PapyrusNodeFigure) {
+ graphics.setForegroundColor(((PapyrusNodeFigure)parentFigure).getBorderColor());
+ graphics.setBackgroundColor(((PapyrusNodeFigure)parentFigure).getBorderColor());
+ }
+ if(upperLine) {
+ for(int i = 0; i < getChildren().size(); i++) {
+ Point source = new Point(parentFigure.getBounds().x, ((IFigure)getChildren().get(i)).getBounds().getTopLeft().y);
+ Point target = null;
+ if(parentFigure instanceof PackageFigure) {
+ target = new Point(((PackageFigure)(parentFigure)).getHeader().x + ((PackageFigure)(parentFigure)).getHeader().width, ((IFigure)getChildren().get(i)).getBounds().getTopRight().y);
+
+ } else {
+ target = new Point(parentFigure.getBounds().x + parentFigure.getBounds().width, ((IFigure)getChildren().get(i)).getBounds().getTopRight().y);
+ }
+ // graphics.setForegroundColor(ColorConstants.black);
+ graphics.setLineWidth(1);
+ if(!( parentFigure instanceof IEllipseFigure)){
+ graphics.drawLine(source, target);
+ }
+ }
+ }
+ }
+
+ /**
+ * used to display or not line upper the compartment stereotype
+ *
+ * @param upperLine
+ * true if we want to display
+ */
+ public void setUpperLine(boolean upperLine) {
+ this.upperLine = upperLine;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SubCompartmentLayoutManager.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SubCompartmentLayoutManager.java
index 857fb45b7d6..4f4f38a03df 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SubCompartmentLayoutManager.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/figure/node/SubCompartmentLayoutManager.java
@@ -1,113 +1,113 @@
-/****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.figure.node;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-
-/**
- * this is the layout manager in charge to place element in compartment element
- *
- */
-
-public class SubCompartmentLayoutManager extends AbstractLayout {
-
- protected final static int MINIMUMCOMPARTMENTSIZE = 15;
-
- protected final static int MINIMUM_COMPARTMENT_WIDTH = 20;
-
- protected int preferedHeight = MINIMUMCOMPARTMENTSIZE;
-
- @Override
- protected Dimension calculatePreferredSize(IFigure figure, int wHint, int hHint) {
- Dimension dim = new Dimension(10, preferedHeight);
- if(!figure.getChildren().isEmpty()) {
- Object compartment = figure.getChildren().get(0);
- if(compartment instanceof ResizableCompartmentFigure) {
- Dimension compartmentPreferredSize = ((ResizableCompartmentFigure)compartment).getPreferredSize();
- dim.height = compartmentPreferredSize.height + 10;
- if(dim.height == 0) {
- dim.height = 20;
- }
- dim.width = compartmentPreferredSize.width;
- }
- }
- return dim;
- }
-
- @Override
- public Dimension getMinimumSize(IFigure container, int wHint, int hHint) {
- return new Dimension(MINIMUM_COMPARTMENT_WIDTH, MINIMUMCOMPARTMENTSIZE);
- }
-
- public void layout(IFigure container) {
- for(int i = 0; i < container.getChildren().size(); i++) {
- IFigure child = ((IFigure)container.getChildren().get(i));
- Rectangle bound = new Rectangle(child.getBounds());
- bound.setSize(getPreferedSize(child));
- bound.x = container.getBounds().x;
- bound.width = container.getBounds().width;
- if(i > 0) {
- bound.y = ((IFigure)container.getChildren().get(i - 1)).getBounds().getBottomLeft().y + 1;
- } else {
- bound.y = container.getBounds().y;
- }
- child.setBounds(bound);
- }
- // container
- int containersize = container.getChildren().size();
- if(containersize > 0) {
- IFigure lastChild = (IFigure)container.getChildren().get(containersize - 1);
- Rectangle lastRectangle = lastChild.getBounds();
- lastRectangle.height = container.getBounds().y + container.getBounds().height - lastRectangle.y;
- lastRectangle.width = container.getBounds().width;
- lastChild.setBounds(lastRectangle);
- }
- }
-
- public Dimension getPreferedSize(IFigure figure) {
- Dimension dim = new Dimension(10, preferedHeight);
- if(figure.getChildren().size() > 0) {
- if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) {
- dim.height = ((ResizableCompartmentFigure)figure.getChildren().get(0)).getPreferredSize().height + 10;
- if(dim.height == 0) {
- dim.height = 20;
- }
-
- }
- }
- return dim;
- }
-
- /**
- * Sets the constraint for the given figure.
- *
- * @param child
- * the child
- * @param constraint
- * the child's new constraint
- */
- @Override
- public void setConstraint(IFigure child, Object constraint) {
- if(constraint instanceof Rectangle && ((Rectangle)constraint).height > MINIMUMCOMPARTMENTSIZE) {
- preferedHeight = ((Rectangle)constraint).height;
- } else {
- preferedHeight = MINIMUMCOMPARTMENTSIZE;
- }
- invalidate(child);
- }
-
-}
+/****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST), Thibault Landre (Atos Origin) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.figure.node;
+
+import org.eclipse.draw2d.AbstractLayout;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+
+/**
+ * this is the layout manager in charge to place element in compartment element
+ *
+ */
+
+public class SubCompartmentLayoutManager extends AbstractLayout {
+
+ protected final static int MINIMUMCOMPARTMENTSIZE = 15;
+
+ protected final static int MINIMUM_COMPARTMENT_WIDTH = 20;
+
+ protected int preferedHeight = MINIMUMCOMPARTMENTSIZE;
+
+ @Override
+ protected Dimension calculatePreferredSize(IFigure figure, int wHint, int hHint) {
+ Dimension dim = new Dimension(10, preferedHeight);
+ if(!figure.getChildren().isEmpty()) {
+ Object compartment = figure.getChildren().get(0);
+ if(compartment instanceof ResizableCompartmentFigure) {
+ Dimension compartmentPreferredSize = ((ResizableCompartmentFigure)compartment).getPreferredSize();
+ dim.height = compartmentPreferredSize.height + 10;
+ if(dim.height == 0) {
+ dim.height = 20;
+ }
+ dim.width = compartmentPreferredSize.width;
+ }
+ }
+ return dim;
+ }
+
+ @Override
+ public Dimension getMinimumSize(IFigure container, int wHint, int hHint) {
+ return new Dimension(MINIMUM_COMPARTMENT_WIDTH, MINIMUMCOMPARTMENTSIZE);
+ }
+
+ public void layout(IFigure container) {
+ for(int i = 0; i < container.getChildren().size(); i++) {
+ IFigure child = ((IFigure)container.getChildren().get(i));
+ Rectangle bound = new Rectangle(child.getBounds());
+ bound.setSize(getPreferedSize(child));
+ bound.x = container.getBounds().x;
+ bound.width = container.getBounds().width;
+ if(i > 0) {
+ bound.y = ((IFigure)container.getChildren().get(i - 1)).getBounds().getBottomLeft().y + 1;
+ } else {
+ bound.y = container.getBounds().y;
+ }
+ child.setBounds(bound);
+ }
+ // container
+ int containersize = container.getChildren().size();
+ if(containersize > 0) {
+ IFigure lastChild = (IFigure)container.getChildren().get(containersize - 1);
+ Rectangle lastRectangle = lastChild.getBounds();
+ lastRectangle.height = container.getBounds().y + container.getBounds().height - lastRectangle.y;
+ lastRectangle.width = container.getBounds().width;
+ lastChild.setBounds(lastRectangle);
+ }
+ }
+
+ public Dimension getPreferedSize(IFigure figure) {
+ Dimension dim = new Dimension(10, preferedHeight);
+ if(figure.getChildren().size() > 0) {
+ if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) {
+ dim.height = ((ResizableCompartmentFigure)figure.getChildren().get(0)).getPreferredSize().height + 10;
+ if(dim.height == 0) {
+ dim.height = 20;
+ }
+
+ }
+ }
+ return dim;
+ }
+
+ /**
+ * Sets the constraint for the given figure.
+ *
+ * @param child
+ * the child
+ * @param constraint
+ * the child's new constraint
+ */
+ @Override
+ public void setConstraint(IFigure child, Object constraint) {
+ if(constraint instanceof Rectangle && ((Rectangle)constraint).height > MINIMUMCOMPARTMENTSIZE) {
+ preferedHeight = ((Rectangle)constraint).height;
+ } else {
+ preferedHeight = MINIMUMCOMPARTMENTSIZE;
+ }
+ invalidate(child);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java
index c73e02502a3..616da2c6ef7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/GraphicalCommandHandler.java
@@ -1,144 +1,144 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.handlers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This abstract command handler: - calculates the current selection -
- * calculates the visibility and enablement based on command executability -
- * executes the command in Papyrus command stack
- *
- */
-public abstract class GraphicalCommandHandler extends AbstractHandler {
-
- protected abstract Command getCommand() throws ExecutionException;
-
- /**
- * Iterate over current selection and build a list of the {@link IGraphicalEditPart} contained in the selection.
- *
- * @return the currently selected {@link IGraphicalEditPart}
- */
- protected List<IGraphicalEditPart> getSelectedElements() {
- List<IGraphicalEditPart> editparts = new ArrayList<IGraphicalEditPart>();
-
- // Get current selection
- IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- Object selection = (activeWorkbenchWindow != null) ? activeWorkbenchWindow.getSelectionService().getSelection() : null;
-
- // Treat non-null selected object (try to adapt and return EObject)
- if(selection != null) {
-
- if(selection instanceof IStructuredSelection) {
-
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-
- Iterator<?> it = structuredSelection.iterator();
- while(it.hasNext()) {
- Object object = it.next();
- if(object instanceof IGraphicalEditPart) {
- editparts.add((IGraphicalEditPart)object);
- }
- }
-
- } else if(selection instanceof IGraphicalEditPart) {
- editparts.add((IGraphicalEditPart)selection);
- }
- }
-
- return editparts;
- }
-
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return null
- * @throws ExecutionException
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- TransactionalEditingDomain editingDomain = getEditingDomain();
- Command command = getCommand();
- if(editingDomain != null && command != null) {
- editingDomain.getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
- }
-
- return null;
- }
-
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return true is the command can be executed
- */
- @Override
- public boolean isEnabled() {
-
- try {
- Command command = getCommand();
- if(command != null && command.canExecute()) {
- return true;
- }
- } catch (ExecutionException e) {
- Activator.log.error(e);
- }
-
- return false;
- }
-
- /**
- *
- * @return true if the command can be executed
- */
- public boolean isVisible() {
- return isEnabled();
- }
-
- /**
- * Retrieves the TransactionalEditingDomain
- *
- * @return the editing domain (can be null)
- */
- protected TransactionalEditingDomain getEditingDomain() {
- ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance();
- TransactionalEditingDomain editingDomain = null;
- try {
- editingDomain = serviceUtils.getTransactionalEditingDomain();
-
- } catch (ServiceException e) {
- //Ignore and return null
- }
-
- return editingDomain;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This abstract command handler: - calculates the current selection -
+ * calculates the visibility and enablement based on command executability -
+ * executes the command in Papyrus command stack
+ *
+ */
+public abstract class GraphicalCommandHandler extends AbstractHandler {
+
+ protected abstract Command getCommand() throws ExecutionException;
+
+ /**
+ * Iterate over current selection and build a list of the {@link IGraphicalEditPart} contained in the selection.
+ *
+ * @return the currently selected {@link IGraphicalEditPart}
+ */
+ protected List<IGraphicalEditPart> getSelectedElements() {
+ List<IGraphicalEditPart> editparts = new ArrayList<IGraphicalEditPart>();
+
+ // Get current selection
+ IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ Object selection = (activeWorkbenchWindow != null) ? activeWorkbenchWindow.getSelectionService().getSelection() : null;
+
+ // Treat non-null selected object (try to adapt and return EObject)
+ if(selection != null) {
+
+ if(selection instanceof IStructuredSelection) {
+
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+
+ Iterator<?> it = structuredSelection.iterator();
+ while(it.hasNext()) {
+ Object object = it.next();
+ if(object instanceof IGraphicalEditPart) {
+ editparts.add((IGraphicalEditPart)object);
+ }
+ }
+
+ } else if(selection instanceof IGraphicalEditPart) {
+ editparts.add((IGraphicalEditPart)selection);
+ }
+ }
+
+ return editparts;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return null
+ * @throws ExecutionException
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ Command command = getCommand();
+ if(editingDomain != null && command != null) {
+ editingDomain.getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+ }
+
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return true is the command can be executed
+ */
+ @Override
+ public boolean isEnabled() {
+
+ try {
+ Command command = getCommand();
+ if(command != null && command.canExecute()) {
+ return true;
+ }
+ } catch (ExecutionException e) {
+ Activator.log.error(e);
+ }
+
+ return false;
+ }
+
+ /**
+ *
+ * @return true if the command can be executed
+ */
+ public boolean isVisible() {
+ return isEnabled();
+ }
+
+ /**
+ * Retrieves the TransactionalEditingDomain
+ *
+ * @return the editing domain (can be null)
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance();
+ TransactionalEditingDomain editingDomain = null;
+ try {
+ editingDomain = serviceUtils.getTransactionalEditingDomain();
+
+ } catch (ServiceException e) {
+ //Ignore and return null
+ }
+
+ return editingDomain;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/LoadHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/LoadHandler.java
index d765777d95e..255164292e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/LoadHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/LoadHandler.java
@@ -1,126 +1,126 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Hemery (Atos) vincent.hemery@atos.net - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.handlers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.services.resourceloading.util.LoadingUtils;
-
-/**
- * Handler for the load resource action. This actions load a resource in the
- * model set, which is not yet loaded (due to resource loading strategy).
- */
-public class LoadHandler extends GraphicalCommandHandler {
-
- /**
- * Get the command to load resource of selected model object
- *
- * @see org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler#getCommand()
- * @return the load command
- * @throws ExecutionException
- */
- protected Command getCommand() throws ExecutionException {
- TransactionalEditingDomain editingDomain = getEditingDomain();
- List<IGraphicalEditPart> selection = getSelectedElements();
- if(editingDomain != null && editingDomain.getResourceSet() instanceof ModelSet && selection.size() > 0) {
- final ModelSet set = (ModelSet)editingDomain.getResourceSet();
- CompoundCommand command = new CompoundCommand();
- List<URI> handledURI = new ArrayList<URI>();
- for(IGraphicalEditPart selPart : selection) {
- View view = (View)((IAdaptable)selPart).getAdapter(View.class);
- if(view != null) {
- EObject sel = view.getElement();
- // check for partially not loaded edge
- if(view instanceof Edge) {
- View target = ((Edge)view).getTarget();
- if(target != null && ViewUtil.resolveSemanticElement(target) == null) {
- // there is a backslash decorator
- EObject linked = target.getElement();
- if(linked != null && linked.eIsProxy()) {
- InternalEObject internal = (InternalEObject)linked;
- URI uriProxy = internal.eProxyURI();
- final URI uriTrim = uriProxy.trimFragment().trimFileExtension();
- if(!handledURI.contains(uriTrim)) {
- handledURI.add(uriTrim);
- Command cmd = new Command() {
-
- @Override
- public void redo() {
- LoadingUtils.loadResourcesInModelSet(set, uriTrim);
- }
-
- @Override
- public void execute() {
- redo();
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
- };
- command.add(cmd);
- }
- }
- }
- }
- if(sel != null && sel.eIsProxy()) {
- InternalEObject internal = (InternalEObject)sel;
- URI uriProxy = internal.eProxyURI();
- final URI uriTrim = uriProxy.trimFragment().trimFileExtension();
- if(!handledURI.contains(uriTrim)) {
- handledURI.add(uriTrim);
- Command cmd = new Command() {
-
- @Override
- public void redo() {
- LoadingUtils.loadResourcesInModelSet(set, uriTrim);
- }
-
- @Override
- public void execute() {
- redo();
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
- };
- command.add(cmd);
- }
- }
- }
- }
- return command;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Hemery (Atos) vincent.hemery@atos.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.handlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.services.resourceloading.util.LoadingUtils;
+
+/**
+ * Handler for the load resource action. This actions load a resource in the
+ * model set, which is not yet loaded (due to resource loading strategy).
+ */
+public class LoadHandler extends GraphicalCommandHandler {
+
+ /**
+ * Get the command to load resource of selected model object
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler#getCommand()
+ * @return the load command
+ * @throws ExecutionException
+ */
+ protected Command getCommand() throws ExecutionException {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ List<IGraphicalEditPart> selection = getSelectedElements();
+ if(editingDomain != null && editingDomain.getResourceSet() instanceof ModelSet && selection.size() > 0) {
+ final ModelSet set = (ModelSet)editingDomain.getResourceSet();
+ CompoundCommand command = new CompoundCommand();
+ List<URI> handledURI = new ArrayList<URI>();
+ for(IGraphicalEditPart selPart : selection) {
+ View view = (View)((IAdaptable)selPart).getAdapter(View.class);
+ if(view != null) {
+ EObject sel = view.getElement();
+ // check for partially not loaded edge
+ if(view instanceof Edge) {
+ View target = ((Edge)view).getTarget();
+ if(target != null && ViewUtil.resolveSemanticElement(target) == null) {
+ // there is a backslash decorator
+ EObject linked = target.getElement();
+ if(linked != null && linked.eIsProxy()) {
+ InternalEObject internal = (InternalEObject)linked;
+ URI uriProxy = internal.eProxyURI();
+ final URI uriTrim = uriProxy.trimFragment().trimFileExtension();
+ if(!handledURI.contains(uriTrim)) {
+ handledURI.add(uriTrim);
+ Command cmd = new Command() {
+
+ @Override
+ public void redo() {
+ LoadingUtils.loadResourcesInModelSet(set, uriTrim);
+ }
+
+ @Override
+ public void execute() {
+ redo();
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+ };
+ command.add(cmd);
+ }
+ }
+ }
+ }
+ if(sel != null && sel.eIsProxy()) {
+ InternalEObject internal = (InternalEObject)sel;
+ URI uriProxy = internal.eProxyURI();
+ final URI uriTrim = uriProxy.trimFragment().trimFileExtension();
+ if(!handledURI.contains(uriTrim)) {
+ handledURI.add(uriTrim);
+ Command cmd = new Command() {
+
+ @Override
+ public void redo() {
+ LoadingUtils.loadResourcesInModelSet(set, uriTrim);
+ }
+
+ @Override
+ public void execute() {
+ redo();
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+ };
+ command.add(cmd);
+ }
+ }
+ }
+ }
+ return command;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/ParametricAndListeningHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/ParametricAndListeningHandler.java
index b39ee446df3..191baf3aa2c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/ParametricAndListeningHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/ParametricAndListeningHandler.java
@@ -1,155 +1,155 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.handlers;
-
-import java.util.Hashtable;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.HandlerEvent;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExecutableExtension;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This abstract command handler: - calculates the current selection -
- * calculates the visibility and enablement based on command executability -
- * executes the command in Papyrus command stack - listen the SelectionService
- * (usefull when the action is inside a Menu (like Diagram)
- */
-public abstract class ParametricAndListeningHandler extends GraphicalCommandHandler implements IExecutableExtension {
-
- /** the selection service */
- private ISelectionService serv = null;
-
- /** this handler */
- private ParametricAndListeningHandler thisHandler;
-
- /** parameter for this handler */
- protected String parameter = null;
-
- /** parameter ID */
- protected String parametedID = null;
-
- /** listener on the selection */
- protected ISelectionListener listener = null;
-
- /**
- *
- * Constructor.
- *
- */
- public ParametricAndListeningHandler() {
- this.thisHandler = this;
- }
-
- /**
- *
- * Constructor.
- *
- */
- public ParametricAndListeningHandler(String parameterID) {
- this.thisHandler = this;
- this.parametedID = parameterID;
- }
-
- /**
- * This method add a listener on the selection service and return a command
- *
- * @see org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler#getCommand()
- *
- * @return {@link UnexecutableCommand}
- * @throws ExecutionException
- */
- @Override
- protected Command getCommand() throws ExecutionException {
- addSelectionListener();
- return UnexecutableCommand.INSTANCE;
- }
-
- /***
- * Add a listener on the selection, in order to refresh the status of the
- * action when the selection changes
- */
- protected void addSelectionListener() {
- // when we are in the Menu, we need to refresh
- if(serv == null) {// should be always!=null after the first call to
- // getCommand()
- IWorkbench workbench = PlatformUI.getWorkbench();
-
- if(workbench != null) {
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- if(workbenchWindow != null) {
- this.serv = workbenchWindow.getSelectionService();
- if(this.serv != null) {
- this.listener = new ISelectionListener() {
-
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- refreshMenu();
- }
- };
-
- serv.addSelectionListener(listener);
- }
- }
- }
- }
- }
-
- /**
- * If the handled action is in a Menu, we need to refresh the handler status
- */
- protected void refreshMenu() {
- fireHandlerChanged(new HandlerEvent(thisHandler, true, false));
- }
-
- /**
- * Initialize the field {@link #parameter}
- *
- * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String,
- * java.lang.Object)
- *
- * @param config
- * @param propertyName
- * @param data
- * @throws CoreException
- */
- public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
- if(data instanceof Hashtable && this.parametedID != null) {
- this.parameter = (String)((Hashtable)data).get(this.parametedID);
- }
- }
-
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#dispose()
- *
- */
- @Override
- public void dispose() {
- if(this.serv != null && this.listener != null) {
- this.serv.removeSelectionListener(listener);
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.handlers;
+
+import java.util.Hashtable;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.HandlerEvent;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This abstract command handler: - calculates the current selection -
+ * calculates the visibility and enablement based on command executability -
+ * executes the command in Papyrus command stack - listen the SelectionService
+ * (usefull when the action is inside a Menu (like Diagram)
+ */
+public abstract class ParametricAndListeningHandler extends GraphicalCommandHandler implements IExecutableExtension {
+
+ /** the selection service */
+ private ISelectionService serv = null;
+
+ /** this handler */
+ private ParametricAndListeningHandler thisHandler;
+
+ /** parameter for this handler */
+ protected String parameter = null;
+
+ /** parameter ID */
+ protected String parametedID = null;
+
+ /** listener on the selection */
+ protected ISelectionListener listener = null;
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public ParametricAndListeningHandler() {
+ this.thisHandler = this;
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public ParametricAndListeningHandler(String parameterID) {
+ this.thisHandler = this;
+ this.parametedID = parameterID;
+ }
+
+ /**
+ * This method add a listener on the selection service and return a command
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.handlers.GraphicalCommandHandler#getCommand()
+ *
+ * @return {@link UnexecutableCommand}
+ * @throws ExecutionException
+ */
+ @Override
+ protected Command getCommand() throws ExecutionException {
+ addSelectionListener();
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /***
+ * Add a listener on the selection, in order to refresh the status of the
+ * action when the selection changes
+ */
+ protected void addSelectionListener() {
+ // when we are in the Menu, we need to refresh
+ if(serv == null) {// should be always!=null after the first call to
+ // getCommand()
+ IWorkbench workbench = PlatformUI.getWorkbench();
+
+ if(workbench != null) {
+ IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
+ if(workbenchWindow != null) {
+ this.serv = workbenchWindow.getSelectionService();
+ if(this.serv != null) {
+ this.listener = new ISelectionListener() {
+
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ refreshMenu();
+ }
+ };
+
+ serv.addSelectionListener(listener);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * If the handled action is in a Menu, we need to refresh the handler status
+ */
+ protected void refreshMenu() {
+ fireHandlerChanged(new HandlerEvent(thisHandler, true, false));
+ }
+
+ /**
+ * Initialize the field {@link #parameter}
+ *
+ * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String,
+ * java.lang.Object)
+ *
+ * @param config
+ * @param propertyName
+ * @param data
+ * @throws CoreException
+ */
+ public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
+ if(data instanceof Hashtable && this.parametedID != null) {
+ this.parameter = (String)((Hashtable)data).get(this.parametedID);
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#dispose()
+ *
+ */
+ @Override
+ public void dispose() {
+ if(this.serv != null && this.listener != null) {
+ this.serv.removeSelectionListener(listener);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/RenamedElementHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/RenamedElementHandler.java
index b1273b462c8..f4d962e17a8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/RenamedElementHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/RenamedElementHandler.java
@@ -1,99 +1,99 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.handlers;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This handler allows to rename element in the Diagram. It works with the
- * org.eclipse.ui.edit.rename command. It is created to replace the initial
- * keybinding done by GMF. see bug 317424
- *
- */
-public class RenamedElementHandler extends AbstractHandler {
-
- /**
- * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
- *
- * @param event
- * @return
- * @throws ExecutionException
- */
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- List<IGraphicalEditPart> selection = getSelectedElements();
- selection.get(0).performRequest(new Request(RequestConstants.REQ_DIRECT_EDIT));
- return null;
- }
-
- /**
- *
- * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
- *
- * @return
- */
- @Override
- public boolean isEnabled() {
- List<IGraphicalEditPart> selection = getSelectedElements();
- if(selection.size() == 1) {
- IGraphicalEditPart editpart = selection.get(0);
- DiagramEditPart diagramEP = DiagramEditPartsUtil.getDiagramEditPart(editpart);
- // we don't rename the diagram
- return editpart != diagramEP;
- }
- return false;
- }
-
- /**
- * Iterate over current selection and build a list of the {@link IGraphicalEditPart} contained in the selection.
- *
- * @return the currently selected {@link IGraphicalEditPart}
- */
- protected List<IGraphicalEditPart> getSelectedElements() {
- List<IGraphicalEditPart> editparts = new ArrayList<IGraphicalEditPart>();
-
- ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(selection instanceof IStructuredSelection) {
-
- IStructuredSelection structuredSelection = (IStructuredSelection)selection;
-
- Iterator<?> it = structuredSelection.iterator();
- while(it.hasNext()) {
- Object object = it.next();
- if(object instanceof IGraphicalEditPart) {
- editparts.add((IGraphicalEditPart)object);
- }
- }
-
- } else if(selection instanceof IGraphicalEditPart) {
- editparts.add((IGraphicalEditPart)selection);
- }
-
- return editparts;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This handler allows to rename element in the Diagram. It works with the
+ * org.eclipse.ui.edit.rename command. It is created to replace the initial
+ * keybinding done by GMF. see bug 317424
+ *
+ */
+public class RenamedElementHandler extends AbstractHandler {
+
+ /**
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ *
+ * @param event
+ * @return
+ * @throws ExecutionException
+ */
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ List<IGraphicalEditPart> selection = getSelectedElements();
+ selection.get(0).performRequest(new Request(RequestConstants.REQ_DIRECT_EDIT));
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.AbstractHandler#isEnabled()
+ *
+ * @return
+ */
+ @Override
+ public boolean isEnabled() {
+ List<IGraphicalEditPart> selection = getSelectedElements();
+ if(selection.size() == 1) {
+ IGraphicalEditPart editpart = selection.get(0);
+ DiagramEditPart diagramEP = DiagramEditPartsUtil.getDiagramEditPart(editpart);
+ // we don't rename the diagram
+ return editpart != diagramEP;
+ }
+ return false;
+ }
+
+ /**
+ * Iterate over current selection and build a list of the {@link IGraphicalEditPart} contained in the selection.
+ *
+ * @return the currently selected {@link IGraphicalEditPart}
+ */
+ protected List<IGraphicalEditPart> getSelectedElements() {
+ List<IGraphicalEditPart> editparts = new ArrayList<IGraphicalEditPart>();
+
+ ISelection selection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
+ if(selection instanceof IStructuredSelection) {
+
+ IStructuredSelection structuredSelection = (IStructuredSelection)selection;
+
+ Iterator<?> it = structuredSelection.iterator();
+ while(it.hasNext()) {
+ Object object = it.next();
+ if(object instanceof IGraphicalEditPart) {
+ editparts.add((IGraphicalEditPart)object);
+ }
+ }
+
+ } else if(selection instanceof IGraphicalEditPart) {
+ editparts.add((IGraphicalEditPart)selection);
+ }
+
+ return editparts;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/UnloadHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/UnloadHandler.java
index 923b244535e..e266354b6d0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/UnloadHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/handlers/UnloadHandler.java
@@ -1,124 +1,124 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Hemery (Atos) vincent.hemery@atos.net - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.handlers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
-import org.eclipse.papyrus.infra.services.resourceloading.util.LoadingUtils;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Handler for the load resource action. This actions load a resource in the
- * model set, which is not yet loaded (due to resource loading strategy).
- */
-public class UnloadHandler extends GraphicalCommandHandler {
-
- /**
- * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
- * @return the command
- */
- @Override
- protected Command getCommand() {
- TransactionalEditingDomain editingDomain = getEditingDomain();
- List<IGraphicalEditPart> selection = getSelectedElements();
- if(editingDomain != null && editingDomain.getResourceSet() instanceof ModelSet && selection.size() > 0) {
- final ModelSet set = (ModelSet)editingDomain.getResourceSet();
- CompoundCommand command = new CompoundCommand();
- List<URI> handledURI = new ArrayList<URI>();
- // ensure main URI is never unloaded
- URI mainURI = NotationUtils.getNotationModel(set).getResourceURI().trimFileExtension();
- handledURI.add(mainURI);
- for(IGraphicalEditPart selPart : selection) {
- View view = (View)((IAdaptable)selPart).getAdapter(View.class);
- if(view != null) {
- EObject sel = view.getElement();
- // note: the element may be null if the View is notational only
- if(sel != null && !sel.eIsProxy()) {
- final URI uriTrim = sel.eResource().getURI().trimFileExtension();
- if(!handledURI.contains(uriTrim)) {
- handledURI.add(uriTrim);
- Command cmd = new Command() {
-
- @Override
- public void redo() {
- LoadingUtils.unloadResourcesFromModelSet(set, uriTrim);
- }
-
- @Override
- public void execute() {
- redo();
- }
-
- @Override
- public boolean canExecute() {
- return true;
- }
- };
- command.add(cmd);
- }
- }
- }
- }
- return command;
- }
- return UnexecutableCommand.INSTANCE;
- }
-
- /**
- * Get currently opened editor
- *
- * @return editor
- */
- protected IEditorPart getEditor() {
- IEditorPart editor = null;
- IWorkbenchWindow activeWorkbenchWindow = getActiveWorkbenchWindow();
- if(activeWorkbenchWindow != null) {
- IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
- if(activePage != null) {
- editor = activePage.getActiveEditor();
- }
- }
- return editor;
- }
-
- /**
- * Get the active workbench window
- *
- * @return window
- */
- protected IWorkbenchWindow getActiveWorkbenchWindow() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- if(workbench != null) {
- return workbench.getActiveWorkbenchWindow();
- }
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Hemery (Atos) vincent.hemery@atos.net - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.handlers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
+import org.eclipse.papyrus.infra.services.resourceloading.util.LoadingUtils;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Handler for the load resource action. This actions load a resource in the
+ * model set, which is not yet loaded (due to resource loading strategy).
+ */
+public class UnloadHandler extends GraphicalCommandHandler {
+
+ /**
+ * @see org.eclipse.papyrus.views.modelexplorer.handler.AbstractCommandHandler#getCommand()
+ * @return the command
+ */
+ @Override
+ protected Command getCommand() {
+ TransactionalEditingDomain editingDomain = getEditingDomain();
+ List<IGraphicalEditPart> selection = getSelectedElements();
+ if(editingDomain != null && editingDomain.getResourceSet() instanceof ModelSet && selection.size() > 0) {
+ final ModelSet set = (ModelSet)editingDomain.getResourceSet();
+ CompoundCommand command = new CompoundCommand();
+ List<URI> handledURI = new ArrayList<URI>();
+ // ensure main URI is never unloaded
+ URI mainURI = NotationUtils.getNotationModel(set).getResourceURI().trimFileExtension();
+ handledURI.add(mainURI);
+ for(IGraphicalEditPart selPart : selection) {
+ View view = (View)((IAdaptable)selPart).getAdapter(View.class);
+ if(view != null) {
+ EObject sel = view.getElement();
+ // note: the element may be null if the View is notational only
+ if(sel != null && !sel.eIsProxy()) {
+ final URI uriTrim = sel.eResource().getURI().trimFileExtension();
+ if(!handledURI.contains(uriTrim)) {
+ handledURI.add(uriTrim);
+ Command cmd = new Command() {
+
+ @Override
+ public void redo() {
+ LoadingUtils.unloadResourcesFromModelSet(set, uriTrim);
+ }
+
+ @Override
+ public void execute() {
+ redo();
+ }
+
+ @Override
+ public boolean canExecute() {
+ return true;
+ }
+ };
+ command.add(cmd);
+ }
+ }
+ }
+ }
+ return command;
+ }
+ return UnexecutableCommand.INSTANCE;
+ }
+
+ /**
+ * Get currently opened editor
+ *
+ * @return editor
+ */
+ protected IEditorPart getEditor() {
+ IEditorPart editor = null;
+ IWorkbenchWindow activeWorkbenchWindow = getActiveWorkbenchWindow();
+ if(activeWorkbenchWindow != null) {
+ IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
+ if(activePage != null) {
+ editor = activePage.getActiveEditor();
+ }
+ }
+ return editor;
+ }
+
+ /**
+ * Get the active workbench window
+ *
+ * @return window
+ */
+ protected IWorkbenchWindow getActiveWorkbenchWindow() {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ if(workbench != null) {
+ return workbench.getActiveWorkbenchWindow();
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AlignmentLinkHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AlignmentLinkHelper.java
index 61cbb8f6b13..6173495df90 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AlignmentLinkHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AlignmentLinkHelper.java
@@ -1,178 +1,178 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.gef.tools.ToolUtilities;
-import org.eclipse.papyrus.uml.diagram.common.layout.EditPartRepresentation;
-import org.eclipse.papyrus.uml.diagram.common.layout.SameAlignment;
-
-/**
- * This class provides a custom method to do an align action using links and not
- * nodes. This action moves node to set the selected link vertically or
- * horizontally. The anchor connection don't move on the node.
- *
- */
-public class AlignmentLinkHelper {
-
- /** the alignment */
- private int alignment;
-
- /** the selected editparts */
- private List<?> linkEditparts;
-
- /** the families of editparts */
- private List<SameAlignment> families = new ArrayList<SameAlignment>();
-
- /**
- *
- * Constructor.
- *
- * @param editparts
- * the selected editpart for the alignment action
- * @param alignment
- * the alignment
- */
- public AlignmentLinkHelper(List<?> editparts, int alignment) {
- this.linkEditparts = editparts;
- this.alignment = alignment;
- }
-
- /**
- * Returns the command for this link representation
- *
- * @return <ul>
- * <li>the command for this link representation</li>
- * <li> {@linkplain UnexecutableCommand#INSTANCE} if the alignment is {@linkplain PositionConstants#MIDDLE} or
- * {@linkplain PositionConstants#CENTER}</li>
- * </ul>
- */
- public Command createCommand() {
- if(this.alignment == PositionConstants.MIDDLE || this.alignment == PositionConstants.CENTER || this.linkEditparts.size() == 0) {
- return UnexecutableCommand.INSTANCE;
- }
- organizeSelection();
- if(isAncestorSelected()) {
- return UnexecutableCommand.INSTANCE;
- }
- return getCommand();
- }
-
- /**
- * Tests if a parent and one of these children are selected
- *
- * @return <ul>
- * <li>{@code true}</li>if a parent and one of these children are selected
- * <li>{@code false}</li>if not
- * </ul>
- *
- */
- protected boolean isAncestorSelected() {
- List<EditPart> nodesEditPart = new ArrayList<EditPart>();
- // get all the sources and target for the selected links
- for(Object currentEP : linkEditparts) {
- EditPart source = ((AbstractConnectionEditPart)currentEP).getSource();
- EditPart target = ((AbstractConnectionEditPart)currentEP).getTarget();
- nodesEditPart.add(source);
- nodesEditPart.add(target);
- }
- // test if a selected editpart is included another selected editpart
- for(EditPart ep : nodesEditPart) {
- if(ToolUtilities.isAncestorContainedIn(nodesEditPart, ep)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Builds and returns the command for this link representation
- *
- * @return the command for this link representation
- */
- protected Command getCommand() {
- CompoundCommand cmd = new CompoundCommand("Command for alignment by links"); //$NON-NLS-1$
- Command tmp;
- for(SameAlignment currentFamily : families) {
- tmp = currentFamily.getCommand();
- if(tmp != null && tmp.canExecute()) {
- cmd.add(tmp);
- }
- }
- return cmd;
-
- }
-
- /**
- * This function organizes the selection following the links : all selected
- * links which share nodes are owned by the same {@linkplain SameAlignment}.
- */
- protected void organizeSelection() {
- for(Object currentEP : this.linkEditparts) {
- // get the editPart source and target for the link
- EditPart source = ((AbstractConnectionEditPart)currentEP).getSource();
- EditPart target = ((AbstractConnectionEditPart)currentEP).getTarget();
-
- SameAlignment familySource = null;
- SameAlignment familyTarget = null;
-
- EditPartRepresentation sourceRep = null;
- EditPartRepresentation targetRep = null;
- // we look for a representation of these source and target
- for(SameAlignment family : families) {
- if(family.getEditPartRepresentationFor(source) != null) {
- sourceRep = family.getEditPartRepresentationFor(source);
- }
- if(family.getEditPartRepresentationFor(target) != null) {
- targetRep = family.getEditPartRepresentationFor(target);
- }
- if(sourceRep != null) {
- familySource = family;
- }
- if(targetRep != null) {
- familyTarget = family;
- }
- }
-
- /*
- * if source and target representation exist, we keep the source
- * representation, and we add it the element containing by the
- * target representation
- */
- if(familySource != null && familyTarget != null) {
- familySource.addFamily(familyTarget);
- families.remove(familyTarget);
- } else if(familySource != null) {// a source representation exists
- // yet, we add it this link
- familySource.addTriplet((EditPart)currentEP, sourceRep, new EditPartRepresentation(target));
- } else if(familyTarget != null) {// a target representation exists
- // yet, we add it this link
- familyTarget.addTriplet((EditPart)currentEP, new EditPartRepresentation(source), targetRep);
- } else {// nothing exists, we create a new link representation
- SameAlignment newFamily = new SameAlignment(this.alignment);
- newFamily.addTriplet((EditPart)currentEP, new EditPartRepresentation(source), new EditPartRepresentation(target));
- families.add(newFamily);
- }
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gef.tools.ToolUtilities;
+import org.eclipse.papyrus.uml.diagram.common.layout.EditPartRepresentation;
+import org.eclipse.papyrus.uml.diagram.common.layout.SameAlignment;
+
+/**
+ * This class provides a custom method to do an align action using links and not
+ * nodes. This action moves node to set the selected link vertically or
+ * horizontally. The anchor connection don't move on the node.
+ *
+ */
+public class AlignmentLinkHelper {
+
+ /** the alignment */
+ private int alignment;
+
+ /** the selected editparts */
+ private List<?> linkEditparts;
+
+ /** the families of editparts */
+ private List<SameAlignment> families = new ArrayList<SameAlignment>();
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editparts
+ * the selected editpart for the alignment action
+ * @param alignment
+ * the alignment
+ */
+ public AlignmentLinkHelper(List<?> editparts, int alignment) {
+ this.linkEditparts = editparts;
+ this.alignment = alignment;
+ }
+
+ /**
+ * Returns the command for this link representation
+ *
+ * @return <ul>
+ * <li>the command for this link representation</li>
+ * <li> {@linkplain UnexecutableCommand#INSTANCE} if the alignment is {@linkplain PositionConstants#MIDDLE} or
+ * {@linkplain PositionConstants#CENTER}</li>
+ * </ul>
+ */
+ public Command createCommand() {
+ if(this.alignment == PositionConstants.MIDDLE || this.alignment == PositionConstants.CENTER || this.linkEditparts.size() == 0) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ organizeSelection();
+ if(isAncestorSelected()) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ return getCommand();
+ }
+
+ /**
+ * Tests if a parent and one of these children are selected
+ *
+ * @return <ul>
+ * <li>{@code true}</li>if a parent and one of these children are selected
+ * <li>{@code false}</li>if not
+ * </ul>
+ *
+ */
+ protected boolean isAncestorSelected() {
+ List<EditPart> nodesEditPart = new ArrayList<EditPart>();
+ // get all the sources and target for the selected links
+ for(Object currentEP : linkEditparts) {
+ EditPart source = ((AbstractConnectionEditPart)currentEP).getSource();
+ EditPart target = ((AbstractConnectionEditPart)currentEP).getTarget();
+ nodesEditPart.add(source);
+ nodesEditPart.add(target);
+ }
+ // test if a selected editpart is included another selected editpart
+ for(EditPart ep : nodesEditPart) {
+ if(ToolUtilities.isAncestorContainedIn(nodesEditPart, ep)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Builds and returns the command for this link representation
+ *
+ * @return the command for this link representation
+ */
+ protected Command getCommand() {
+ CompoundCommand cmd = new CompoundCommand("Command for alignment by links"); //$NON-NLS-1$
+ Command tmp;
+ for(SameAlignment currentFamily : families) {
+ tmp = currentFamily.getCommand();
+ if(tmp != null && tmp.canExecute()) {
+ cmd.add(tmp);
+ }
+ }
+ return cmd;
+
+ }
+
+ /**
+ * This function organizes the selection following the links : all selected
+ * links which share nodes are owned by the same {@linkplain SameAlignment}.
+ */
+ protected void organizeSelection() {
+ for(Object currentEP : this.linkEditparts) {
+ // get the editPart source and target for the link
+ EditPart source = ((AbstractConnectionEditPart)currentEP).getSource();
+ EditPart target = ((AbstractConnectionEditPart)currentEP).getTarget();
+
+ SameAlignment familySource = null;
+ SameAlignment familyTarget = null;
+
+ EditPartRepresentation sourceRep = null;
+ EditPartRepresentation targetRep = null;
+ // we look for a representation of these source and target
+ for(SameAlignment family : families) {
+ if(family.getEditPartRepresentationFor(source) != null) {
+ sourceRep = family.getEditPartRepresentationFor(source);
+ }
+ if(family.getEditPartRepresentationFor(target) != null) {
+ targetRep = family.getEditPartRepresentationFor(target);
+ }
+ if(sourceRep != null) {
+ familySource = family;
+ }
+ if(targetRep != null) {
+ familyTarget = family;
+ }
+ }
+
+ /*
+ * if source and target representation exist, we keep the source
+ * representation, and we add it the element containing by the
+ * target representation
+ */
+ if(familySource != null && familyTarget != null) {
+ familySource.addFamily(familyTarget);
+ families.remove(familyTarget);
+ } else if(familySource != null) {// a source representation exists
+ // yet, we add it this link
+ familySource.addTriplet((EditPart)currentEP, sourceRep, new EditPartRepresentation(target));
+ } else if(familyTarget != null) {// a target representation exists
+ // yet, we add it this link
+ familyTarget.addTriplet((EditPart)currentEP, new EditPartRepresentation(source), targetRep);
+ } else {// nothing exists, we create a new link representation
+ SameAlignment newFamily = new SameAlignment(this.alignment);
+ newFamily.addTriplet((EditPart)currentEP, new EditPartRepresentation(source), new EditPartRepresentation(target));
+ families.add(newFamily);
+ }
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AssociationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AssociationHelper.java
index a3ff0755a97..133ed007c46 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AssociationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/AssociationHelper.java
@@ -1,180 +1,180 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.operations.IUndoableOperation;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.uml2.uml.AggregationKind;
-import org.eclipse.uml2.uml.Association;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * this class is used to help design to code the managment of Association
- *
- *
- */
-public class AssociationHelper {
-
- public static int source = 0;
-
- public static int target = 1;
-
- /**
- * use to change the type of the end with the new type
- *
- * @param end
- * source or target?
- * @param association
- * the association that is reconnected
- * @param newType
- * the new source or the new target
- * @return the CommandResult
- */
- public static CommandResult reconnect(int end, Association association, Type newType) {
- ((Property)association.getMemberEnds().get(end)).setType(newType);
-
- return CommandResult.newOKCommandResult(association);
- }
-
- /**
- * Creates a new aggregation kind modification command
- *
- * @param property
- * the property to modify
- * @param aggregationKind
- * the new {@link AggregationKind} to set
- * @return an {@link IUndoableOperation} that will perform the modification
- */
- public static IUndoableOperation createSetAggregationCommand(Property property, AggregationKind aggregationKind) {
- EStructuralFeature feature = UMLPackage.eINSTANCE.getProperty_Aggregation();
- SetRequest setRequest = new SetRequest(property, feature, aggregationKind);
- SetValueCommand setValueCommand = new SetValueCommand(setRequest);
- return setValueCommand;
- }
-
- /**
- * Creates the command to set the owner of a given property in an
- * association
- *
- * @param association
- * the association to modify
- * @param property
- * the property to modify
- * @param belongsToClass
- * boolean set to <code>true</code> if the property belongs to
- * the class, <code>false</code> if it belongs to the association
- * @return the command that will perform modifications or <code>null</code>!
- */
- public static IUndoableOperation createSetOwnerCommand(Association association, Property property, boolean belongsToClass) {
- Type owner = null;
- if(belongsToClass) {
- // it already belongs to the right component, does not change...
- if(!(property.getOwner() instanceof Association)) {
- return null;
- } else {
- // look for the owner of the property to Set
- List<Type> ownerList = association.getEndTypes();
- if(ownerList.get(0).equals(property.getType()) && ownerList.size() > 1) {
- owner = (Type)ownerList.get(1);
- } else {
- owner = (Type)ownerList.get(0);
- }
- }
- // this is a classifier , construct and run the command
- EStructuralFeature feature = UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute();
- if(owner instanceof org.eclipse.uml2.uml.Class) {
- List<Property> attributeList = new ArrayList<Property>();
- attributeList.addAll(((org.eclipse.uml2.uml.Class)owner).getAttributes());
- attributeList.add(property);
- SetRequest setRequest = new SetRequest(owner, feature, attributeList);
- SetValueCommand setValueCommand = new SetValueCommand(setRequest);
- return setValueCommand;
- }
- return UnexecutableCommand.INSTANCE;
- } else {
- EStructuralFeature feature = UMLPackage.eINSTANCE.getAssociation_OwnedEnd();
- List<Property> attributeList = new ArrayList<Property>();
- attributeList.addAll(property.getAssociation().getOwnedEnds());
- attributeList.add(property);
- SetRequest setRequest = new SetRequest(property.getAssociation(), feature, attributeList);
- SetValueCommand setValueCommand = new SetValueCommand(setRequest);
- return setValueCommand;
- }
- }
-
- /**
- * Creates the command to set the multiplicity of the given property
- *
- * @param property
- * the property to modify
- * @param lower
- * the value of the lower bound
- * @param upper
- * the value of the upper bound
- * @return the command that sets the multiplicity of the property
- */
- public static IUndoableOperation createSetMultiplicityCommand(Property property, int lower, int upper) {
- EStructuralFeature lowerFeature = UMLPackage.eINSTANCE.getMultiplicityElement_Lower();
- EStructuralFeature upperFeature = UMLPackage.eINSTANCE.getMultiplicityElement_Upper();
-
- CompositeCommand compositeCommand = new CompositeCommand("Set Multiplicity");
-
- // creates and adds the lower feature set command
- SetRequest setLowerRequest = new SetRequest(property, lowerFeature, lower);
- compositeCommand.compose(new SetValueCommand(setLowerRequest));
-
- // idem with the upper feature
- SetRequest setUpperRequest = new SetRequest(property, upperFeature, upper);
- compositeCommand.compose(new SetValueCommand(setUpperRequest));
-
- return compositeCommand;
-
- }
-
- /**
- * Creates the command to set the navigation of the given property
- *
- * @param association
- * the association that has the property as member end
- * @param property
- * the property to modify
- * @param isNavigable
- * <code>true</code> if the property should be navigable
- * @return the command that sets the navigation of the property
- */
- public static IUndoableOperation createSetNavigableCommand(Association association, Property property, boolean isNavigable) {
- EStructuralFeature feature = UMLPackage.eINSTANCE.getAssociation_NavigableOwnedEnd();
- List<Property> attributeList = new ArrayList<Property>();
- attributeList.addAll(property.getAssociation().getNavigableOwnedEnds());
- if(isNavigable) {
- attributeList.add(property);
- } else {
- attributeList.remove(property);
- }
- SetRequest setRequest = new SetRequest(property.getAssociation(), feature, attributeList);
- return new SetValueCommand(setRequest);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.operations.IUndoableOperation;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.uml2.uml.AggregationKind;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * this class is used to help design to code the managment of Association
+ *
+ *
+ */
+public class AssociationHelper {
+
+ public static int source = 0;
+
+ public static int target = 1;
+
+ /**
+ * use to change the type of the end with the new type
+ *
+ * @param end
+ * source or target?
+ * @param association
+ * the association that is reconnected
+ * @param newType
+ * the new source or the new target
+ * @return the CommandResult
+ */
+ public static CommandResult reconnect(int end, Association association, Type newType) {
+ ((Property)association.getMemberEnds().get(end)).setType(newType);
+
+ return CommandResult.newOKCommandResult(association);
+ }
+
+ /**
+ * Creates a new aggregation kind modification command
+ *
+ * @param property
+ * the property to modify
+ * @param aggregationKind
+ * the new {@link AggregationKind} to set
+ * @return an {@link IUndoableOperation} that will perform the modification
+ */
+ public static IUndoableOperation createSetAggregationCommand(Property property, AggregationKind aggregationKind) {
+ EStructuralFeature feature = UMLPackage.eINSTANCE.getProperty_Aggregation();
+ SetRequest setRequest = new SetRequest(property, feature, aggregationKind);
+ SetValueCommand setValueCommand = new SetValueCommand(setRequest);
+ return setValueCommand;
+ }
+
+ /**
+ * Creates the command to set the owner of a given property in an
+ * association
+ *
+ * @param association
+ * the association to modify
+ * @param property
+ * the property to modify
+ * @param belongsToClass
+ * boolean set to <code>true</code> if the property belongs to
+ * the class, <code>false</code> if it belongs to the association
+ * @return the command that will perform modifications or <code>null</code>!
+ */
+ public static IUndoableOperation createSetOwnerCommand(Association association, Property property, boolean belongsToClass) {
+ Type owner = null;
+ if(belongsToClass) {
+ // it already belongs to the right component, does not change...
+ if(!(property.getOwner() instanceof Association)) {
+ return null;
+ } else {
+ // look for the owner of the property to Set
+ List<Type> ownerList = association.getEndTypes();
+ if(ownerList.get(0).equals(property.getType()) && ownerList.size() > 1) {
+ owner = (Type)ownerList.get(1);
+ } else {
+ owner = (Type)ownerList.get(0);
+ }
+ }
+ // this is a classifier , construct and run the command
+ EStructuralFeature feature = UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute();
+ if(owner instanceof org.eclipse.uml2.uml.Class) {
+ List<Property> attributeList = new ArrayList<Property>();
+ attributeList.addAll(((org.eclipse.uml2.uml.Class)owner).getAttributes());
+ attributeList.add(property);
+ SetRequest setRequest = new SetRequest(owner, feature, attributeList);
+ SetValueCommand setValueCommand = new SetValueCommand(setRequest);
+ return setValueCommand;
+ }
+ return UnexecutableCommand.INSTANCE;
+ } else {
+ EStructuralFeature feature = UMLPackage.eINSTANCE.getAssociation_OwnedEnd();
+ List<Property> attributeList = new ArrayList<Property>();
+ attributeList.addAll(property.getAssociation().getOwnedEnds());
+ attributeList.add(property);
+ SetRequest setRequest = new SetRequest(property.getAssociation(), feature, attributeList);
+ SetValueCommand setValueCommand = new SetValueCommand(setRequest);
+ return setValueCommand;
+ }
+ }
+
+ /**
+ * Creates the command to set the multiplicity of the given property
+ *
+ * @param property
+ * the property to modify
+ * @param lower
+ * the value of the lower bound
+ * @param upper
+ * the value of the upper bound
+ * @return the command that sets the multiplicity of the property
+ */
+ public static IUndoableOperation createSetMultiplicityCommand(Property property, int lower, int upper) {
+ EStructuralFeature lowerFeature = UMLPackage.eINSTANCE.getMultiplicityElement_Lower();
+ EStructuralFeature upperFeature = UMLPackage.eINSTANCE.getMultiplicityElement_Upper();
+
+ CompositeCommand compositeCommand = new CompositeCommand("Set Multiplicity");
+
+ // creates and adds the lower feature set command
+ SetRequest setLowerRequest = new SetRequest(property, lowerFeature, lower);
+ compositeCommand.compose(new SetValueCommand(setLowerRequest));
+
+ // idem with the upper feature
+ SetRequest setUpperRequest = new SetRequest(property, upperFeature, upper);
+ compositeCommand.compose(new SetValueCommand(setUpperRequest));
+
+ return compositeCommand;
+
+ }
+
+ /**
+ * Creates the command to set the navigation of the given property
+ *
+ * @param association
+ * the association that has the property as member end
+ * @param property
+ * the property to modify
+ * @param isNavigable
+ * <code>true</code> if the property should be navigable
+ * @return the command that sets the navigation of the property
+ */
+ public static IUndoableOperation createSetNavigableCommand(Association association, Property property, boolean isNavigable) {
+ EStructuralFeature feature = UMLPackage.eINSTANCE.getAssociation_NavigableOwnedEnd();
+ List<Property> attributeList = new ArrayList<Property>();
+ attributeList.addAll(property.getAssociation().getNavigableOwnedEnds());
+ if(isNavigable) {
+ attributeList.add(property);
+ } else {
+ attributeList.remove(property);
+ }
+ SetRequest setRequest = new SetRequest(property.getAssociation(), feature, attributeList);
+ return new SetValueCommand(setRequest);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/BasicClassifierCompartmentLayoutHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/BasicClassifierCompartmentLayoutHelper.java
index 278396a0077..dd9c6c8c777 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/BasicClassifierCompartmentLayoutHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/BasicClassifierCompartmentLayoutHelper.java
@@ -1,117 +1,117 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.papyrus.infra.emf.appearance.commands.SetLayoutKindCommand;
-import org.eclipse.papyrus.uml.diagram.common.figure.layout.AutomaticCompartmentToolBox;
-import org.eclipse.papyrus.uml.diagram.common.figure.layout.ILayoutToolBox;
-import org.eclipse.papyrus.uml.diagram.common.figure.layout.ManualCompartmentToolBox;
-
-/**
- * The Class BasicClassifierCompartmentLayoutHelper offer automatic layout or
- * manual layout
- */
-public class BasicClassifierCompartmentLayoutHelper extends ClassifierCompartmentLayoutHelper {
-
- /** The e instance. */
- protected static BasicClassifierCompartmentLayoutHelper eInstance = new BasicClassifierCompartmentLayoutHelper();
-
- /** The manualtool box. */
- protected ILayoutToolBox manualtoolBox;
-
- /** The automatic tool box. */
- protected ILayoutToolBox automaticToolBox;
-
- /**
- * Gets the instances.
- *
- * @return the instances
- */
- public static BasicClassifierCompartmentLayoutHelper getInstances() {
- return eInstance;
- }
-
- /**
- * Instantiates a new basic classifier compartment layout helper.
- */
- protected BasicClassifierCompartmentLayoutHelper() {
- super();
- manualtoolBox = new ManualCompartmentToolBox();
- layoutToolBoxList.put(manualtoolBox.getLayout(), manualtoolBox);
- automaticToolBox = new AutomaticCompartmentToolBox();
- layoutToolBoxList.put(automaticToolBox.getLayout(), automaticToolBox);
- }
-
- /**
- * Checks if is automatic.
- *
- * @param eModelElement
- * the e model element
- *
- * @return true, if is automatic
- */
- public boolean isAutomatic(EModelElement eModelElement) {
- if((super.getLayoutKindFromView(eModelElement)).equals(automaticToolBox.getLayout())) {
- return true;
- }
- return false;
- }
-
- /**
- * Checks if is manual.
- *
- * @param eModelElement
- * the e model element
- *
- * @return true, if is manual
- */
- public boolean isManual(EModelElement eModelElement) {
- if((super.getLayoutKindFromView(eModelElement)).equals(manualtoolBox.getLayout())) {
- return true;
- }
- return false;
- }
-
- /**
- * Sets the manual layout kind on view.
- *
- * @param domain
- * the domain
- * @param view
- * the view
- *
- * @return the sets the layout kind command
- */
- public SetLayoutKindCommand setManualLayoutKindOnView(TransactionalEditingDomain domain, EModelElement view) {
- // TODO Auto-generated method stub
- return super.setLayoutKindOnView(domain, view, manualtoolBox.getLayout());
- }
-
- /**
- * Sets the automatic layout kind on view.
- *
- * @param domain
- * the domain
- * @param view
- * the view
- *
- * @return the sets the layout kind command
- */
- public SetLayoutKindCommand setAutomaticLayoutKindOnView(TransactionalEditingDomain domain, EModelElement view) {
- // TODO Auto-generated method stub
- return super.setLayoutKindOnView(domain, view, automaticToolBox.getLayout());
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.infra.emf.appearance.commands.SetLayoutKindCommand;
+import org.eclipse.papyrus.uml.diagram.common.figure.layout.AutomaticCompartmentToolBox;
+import org.eclipse.papyrus.uml.diagram.common.figure.layout.ILayoutToolBox;
+import org.eclipse.papyrus.uml.diagram.common.figure.layout.ManualCompartmentToolBox;
+
+/**
+ * The Class BasicClassifierCompartmentLayoutHelper offer automatic layout or
+ * manual layout
+ */
+public class BasicClassifierCompartmentLayoutHelper extends ClassifierCompartmentLayoutHelper {
+
+ /** The e instance. */
+ protected static BasicClassifierCompartmentLayoutHelper eInstance = new BasicClassifierCompartmentLayoutHelper();
+
+ /** The manualtool box. */
+ protected ILayoutToolBox manualtoolBox;
+
+ /** The automatic tool box. */
+ protected ILayoutToolBox automaticToolBox;
+
+ /**
+ * Gets the instances.
+ *
+ * @return the instances
+ */
+ public static BasicClassifierCompartmentLayoutHelper getInstances() {
+ return eInstance;
+ }
+
+ /**
+ * Instantiates a new basic classifier compartment layout helper.
+ */
+ protected BasicClassifierCompartmentLayoutHelper() {
+ super();
+ manualtoolBox = new ManualCompartmentToolBox();
+ layoutToolBoxList.put(manualtoolBox.getLayout(), manualtoolBox);
+ automaticToolBox = new AutomaticCompartmentToolBox();
+ layoutToolBoxList.put(automaticToolBox.getLayout(), automaticToolBox);
+ }
+
+ /**
+ * Checks if is automatic.
+ *
+ * @param eModelElement
+ * the e model element
+ *
+ * @return true, if is automatic
+ */
+ public boolean isAutomatic(EModelElement eModelElement) {
+ if((super.getLayoutKindFromView(eModelElement)).equals(automaticToolBox.getLayout())) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks if is manual.
+ *
+ * @param eModelElement
+ * the e model element
+ *
+ * @return true, if is manual
+ */
+ public boolean isManual(EModelElement eModelElement) {
+ if((super.getLayoutKindFromView(eModelElement)).equals(manualtoolBox.getLayout())) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Sets the manual layout kind on view.
+ *
+ * @param domain
+ * the domain
+ * @param view
+ * the view
+ *
+ * @return the sets the layout kind command
+ */
+ public SetLayoutKindCommand setManualLayoutKindOnView(TransactionalEditingDomain domain, EModelElement view) {
+ // TODO Auto-generated method stub
+ return super.setLayoutKindOnView(domain, view, manualtoolBox.getLayout());
+ }
+
+ /**
+ * Sets the automatic layout kind on view.
+ *
+ * @param domain
+ * the domain
+ * @param view
+ * the view
+ *
+ * @return the sets the layout kind command
+ */
+ public SetLayoutKindCommand setAutomaticLayoutKindOnView(TransactionalEditingDomain domain, EModelElement view) {
+ // TODO Auto-generated method stub
+ return super.setLayoutKindOnView(domain, view, automaticToolBox.getLayout());
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ClassifierCompartmentLayoutHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ClassifierCompartmentLayoutHelper.java
index 8101bf4acad..2fa40d54ad5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ClassifierCompartmentLayoutHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ClassifierCompartmentLayoutHelper.java
@@ -1,84 +1,84 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.HashMap;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.util.EMap;
-import org.eclipse.emf.ecore.EAnnotation;
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.papyrus.infra.emf.appearance.commands.SetLayoutKindCommand;
-import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
-import org.eclipse.papyrus.uml.diagram.common.figure.layout.ILayoutToolBox;
-
-/**
- * The Class ClassifierCompartmentLayoutHelper.
- */
-public abstract class ClassifierCompartmentLayoutHelper implements ICompartmentLayoutHelper {
-
- protected HashMap<String, ILayoutToolBox> layoutToolBoxList = null;
-
- /**
- * Instantiates a new classifier compartment layout helper.
- */
- public ClassifierCompartmentLayoutHelper() {
- layoutToolBoxList = new HashMap<String, ILayoutToolBox>();
- }
-
- /**
- * {@inheritDoc}
- */
- public void applyLayout(AbstractGraphicalEditPart compartmentEditPart) {
- EditPart containerEditPart = compartmentEditPart.getParent();
- IFigure fig = (IFigure)(((IGraphicalEditPart)containerEditPart).getFigure().getChildren().get(0));
- IFigure primaryfig = (IFigure)(fig.getChildren().get(0));
- String layoutKind = getLayoutKindFromView(((EModelElement)containerEditPart.getModel()));
- ILayoutToolBox currentLayoutToolBox = layoutToolBoxList.get(layoutKind);
- if(currentLayoutToolBox != null) {
- compartmentEditPart.installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, currentLayoutToolBox.getEditPolicy());
- primaryfig.setLayoutManager(currentLayoutToolBox.getFigureLayout());
- }
-
- }
-
- /**
- * {@inheritDoc}
- */
- public String getLayoutKindFromView(EModelElement modelElement) {
- EAnnotation layoutAnnotation = modelElement.getEAnnotation(VisualInformationPapyrusConstants.LAYOUTFIGURE);
- if(layoutAnnotation != null) {
- EMap<String, String> entries = layoutAnnotation.getDetails();
-
- if(entries != null) {
- String gradientvalueString = entries.get(VisualInformationPapyrusConstants.LAYOUTFIGURE_VALUE);
- return gradientvalueString;
- }
- }
- return "";
- }
-
- /**
- * {@inheritDoc}
- */
- public SetLayoutKindCommand setLayoutKindOnView(TransactionalEditingDomain domain, EModelElement view, String layoutKind) {
- return new SetLayoutKindCommand(domain, view, layoutKind);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.HashMap;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.util.EMap;
+import org.eclipse.emf.ecore.EAnnotation;
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.papyrus.infra.emf.appearance.commands.SetLayoutKindCommand;
+import org.eclipse.papyrus.infra.emf.appearance.helper.VisualInformationPapyrusConstants;
+import org.eclipse.papyrus.uml.diagram.common.figure.layout.ILayoutToolBox;
+
+/**
+ * The Class ClassifierCompartmentLayoutHelper.
+ */
+public abstract class ClassifierCompartmentLayoutHelper implements ICompartmentLayoutHelper {
+
+ protected HashMap<String, ILayoutToolBox> layoutToolBoxList = null;
+
+ /**
+ * Instantiates a new classifier compartment layout helper.
+ */
+ public ClassifierCompartmentLayoutHelper() {
+ layoutToolBoxList = new HashMap<String, ILayoutToolBox>();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void applyLayout(AbstractGraphicalEditPart compartmentEditPart) {
+ EditPart containerEditPart = compartmentEditPart.getParent();
+ IFigure fig = (IFigure)(((IGraphicalEditPart)containerEditPart).getFigure().getChildren().get(0));
+ IFigure primaryfig = (IFigure)(fig.getChildren().get(0));
+ String layoutKind = getLayoutKindFromView(((EModelElement)containerEditPart.getModel()));
+ ILayoutToolBox currentLayoutToolBox = layoutToolBoxList.get(layoutKind);
+ if(currentLayoutToolBox != null) {
+ compartmentEditPart.installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, currentLayoutToolBox.getEditPolicy());
+ primaryfig.setLayoutManager(currentLayoutToolBox.getFigureLayout());
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getLayoutKindFromView(EModelElement modelElement) {
+ EAnnotation layoutAnnotation = modelElement.getEAnnotation(VisualInformationPapyrusConstants.LAYOUTFIGURE);
+ if(layoutAnnotation != null) {
+ EMap<String, String> entries = layoutAnnotation.getDetails();
+
+ if(entries != null) {
+ String gradientvalueString = entries.get(VisualInformationPapyrusConstants.LAYOUTFIGURE_VALUE);
+ return gradientvalueString;
+ }
+ }
+ return "";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public SetLayoutKindCommand setLayoutKindOnView(TransactionalEditingDomain domain, EModelElement view, String layoutKind) {
+ return new SetLayoutKindCommand(domain, view, layoutKind);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/CleanDiagramHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/CleanDiagramHelper.java
index 594dd832e63..29407c995ba 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/CleanDiagramHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/CleanDiagramHelper.java
@@ -1,188 +1,188 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-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.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.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.AbstractEMFOperation;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.common.core.util.Log;
-import org.eclipse.gmf.runtime.common.core.util.StringStatics;
-import org.eclipse.gmf.runtime.common.core.util.Trace;
-import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
-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.DiagramUIDebugOptions;
-import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
-import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIStatusCodes;
-import org.eclipse.gmf.runtime.diagram.ui.internal.editparts.DefaultNodeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
-import org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy;
-
-@SuppressWarnings("restriction")
-public class CleanDiagramHelper {
-
- protected static CleanDiagramHelper cleanDiagramHelper;
-
- /** The view to remove. */
- protected ArrayList<View> viewToRemove = new ArrayList<View>();
-
- protected DiagramEditPart selectedElement;
-
- public static CleanDiagramHelper getInstance() {
- if(cleanDiagramHelper == null) {
- cleanDiagramHelper = new CleanDiagramHelper();
- }
- return cleanDiagramHelper;
- }
-
- /**
- * {@inheritDoc}
- */
- public void run(DiagramEditPart diagramEditPart) {
- this.selectedElement = diagramEditPart;
- OrphanViewPolicy removeOrphanViewPolicy = (OrphanViewPolicy)diagramEditPart.getEditPolicy("RemoveOrphanView");
- if(removeOrphanViewPolicy != null) {
- removeOrphanViewPolicy.forceRefresh();
- }
- scan(diagramEditPart);
- deleteUnknownViews();
-
- }
-
- /**
- * Delete unknown views.
- */
- protected void deleteUnknownViews() {
- for(int i = 0; i < viewToRemove.size(); i++) {
- Activator.getDefault().logInfo("Remove " + viewToRemove.get(i));
- executeCommand(getDeleteViewCommand(viewToRemove.get(i)));
- }
- }
-
- /**
- * comes from {@link OrphanViewPolicy}.
- *
- * @param cmd
- * the cmd
- */
- @SuppressWarnings("rawtypes")
- protected void executeCommand(final Command cmd) {
- Map options = null;
-
- EditPart ep = selectedElement;
- boolean isActivating = true;
- // use the viewer to determine if we are still initializing the diagram
- // do not use the DiagramEditPart.isActivating since
- // ConnectionEditPart's
- // parent will not be a diagram edit part
- EditPartViewer viewer = ep.getViewer();
- if(viewer instanceof DiagramGraphicalViewer) {
- isActivating = ((DiagramGraphicalViewer)viewer).isInitializing();
- }
-
- if(isActivating || !EditPartUtil.isWriteTransactionInProgress((IGraphicalEditPart)selectedElement, false, false))
- options = Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
-
- AbstractEMFOperation operation = new AbstractEMFOperation(((IGraphicalEditPart)selectedElement).getEditingDomain(), StringStatics.BLANK, options) {
-
- protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- cmd.execute();
-
- return Status.OK_STATUS;
- }
- };
- try {
- operation.execute(new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "executeCommand", e); //$NON-NLS-1$
- Log.warning(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "executeCommand", e); //$NON-NLS-1$
- }
- }
-
- /**
- * Try to construct.
- *
- * @param parent
- * the parent
- * @param child
- * the child
- *
- * @return the edits the part
- */
- protected EditPart tryToConstruct(EditPart parent, View child) {
-
- if(selectedElement.getViewer().getEditPartFactory().createEditPart(parent, child) instanceof DefaultNodeEditPart) {
- viewToRemove.add(child);
- } else {
- Object object = selectedElement.getViewer().getEditPartRegistry().get(child);
- if(object instanceof EditPart) {
- return ((EditPart)object);
- }
- }
- return null;
- }
-
- /**
- * gets a {@link Command} to delete the supplied {@link View}.
- *
- * @param view
- * view to use
- *
- * @return command
- */
- protected Command getDeleteViewCommand(View view) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)selectedElement).getEditingDomain();
- return new ICommandProxy(new DeleteCommand(editingDomain, view));
- }
-
- /**
- * Scan.
- *
- * @param editPart
- * the edit part
- */
- protected void scan(EditPart editPart) {
- View parentView = (View)editPart.getModel();
- Iterator<EObject> iterator = parentView.eAllContents();
- while(iterator.hasNext()) {
- EObject currentObject = iterator.next();
- if(currentObject instanceof View) {
- tryToConstruct(editPart, (View)currentObject);
-
- }
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+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.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.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.AbstractEMFOperation;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.util.Log;
+import org.eclipse.gmf.runtime.common.core.util.StringStatics;
+import org.eclipse.gmf.runtime.common.core.util.Trace;
+import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
+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.DiagramUIDebugOptions;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIPlugin;
+import org.eclipse.gmf.runtime.diagram.ui.internal.DiagramUIStatusCodes;
+import org.eclipse.gmf.runtime.diagram.ui.internal.editparts.DefaultNodeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
+import org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.OrphanViewPolicy;
+
+@SuppressWarnings("restriction")
+public class CleanDiagramHelper {
+
+ protected static CleanDiagramHelper cleanDiagramHelper;
+
+ /** The view to remove. */
+ protected ArrayList<View> viewToRemove = new ArrayList<View>();
+
+ protected DiagramEditPart selectedElement;
+
+ public static CleanDiagramHelper getInstance() {
+ if(cleanDiagramHelper == null) {
+ cleanDiagramHelper = new CleanDiagramHelper();
+ }
+ return cleanDiagramHelper;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(DiagramEditPart diagramEditPart) {
+ this.selectedElement = diagramEditPart;
+ OrphanViewPolicy removeOrphanViewPolicy = (OrphanViewPolicy)diagramEditPart.getEditPolicy("RemoveOrphanView");
+ if(removeOrphanViewPolicy != null) {
+ removeOrphanViewPolicy.forceRefresh();
+ }
+ scan(diagramEditPart);
+ deleteUnknownViews();
+
+ }
+
+ /**
+ * Delete unknown views.
+ */
+ protected void deleteUnknownViews() {
+ for(int i = 0; i < viewToRemove.size(); i++) {
+ Activator.getDefault().logInfo("Remove " + viewToRemove.get(i));
+ executeCommand(getDeleteViewCommand(viewToRemove.get(i)));
+ }
+ }
+
+ /**
+ * comes from {@link OrphanViewPolicy}.
+ *
+ * @param cmd
+ * the cmd
+ */
+ @SuppressWarnings("rawtypes")
+ protected void executeCommand(final Command cmd) {
+ Map options = null;
+
+ EditPart ep = selectedElement;
+ boolean isActivating = true;
+ // use the viewer to determine if we are still initializing the diagram
+ // do not use the DiagramEditPart.isActivating since
+ // ConnectionEditPart's
+ // parent will not be a diagram edit part
+ EditPartViewer viewer = ep.getViewer();
+ if(viewer instanceof DiagramGraphicalViewer) {
+ isActivating = ((DiagramGraphicalViewer)viewer).isInitializing();
+ }
+
+ if(isActivating || !EditPartUtil.isWriteTransactionInProgress((IGraphicalEditPart)selectedElement, false, false))
+ options = Collections.singletonMap(Transaction.OPTION_UNPROTECTED, Boolean.TRUE);
+
+ AbstractEMFOperation operation = new AbstractEMFOperation(((IGraphicalEditPart)selectedElement).getEditingDomain(), StringStatics.BLANK, options) {
+
+ protected IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ cmd.execute();
+
+ return Status.OK_STATUS;
+ }
+ };
+ try {
+ operation.execute(new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ Trace.catching(DiagramUIPlugin.getInstance(), DiagramUIDebugOptions.EXCEPTIONS_CATCHING, getClass(), "executeCommand", e); //$NON-NLS-1$
+ Log.warning(DiagramUIPlugin.getInstance(), DiagramUIStatusCodes.IGNORED_EXCEPTION_WARNING, "executeCommand", e); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Try to construct.
+ *
+ * @param parent
+ * the parent
+ * @param child
+ * the child
+ *
+ * @return the edits the part
+ */
+ protected EditPart tryToConstruct(EditPart parent, View child) {
+
+ if(selectedElement.getViewer().getEditPartFactory().createEditPart(parent, child) instanceof DefaultNodeEditPart) {
+ viewToRemove.add(child);
+ } else {
+ Object object = selectedElement.getViewer().getEditPartRegistry().get(child);
+ if(object instanceof EditPart) {
+ return ((EditPart)object);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * gets a {@link Command} to delete the supplied {@link View}.
+ *
+ * @param view
+ * view to use
+ *
+ * @return command
+ */
+ protected Command getDeleteViewCommand(View view) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart)selectedElement).getEditingDomain();
+ return new ICommandProxy(new DeleteCommand(editingDomain, view));
+ }
+
+ /**
+ * Scan.
+ *
+ * @param editPart
+ * the edit part
+ */
+ protected void scan(EditPart editPart) {
+ View parentView = (View)editPart.getModel();
+ Iterator<EObject> iterator = parentView.eAllContents();
+ while(iterator.hasNext()) {
+ EObject currentObject = iterator.next();
+ if(currentObject instanceof View) {
+ tryToConstruct(editPart, (View)currentObject);
+
+ }
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationConstraintHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationConstraintHelper.java
index 7e4b7b420d4..2c648de6be0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationConstraintHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationConstraintHelper.java
@@ -1,109 +1,109 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.uml2.uml.DurationConstraint;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This helper provides interesting features for DurationConstraint objects
- */
-public class DurationConstraintHelper {
-
- /**
- * Get the list of all DurationConstraint constraining a given element
- *
- * @param element
- * the constrained element
- * @return list of DurationConstraint
- */
- public static List<DurationConstraint> getDurationConstraintsOn(NamedElement element) {
- Collection<Setting> inverseReferences = EMFHelper.getUsages(element);
- // DurationConstraint referencing element
- List<DurationConstraint> referencing = new LinkedList<DurationConstraint>();
- for(Setting ref : inverseReferences) {
- if(UMLPackage.eINSTANCE.getConstraint_ConstrainedElement().equals(ref.getEStructuralFeature()) && ref.getEObject() instanceof DurationConstraint && ref.getEObject().eContainer() != null) {
- referencing.add((DurationConstraint)ref.getEObject());
- }
- }
- return referencing;
- }
-
- /**
- * Get the list of all DurationConstraint constraining duration between the
- * two elements (order of parameters does not matter)
- *
- * @param element1
- * the first observed element
- * @param element2
- * the second observed element
- * @return list of DurationConstraint
- */
- public static List<DurationConstraint> getDurationConstraintsBetween(NamedElement element1, NamedElement element2) {
- List<DurationConstraint> referencing = getDurationConstraintsOn(element1);
- referencing.retainAll(getDurationConstraintsOn(element2));
- return referencing;
- }
-
- /**
- * Check whether two occurrences cover the same lifeline for enabling
- * duration constraint creation
- *
- * @param occurrence
- * first occurrence specification
- * @param occurrence2
- * second occurrence specification
- * @return true if occurrences cover the same lifeline
- */
- public static boolean coversSameLifeline(OccurrenceSpecification occurrence, OccurrenceSpecification occurrence2) {
- // In fact, the covered lifeline(s) should be a size 1 list (UML
- // constraint on OccurrenceSpecification).
- List<Lifeline> coveredLifeline = new ArrayList<Lifeline>(occurrence.getCovereds());
- coveredLifeline.retainAll(occurrence2.getCovereds());
- return !coveredLifeline.isEmpty();
- }
-
- /**
- * Check whether two occurrences are ends of the same message for enabling
- * duration constraint creation
- *
- * @param occurrence
- * first occurrence specification
- * @param occurrence2
- * second occurrence specification
- * @return true if occurrences are ends of the same message
- */
- public static boolean endsOfSameMessage(OccurrenceSpecification occurrence, OccurrenceSpecification occurrence2) {
- if(occurrence instanceof MessageOccurrenceSpecification) {
- Message mess = ((MessageOccurrenceSpecification)occurrence).getMessage();
- if(mess != null && occurrence2 instanceof MessageOccurrenceSpecification) {
- Message mess2 = ((MessageOccurrenceSpecification)occurrence2).getMessage();
- return mess.equals(mess2);
- }
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.uml2.uml.DurationConstraint;
+import org.eclipse.uml2.uml.Lifeline;
+import org.eclipse.uml2.uml.Message;
+import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.OccurrenceSpecification;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This helper provides interesting features for DurationConstraint objects
+ */
+public class DurationConstraintHelper {
+
+ /**
+ * Get the list of all DurationConstraint constraining a given element
+ *
+ * @param element
+ * the constrained element
+ * @return list of DurationConstraint
+ */
+ public static List<DurationConstraint> getDurationConstraintsOn(NamedElement element) {
+ Collection<Setting> inverseReferences = EMFHelper.getUsages(element);
+ // DurationConstraint referencing element
+ List<DurationConstraint> referencing = new LinkedList<DurationConstraint>();
+ for(Setting ref : inverseReferences) {
+ if(UMLPackage.eINSTANCE.getConstraint_ConstrainedElement().equals(ref.getEStructuralFeature()) && ref.getEObject() instanceof DurationConstraint && ref.getEObject().eContainer() != null) {
+ referencing.add((DurationConstraint)ref.getEObject());
+ }
+ }
+ return referencing;
+ }
+
+ /**
+ * Get the list of all DurationConstraint constraining duration between the
+ * two elements (order of parameters does not matter)
+ *
+ * @param element1
+ * the first observed element
+ * @param element2
+ * the second observed element
+ * @return list of DurationConstraint
+ */
+ public static List<DurationConstraint> getDurationConstraintsBetween(NamedElement element1, NamedElement element2) {
+ List<DurationConstraint> referencing = getDurationConstraintsOn(element1);
+ referencing.retainAll(getDurationConstraintsOn(element2));
+ return referencing;
+ }
+
+ /**
+ * Check whether two occurrences cover the same lifeline for enabling
+ * duration constraint creation
+ *
+ * @param occurrence
+ * first occurrence specification
+ * @param occurrence2
+ * second occurrence specification
+ * @return true if occurrences cover the same lifeline
+ */
+ public static boolean coversSameLifeline(OccurrenceSpecification occurrence, OccurrenceSpecification occurrence2) {
+ // In fact, the covered lifeline(s) should be a size 1 list (UML
+ // constraint on OccurrenceSpecification).
+ List<Lifeline> coveredLifeline = new ArrayList<Lifeline>(occurrence.getCovereds());
+ coveredLifeline.retainAll(occurrence2.getCovereds());
+ return !coveredLifeline.isEmpty();
+ }
+
+ /**
+ * Check whether two occurrences are ends of the same message for enabling
+ * duration constraint creation
+ *
+ * @param occurrence
+ * first occurrence specification
+ * @param occurrence2
+ * second occurrence specification
+ * @return true if occurrences are ends of the same message
+ */
+ public static boolean endsOfSameMessage(OccurrenceSpecification occurrence, OccurrenceSpecification occurrence2) {
+ if(occurrence instanceof MessageOccurrenceSpecification) {
+ Message mess = ((MessageOccurrenceSpecification)occurrence).getMessage();
+ if(mess != null && occurrence2 instanceof MessageOccurrenceSpecification) {
+ Message mess2 = ((MessageOccurrenceSpecification)occurrence2).getMessage();
+ return mess.equals(mess2);
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationObservationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationObservationHelper.java
index 33702422768..a770d985d22 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationObservationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/DurationObservationHelper.java
@@ -1,98 +1,98 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.uml2.uml.DurationObservation;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.OccurrenceSpecification;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This helper provides interesting features for DurationObservation objects
- */
-public class DurationObservationHelper {
-
- /** The label to display for the duration observation */
- private static final String DURATION_OBSERVATION_LABEL_FORMAT = "&%s";
-
- /**
- * Get the list of all DurationObservation observing duration between the
- * two elements (order of parameters does not matter)
- *
- * @param element1
- * the first observed element
- * @param element2
- * the second observed element
- * @return list of DurationObservation
- */
- public static List<DurationObservation> getDurationObservationsBetween(NamedElement element1, NamedElement element2) {
- // DurationObservation referencing element1
- List<DurationObservation> referencing1 = getDurationObservationsOn(element1);
- // DurationObservation referencing element2
- List<DurationObservation> referencing2 = getDurationObservationsOn(element2);
- referencing1.retainAll(referencing2);
- return referencing1;
- }
-
- /**
- * Get the list of all DurationObservation observing duration from or to an
- * element
- *
- * @param element
- * the observed element
- * @return list of DurationObservation
- */
- public static List<DurationObservation> getDurationObservationsOn(NamedElement element) {
- Collection<Setting> inverseReferences = EMFHelper.getUsages(element);
- // DurationObservation referencing element
- List<DurationObservation> referencing1 = new LinkedList<DurationObservation>();
- for(Setting ref : inverseReferences) {
- if(UMLPackage.eINSTANCE.getDurationObservation_Event().equals(ref.getEStructuralFeature()) && ref.getEObject().eContainer() != null) {
- referencing1.add((DurationObservation)ref.getEObject());
- }
- }
- return referencing1;
- }
-
- /**
- * Get the string for displaying label of a DurationObservation
- *
- * @param observation
- * the duration observation to display
- * @return string
- */
- public static String getLabelString(DurationObservation observation) {
- return String.format(DURATION_OBSERVATION_LABEL_FORMAT, observation.getName());
- }
-
- /**
- * Check whether two occurrences are ends of the same message for enabling
- * duration constraint creation
- *
- * @param occurrence
- * first occurrence specification
- * @param occurrence2
- * second occurrence specification
- * @return true if occurrences are ends of the same message
- */
- public static boolean endsOfSameMessage(OccurrenceSpecification occurrence, OccurrenceSpecification occurrence2) {
- return DurationConstraintHelper.endsOfSameMessage(occurrence, occurrence2);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.uml2.uml.DurationObservation;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.OccurrenceSpecification;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This helper provides interesting features for DurationObservation objects
+ */
+public class DurationObservationHelper {
+
+ /** The label to display for the duration observation */
+ private static final String DURATION_OBSERVATION_LABEL_FORMAT = "&%s";
+
+ /**
+ * Get the list of all DurationObservation observing duration between the
+ * two elements (order of parameters does not matter)
+ *
+ * @param element1
+ * the first observed element
+ * @param element2
+ * the second observed element
+ * @return list of DurationObservation
+ */
+ public static List<DurationObservation> getDurationObservationsBetween(NamedElement element1, NamedElement element2) {
+ // DurationObservation referencing element1
+ List<DurationObservation> referencing1 = getDurationObservationsOn(element1);
+ // DurationObservation referencing element2
+ List<DurationObservation> referencing2 = getDurationObservationsOn(element2);
+ referencing1.retainAll(referencing2);
+ return referencing1;
+ }
+
+ /**
+ * Get the list of all DurationObservation observing duration from or to an
+ * element
+ *
+ * @param element
+ * the observed element
+ * @return list of DurationObservation
+ */
+ public static List<DurationObservation> getDurationObservationsOn(NamedElement element) {
+ Collection<Setting> inverseReferences = EMFHelper.getUsages(element);
+ // DurationObservation referencing element
+ List<DurationObservation> referencing1 = new LinkedList<DurationObservation>();
+ for(Setting ref : inverseReferences) {
+ if(UMLPackage.eINSTANCE.getDurationObservation_Event().equals(ref.getEStructuralFeature()) && ref.getEObject().eContainer() != null) {
+ referencing1.add((DurationObservation)ref.getEObject());
+ }
+ }
+ return referencing1;
+ }
+
+ /**
+ * Get the string for displaying label of a DurationObservation
+ *
+ * @param observation
+ * the duration observation to display
+ * @return string
+ */
+ public static String getLabelString(DurationObservation observation) {
+ return String.format(DURATION_OBSERVATION_LABEL_FORMAT, observation.getName());
+ }
+
+ /**
+ * Check whether two occurrences are ends of the same message for enabling
+ * duration constraint creation
+ *
+ * @param occurrence
+ * first occurrence specification
+ * @param occurrence2
+ * second occurrence specification
+ * @return true if occurrences are ends of the same message
+ */
+ public static boolean endsOfSameMessage(OccurrenceSpecification occurrence, OccurrenceSpecification occurrence2) {
+ return DurationConstraintHelper.endsOfSameMessage(occurrence, occurrence2);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ElementHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ElementHelper.java
index 80a098faca7..0173b9d4912 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ElementHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ElementHelper.java
@@ -1,35 +1,35 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-
-/**
- *
- * this is an abstract class for helper
- *
- */
-public abstract class ElementHelper {
-
- protected TransactionalEditingDomain editDomain;
-
- /**
- * Gets the editing domain.
- *
- * @return the editing domain
- */
- protected TransactionalEditingDomain getEditingDomain() {
- return editDomain;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+
+/**
+ *
+ * this is an abstract class for helper
+ *
+ */
+public abstract class ElementHelper {
+
+ protected TransactionalEditingDomain editDomain;
+
+ /**
+ * Gets the editing domain.
+ *
+ * @return the editing domain
+ */
+ protected TransactionalEditingDomain getEditingDomain() {
+ return editDomain;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ICompartmentLayoutHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ICompartmentLayoutHelper.java
index 74cb7bd23fc..0a47efb6110 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ICompartmentLayoutHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ICompartmentLayoutHelper.java
@@ -1,45 +1,45 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import org.eclipse.emf.ecore.EModelElement;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.papyrus.infra.emf.appearance.commands.SetLayoutKindCommand;
-
-/**
- * the purpose of these kind of object is to. All subclasses are singletons.
- */
-public interface ICompartmentLayoutHelper {
-
- /**
- * Apply layout on the edit part by taking in account the good toolkit.
- */
- public void applyLayout(AbstractGraphicalEditPart editPart);
-
- /**
- * Sets the layout kind on view.
- *
- * @param layoutKind
- * the new layout kind on view
- */
- public SetLayoutKindCommand setLayoutKindOnView(TransactionalEditingDomain domain, EModelElement view, String layoutKind);
-
- /**
- * Gets the layout kind from view.
- *
- * @return the layout kind from view
- */
- public String getLayoutKindFromView(EModelElement modelElement);
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import org.eclipse.emf.ecore.EModelElement;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
+import org.eclipse.papyrus.infra.emf.appearance.commands.SetLayoutKindCommand;
+
+/**
+ * the purpose of these kind of object is to. All subclasses are singletons.
+ */
+public interface ICompartmentLayoutHelper {
+
+ /**
+ * Apply layout on the edit part by taking in account the good toolkit.
+ */
+ public void applyLayout(AbstractGraphicalEditPart editPart);
+
+ /**
+ * Sets the layout kind on view.
+ *
+ * @param layoutKind
+ * the new layout kind on view
+ */
+ public SetLayoutKindCommand setLayoutKindOnView(TransactionalEditingDomain domain, EModelElement view, String layoutKind);
+
+ /**
+ * Gets the layout kind from view.
+ *
+ * @return the layout kind from view
+ */
+ public String getLayoutKindFromView(EModelElement modelElement);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ILinkMappingHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ILinkMappingHelper.java
index 956db30d3ed..19cd834bf99 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ILinkMappingHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/ILinkMappingHelper.java
@@ -1,44 +1,44 @@
-/*****************************************************************************
- * 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:
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.Collection;
-
-import org.eclipse.uml2.uml.Element;
-
-/**
- * Interface to map links at semantic level.
- */
-public interface ILinkMappingHelper {
-
- /**
- * Gets the source.
- *
- * @param link
- * the link
- *
- * @return the source
- */
- public Collection<?> getSource(Element link);
-
- /**
- * Gets the target.
- *
- * @param link
- * the link
- *
- * @return the target
- */
- public Collection<?> getTarget(Element link);
-}
+/*****************************************************************************
+ * 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:
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.Collection;
+
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Interface to map links at semantic level.
+ */
+public interface ILinkMappingHelper {
+
+ /**
+ * Gets the source.
+ *
+ * @param link
+ * the link
+ *
+ * @return the source
+ */
+ public Collection<?> getSource(Element link);
+
+ /**
+ * Gets the target.
+ *
+ * @param link
+ * the link
+ *
+ * @return the target
+ */
+ public Collection<?> getTarget(Element link);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/InteractionFragmentHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/InteractionFragmentHelper.java
index caf9fc1565a..7cf78f0916b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/InteractionFragmentHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/InteractionFragmentHelper.java
@@ -1,156 +1,156 @@
-/*****************************************************************************
- * 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:
- * Vincent Hemery (Atos Origin) vincent.hemery@atosorigin.com - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.InteractionFragment;
-import org.eclipse.uml2.uml.InteractionOperand;
-
-/**
- * This helper provides interesting features for InteractionFragment objects
- *
- * @author vhemery
- *
- */
-public class InteractionFragmentHelper {
-
- /**
- * Find the fragment happening just before this one.
- *
- * @param interactionFragment
- * interaction fragment to search the one before
- * @param uppestContainerToSearchInto
- * the container which we will not search further if encountered
- * (may be null)
- * @return the fragment found happening just before, or null
- */
- public static InteractionFragment findPreviousFragment(InteractionFragment interactionFragment, EObject uppestContainerToSearchInto) {
- if (interactionFragment == null) {
- return null;
- }
-
- Element paramElement;
- if(uppestContainerToSearchInto instanceof Element) {
- paramElement = (Element)uppestContainerToSearchInto;
- } else {
- // search in the parent interaction.
- paramElement = interactionFragment;
- while(paramElement.getOwner() != null && !(paramElement instanceof Interaction)) {
- paramElement = paramElement.getOwner();
- }
- }
- return findInteractionFragment(paramElement, true, interactionFragment, false);
- }
-
- /**
- * Find the fragment happening just after this one.
- *
- * @param interactionFragment
- * interaction fragment to search the one after
- * @param uppestContainerToSearchInto
- * the container which we will not search further if encountered
- * (may be null)
- * @return the fragment found happening just after, or null
- */
- public static InteractionFragment findNextFragment(InteractionFragment interactionFragment, EObject uppestContainerToSearchInto) {
- if (interactionFragment == null) {
- return null;
- }
-
- Element paramElement;
- if(uppestContainerToSearchInto instanceof Element) {
- paramElement = (Element)uppestContainerToSearchInto;
- } else {
- // search in the parent interaction.
- paramElement = interactionFragment;
- while(paramElement.getOwner() != null && !(paramElement instanceof Interaction)) {
- paramElement = paramElement.getOwner();
- }
- }
- return findInteractionFragment(paramElement, false, interactionFragment, false);
- }
-
- /**
- * Find the next or previous interaction fragment
- *
- * @param uppestContainerToSearchInto
- * the container in which we restrain our search
- * @param reverseOrder
- * true if we search the fragment before, false for the one after
- * @param fragmentToStartFrom
- * the reference fragment
- * @param startFragmentFound
- * use false for an external call, true for recursive internal
- * call when the fragmentToStartFrom has already been found
- * @return the found interaction fragment or null if it is not in
- * uppestContainerToSearchInto
- */
- private static InteractionFragment findInteractionFragment(Element uppestContainerToSearchInto, boolean reverseOrder, InteractionFragment fragmentToStartFrom, boolean startFragmentFound) {
- List<? extends Element> listToSearchInto;
- if(uppestContainerToSearchInto instanceof InteractionOperand) {
- listToSearchInto = ((InteractionOperand)uppestContainerToSearchInto).getFragments();
- } else if(uppestContainerToSearchInto instanceof Interaction) {
- listToSearchInto = ((Interaction)uppestContainerToSearchInto).getFragments();
- } else {
- listToSearchInto = uppestContainerToSearchInto.getOwnedElements();
- }
- // search recursively in all the child tree.
- for(int i = 0; i < listToSearchInto.size(); i++) {
- int searchIndex = i;
- if(reverseOrder) {
- searchIndex = listToSearchInto.size() - 1 - i;
- }
- Element searchElement = listToSearchInto.get(searchIndex);
-
- if(fragmentToStartFrom.equals(searchElement)) {
- startFragmentFound = true;
- if(reverseOrder) {
- // search in the previous child
- continue;
- } else {
- // search deeper for children (which we consider they come
- // after)
- }
- } else if(!startFragmentFound) {
- // go quicker to skip every node until we find the appropriate
- // starting fragment
- if(!EcoreUtil.isAncestor(searchElement, fragmentToStartFrom)) {
- continue;
- } else {
- // search deeper for starting fragment
- // startFragmentFound == false
- }
- } else if(searchElement instanceof InteractionFragment && !reverseOrder) {
- // next fragment found, do not search deeper
- return (InteractionFragment)searchElement;
- }
- // search deeper for a fragment
- InteractionFragment fragment = findInteractionFragment(searchElement, reverseOrder, fragmentToStartFrom, startFragmentFound);
- if(fragment != null) {
- return fragment;
- } else if(reverseOrder && searchElement instanceof InteractionFragment) {
- // we searched ineffectively in the children, stop here and
- // return the element
- return (InteractionFragment)searchElement;
- }
- // else, continue
- }
- return null;
- }
-}
+/*****************************************************************************
+ * 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:
+ * Vincent Hemery (Atos Origin) vincent.hemery@atosorigin.com - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Interaction;
+import org.eclipse.uml2.uml.InteractionFragment;
+import org.eclipse.uml2.uml.InteractionOperand;
+
+/**
+ * This helper provides interesting features for InteractionFragment objects
+ *
+ * @author vhemery
+ *
+ */
+public class InteractionFragmentHelper {
+
+ /**
+ * Find the fragment happening just before this one.
+ *
+ * @param interactionFragment
+ * interaction fragment to search the one before
+ * @param uppestContainerToSearchInto
+ * the container which we will not search further if encountered
+ * (may be null)
+ * @return the fragment found happening just before, or null
+ */
+ public static InteractionFragment findPreviousFragment(InteractionFragment interactionFragment, EObject uppestContainerToSearchInto) {
+ if (interactionFragment == null) {
+ return null;
+ }
+
+ Element paramElement;
+ if(uppestContainerToSearchInto instanceof Element) {
+ paramElement = (Element)uppestContainerToSearchInto;
+ } else {
+ // search in the parent interaction.
+ paramElement = interactionFragment;
+ while(paramElement.getOwner() != null && !(paramElement instanceof Interaction)) {
+ paramElement = paramElement.getOwner();
+ }
+ }
+ return findInteractionFragment(paramElement, true, interactionFragment, false);
+ }
+
+ /**
+ * Find the fragment happening just after this one.
+ *
+ * @param interactionFragment
+ * interaction fragment to search the one after
+ * @param uppestContainerToSearchInto
+ * the container which we will not search further if encountered
+ * (may be null)
+ * @return the fragment found happening just after, or null
+ */
+ public static InteractionFragment findNextFragment(InteractionFragment interactionFragment, EObject uppestContainerToSearchInto) {
+ if (interactionFragment == null) {
+ return null;
+ }
+
+ Element paramElement;
+ if(uppestContainerToSearchInto instanceof Element) {
+ paramElement = (Element)uppestContainerToSearchInto;
+ } else {
+ // search in the parent interaction.
+ paramElement = interactionFragment;
+ while(paramElement.getOwner() != null && !(paramElement instanceof Interaction)) {
+ paramElement = paramElement.getOwner();
+ }
+ }
+ return findInteractionFragment(paramElement, false, interactionFragment, false);
+ }
+
+ /**
+ * Find the next or previous interaction fragment
+ *
+ * @param uppestContainerToSearchInto
+ * the container in which we restrain our search
+ * @param reverseOrder
+ * true if we search the fragment before, false for the one after
+ * @param fragmentToStartFrom
+ * the reference fragment
+ * @param startFragmentFound
+ * use false for an external call, true for recursive internal
+ * call when the fragmentToStartFrom has already been found
+ * @return the found interaction fragment or null if it is not in
+ * uppestContainerToSearchInto
+ */
+ private static InteractionFragment findInteractionFragment(Element uppestContainerToSearchInto, boolean reverseOrder, InteractionFragment fragmentToStartFrom, boolean startFragmentFound) {
+ List<? extends Element> listToSearchInto;
+ if(uppestContainerToSearchInto instanceof InteractionOperand) {
+ listToSearchInto = ((InteractionOperand)uppestContainerToSearchInto).getFragments();
+ } else if(uppestContainerToSearchInto instanceof Interaction) {
+ listToSearchInto = ((Interaction)uppestContainerToSearchInto).getFragments();
+ } else {
+ listToSearchInto = uppestContainerToSearchInto.getOwnedElements();
+ }
+ // search recursively in all the child tree.
+ for(int i = 0; i < listToSearchInto.size(); i++) {
+ int searchIndex = i;
+ if(reverseOrder) {
+ searchIndex = listToSearchInto.size() - 1 - i;
+ }
+ Element searchElement = listToSearchInto.get(searchIndex);
+
+ if(fragmentToStartFrom.equals(searchElement)) {
+ startFragmentFound = true;
+ if(reverseOrder) {
+ // search in the previous child
+ continue;
+ } else {
+ // search deeper for children (which we consider they come
+ // after)
+ }
+ } else if(!startFragmentFound) {
+ // go quicker to skip every node until we find the appropriate
+ // starting fragment
+ if(!EcoreUtil.isAncestor(searchElement, fragmentToStartFrom)) {
+ continue;
+ } else {
+ // search deeper for starting fragment
+ // startFragmentFound == false
+ }
+ } else if(searchElement instanceof InteractionFragment && !reverseOrder) {
+ // next fragment found, do not search deeper
+ return (InteractionFragment)searchElement;
+ }
+ // search deeper for a fragment
+ InteractionFragment fragment = findInteractionFragment(searchElement, reverseOrder, fragmentToStartFrom, startFragmentFound);
+ if(fragment != null) {
+ return fragment;
+ } else if(reverseOrder && searchElement instanceof InteractionFragment) {
+ // we searched ineffectively in the children, stop here and
+ // return the element
+ return (InteractionFragment)searchElement;
+ }
+ // else, continue
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/LinkMappingHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/LinkMappingHelper.java
index 9a49837d792..d614cdd8e34 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/LinkMappingHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/LinkMappingHelper.java
@@ -1,195 +1,195 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.util.UMLSwitch;
-
-/**
- * The Class LinkMappingHelper is used as a declaration of contract. This class
- * is used to express the mapping of link at semantic level. for a semantic what
- * is the source what is the target?
- */
-public class LinkMappingHelper {
-
- /**
- * Gets the source.
- *
- * @param link
- * the link
- *
- * @return the source
- */
- // @unused
- public static Collection<?> getSource(Element link) {
- return getSource(link, new CommonSourceUMLSwitch());
- }
-
- /**
- * Gets the source.
- *
- * @param link
- * the link
- * @param umlSwitch
- * the uml switch
- *
- * @return the source
- */
- public static Collection<?> getSource(Element link, CommonSourceUMLSwitch umlSwitch) {
- return umlSwitch.doSwitch(link);
- }
-
- /**
- * Gets the source.
- *
- * @param link
- * the link
- *
- * @return the source
- */
- // @unused
- public static Collection<?> getTarget(Element link) {
- return getTarget(link, new CommonTargetUMLSwitch());
- }
-
- /**
- * Gets the source.
- *
- * @param link
- * the link
- * @param umlSwitch
- * the uml switch
- *
- * @return the source
- */
- public static Collection<?> getTarget(Element link, CommonTargetUMLSwitch umlSwitch) {
- return umlSwitch.doSwitch(link);
- }
-
- /**
- * Contains diagrams common behavior that need to be redefined
- *
- * @author eperico
- */
- public static class CommonSourceUMLSwitch extends UMLSwitch<Collection<?>> {
-
- @Override
- public java.util.Collection<?> caseAssociation(org.eclipse.uml2.uml.Association object) {
- return object.getEndTypes();
- };
-
- @Override
- public java.util.Collection<?> caseComment(org.eclipse.uml2.uml.Comment object) {
- ArrayList result = new ArrayList();
- result.add(object);
- return result;
- };
-
- @Override
- public Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
- return object.getClients();
- };
-
- @Override
- public java.util.Collection<?> caseGeneralization(org.eclipse.uml2.uml.Generalization object) {
- ArrayList result = new ArrayList();
- result.add(object.getOwner());
- return result;
- };
-
- @Override
- public java.util.Collection<?> casePackageMerge(org.eclipse.uml2.uml.PackageMerge object) {
- ArrayList result = new ArrayList();
- result.add(object.getReceivingPackage());
- return result;
- };
-
- @Override
- public java.util.Collection<?> casePackageImport(org.eclipse.uml2.uml.PackageImport object) {
- ArrayList result = new ArrayList();
- result.add(object.getImportingNamespace());
- return result;
- };
-
- @Override
- public Collection<?> caseInformationFlow(org.eclipse.uml2.uml.InformationFlow object) {
- return object.getInformationSources();
- };
-
- @Override
- public Collection<?> defaultCase(org.eclipse.emf.ecore.EObject object) {
- return Collections.EMPTY_LIST;
- };
- }
-
- /**
- * Contains diagrams common behavior that need to be redefined
- *
- * @author eperico
- */
- public static class CommonTargetUMLSwitch extends UMLSwitch<Collection<?>> {
-
- @Override
- public java.util.Collection<?> caseAssociation(org.eclipse.uml2.uml.Association object) {
- return object.getEndTypes();
- };
-
- @Override
- public java.util.Collection<?> caseComment(org.eclipse.uml2.uml.Comment object) {
- return object.getAnnotatedElements();
- };
-
- @Override
- public Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
- return object.getSuppliers();
- };
-
- @Override
- public java.util.Collection<?> caseGeneralization(org.eclipse.uml2.uml.Generalization object) {
- ArrayList result = new ArrayList();
- result.add(object.getGeneral());
- return result;
- };
-
- @Override
- public java.util.Collection<?> casePackageMerge(org.eclipse.uml2.uml.PackageMerge object) {
- ArrayList result = new ArrayList();
- result.add(object.getMergedPackage());
- return result;
- };
-
- @Override
- public java.util.Collection<?> casePackageImport(org.eclipse.uml2.uml.PackageImport object) {
- ArrayList result = new ArrayList();
- result.add(object.getImportedPackage());
- return result;
- };
-
- @Override
- public Collection<?> caseInformationFlow(org.eclipse.uml2.uml.InformationFlow object) {
- return object.getInformationTargets();
- };
-
- @Override
- public Collection<?> defaultCase(org.eclipse.emf.ecore.EObject object) {
- return Collections.EMPTY_LIST;
- };
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ * Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - refactor common behavior between diagrams
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.util.UMLSwitch;
+
+/**
+ * The Class LinkMappingHelper is used as a declaration of contract. This class
+ * is used to express the mapping of link at semantic level. for a semantic what
+ * is the source what is the target?
+ */
+public class LinkMappingHelper {
+
+ /**
+ * Gets the source.
+ *
+ * @param link
+ * the link
+ *
+ * @return the source
+ */
+ // @unused
+ public static Collection<?> getSource(Element link) {
+ return getSource(link, new CommonSourceUMLSwitch());
+ }
+
+ /**
+ * Gets the source.
+ *
+ * @param link
+ * the link
+ * @param umlSwitch
+ * the uml switch
+ *
+ * @return the source
+ */
+ public static Collection<?> getSource(Element link, CommonSourceUMLSwitch umlSwitch) {
+ return umlSwitch.doSwitch(link);
+ }
+
+ /**
+ * Gets the source.
+ *
+ * @param link
+ * the link
+ *
+ * @return the source
+ */
+ // @unused
+ public static Collection<?> getTarget(Element link) {
+ return getTarget(link, new CommonTargetUMLSwitch());
+ }
+
+ /**
+ * Gets the source.
+ *
+ * @param link
+ * the link
+ * @param umlSwitch
+ * the uml switch
+ *
+ * @return the source
+ */
+ public static Collection<?> getTarget(Element link, CommonTargetUMLSwitch umlSwitch) {
+ return umlSwitch.doSwitch(link);
+ }
+
+ /**
+ * Contains diagrams common behavior that need to be redefined
+ *
+ * @author eperico
+ */
+ public static class CommonSourceUMLSwitch extends UMLSwitch<Collection<?>> {
+
+ @Override
+ public java.util.Collection<?> caseAssociation(org.eclipse.uml2.uml.Association object) {
+ return object.getEndTypes();
+ };
+
+ @Override
+ public java.util.Collection<?> caseComment(org.eclipse.uml2.uml.Comment object) {
+ ArrayList result = new ArrayList();
+ result.add(object);
+ return result;
+ };
+
+ @Override
+ public Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
+ return object.getClients();
+ };
+
+ @Override
+ public java.util.Collection<?> caseGeneralization(org.eclipse.uml2.uml.Generalization object) {
+ ArrayList result = new ArrayList();
+ result.add(object.getOwner());
+ return result;
+ };
+
+ @Override
+ public java.util.Collection<?> casePackageMerge(org.eclipse.uml2.uml.PackageMerge object) {
+ ArrayList result = new ArrayList();
+ result.add(object.getReceivingPackage());
+ return result;
+ };
+
+ @Override
+ public java.util.Collection<?> casePackageImport(org.eclipse.uml2.uml.PackageImport object) {
+ ArrayList result = new ArrayList();
+ result.add(object.getImportingNamespace());
+ return result;
+ };
+
+ @Override
+ public Collection<?> caseInformationFlow(org.eclipse.uml2.uml.InformationFlow object) {
+ return object.getInformationSources();
+ };
+
+ @Override
+ public Collection<?> defaultCase(org.eclipse.emf.ecore.EObject object) {
+ return Collections.EMPTY_LIST;
+ };
+ }
+
+ /**
+ * Contains diagrams common behavior that need to be redefined
+ *
+ * @author eperico
+ */
+ public static class CommonTargetUMLSwitch extends UMLSwitch<Collection<?>> {
+
+ @Override
+ public java.util.Collection<?> caseAssociation(org.eclipse.uml2.uml.Association object) {
+ return object.getEndTypes();
+ };
+
+ @Override
+ public java.util.Collection<?> caseComment(org.eclipse.uml2.uml.Comment object) {
+ return object.getAnnotatedElements();
+ };
+
+ @Override
+ public Collection<?> caseDependency(org.eclipse.uml2.uml.Dependency object) {
+ return object.getSuppliers();
+ };
+
+ @Override
+ public java.util.Collection<?> caseGeneralization(org.eclipse.uml2.uml.Generalization object) {
+ ArrayList result = new ArrayList();
+ result.add(object.getGeneral());
+ return result;
+ };
+
+ @Override
+ public java.util.Collection<?> casePackageMerge(org.eclipse.uml2.uml.PackageMerge object) {
+ ArrayList result = new ArrayList();
+ result.add(object.getMergedPackage());
+ return result;
+ };
+
+ @Override
+ public java.util.Collection<?> casePackageImport(org.eclipse.uml2.uml.PackageImport object) {
+ ArrayList result = new ArrayList();
+ result.add(object.getImportedPackage());
+ return result;
+ };
+
+ @Override
+ public Collection<?> caseInformationFlow(org.eclipse.uml2.uml.InformationFlow object) {
+ return object.getInformationTargets();
+ };
+
+ @Override
+ public Collection<?> defaultCase(org.eclipse.emf.ecore.EObject object) {
+ return Collections.EMPTY_LIST;
+ };
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NamedElementHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NamedElementHelper.java
index 6974cfbc1fb..d4cab9434df 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NamedElementHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NamedElementHelper.java
@@ -1,106 +1,106 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * This singleton is used to find a new name of element
- *
- * @deprecated use {@link NamedElementUtil} instead.
- */
-@Deprecated
-public class NamedElementHelper {
-
- public static NamedElementHelper EINSTANCE = new NamedElementHelper();
-
- private String baseString = "default";
-
- /**
- * @deprecated should not be used
- */
- @Deprecated
- public String getBaseString() {
- return baseString;
- }
-
- /**
- * Generic method that returns a new unique name within a namespace.
- *
- * @param umlParent
- * the parent of the element to create
- * @param eclass
- * the eclass of the element to name
- *
- * @return a distinguisable name within the namespace of the umlParent
- * @deprecated
- */
- @Deprecated
- public String getNewUMLElementName(Element umlParent, EClass eclass) {
- return getNewUMLElementName(umlParent, eclass.getName());
- }
-
- /**
- * Generic method that returns a new unique name within a namespace.
- *
- * @param umlParent
- * the parent of the element to create
- * @param baseString
- * the base string for the new element name
- *
- * @return a distinguishable name within the namespace of the umlParent
- *
- * @deprecated use {@link NamedElementUtil#getDefaultNameWithIncrementFromBase(String, java.util.Collection)} directly.
- */
- @Deprecated
- public String getNewUMLElementName(Element umlParent, String baseString) {
- return NamedElementUtil.getDefaultNameWithIncrementFromBase(baseString, umlParent.eContents());
- // this.setBaseString(baseString);
- // String name = ""; //$NON-NLS-1$
- //
- // boolean found = false;
- // // i <10000: avoid infinite loops
- // for(int i = 0; i < 10001; i++) {
- // found = false;
- // name = getBaseString() + i;
- // Iterator it = umlParent.getOwnedElements().iterator();
- // while(it.hasNext() && !found) {
- // Object o = it.next();
- // if(o instanceof NamedElement) {
- // if(name.equals(((NamedElement)o).getName())) {
- // found = true;
- // }
- // }
- // }
- // if(!found) {
- // return name;
- // }
- // }
- // return getBaseString() + "X"; //$NON-NLS-1$
- }
-
- /**
- * set the base string for the name
- *
- * @param baseString
- * a string that is the prefix
- * @deprecated should not be used
- */
- @Deprecated
- public void setBaseString(String baseString) {
- this.baseString = baseString;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * This singleton is used to find a new name of element
+ *
+ * @deprecated use {@link NamedElementUtil} instead.
+ */
+@Deprecated
+public class NamedElementHelper {
+
+ public static NamedElementHelper EINSTANCE = new NamedElementHelper();
+
+ private String baseString = "default";
+
+ /**
+ * @deprecated should not be used
+ */
+ @Deprecated
+ public String getBaseString() {
+ return baseString;
+ }
+
+ /**
+ * Generic method that returns a new unique name within a namespace.
+ *
+ * @param umlParent
+ * the parent of the element to create
+ * @param eclass
+ * the eclass of the element to name
+ *
+ * @return a distinguisable name within the namespace of the umlParent
+ * @deprecated
+ */
+ @Deprecated
+ public String getNewUMLElementName(Element umlParent, EClass eclass) {
+ return getNewUMLElementName(umlParent, eclass.getName());
+ }
+
+ /**
+ * Generic method that returns a new unique name within a namespace.
+ *
+ * @param umlParent
+ * the parent of the element to create
+ * @param baseString
+ * the base string for the new element name
+ *
+ * @return a distinguishable name within the namespace of the umlParent
+ *
+ * @deprecated use {@link NamedElementUtil#getDefaultNameWithIncrementFromBase(String, java.util.Collection)} directly.
+ */
+ @Deprecated
+ public String getNewUMLElementName(Element umlParent, String baseString) {
+ return NamedElementUtil.getDefaultNameWithIncrementFromBase(baseString, umlParent.eContents());
+ // this.setBaseString(baseString);
+ // String name = ""; //$NON-NLS-1$
+ //
+ // boolean found = false;
+ // // i <10000: avoid infinite loops
+ // for(int i = 0; i < 10001; i++) {
+ // found = false;
+ // name = getBaseString() + i;
+ // Iterator it = umlParent.getOwnedElements().iterator();
+ // while(it.hasNext() && !found) {
+ // Object o = it.next();
+ // if(o instanceof NamedElement) {
+ // if(name.equals(((NamedElement)o).getName())) {
+ // found = true;
+ // }
+ // }
+ // }
+ // if(!found) {
+ // return name;
+ // }
+ // }
+ // return getBaseString() + "X"; //$NON-NLS-1$
+ }
+
+ /**
+ * set the base string for the name
+ *
+ * @param baseString
+ * a string that is the prefix
+ * @deprecated should not be used
+ */
+ @Deprecated
+ public void setBaseString(String baseString) {
+ this.baseString = baseString;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NotificationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NotificationHelper.java
index 87e3f8b050a..369cfa23a92 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NotificationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/NotificationHelper.java
@@ -1,82 +1,82 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
-
-public class NotificationHelper {
-
- private UIAdapterImpl modelListener;
-
- private List<Notifier> listeners = new ArrayList<Notifier>();
-
- public NotificationHelper() {
- super();
- }
-
- public NotificationHelper(UIAdapterImpl modelListener) {
- this.modelListener = modelListener;
- }
-
- /**
- * Add listener on a element
- *
- * @param element
- * The object to listen
- */
- public void listenObject(Notifier element) {
- // Only listen the object if it isn't yet listened
- if(element != null && !element.eAdapters().contains(modelListener)) {
- element.eAdapters().add(modelListener);
- listeners.add(element);
- }
- }
-
- /**
- * Remove listener on a element
- *
- * @param element
- * The object to unlisten
- */
- public void unlistenObject(Notifier element) {
- // Only listen the object if it isn't yet listened
- if(element != null && element.eAdapters().contains(modelListener)) {
- element.eAdapters().remove(modelListener);
- }
- listeners.remove(element);
- }
-
- /**
- * Remove all listeners
- */
- public void unlistenAll() {
- if(listeners.size() > 0) {
- for(Notifier listener : listeners) {
- if(listener != null && listener.eAdapters().contains(modelListener)) {
- listener.eAdapters().remove(modelListener);
- }
- }
- listeners.clear();
- }
- }
-
- public void setModelListener(UIAdapterImpl adpater) {
- this.modelListener = adpater;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.papyrus.uml.diagram.common.providers.UIAdapterImpl;
+
+public class NotificationHelper {
+
+ private UIAdapterImpl modelListener;
+
+ private List<Notifier> listeners = new ArrayList<Notifier>();
+
+ public NotificationHelper() {
+ super();
+ }
+
+ public NotificationHelper(UIAdapterImpl modelListener) {
+ this.modelListener = modelListener;
+ }
+
+ /**
+ * Add listener on a element
+ *
+ * @param element
+ * The object to listen
+ */
+ public void listenObject(Notifier element) {
+ // Only listen the object if it isn't yet listened
+ if(element != null && !element.eAdapters().contains(modelListener)) {
+ element.eAdapters().add(modelListener);
+ listeners.add(element);
+ }
+ }
+
+ /**
+ * Remove listener on a element
+ *
+ * @param element
+ * The object to unlisten
+ */
+ public void unlistenObject(Notifier element) {
+ // Only listen the object if it isn't yet listened
+ if(element != null && element.eAdapters().contains(modelListener)) {
+ element.eAdapters().remove(modelListener);
+ }
+ listeners.remove(element);
+ }
+
+ /**
+ * Remove all listeners
+ */
+ public void unlistenAll() {
+ if(listeners.size() > 0) {
+ for(Notifier listener : listeners) {
+ if(listener != null && listener.eAdapters().contains(modelListener)) {
+ listener.eAdapters().remove(modelListener);
+ }
+ }
+ listeners.clear();
+ }
+ }
+
+ public void setModelListener(UIAdapterImpl adpater) {
+ this.modelListener = adpater;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/OperationLabelHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/OperationLabelHelper.java
index 229ef74ae13..91ed5ca1469 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/OperationLabelHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/OperationLabelHelper.java
@@ -1,135 +1,135 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
-import org.eclipse.papyrus.uml.tools.utils.OperationUtil;
-import org.eclipse.uml2.uml.Operation;
-
-/**
- * Helper for labels displaying {@link Property}
- */
-public class OperationLabelHelper extends StereotypedElementLabelHelper {
-
- /**
- * singelton instance
- */
- private static OperationLabelHelper labelHelper;
-
- /**
- * Returns the singleton instance of this class
- *
- * @return the singleton instance.
- */
- public static OperationLabelHelper getInstance() {
- if(labelHelper == null) {
- labelHelper = new OperationLabelHelper();
- }
- return labelHelper;
- }
-
- /** Map for masks */
- protected final Map<Integer, String> masks = new HashMap<Integer, String>(7);
-
- /**
- * Creates a new Operation label helper.
- */
- protected OperationLabelHelper() {
- // initialize the map
- masks.put(ICustomAppearence.DISP_VISIBILITY, "Visibility");
- masks.put(ICustomAppearence.DISP_NAME, "Name");
- masks.put(ICustomAppearence.DISP_PARAMETER_NAME, "Parameters Name");
- masks.put(ICustomAppearence.DISP_PARAMETER_DIRECTION, "Parameters Direction");
- masks.put(ICustomAppearence.DISP_PARAMETER_TYPE, "Parameters Type");
- masks.put(ICustomAppearence.DISP_RT_TYPE, "Return Type");
- masks.put(ICustomAppearence.DISP_PARAMETER_MULTIPLICITY, "Parameters Multiplicity");
- masks.put(ICustomAppearence.DISP_PARAMETER_DEFAULT, "Parameters Default Value");
- masks.put(ICustomAppearence.DISP_PARAMETER_MODIFIERS, "Parameters Modifiers");
- masks.put(ICustomAppearence.DISP_MOFIFIERS, "Modifiers");
-
- }
-
- /**
- * Computes the label that should be displayed by the figure managed by this
- * edit part.
- *
- * @param editPart
- * the edit part that controls the {@link Property} to be
- * displayed
- * @return the label corresponding to the specific display of the property
- * ("default" display given by preferences or specific display given
- * by eAnnotation).
- */
- protected String elementLabel(GraphicalEditPart editPart) {
- int displayValue = ICustomAppearence.DEFAULT_UML_OPERATION;
-
- IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(policy != null) {
- displayValue = policy.getCurrentDisplayValue();
- }
- return OperationUtil.getCustomLabel(getUMLElement(editPart), displayValue);
- }
-
- /**
- * Returns the mask name given the value of the mask
- *
- * @return the mask name or <code>null</code> if no masks has been found
- */
- public String getMaskLabel(int value) {
- return masks.get(value);
- }
-
- /**
- * Returns the collection of mask names
- *
- * @return the collection of mask names
- */
- public Collection<String> getMaskLabels() {
- return masks.values();
- }
-
- /**
- * Returns the map of masks used to display a {@link Property}
- *
- * @return the {@link Map} of masks used to display a {@link Property}
- */
- public Map<Integer, String> getMasks() {
- return masks;
- }
-
- /**
- * Returns the collection of mask values
- *
- * @return the collection of mask values
- */
- public Set<Integer> getMaskValues() {
- return masks.keySet();
- }
-
- /**
- * {@inheritDoc}
- */
- public Operation getUMLElement(GraphicalEditPart editPart) {
- return (Operation)((View)editPart.getModel()).getElement();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
+import org.eclipse.papyrus.uml.tools.utils.OperationUtil;
+import org.eclipse.uml2.uml.Operation;
+
+/**
+ * Helper for labels displaying {@link Property}
+ */
+public class OperationLabelHelper extends StereotypedElementLabelHelper {
+
+ /**
+ * singelton instance
+ */
+ private static OperationLabelHelper labelHelper;
+
+ /**
+ * Returns the singleton instance of this class
+ *
+ * @return the singleton instance.
+ */
+ public static OperationLabelHelper getInstance() {
+ if(labelHelper == null) {
+ labelHelper = new OperationLabelHelper();
+ }
+ return labelHelper;
+ }
+
+ /** Map for masks */
+ protected final Map<Integer, String> masks = new HashMap<Integer, String>(7);
+
+ /**
+ * Creates a new Operation label helper.
+ */
+ protected OperationLabelHelper() {
+ // initialize the map
+ masks.put(ICustomAppearence.DISP_VISIBILITY, "Visibility");
+ masks.put(ICustomAppearence.DISP_NAME, "Name");
+ masks.put(ICustomAppearence.DISP_PARAMETER_NAME, "Parameters Name");
+ masks.put(ICustomAppearence.DISP_PARAMETER_DIRECTION, "Parameters Direction");
+ masks.put(ICustomAppearence.DISP_PARAMETER_TYPE, "Parameters Type");
+ masks.put(ICustomAppearence.DISP_RT_TYPE, "Return Type");
+ masks.put(ICustomAppearence.DISP_PARAMETER_MULTIPLICITY, "Parameters Multiplicity");
+ masks.put(ICustomAppearence.DISP_PARAMETER_DEFAULT, "Parameters Default Value");
+ masks.put(ICustomAppearence.DISP_PARAMETER_MODIFIERS, "Parameters Modifiers");
+ masks.put(ICustomAppearence.DISP_MOFIFIERS, "Modifiers");
+
+ }
+
+ /**
+ * Computes the label that should be displayed by the figure managed by this
+ * edit part.
+ *
+ * @param editPart
+ * the edit part that controls the {@link Property} to be
+ * displayed
+ * @return the label corresponding to the specific display of the property
+ * ("default" display given by preferences or specific display given
+ * by eAnnotation).
+ */
+ protected String elementLabel(GraphicalEditPart editPart) {
+ int displayValue = ICustomAppearence.DEFAULT_UML_OPERATION;
+
+ IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(policy != null) {
+ displayValue = policy.getCurrentDisplayValue();
+ }
+ return OperationUtil.getCustomLabel(getUMLElement(editPart), displayValue);
+ }
+
+ /**
+ * Returns the mask name given the value of the mask
+ *
+ * @return the mask name or <code>null</code> if no masks has been found
+ */
+ public String getMaskLabel(int value) {
+ return masks.get(value);
+ }
+
+ /**
+ * Returns the collection of mask names
+ *
+ * @return the collection of mask names
+ */
+ public Collection<String> getMaskLabels() {
+ return masks.values();
+ }
+
+ /**
+ * Returns the map of masks used to display a {@link Property}
+ *
+ * @return the {@link Map} of masks used to display a {@link Property}
+ */
+ public Map<Integer, String> getMasks() {
+ return masks;
+ }
+
+ /**
+ * Returns the collection of mask values
+ *
+ * @return the collection of mask values
+ */
+ public Set<Integer> getMaskValues() {
+ return masks.keySet();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Operation getUMLElement(GraphicalEditPart editPart) {
+ return (Operation)((View)editPart.getModel()).getElement();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PortLabelHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PortLabelHelper.java
index 01bb767c1d4..c2198852019 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PortLabelHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PortLabelHelper.java
@@ -1,79 +1,79 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
-import org.eclipse.papyrus.uml.tools.utils.PortUtil;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
-
-
-public class PortLabelHelper extends PropertyLabelHelper {
-
- // Einstance
- private static PortLabelHelper labelHelper;
-
- public static PortLabelHelper getInstance() {
- if(labelHelper == null) {
- labelHelper = new PortLabelHelper();
- }
- return labelHelper;
- }
- protected PortLabelHelper(){
- super();
- masks.put(ICustomAppearence.DISP_CONJUGATED, "Conjugated");
- }
-
- /**
- * Computes the label that should be displayed by the figure managed by this
- * edit part.
- *
- * @param editPart
- * the edit part that controls the {@link Property} to be
- * displayed
- * @return the label corresponding to the specific display of the property
- * ("default" display given by preferences or specific display given
- * by eAnnotation).
- */
- protected String elementLabel(GraphicalEditPart editPart) {
- int displayValue = ICustomAppearence.DEFAULT_UML_PORT;
-
- IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(policy != null) {
- displayValue = policy.getCurrentDisplayValue();
- }
- Port elem = getUMLElement(editPart);
- if(elem != null) {
- return PortUtil.getCustomLabel(elem, displayValue);
- }
- return "";
- }
-
-
- /**
- * {@inheritDoc}
- */
- public Port getUMLElement(GraphicalEditPart editPart) {
- if(editPart.getModel() instanceof View) {
- View view = (View)editPart.getModel();
- if(view.getElement() instanceof Port) {
- return (Port)view.getElement();
- }
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
+import org.eclipse.papyrus.uml.tools.utils.PortUtil;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Property;
+
+
+public class PortLabelHelper extends PropertyLabelHelper {
+
+ // Einstance
+ private static PortLabelHelper labelHelper;
+
+ public static PortLabelHelper getInstance() {
+ if(labelHelper == null) {
+ labelHelper = new PortLabelHelper();
+ }
+ return labelHelper;
+ }
+ protected PortLabelHelper(){
+ super();
+ masks.put(ICustomAppearence.DISP_CONJUGATED, "Conjugated");
+ }
+
+ /**
+ * Computes the label that should be displayed by the figure managed by this
+ * edit part.
+ *
+ * @param editPart
+ * the edit part that controls the {@link Property} to be
+ * displayed
+ * @return the label corresponding to the specific display of the property
+ * ("default" display given by preferences or specific display given
+ * by eAnnotation).
+ */
+ protected String elementLabel(GraphicalEditPart editPart) {
+ int displayValue = ICustomAppearence.DEFAULT_UML_PORT;
+
+ IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(policy != null) {
+ displayValue = policy.getCurrentDisplayValue();
+ }
+ Port elem = getUMLElement(editPart);
+ if(elem != null) {
+ return PortUtil.getCustomLabel(elem, displayValue);
+ }
+ return "";
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public Port getUMLElement(GraphicalEditPart editPart) {
+ if(editPart.getModel() instanceof View) {
+ View view = (View)editPart.getModel();
+ if(view.getElement() instanceof Port) {
+ return (Port)view.getElement();
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PreferenceInitializerForElementHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PreferenceInitializerForElementHelper.java
index b676303b49a..38668e5f811 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PreferenceInitializerForElementHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PreferenceInitializerForElementHelper.java
@@ -1,356 +1,356 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.RecordingCommand;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPartService;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
-import org.eclipse.gmf.runtime.notation.FillStyle;
-import org.eclipse.gmf.runtime.notation.FontStyle;
-import org.eclipse.gmf.runtime.notation.JumpLinkStatus;
-import org.eclipse.gmf.runtime.notation.JumpLinkType;
-import org.eclipse.gmf.runtime.notation.Location;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.Routing;
-import org.eclipse.gmf.runtime.notation.Smoothness;
-import org.eclipse.gmf.runtime.notation.TitleStyle;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.papyrus.infra.emf.appearance.style.AnnotationStyleProvider;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
-import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
-import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-
-/**
- * this is an helper that contains method use to initialize font color etc in
- * the view provider
- *
- */
-public class PreferenceInitializerForElementHelper {
-
- public static boolean usePreferenceInitializer(View view) {
- return ThemeInitializerManager.instance.usePreferenceInitializer(view);
- }
-
- public static String getpreferenceKey(View view, String elementName, int pref) {
- return PreferenceConstantHelper.getElementConstant(view.getDiagram().getType() + "_" + elementName, pref); //$NON-NLS-1$
- }
-
- /**
- * initialize the background for a graphical element
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- */
- public static void initBackgroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- if(!usePreferenceInitializer(view)) {
- return;
- }
-
- String fillColorConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.COLOR_FILL);
- String gradientColorConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.COLOR_GRADIENT);
- String gradientPolicyConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.GRADIENT_POLICY);
- String shadowConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.SHADOW);
- String elementIcon = getpreferenceKey(view, elementName, PreferenceConstantHelper.ELEMENTICON);
- String qualifiedName = getpreferenceKey(view, elementName, PreferenceConstantHelper.QUALIFIEDNAME);
-
- org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(store, fillColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
-
- FillStyle fillStyle = (FillStyle)view.getStyle(NotationPackage.Literals.FILL_STYLE);
- fillStyle.setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue());
-
- if(store.getBoolean(gradientPolicyConstant)) {
- GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.getString(gradientColorConstant));
- fillStyle.setGradient(gradientPreferenceConverter.getGradientData());
- fillStyle.setTransparency(gradientPreferenceConverter.getTransparency());
- }
-
- EditingDomain domain = EMFHelper.resolveEditingDomain(view);
- if(domain instanceof TransactionalEditingDomain) {
- TransactionalEditingDomain editingDomain = (TransactionalEditingDomain)domain;
- // shadow
- RecordingCommand shadowcommand = AnnotationStyleProvider.getSetShadowCommand(editingDomain, view, store.getBoolean(shadowConstant));
- if(shadowcommand.canExecute()) {
- shadowcommand.execute();
- }
- // icon label
- RecordingCommand namelabelIconCommand = AnnotationStyleProvider.getSetElementIconCommand(editingDomain, view, store.getBoolean(elementIcon));
- if(namelabelIconCommand.canExecute()) {
- namelabelIconCommand.execute();
- }
- // qualified name
- if(!store.getBoolean(qualifiedName)) {
- RecordingCommand qualifiedNameCommand = AnnotationStyleProvider.getSetQualifiedNameDepthCommand(editingDomain, view, 1000);
- if(qualifiedNameCommand.canExecute()) {
- qualifiedNameCommand.execute();
- }
- }
- }
- }
-
- /**
- * initialize the font for a graphical element
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- */
- public static void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) {
- if(!usePreferenceInitializer(view)) {
- return;
- }
-
- String fontConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.FONT);
- String fontColorConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.COLOR_FONT);
-
- FontStyle viewFontStyle = (FontStyle)view.getStyle(NotationPackage.Literals.FONT_STYLE);
- if(viewFontStyle != null) {
- FontData fontData = PreferenceConverter.getFontData(store, fontConstant);
- viewFontStyle.setFontName(fontData.getName());
- viewFontStyle.setFontHeight(fontData.getHeight());
- viewFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
- viewFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
-
- org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(store, fontColorConstant);
- viewFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
- }
- }
-
- /**
- * initialize the foreground for a graphical element
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- */
- public static void initForegroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
- if(!usePreferenceInitializer(view)) {
- return;
- }
-
- String lineColorConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.COLOR_LINE);
- org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(store, lineColorConstant);
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
- }
-
- /**
- * initialize the routing for a graphical element
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- *
- * @deprecated call {@link PreferenceInitializerForElementHelper#initRoutingFromPrefs(View, IPreferenceStore, String)} instead.
- */
- @Deprecated
- public static void initRountingFromPrefs(View view, final IPreferenceStore store, String elementName) {
- if(!usePreferenceInitializer(view)) {
- return;
- }
- initRoutingFromPrefs(view, store, elementName);
- }
-
- /**
- * initialize the routing for a graphical element
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- */
- public static void initRoutingFromPrefs(View view, final IPreferenceStore store, String elementName) {
- if(!usePreferenceInitializer(view)) {
- return;
- }
-
- Routing routing = Routing.get(store.getInt(getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_STYLE)));
- if(routing != null) {
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
- }
- Smoothness smoothness = Smoothness.get(store.getInt(getpreferenceKey(view, elementName, PreferenceConstantHelper.SMOOTHNESS)));
- if(routing != null) {
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_Smoothness(), smoothness);
- }
- JumpLinkStatus jumpLinkStatus = JumpLinkStatus.get(getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_STATUS));
- if(routing != null) {
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus(), jumpLinkStatus);
- }
-
- JumpLinkType jumpLinkType = JumpLinkType.get(getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_TYPE));
- if(routing != null) {
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType(), jumpLinkType);
- }
- boolean jumpLinksReverse = store.getBoolean(getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_REVERSE));
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse(), jumpLinksReverse);
-
- boolean routingObstruction = store.getBoolean(getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_POLICY_OBSTRUCTION));
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions(), routingObstruction);
-
- boolean routingDistance = store.getBoolean(getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_POLICY_DISTANCE));
- ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance(), routingDistance);
- }
-
- /**
- * initialize the status of the compartment for the node (Showed or hidden)
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- */
- public static void initCompartmentsStatusFromPrefs(View view, final IPreferenceStore store, String elementName) {
- EList<?> children = view.getPersistedChildren();
- if(children != null) {
- for(Object object : children) {
-
- // we look for the name of the compartment for this view
- EditPart dummyEP = EditPartService.getInstance().createGraphicEditPart((View)object);
- IGraphicalEditPart epp = (IGraphicalEditPart)dummyEP;
- IFigure fig1 = epp.getFigure();
-
- if(fig1 instanceof ResizableCompartmentFigure) {
- String compartmentName = ((ResizableCompartmentFigure)fig1).getCompartmentTitle();
- if(compartmentName != null) {
- String diagramKind = view.getDiagram().getType();
- String preferenceKey = PreferenceConstantHelper.getCompartmentElementConstant(diagramKind + "_" + elementName, compartmentName, PreferenceConstantHelper.COMPARTMENT_VISIBILITY); //$NON-NLS-1$
- boolean value = store.getBoolean(preferenceKey);
-
- if(!value) {// the default value is true : nothing to
- // do
- ENamedElement namedElement = PackageUtil.getElement("notation.View.visible"); //$NON-NLS-1$
- ViewUtil.setStructuralFeatureValue((View)object, (EStructuralFeature)namedElement, value);
- }
-
- String compartmentNameVisibilityPreference = PreferenceConstantHelper.getCompartmentElementConstant(diagramKind + "_" + elementName, compartmentName, PreferenceConstantHelper.COMPARTMENT_NAME_VISIBILITY); //$NON-NLS-1$
- boolean showCompartmentName = store.getBoolean(compartmentNameVisibilityPreference);
- View childView = (View)object;
- TitleStyle style = (TitleStyle)childView.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
- if(style != null) {
- style.setShowTitle(showCompartmentName);
- }
- }
- }
- dummyEP = null;
- }
- }
- }
-
- /**
- * initialize the status of each label for the node or for the link (Showed
- * or hidden)
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- */
- public static void initLabelVisibilityFromPrefs(View view, final IPreferenceStore store, String elementName) {
- EList<?> children = view.getPersistedChildren();
- if(children != null) {
- for(Object object : children) {
-
- // we look for the name of the label for this view
- EditPart dummyEP = EditPartService.getInstance().createGraphicEditPart((View)object);
- if(dummyEP instanceof ILabelRoleProvider) {
- String role = ((ILabelRoleProvider)dummyEP).getLabelRole();
- String diagramKind = view.getDiagram().getType();
- String key = PreferenceConstantHelper.getLabelElementConstant(diagramKind + "_" + elementName, role, PreferenceConstantHelper.LABEL_VISIBILITY); //$NON-NLS-1$
- ((View)object).setVisible(store.getBoolean(key));
- }
- dummyEP = null;
- }
- }
- }
-
- /**
- * initialize node dimension.
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- */
- public static Dimension getDimensionFromPref(View view, final IPreferenceStore store, String elementName) {
- Dimension dim = new Dimension();
- String width = getpreferenceKey(view, elementName, PreferenceConstantHelper.WIDTH);
- String height = getpreferenceKey(view, elementName, PreferenceConstantHelper.HEIGHT);
- dim = new Dimension(store.getInt(width), store.getInt(height));
- return dim;
- }
-
- /**
- * initialize label location.
- *
- * @param view
- * the element to initialize
- * @param store
- * the preference store
- * @param elementName
- * the name to the element
- */
- public static void initLabelLocationFromPrefs(View view, final IPreferenceStore store, String elementName) {
- assert (view instanceof Node);
-
- Node label = (Node)view;
- Location location = (Location)label.getLayoutConstraint();
-
- String xKey = getpreferenceKey(view, elementName, PreferenceConstantHelper.LOCATION_X);
- String yKey = getpreferenceKey(view, elementName, PreferenceConstantHelper.LOCATION_Y);
-
- location.setX(store.getInt(xKey));
- location.setY(store.getInt(yKey));
-
- label.setLayoutConstraint(location);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPartService;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
+import org.eclipse.gmf.runtime.emf.core.util.PackageUtil;
+import org.eclipse.gmf.runtime.notation.FillStyle;
+import org.eclipse.gmf.runtime.notation.FontStyle;
+import org.eclipse.gmf.runtime.notation.JumpLinkStatus;
+import org.eclipse.gmf.runtime.notation.JumpLinkType;
+import org.eclipse.gmf.runtime.notation.Location;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.Routing;
+import org.eclipse.gmf.runtime.notation.Smoothness;
+import org.eclipse.gmf.runtime.notation.TitleStyle;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.papyrus.infra.emf.appearance.style.AnnotationStyleProvider;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.providers.ThemeInitializerManager;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.GradientPreferenceConverter;
+import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.uml.diagram.common.editparts.ILabelRoleProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.FontData;
+
+/**
+ * this is an helper that contains method use to initialize font color etc in
+ * the view provider
+ *
+ */
+public class PreferenceInitializerForElementHelper {
+
+ public static boolean usePreferenceInitializer(View view) {
+ return ThemeInitializerManager.instance.usePreferenceInitializer(view);
+ }
+
+ public static String getpreferenceKey(View view, String elementName, int pref) {
+ return PreferenceConstantHelper.getElementConstant(view.getDiagram().getType() + "_" + elementName, pref); //$NON-NLS-1$
+ }
+
+ /**
+ * initialize the background for a graphical element
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ */
+ public static void initBackgroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
+ if(!usePreferenceInitializer(view)) {
+ return;
+ }
+
+ String fillColorConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.COLOR_FILL);
+ String gradientColorConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.COLOR_GRADIENT);
+ String gradientPolicyConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.GRADIENT_POLICY);
+ String shadowConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.SHADOW);
+ String elementIcon = getpreferenceKey(view, elementName, PreferenceConstantHelper.ELEMENTICON);
+ String qualifiedName = getpreferenceKey(view, elementName, PreferenceConstantHelper.QUALIFIEDNAME);
+
+ org.eclipse.swt.graphics.RGB fillRGB = PreferenceConverter.getColor(store, fillColorConstant);
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getFillStyle_FillColor(), FigureUtilities.RGBToInteger(fillRGB));
+
+ FillStyle fillStyle = (FillStyle)view.getStyle(NotationPackage.Literals.FILL_STYLE);
+ fillStyle.setFillColor(FigureUtilities.RGBToInteger(fillRGB).intValue());
+
+ if(store.getBoolean(gradientPolicyConstant)) {
+ GradientPreferenceConverter gradientPreferenceConverter = new GradientPreferenceConverter(store.getString(gradientColorConstant));
+ fillStyle.setGradient(gradientPreferenceConverter.getGradientData());
+ fillStyle.setTransparency(gradientPreferenceConverter.getTransparency());
+ }
+
+ EditingDomain domain = EMFHelper.resolveEditingDomain(view);
+ if(domain instanceof TransactionalEditingDomain) {
+ TransactionalEditingDomain editingDomain = (TransactionalEditingDomain)domain;
+ // shadow
+ RecordingCommand shadowcommand = AnnotationStyleProvider.getSetShadowCommand(editingDomain, view, store.getBoolean(shadowConstant));
+ if(shadowcommand.canExecute()) {
+ shadowcommand.execute();
+ }
+ // icon label
+ RecordingCommand namelabelIconCommand = AnnotationStyleProvider.getSetElementIconCommand(editingDomain, view, store.getBoolean(elementIcon));
+ if(namelabelIconCommand.canExecute()) {
+ namelabelIconCommand.execute();
+ }
+ // qualified name
+ if(!store.getBoolean(qualifiedName)) {
+ RecordingCommand qualifiedNameCommand = AnnotationStyleProvider.getSetQualifiedNameDepthCommand(editingDomain, view, 1000);
+ if(qualifiedNameCommand.canExecute()) {
+ qualifiedNameCommand.execute();
+ }
+ }
+ }
+ }
+
+ /**
+ * initialize the font for a graphical element
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ */
+ public static void initFontStyleFromPrefs(View view, final IPreferenceStore store, String elementName) {
+ if(!usePreferenceInitializer(view)) {
+ return;
+ }
+
+ String fontConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.FONT);
+ String fontColorConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.COLOR_FONT);
+
+ FontStyle viewFontStyle = (FontStyle)view.getStyle(NotationPackage.Literals.FONT_STYLE);
+ if(viewFontStyle != null) {
+ FontData fontData = PreferenceConverter.getFontData(store, fontConstant);
+ viewFontStyle.setFontName(fontData.getName());
+ viewFontStyle.setFontHeight(fontData.getHeight());
+ viewFontStyle.setBold((fontData.getStyle() & SWT.BOLD) != 0);
+ viewFontStyle.setItalic((fontData.getStyle() & SWT.ITALIC) != 0);
+
+ org.eclipse.swt.graphics.RGB fontRGB = PreferenceConverter.getColor(store, fontColorConstant);
+ viewFontStyle.setFontColor(FigureUtilities.RGBToInteger(fontRGB).intValue());
+ }
+ }
+
+ /**
+ * initialize the foreground for a graphical element
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ */
+ public static void initForegroundFromPrefs(View view, final IPreferenceStore store, String elementName) {
+ if(!usePreferenceInitializer(view)) {
+ return;
+ }
+
+ String lineColorConstant = getpreferenceKey(view, elementName, PreferenceConstantHelper.COLOR_LINE);
+ org.eclipse.swt.graphics.RGB lineRGB = PreferenceConverter.getColor(store, lineColorConstant);
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getLineStyle_LineColor(), FigureUtilities.RGBToInteger(lineRGB));
+ }
+
+ /**
+ * initialize the routing for a graphical element
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ *
+ * @deprecated call {@link PreferenceInitializerForElementHelper#initRoutingFromPrefs(View, IPreferenceStore, String)} instead.
+ */
+ @Deprecated
+ public static void initRountingFromPrefs(View view, final IPreferenceStore store, String elementName) {
+ if(!usePreferenceInitializer(view)) {
+ return;
+ }
+ initRoutingFromPrefs(view, store, elementName);
+ }
+
+ /**
+ * initialize the routing for a graphical element
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ */
+ public static void initRoutingFromPrefs(View view, final IPreferenceStore store, String elementName) {
+ if(!usePreferenceInitializer(view)) {
+ return;
+ }
+
+ Routing routing = Routing.get(store.getInt(getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_STYLE)));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_Routing(), routing);
+ }
+ Smoothness smoothness = Smoothness.get(store.getInt(getpreferenceKey(view, elementName, PreferenceConstantHelper.SMOOTHNESS)));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_Smoothness(), smoothness);
+ }
+ JumpLinkStatus jumpLinkStatus = JumpLinkStatus.get(getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_STATUS));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkStatus(), jumpLinkStatus);
+ }
+
+ JumpLinkType jumpLinkType = JumpLinkType.get(getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_TYPE));
+ if(routing != null) {
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinkType(), jumpLinkType);
+ }
+ boolean jumpLinksReverse = store.getBoolean(getpreferenceKey(view, elementName, PreferenceConstantHelper.JUMPLINK_REVERSE));
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_JumpLinksReverse(), jumpLinksReverse);
+
+ boolean routingObstruction = store.getBoolean(getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_POLICY_OBSTRUCTION));
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_AvoidObstructions(), routingObstruction);
+
+ boolean routingDistance = store.getBoolean(getpreferenceKey(view, elementName, PreferenceConstantHelper.ROUTING_POLICY_DISTANCE));
+ ViewUtil.setStructuralFeatureValue(view, NotationPackage.eINSTANCE.getRoutingStyle_ClosestDistance(), routingDistance);
+ }
+
+ /**
+ * initialize the status of the compartment for the node (Showed or hidden)
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ */
+ public static void initCompartmentsStatusFromPrefs(View view, final IPreferenceStore store, String elementName) {
+ EList<?> children = view.getPersistedChildren();
+ if(children != null) {
+ for(Object object : children) {
+
+ // we look for the name of the compartment for this view
+ EditPart dummyEP = EditPartService.getInstance().createGraphicEditPart((View)object);
+ IGraphicalEditPart epp = (IGraphicalEditPart)dummyEP;
+ IFigure fig1 = epp.getFigure();
+
+ if(fig1 instanceof ResizableCompartmentFigure) {
+ String compartmentName = ((ResizableCompartmentFigure)fig1).getCompartmentTitle();
+ if(compartmentName != null) {
+ String diagramKind = view.getDiagram().getType();
+ String preferenceKey = PreferenceConstantHelper.getCompartmentElementConstant(diagramKind + "_" + elementName, compartmentName, PreferenceConstantHelper.COMPARTMENT_VISIBILITY); //$NON-NLS-1$
+ boolean value = store.getBoolean(preferenceKey);
+
+ if(!value) {// the default value is true : nothing to
+ // do
+ ENamedElement namedElement = PackageUtil.getElement("notation.View.visible"); //$NON-NLS-1$
+ ViewUtil.setStructuralFeatureValue((View)object, (EStructuralFeature)namedElement, value);
+ }
+
+ String compartmentNameVisibilityPreference = PreferenceConstantHelper.getCompartmentElementConstant(diagramKind + "_" + elementName, compartmentName, PreferenceConstantHelper.COMPARTMENT_NAME_VISIBILITY); //$NON-NLS-1$
+ boolean showCompartmentName = store.getBoolean(compartmentNameVisibilityPreference);
+ View childView = (View)object;
+ TitleStyle style = (TitleStyle)childView.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
+ if(style != null) {
+ style.setShowTitle(showCompartmentName);
+ }
+ }
+ }
+ dummyEP = null;
+ }
+ }
+ }
+
+ /**
+ * initialize the status of each label for the node or for the link (Showed
+ * or hidden)
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ */
+ public static void initLabelVisibilityFromPrefs(View view, final IPreferenceStore store, String elementName) {
+ EList<?> children = view.getPersistedChildren();
+ if(children != null) {
+ for(Object object : children) {
+
+ // we look for the name of the label for this view
+ EditPart dummyEP = EditPartService.getInstance().createGraphicEditPart((View)object);
+ if(dummyEP instanceof ILabelRoleProvider) {
+ String role = ((ILabelRoleProvider)dummyEP).getLabelRole();
+ String diagramKind = view.getDiagram().getType();
+ String key = PreferenceConstantHelper.getLabelElementConstant(diagramKind + "_" + elementName, role, PreferenceConstantHelper.LABEL_VISIBILITY); //$NON-NLS-1$
+ ((View)object).setVisible(store.getBoolean(key));
+ }
+ dummyEP = null;
+ }
+ }
+ }
+
+ /**
+ * initialize node dimension.
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ */
+ public static Dimension getDimensionFromPref(View view, final IPreferenceStore store, String elementName) {
+ Dimension dim = new Dimension();
+ String width = getpreferenceKey(view, elementName, PreferenceConstantHelper.WIDTH);
+ String height = getpreferenceKey(view, elementName, PreferenceConstantHelper.HEIGHT);
+ dim = new Dimension(store.getInt(width), store.getInt(height));
+ return dim;
+ }
+
+ /**
+ * initialize label location.
+ *
+ * @param view
+ * the element to initialize
+ * @param store
+ * the preference store
+ * @param elementName
+ * the name to the element
+ */
+ public static void initLabelLocationFromPrefs(View view, final IPreferenceStore store, String elementName) {
+ assert (view instanceof Node);
+
+ Node label = (Node)view;
+ Location location = (Location)label.getLayoutConstraint();
+
+ String xKey = getpreferenceKey(view, elementName, PreferenceConstantHelper.LOCATION_X);
+ String yKey = getpreferenceKey(view, elementName, PreferenceConstantHelper.LOCATION_Y);
+
+ location.setX(store.getInt(xKey));
+ location.setY(store.getInt(yKey));
+
+ label.setLayoutConstraint(location);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PropertyLabelHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PropertyLabelHelper.java
index e4f5676ad97..85c20349f17 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PropertyLabelHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/PropertyLabelHelper.java
@@ -1,131 +1,131 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * Helper for labels displaying {@link Property}
- */
-public class PropertyLabelHelper extends StereotypedElementLabelHelper {
-
- // Einstance
- private static PropertyLabelHelper labelHelper;
-
- public static PropertyLabelHelper getInstance() {
- if(labelHelper == null) {
- labelHelper = new PropertyLabelHelper();
- }
- return labelHelper;
- }
-
- /** Map for masks */
- protected final Map<Integer, String> masks = new HashMap<Integer, String>(7);
-
- protected PropertyLabelHelper() {
- // initialize the map
- masks.put(ICustomAppearence.DISP_VISIBILITY, "Visibility");
- masks.put(ICustomAppearence.DISP_DERIVE, "Is Derived");
- masks.put(ICustomAppearence.DISP_NAME, "Name");
- masks.put(ICustomAppearence.DISP_TYPE, "Type");
- masks.put(ICustomAppearence.DISP_MULTIPLICITY, "Multiplicity");
- masks.put(ICustomAppearence.DISP_DFLT_VALUE, "Default Value");
- masks.put(ICustomAppearence.DISP_MOFIFIERS, "Modifiers");
- }
-
- /**
- * Computes the label that should be displayed by the figure managed by this
- * edit part.
- *
- * @param editPart
- * the edit part that controls the {@link Property} to be
- * displayed
- * @return the label corresponding to the specific display of the property
- * ("default" display given by preferences or specific display given
- * by eAnnotation).
- */
- protected String elementLabel(GraphicalEditPart editPart) {
- int displayValue = ICustomAppearence.DEFAULT_UML_PROPERTY;
-
- IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- if(policy != null) {
- displayValue = policy.getCurrentDisplayValue();
- }
- Property elem = getUMLElement(editPart);
- if(elem != null) {
- return PropertyUtil.getCustomLabel(elem, displayValue);
- }
- return "";
- }
-
- /**
- * Returns the mask name given the value of the mask
- *
- * @return the mask name or <code>null</code> if no masks has been found
- */
- public String getMaskLabel(int value) {
- return masks.get(value);
- }
-
- /**
- * Returns the collection of mask names
- *
- * @return the collection of mask names
- */
- public Collection<String> getMaskLabels() {
- return masks.values();
- }
-
- /**
- * Returns the map of masks used to display a {@link Property}
- *
- * @return the {@link Map} of masks used to display a {@link Property}
- */
- public Map<Integer, String> getMasks() {
- return masks;
- }
-
- /**
- * Returns the collection of mask values
- *
- * @return the collection of mask values
- */
- public Set<Integer> getMaskValues() {
- return masks.keySet();
- }
-
- /**
- * {@inheritDoc}
- */
- public Property getUMLElement(GraphicalEditPart editPart) {
- if(editPart.getModel() instanceof View) {
- View view = (View)editPart.getModel();
- if(view.getElement() instanceof Property) {
- return (Property)view.getElement();
- }
- }
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
+import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
+import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
+import org.eclipse.uml2.uml.Property;
+
+/**
+ * Helper for labels displaying {@link Property}
+ */
+public class PropertyLabelHelper extends StereotypedElementLabelHelper {
+
+ // Einstance
+ private static PropertyLabelHelper labelHelper;
+
+ public static PropertyLabelHelper getInstance() {
+ if(labelHelper == null) {
+ labelHelper = new PropertyLabelHelper();
+ }
+ return labelHelper;
+ }
+
+ /** Map for masks */
+ protected final Map<Integer, String> masks = new HashMap<Integer, String>(7);
+
+ protected PropertyLabelHelper() {
+ // initialize the map
+ masks.put(ICustomAppearence.DISP_VISIBILITY, "Visibility");
+ masks.put(ICustomAppearence.DISP_DERIVE, "Is Derived");
+ masks.put(ICustomAppearence.DISP_NAME, "Name");
+ masks.put(ICustomAppearence.DISP_TYPE, "Type");
+ masks.put(ICustomAppearence.DISP_MULTIPLICITY, "Multiplicity");
+ masks.put(ICustomAppearence.DISP_DFLT_VALUE, "Default Value");
+ masks.put(ICustomAppearence.DISP_MOFIFIERS, "Modifiers");
+ }
+
+ /**
+ * Computes the label that should be displayed by the figure managed by this
+ * edit part.
+ *
+ * @param editPart
+ * the edit part that controls the {@link Property} to be
+ * displayed
+ * @return the label corresponding to the specific display of the property
+ * ("default" display given by preferences or specific display given
+ * by eAnnotation).
+ */
+ protected String elementLabel(GraphicalEditPart editPart) {
+ int displayValue = ICustomAppearence.DEFAULT_UML_PROPERTY;
+
+ IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart.getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
+ if(policy != null) {
+ displayValue = policy.getCurrentDisplayValue();
+ }
+ Property elem = getUMLElement(editPart);
+ if(elem != null) {
+ return PropertyUtil.getCustomLabel(elem, displayValue);
+ }
+ return "";
+ }
+
+ /**
+ * Returns the mask name given the value of the mask
+ *
+ * @return the mask name or <code>null</code> if no masks has been found
+ */
+ public String getMaskLabel(int value) {
+ return masks.get(value);
+ }
+
+ /**
+ * Returns the collection of mask names
+ *
+ * @return the collection of mask names
+ */
+ public Collection<String> getMaskLabels() {
+ return masks.values();
+ }
+
+ /**
+ * Returns the map of masks used to display a {@link Property}
+ *
+ * @return the {@link Map} of masks used to display a {@link Property}
+ */
+ public Map<Integer, String> getMasks() {
+ return masks;
+ }
+
+ /**
+ * Returns the collection of mask values
+ *
+ * @return the collection of mask values
+ */
+ public Set<Integer> getMaskValues() {
+ return masks.keySet();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Property getUMLElement(GraphicalEditPart editPart) {
+ if(editPart.getModel() instanceof View) {
+ View view = (View)editPart.getModel();
+ if(view.getElement() instanceof Property) {
+ return (Property)view.getElement();
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypeFigureHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypeFigureHelper.java
index f017bd1ff6d..ef5f4004de3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypeFigureHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypeFigureHelper.java
@@ -1,384 +1,384 @@
-/*****************************************************************************
- * Copyright (c) 2010 Atos Origin.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.GravityConstrainedFlowLayout;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.GravityDirectionType;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
-import org.eclipse.papyrus.uml.diagram.common.figure.node.CenteredWrappedLabel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * StereotypeFigureHelper helps a Figure implement IPapyrusNodeUMLElementFigure
- * class to support stereotypes
- */
-public abstract class StereotypeFigureHelper {
-
- /** @generated */
- private CenteredWrappedLabel fActionStereotypeLabel;
-
- /** Added for stereotypes properties, displayed in the InBrace location */
- private CenteredWrappedLabel stereotypePropertiesInBraceContent;
-
- /** Added for stereotypes properties */
- private WrappingLabel stereotypePropertiesContent;
-
- /** The rectangle displaying stereotype elements */
- private RectangleFigure stereotypeRectangle;
-
- /** whether the stereotypeRectangle is displayed */
- private boolean stereotypePrinted;
-
- private IFigure container;
- /**
- * Inset used by then centered wrappe label
- */
- private int topInset = 2;
- private int leftInset = 5;
- private int bottomInset = 5;
- private int rightInset = 5;
- /**
- * True if the container of the stereotype has to be filled
- */
- private boolean isStereotypeContainerFilled = false;
-
- /**
- * @generated
- */
- public StereotypeFigureHelper(IFigure containingFigure) {
- container = containingFigure;
- init();
- createContents();
- }
- /**
- * Method use to be override by child class to set the options
- */
- protected void init() {
- }
-
- /**
- * @generated NOT
- */
- private void createContents() {
-
- stereotypeRectangle = new RectangleFigure();
- stereotypeRectangle.setFill(isStereotypeContainerFilled);
- stereotypeRectangle.setOutline(false);
- stereotypeRectangle.setLineWidth(1);
- stereotypePrinted = false;
-
- GravityConstrainedFlowLayout layoutStereotypeRect0 = new GravityConstrainedFlowLayout();
- layoutStereotypeRect0.setGravity(GravityDirectionType.NORTH);
- layoutStereotypeRect0.setIgnoreInvisibleChildren(true);
- layoutStereotypeRect0.setStretchMajorAxis(false);
- layoutStereotypeRect0.setStretchMinorAxis(false);
- stereotypeRectangle.setLayoutManager(layoutStereotypeRect0);
- }
-
- /**
- * This method is used to draw the rectangle displaying stereotype elements
- * if not displayed
- */
- protected void ensureStereotypeRectanglePrinted() {
- if(!stereotypePrinted) {
- Object constraintStereotypeRect0 = getStereotypeRectangleConstraint();
-
- container.add(stereotypeRectangle, constraintStereotypeRect0, 0);
- stereotypePrinted = true;
- }
- }
-
- /**
- * This method is used to ensure the rectangle displaying stereotype
- * elements is not displayed if empty
- */
- protected void cleanStereotypeRectangle() {
- if(stereotypePrinted && stereotypeRectangle.getChildren().isEmpty()) {
- container.remove(stereotypeRectangle);
- stereotypePrinted = false;
- }
- }
-
- /**
- * this method is used to remove the stereotype label.
- */
- protected void removeStereotypeLabel() {
- // Remove label if any
- if(fActionStereotypeLabel != null) {
- stereotypeRectangle.remove(fActionStereotypeLabel);
- fActionStereotypeLabel = null;
- }
- cleanStereotypeRectangle();
- }
-
- /**
- * this method is used to create the stereotype label.
- */
- protected void createStereotypeLabel() {
- ensureStereotypeRectanglePrinted();
- fActionStereotypeLabel = new CenteredWrappedLabel();
- //fActionStereotypeLabel.setBorder(new MarginBorder(getMapMode().DPtoLP(topInset), getMapMode().DPtoLP(leftInset), getMapMode().DPtoLP(bottomInset ), getMapMode().DPtoLP(rightInset)));
- // Add the stereotype label to the figure
- stereotypeRectangle.add(fActionStereotypeLabel, GravityConstrainedFlowLayout.ALIGN_CENTER, 0);
- }
-
- /**
- * this method is used to remove the stereotype label.
- */
- protected void removeStereotypePropertiesInBraceLabel() {
- // Remove label if any
- if(stereotypePropertiesInBraceContent != null) {
- stereotypeRectangle.remove(stereotypePropertiesInBraceContent);
- stereotypePropertiesInBraceContent = null;
- }
- cleanStereotypeRectangle();
- }
-
- /**
- * this method is used to create the stereotype label.
- */
- protected void createStereotypePropertiesInBraceLabel() {
- ensureStereotypeRectanglePrinted();
- stereotypePropertiesInBraceContent = new CenteredWrappedLabel();
- //stereotypePropertiesInBraceContent.setBorder(new MarginBorder(getMapMode().DPtoLP(2), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5)));
- // Add the stereotype label to the figure
- stereotypeRectangle.add(stereotypePropertiesInBraceContent, GravityConstrainedFlowLayout.ALIGN_CENTER, -1);
- }
-
- /**
- * this method is used to remove the stereotype label.
- */
- protected void removeStereotypePropertiesInCompartment() {
- // Remove label if any
- if(stereotypePropertiesContent != null) {
- stereotypeRectangle.remove(stereotypePropertiesContent);
- stereotypePropertiesContent = null;
- }
- cleanStereotypeRectangle();
- }
-
- /**
- * Create properties compartment for displaying visible properties of
- * applied stereotypes
- */
- protected void createStereotypePropertiesInCompartment() {
- ensureStereotypeRectanglePrinted();
- stereotypePropertiesContent = new WrappingLabel();
- stereotypePropertiesContent.setTextJustification(SWT.LEFT);
- stereotypePropertiesContent.setTextAlignment(PositionConstants.LEFT);
- stereotypePropertiesContent.setTextWrap(true);
- //stereotypePropertiesContent.setBorder(new MarginBorder(getMapMode().DPtoLP(2), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5)));
- // Add the stereotype label to the figure
- stereotypeRectangle.add(stereotypePropertiesContent, GravityConstrainedFlowLayout.ALIGN_TOPLEFT, -1);
- }
-
- /**
- * Fill properties compartment with displayed properties
- *
- * @param stereotypeProperties
- * the properties string
- */
- private void fillStereotypePropertiesInCompartment(String stereotypeProperties) {
-
- String propertiesString = stereotypeProperties;
- propertiesString = propertiesString.replace(";", "\n");
- propertiesString = propertiesString.replace("#", "\n ");
- propertiesString = propertiesString.replace("|", "\n ");
- stereotypePropertiesContent.setText(propertiesString);
- }
-
- /**
- * Sets the stereotypes for this figure.
- * <p>
- * This implementation checks if the specified string is null or not.
- * <ul>
- * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
- * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
- * </ul>
- * </p>
- *
- * @param stereotypes
- * the string representing the stereotypes to be displayed
- * @param image
- * the image representing the stereotypes to be displayed
- * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure#setStereotypeDisplay(java.lang.String,
- * org.eclipse.swt.graphics.Image)
- */
- public void setStereotypeDisplay(String stereotypes, Image image) {
- if(("".equals(stereotypes) || stereotypes == null) && image == null) {
- removeStereotypeLabel();
- } else {
- // Set the stereotype label if it does not already exist
- if(fActionStereotypeLabel == null) {
- createStereotypeLabel();
- }
- // Set stereotype text on figure
- fActionStereotypeLabel.setText(stereotypes);
- // Set stereotype icon on figure
- fActionStereotypeLabel.setIcon(image);
- }
- // refreshLayout();
- }
-
- /**
- * Sets the stereotypes properties for this figure.
- * <p>
- * This implementation checks if the specified string is null or not.
- * <ul>
- * <li>if the string is <code>null</code>, it removes the label representing the stereotypes properties with brace.</li>
- * <li>if this is not <code>null</code>, it creates the stereotype properties label if needed and displays the specified string.</li>
- * </ul>
- * </p>
- *
- * @param stereotypeProperties
- * the string representing the stereotype properties to be
- * displayed
- */
- public void setStereotypePropertiesInBrace(String stereotypeProperties) {
- if("".equals(stereotypeProperties) || stereotypeProperties == null) {
- removeStereotypePropertiesInBraceLabel();
- } else {
- // Set the stereotype label if it does not already exist
- if(stereotypePropertiesInBraceContent == null) {
- createStereotypePropertiesInBraceLabel();
- }
- // Set stereotype text on figure
- stereotypePropertiesInBraceContent.setText("{" + stereotypeProperties + "}");
- }
- // refreshLayout();
- }
-
- /**
- * displays the new string corresponding to the list of stereotypes.
- *
- * if the string is <code>null</code>, then the figure that displays the
- * stereotype label is removed from the NodeNamedElementFigure.
- *
- * @param stereotypeProperties
- * the string to be displayed.
- */
- public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
- if("".equals(stereotypeProperties) || stereotypeProperties == null) {
- removeStereotypePropertiesInCompartment();
- } else {
- // set stereotype properties content
- if(stereotypePropertiesContent == null) {
- createStereotypePropertiesInCompartment();
- }
- fillStereotypePropertiesInCompartment(stereotypeProperties);
- }
- // refreshLayout();
- }
-
- /**
- * @generated
- */
- public CenteredWrappedLabel getActionStereotypeLabel() {
- return fActionStereotypeLabel;
- }
-
- /**
- * Make the layout constraint which must be used to layout the stereotype
- * rectangle
- */
- public abstract Object getStereotypeRectangleConstraint();
-
- /**
- * Get the map mode of the corresponding edit part
- */
- //public abstract IMapMode getMapMode();
-
- public int getTopInset() {
- return topInset;
- }
-
- /**
- *
- * @param topInset
- */
- public void setTopInset(int topInset) {
- this.topInset = topInset;
- }
-
- /**
- *
- * @return
- */
- public int getLeftInset() {
- return leftInset;
- }
-
- /**
- *
- * @param leftInset
- */
- public void setLeftInset(int leftInset) {
- this.leftInset = leftInset;
- }
-
- /**
- *
- * @return
- */
- public int getBottomInset() {
- return bottomInset;
- }
-
- /**
- *
- * @param bottomInset
- */
- public void setBottomInset(int bottomInset) {
- this.bottomInset = bottomInset;
- }
-
- /**
- *
- * @return
- */
- public int getRightInset() {
- return rightInset;
- }
-
- /**
- *
- * @param rightInset
- */
- public void setRightInset(int rightInset) {
- this.rightInset = rightInset;
- }
-
- /**
- * Return true if the Rectangle containing the the stereotype has to be
- * filled
- * @return
- */
- public boolean isStereotypeContainerFilled() {
- return isStereotypeContainerFilled;
- }
-
- /**
- * If set to true the rectangle containing the stereotype will be filled
- * @param isStereotypeContainerFilled
- */
- public void setStereotypeContainerFilled(boolean isStereotypeContainerFilled) {
- this.isStereotypeContainerFilled = isStereotypeContainerFilled;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.MarginBorder;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.RectangleFigure;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.GravityConstrainedFlowLayout;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.GravityDirectionType;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+import org.eclipse.papyrus.uml.diagram.common.figure.node.CenteredWrappedLabel;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * StereotypeFigureHelper helps a Figure implement IPapyrusNodeUMLElementFigure
+ * class to support stereotypes
+ */
+public abstract class StereotypeFigureHelper {
+
+ /** @generated */
+ private CenteredWrappedLabel fActionStereotypeLabel;
+
+ /** Added for stereotypes properties, displayed in the InBrace location */
+ private CenteredWrappedLabel stereotypePropertiesInBraceContent;
+
+ /** Added for stereotypes properties */
+ private WrappingLabel stereotypePropertiesContent;
+
+ /** The rectangle displaying stereotype elements */
+ private RectangleFigure stereotypeRectangle;
+
+ /** whether the stereotypeRectangle is displayed */
+ private boolean stereotypePrinted;
+
+ private IFigure container;
+ /**
+ * Inset used by then centered wrappe label
+ */
+ private int topInset = 2;
+ private int leftInset = 5;
+ private int bottomInset = 5;
+ private int rightInset = 5;
+ /**
+ * True if the container of the stereotype has to be filled
+ */
+ private boolean isStereotypeContainerFilled = false;
+
+ /**
+ * @generated
+ */
+ public StereotypeFigureHelper(IFigure containingFigure) {
+ container = containingFigure;
+ init();
+ createContents();
+ }
+ /**
+ * Method use to be override by child class to set the options
+ */
+ protected void init() {
+ }
+
+ /**
+ * @generated NOT
+ */
+ private void createContents() {
+
+ stereotypeRectangle = new RectangleFigure();
+ stereotypeRectangle.setFill(isStereotypeContainerFilled);
+ stereotypeRectangle.setOutline(false);
+ stereotypeRectangle.setLineWidth(1);
+ stereotypePrinted = false;
+
+ GravityConstrainedFlowLayout layoutStereotypeRect0 = new GravityConstrainedFlowLayout();
+ layoutStereotypeRect0.setGravity(GravityDirectionType.NORTH);
+ layoutStereotypeRect0.setIgnoreInvisibleChildren(true);
+ layoutStereotypeRect0.setStretchMajorAxis(false);
+ layoutStereotypeRect0.setStretchMinorAxis(false);
+ stereotypeRectangle.setLayoutManager(layoutStereotypeRect0);
+ }
+
+ /**
+ * This method is used to draw the rectangle displaying stereotype elements
+ * if not displayed
+ */
+ protected void ensureStereotypeRectanglePrinted() {
+ if(!stereotypePrinted) {
+ Object constraintStereotypeRect0 = getStereotypeRectangleConstraint();
+
+ container.add(stereotypeRectangle, constraintStereotypeRect0, 0);
+ stereotypePrinted = true;
+ }
+ }
+
+ /**
+ * This method is used to ensure the rectangle displaying stereotype
+ * elements is not displayed if empty
+ */
+ protected void cleanStereotypeRectangle() {
+ if(stereotypePrinted && stereotypeRectangle.getChildren().isEmpty()) {
+ container.remove(stereotypeRectangle);
+ stereotypePrinted = false;
+ }
+ }
+
+ /**
+ * this method is used to remove the stereotype label.
+ */
+ protected void removeStereotypeLabel() {
+ // Remove label if any
+ if(fActionStereotypeLabel != null) {
+ stereotypeRectangle.remove(fActionStereotypeLabel);
+ fActionStereotypeLabel = null;
+ }
+ cleanStereotypeRectangle();
+ }
+
+ /**
+ * this method is used to create the stereotype label.
+ */
+ protected void createStereotypeLabel() {
+ ensureStereotypeRectanglePrinted();
+ fActionStereotypeLabel = new CenteredWrappedLabel();
+ //fActionStereotypeLabel.setBorder(new MarginBorder(getMapMode().DPtoLP(topInset), getMapMode().DPtoLP(leftInset), getMapMode().DPtoLP(bottomInset ), getMapMode().DPtoLP(rightInset)));
+ // Add the stereotype label to the figure
+ stereotypeRectangle.add(fActionStereotypeLabel, GravityConstrainedFlowLayout.ALIGN_CENTER, 0);
+ }
+
+ /**
+ * this method is used to remove the stereotype label.
+ */
+ protected void removeStereotypePropertiesInBraceLabel() {
+ // Remove label if any
+ if(stereotypePropertiesInBraceContent != null) {
+ stereotypeRectangle.remove(stereotypePropertiesInBraceContent);
+ stereotypePropertiesInBraceContent = null;
+ }
+ cleanStereotypeRectangle();
+ }
+
+ /**
+ * this method is used to create the stereotype label.
+ */
+ protected void createStereotypePropertiesInBraceLabel() {
+ ensureStereotypeRectanglePrinted();
+ stereotypePropertiesInBraceContent = new CenteredWrappedLabel();
+ //stereotypePropertiesInBraceContent.setBorder(new MarginBorder(getMapMode().DPtoLP(2), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5)));
+ // Add the stereotype label to the figure
+ stereotypeRectangle.add(stereotypePropertiesInBraceContent, GravityConstrainedFlowLayout.ALIGN_CENTER, -1);
+ }
+
+ /**
+ * this method is used to remove the stereotype label.
+ */
+ protected void removeStereotypePropertiesInCompartment() {
+ // Remove label if any
+ if(stereotypePropertiesContent != null) {
+ stereotypeRectangle.remove(stereotypePropertiesContent);
+ stereotypePropertiesContent = null;
+ }
+ cleanStereotypeRectangle();
+ }
+
+ /**
+ * Create properties compartment for displaying visible properties of
+ * applied stereotypes
+ */
+ protected void createStereotypePropertiesInCompartment() {
+ ensureStereotypeRectanglePrinted();
+ stereotypePropertiesContent = new WrappingLabel();
+ stereotypePropertiesContent.setTextJustification(SWT.LEFT);
+ stereotypePropertiesContent.setTextAlignment(PositionConstants.LEFT);
+ stereotypePropertiesContent.setTextWrap(true);
+ //stereotypePropertiesContent.setBorder(new MarginBorder(getMapMode().DPtoLP(2), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5), getMapMode().DPtoLP(5)));
+ // Add the stereotype label to the figure
+ stereotypeRectangle.add(stereotypePropertiesContent, GravityConstrainedFlowLayout.ALIGN_TOPLEFT, -1);
+ }
+
+ /**
+ * Fill properties compartment with displayed properties
+ *
+ * @param stereotypeProperties
+ * the properties string
+ */
+ private void fillStereotypePropertiesInCompartment(String stereotypeProperties) {
+
+ String propertiesString = stereotypeProperties;
+ propertiesString = propertiesString.replace(";", "\n");
+ propertiesString = propertiesString.replace("#", "\n ");
+ propertiesString = propertiesString.replace("|", "\n ");
+ stereotypePropertiesContent.setText(propertiesString);
+ }
+
+ /**
+ * Sets the stereotypes for this figure.
+ * <p>
+ * This implementation checks if the specified string is null or not.
+ * <ul>
+ * <li>if the string is <code>null</code>, it removes the label representing the stereotypes.</li>
+ * <li>if this is not <code>null</code>, it creates the stereotype label if needed and displays the specified string.</li>
+ * </ul>
+ * </p>
+ *
+ * @param stereotypes
+ * the string representing the stereotypes to be displayed
+ * @param image
+ * the image representing the stereotypes to be displayed
+ * @see org.eclipse.papyrus.uml.diagram.common.figure.node.IPapyrusUMLElementFigure#setStereotypeDisplay(java.lang.String,
+ * org.eclipse.swt.graphics.Image)
+ */
+ public void setStereotypeDisplay(String stereotypes, Image image) {
+ if(("".equals(stereotypes) || stereotypes == null) && image == null) {
+ removeStereotypeLabel();
+ } else {
+ // Set the stereotype label if it does not already exist
+ if(fActionStereotypeLabel == null) {
+ createStereotypeLabel();
+ }
+ // Set stereotype text on figure
+ fActionStereotypeLabel.setText(stereotypes);
+ // Set stereotype icon on figure
+ fActionStereotypeLabel.setIcon(image);
+ }
+ // refreshLayout();
+ }
+
+ /**
+ * Sets the stereotypes properties for this figure.
+ * <p>
+ * This implementation checks if the specified string is null or not.
+ * <ul>
+ * <li>if the string is <code>null</code>, it removes the label representing the stereotypes properties with brace.</li>
+ * <li>if this is not <code>null</code>, it creates the stereotype properties label if needed and displays the specified string.</li>
+ * </ul>
+ * </p>
+ *
+ * @param stereotypeProperties
+ * the string representing the stereotype properties to be
+ * displayed
+ */
+ public void setStereotypePropertiesInBrace(String stereotypeProperties) {
+ if("".equals(stereotypeProperties) || stereotypeProperties == null) {
+ removeStereotypePropertiesInBraceLabel();
+ } else {
+ // Set the stereotype label if it does not already exist
+ if(stereotypePropertiesInBraceContent == null) {
+ createStereotypePropertiesInBraceLabel();
+ }
+ // Set stereotype text on figure
+ stereotypePropertiesInBraceContent.setText("{" + stereotypeProperties + "}");
+ }
+ // refreshLayout();
+ }
+
+ /**
+ * displays the new string corresponding to the list of stereotypes.
+ *
+ * if the string is <code>null</code>, then the figure that displays the
+ * stereotype label is removed from the NodeNamedElementFigure.
+ *
+ * @param stereotypeProperties
+ * the string to be displayed.
+ */
+ public void setStereotypePropertiesInCompartment(String stereotypeProperties) {
+ if("".equals(stereotypeProperties) || stereotypeProperties == null) {
+ removeStereotypePropertiesInCompartment();
+ } else {
+ // set stereotype properties content
+ if(stereotypePropertiesContent == null) {
+ createStereotypePropertiesInCompartment();
+ }
+ fillStereotypePropertiesInCompartment(stereotypeProperties);
+ }
+ // refreshLayout();
+ }
+
+ /**
+ * @generated
+ */
+ public CenteredWrappedLabel getActionStereotypeLabel() {
+ return fActionStereotypeLabel;
+ }
+
+ /**
+ * Make the layout constraint which must be used to layout the stereotype
+ * rectangle
+ */
+ public abstract Object getStereotypeRectangleConstraint();
+
+ /**
+ * Get the map mode of the corresponding edit part
+ */
+ //public abstract IMapMode getMapMode();
+
+ public int getTopInset() {
+ return topInset;
+ }
+
+ /**
+ *
+ * @param topInset
+ */
+ public void setTopInset(int topInset) {
+ this.topInset = topInset;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public int getLeftInset() {
+ return leftInset;
+ }
+
+ /**
+ *
+ * @param leftInset
+ */
+ public void setLeftInset(int leftInset) {
+ this.leftInset = leftInset;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public int getBottomInset() {
+ return bottomInset;
+ }
+
+ /**
+ *
+ * @param bottomInset
+ */
+ public void setBottomInset(int bottomInset) {
+ this.bottomInset = bottomInset;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public int getRightInset() {
+ return rightInset;
+ }
+
+ /**
+ *
+ * @param rightInset
+ */
+ public void setRightInset(int rightInset) {
+ this.rightInset = rightInset;
+ }
+
+ /**
+ * Return true if the Rectangle containing the the stereotype has to be
+ * filled
+ * @return
+ */
+ public boolean isStereotypeContainerFilled() {
+ return isStereotypeContainerFilled;
+ }
+
+ /**
+ * If set to true the rectangle containing the stereotype will be filled
+ * @param isStereotypeContainerFilled
+ */
+ public void setStereotypeContainerFilled(boolean isStereotypeContainerFilled) {
+ this.isStereotypeContainerFilled = isStereotypeContainerFilled;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypedElementLabelHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypedElementLabelHelper.java
index 645c1eb85fa..9875201cb23 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypedElementLabelHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/StereotypedElementLabelHelper.java
@@ -1,415 +1,415 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Nizar GUEDIDI (CEA LIST) - update getImage() : test if element is null
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- * Helper class for labels for elements that can have stereotypes
- */
-public abstract class StereotypedElementLabelHelper {
-
- /**
- * {@inheritDoc}
- */
- public Element getUMLElement(GraphicalEditPart editPart) {
- EObject element = ((View)editPart.getModel()).getElement();
- if(element instanceof Element) {
- return (Element)element;
- }
- return null;
- }
-
- /**
- * Parses the string containing the complete definition of properties to be
- * displayed, and generates a map.
- *
- * @param editPart
- * the edit part for which the label is edited
- * @param stereotypesToDisplay
- * the list of stereotypes to display
- * @param stereotypesPropertiesToDisplay
- * the properties of stereotypes to display
- * @return a map. The keys are the name of displayed stereotypes, the
- * corresponding data is a collection of its properties to be
- * displayed
- */
- protected Map<String, List<String>> parseStereotypeProperties(GraphicalEditPart editPart, String stereotypesToDisplay, String stereotypesPropertiesToDisplay) {
- Map<String, List<String>> propertiesMap = new HashMap<String, List<String>>();
- StringTokenizer stringTokenizer = new StringTokenizer(stereotypesPropertiesToDisplay, UMLVisualInformationPapyrusConstant.STEREOTYPE_PROPERTIES_LIST_SEPARATOR);
- while(stringTokenizer.hasMoreTokens()) {
- String propertyName = stringTokenizer.nextToken();
- // retrieve the name of the stereotype for this property
- String stereotypeName = propertyName.substring(0, propertyName.lastIndexOf(".")); // stereotypequalifiedName.propertyname
- if(!propertiesMap.containsKey(stereotypeName)) {
- List<String> propertiesForStereotype = new ArrayList<String>();
- propertiesMap.put(stereotypeName, propertiesForStereotype);
- }
- propertiesMap.get(stereotypeName).add(propertyName.substring(propertyName.lastIndexOf(".") + 1, propertyName.length()));
- }
- return propertiesMap;
- }
-
- /**
- * Returns the image to be displayed for the applied stereotypes.
- *
- * @return the image that represents the first applied stereotype or <code>null</code> if no image has to be displayed
- */
- public Collection<Image> stereotypeIconsToDisplay(GraphicalEditPart editPart) {
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)editPart.getModel());
- if(stereotypespresentationKind == null) {
- return null;
- }
- if(stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) {
- // retrieve the first stereotype in the list of displayed stereotype
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)editPart.getModel());
- Collection<Stereotype> stereotypes = new ArrayList<Stereotype>();
- StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
- while(tokenizer.hasMoreTokens()) {
- String firstStereotypeName = tokenizer.nextToken();
- stereotypes.add(getUMLElement(editPart).getAppliedStereotype(firstStereotypeName));
- }
- return Activator.getIconElements(getUMLElement(editPart), stereotypes, false);
- }
- return new ArrayList<Image>();
- }
-
- /**
- * Returns a String that displays stereotypes (using their simple name or
- * their qualified name) and their properties
- *
- * @param editPart
- * the edit part for which the label is edited
- * @param separator
- * the separator used to split the string representing the
- * stereotypes.
- * @param stereotypesToDisplay
- * the list of stereotypes displayed
- * @param stereotypeWithQualifiedName
- * the list of stereotypes displayed using their qualified names
- * @param stereotypesPropertiesToDisplay
- * the list of properties to display
- * @return a string that displays stereotypes (using their simple name or
- * their qualified name) and their properties
- */
- public String stereotypesAndPropertiesToDisplay(GraphicalEditPart editPart, String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName, String stereotypesPropertiesToDisplay) {
- // Get the preference from PreferenceStore. there should be an assert
- final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- assert store != null : "The preference store was not found";
- if(store == null) {
- return "";
- }
- // retrieve if the name of the stereotype has to put to lower case or
- // not
- String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
- // changes the string of properties into a map, where the entries of the
- // map are the
- // stereotype qualified name, and the properties to display are the data
- Map<String, List<String>> propertiesToDisplay = parseStereotypeProperties(editPart, stereotypesToDisplay, stereotypesPropertiesToDisplay);
- StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
- String out = "";
- while(strQualifiedName.hasMoreElements()) {
- String currentStereotype = strQualifiedName.nextToken();
- // check if current stereotype is applied
- final Element umlElement = getUMLElement(editPart);
- Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
- if(stereotype != null) {
- String name = currentStereotype;
- if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
- // property value contains qualifiedName ==> extract name
- // from it
- StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
- while(strToken.hasMoreTokens()) {
- name = strToken.nextToken();
- }
- }
- // AL Changes Feb. 07 - Beg
- // Handling STEREOTYPE_NAME_APPEARANCE preference (from
- // ProfileApplicationPreferencePage)
- // Previously lowercase forced onto first letter (standard UML)
- // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
- // 1).toLowerCase()+name.substring(1,
- // name.length())+","+separator;
- // check that the name has not already been added to the
- // displayed string
- if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
- if(out.indexOf(name) == -1) {
- out = out + Activator.ST_LEFT + name + Activator.ST_RIGHT + separator;
- }
- } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
- // {
- name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
- if(out.indexOf(name) == -1) {
- out = out + Activator.ST_LEFT + name + Activator.ST_RIGHT + separator;
- }
- }
- // now should add all properties associated to this stereotype
- List<String> properties = propertiesToDisplay.get(stereotype.getQualifiedName());
- if(properties != null) {
- // retrieve property
- for(String propertyName : properties) {
- out = out + StereotypeUtil.displayPropertyValue(stereotype, StereotypeUtil.getPropertyByName(stereotype, propertyName), getUMLElement(editPart), " ");
- }
- }
- }
- }
- if(out.endsWith(",")) {
- return out.substring(0, out.length() - 1);
- }
- if(out.endsWith(separator)) {
- return out.substring(0, out.length() - separator.length());
- }
- return out;
- }
-
- /**
- * get the list of stereotype to display from the eannotation
- *
- * @return the list of stereotypes to display
- */
- public String stereotypesToDisplay(GraphicalEditPart editPart) {
- View view = (View)editPart.getModel();
- // retrieve all stereotypes to be displayed
- // try to display stereotype properties
- String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay(view);
- String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay(view);
- String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(view);
- // now check presentation.
- // if horizontal => equivalent to the inBrace visualization in nodes
- // (i.e. only name =
- // value, separator = comma, delimited with brace
- // if vertical => equivalent to compartment visualization name of
- // stereotype, NL, property =
- // value, NL, etC.
- // check the presentation kind. if only icon => do not display
- // stereotype, only values
- if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
- return StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement(editPart));
- }
- String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(view);
- String display = "";
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
- display += stereotypesAndPropertiesToDisplay(editPart, "\n", stereotypesToDisplay, stereotypesToDisplayWithQN, stereotypesPropertiesToDisplay);
- } else {
- final String st = stereotypesToDisplay(editPart, ", ", stereotypesToDisplay, stereotypesToDisplayWithQN);
- if(st != null && !st.equals("")) {
- display += Activator.ST_LEFT + st + Activator.ST_RIGHT + " ";
- }
- final String propSt = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement(editPart));
- if(propSt != null && !propSt.equals("")) {
- if(st != null && !st.equals("")) {
- // display += "\n";
- }
- display += "{" + propSt + "} ";
- }
- }
- return display;
- }
-
- /**
- * Computes the string that displays the stereotypes for the current element
- *
- * @param separator
- * the separator used to split the string representing the
- * stereotypes.
- * @param stereotypesToDisplay
- * the list of stereotypes displayed
- * @param stereotypeWithQualifiedName
- * the list of stereotypes displayed using their qualified names
- * @return the string that represent the stereotypes
- */
- public String stereotypesToDisplay(GraphicalEditPart editPart, String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName) {
- // AL Changes Feb. 07 - Beg
- // Style Handling for STEREOTYPE_NAME_APPEARANCE from
- // ProfileApplicationPreferencePage
- // Stereotype displayed according to UML standard (first letter forced
- // to lower case) -
- // default -
- // or kept as entered by user (user controlled)
- // Get the preference from PreferenceStore. there should be an assert
- final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
- assert store != null : "The preference store was not found";
- if(store == null) {
- return "";
- }
- String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
- StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
- String out = "";
- while(strQualifiedName.hasMoreElements()) {
- String currentStereotype = strQualifiedName.nextToken();
- // check if current stereotype is applied
- final Element umlElement = getUMLElement(editPart);
- Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
- if(stereotype != null) {
- String name = currentStereotype;
- if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
- // property value contains qualifiedName ==> extract name
- // from it
- StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
- while(strToken.hasMoreTokens()) {
- name = strToken.nextToken();
- }
- }
- // AL Changes Feb. 07 - Beg
- // Handling STEREOTYPE_NAME_APPEARANCE preference (from
- // ProfileApplicationPreferencePage)
- // Previously lowercase forced onto first letter (standard UML)
- // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
- // 1).toLowerCase()+name.substring(1,
- // name.length())+","+separator;
- // check that the name has not already been added to the
- // displayed string
- if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
- if(out.indexOf(name) == -1) {
- out = out + name + separator;
- }
- } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
- // {
- name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
- if(out.indexOf(name) == -1) {
- out = out + name + separator;
- }
- }
- }
- }
- if(out.endsWith(",")) {
- return out.substring(0, out.length() - 1);
- }
- if(out.endsWith(separator)) {
- return out.substring(0, out.length() - separator.length());
- }
- return out;
- }
-
- /**
- * Refreshes the label of the figure associated to the specified edit part
- *
- * @param editPart
- * the edit part managing the refreshed figure
- */
- public void refreshEditPartDisplay(GraphicalEditPart editPart) {
- IFigure figure = editPart.getFigure();
- // computes the icon to be displayed
- final Collection<Image> imageToDisplay = stereotypeIconsToDisplay(editPart);
- // should check if edit part has to display the element icon or not
- if(NameLabelIconHelper.showLabelIcon((View)editPart.getModel())) {
- imageToDisplay.add(getImage(editPart));
- }
- // for each element in the list of stereotype icon, adds it to the icons
- // list of the
- // wrapping label
- // problem (RS - CEA LIST): more icons were displayed before refresh:
- // has to clean
- // problem 2 (RS - CEA LIST): no method to know how many icons were
- // displayed => should fix
- // a max number ?!
- // solution: set all images to null, and then add the correct icons
- int i = 0;
- if(figure instanceof WrappingLabel) {
- while(((WrappingLabel)figure).getIcon(i) != null) {
- ((WrappingLabel)figure).setIcon(null, i);
- i++;
- }
- i = 0;
- for(Image image : imageToDisplay) {
- ((WrappingLabel)figure).setIcon(image, i);
- i++;
- }
- ((WrappingLabel)figure).setText(labelToDisplay(editPart));
- }
- }
-
- /**
- * Computes the label to be displayed for the property
- */
- protected String labelToDisplay(GraphicalEditPart editPart) {
- StringBuffer buffer = new StringBuffer();
- // computes the label for the stereotype (horizontal presentation)
- buffer.append(stereotypesToDisplay(editPart));
- // computes the string label to be displayed
- buffer.append(elementLabel(editPart));
- // buffer.append(PropertyUtil.getCustomLabel(getUMLElement(), 0));
- return buffer.toString();
- }
-
- /**
- * Computes the label corresponding to the semantic element
- *
- * @param editPart
- * the graphical part managing the semantic element
- * @return the string corresponding to the display of the semantic element
- */
- protected abstract String elementLabel(GraphicalEditPart editPart);
-
- /**
- * Returns the image for the element
- *
- * @param editPart
- * the edit part that displays the element
- * @return the image
- */
- public Image getImage(GraphicalEditPart editPart) {
- Element element = getUMLElement(editPart);
- String key = "";
- if(element instanceof NamedElement) {
- key = ((NamedElement)element).getName() + "::" + ((NamedElement)element).getVisibility();
- } else if(element != null) {
- key = element.getClass().getName();
- } else {
- return null;
- }
- ImageRegistry imageRegistry = Activator.getDefault().getImageRegistry();
- Image image = imageRegistry.get(key);
- ImageDescriptor descriptor = null;
- if(image == null) {
- AdapterFactory factory = Activator.getDefault().getItemProvidersAdapterFactory();
- IItemLabelProvider labelProvider = (IItemLabelProvider)factory.adapt(getUMLElement(editPart), IItemLabelProvider.class);
- if(labelProvider != null) {
- descriptor = ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(getUMLElement(editPart)));
- }
- if(descriptor == null) {
- descriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- imageRegistry.put(key, descriptor);
- image = imageRegistry.get(key);
- }
- return image;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * Nizar GUEDIDI (CEA LIST) - update getImage() : test if element is null
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.papyrus.infra.emf.appearance.helper.NameLabelIconHelper;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Stereotype;
+
+/**
+ * Helper class for labels for elements that can have stereotypes
+ */
+public abstract class StereotypedElementLabelHelper {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Element getUMLElement(GraphicalEditPart editPart) {
+ EObject element = ((View)editPart.getModel()).getElement();
+ if(element instanceof Element) {
+ return (Element)element;
+ }
+ return null;
+ }
+
+ /**
+ * Parses the string containing the complete definition of properties to be
+ * displayed, and generates a map.
+ *
+ * @param editPart
+ * the edit part for which the label is edited
+ * @param stereotypesToDisplay
+ * the list of stereotypes to display
+ * @param stereotypesPropertiesToDisplay
+ * the properties of stereotypes to display
+ * @return a map. The keys are the name of displayed stereotypes, the
+ * corresponding data is a collection of its properties to be
+ * displayed
+ */
+ protected Map<String, List<String>> parseStereotypeProperties(GraphicalEditPart editPart, String stereotypesToDisplay, String stereotypesPropertiesToDisplay) {
+ Map<String, List<String>> propertiesMap = new HashMap<String, List<String>>();
+ StringTokenizer stringTokenizer = new StringTokenizer(stereotypesPropertiesToDisplay, UMLVisualInformationPapyrusConstant.STEREOTYPE_PROPERTIES_LIST_SEPARATOR);
+ while(stringTokenizer.hasMoreTokens()) {
+ String propertyName = stringTokenizer.nextToken();
+ // retrieve the name of the stereotype for this property
+ String stereotypeName = propertyName.substring(0, propertyName.lastIndexOf(".")); // stereotypequalifiedName.propertyname
+ if(!propertiesMap.containsKey(stereotypeName)) {
+ List<String> propertiesForStereotype = new ArrayList<String>();
+ propertiesMap.put(stereotypeName, propertiesForStereotype);
+ }
+ propertiesMap.get(stereotypeName).add(propertyName.substring(propertyName.lastIndexOf(".") + 1, propertyName.length()));
+ }
+ return propertiesMap;
+ }
+
+ /**
+ * Returns the image to be displayed for the applied stereotypes.
+ *
+ * @return the image that represents the first applied stereotype or <code>null</code> if no image has to be displayed
+ */
+ public Collection<Image> stereotypeIconsToDisplay(GraphicalEditPart editPart) {
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind((View)editPart.getModel());
+ if(stereotypespresentationKind == null) {
+ return null;
+ }
+ if(stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION) || stereotypespresentationKind.equals(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION)) {
+ // retrieve the first stereotype in the list of displayed stereotype
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay((View)editPart.getModel());
+ Collection<Stereotype> stereotypes = new ArrayList<Stereotype>();
+ StringTokenizer tokenizer = new StringTokenizer(stereotypesToDisplay, ",");
+ while(tokenizer.hasMoreTokens()) {
+ String firstStereotypeName = tokenizer.nextToken();
+ stereotypes.add(getUMLElement(editPart).getAppliedStereotype(firstStereotypeName));
+ }
+ return Activator.getIconElements(getUMLElement(editPart), stereotypes, false);
+ }
+ return new ArrayList<Image>();
+ }
+
+ /**
+ * Returns a String that displays stereotypes (using their simple name or
+ * their qualified name) and their properties
+ *
+ * @param editPart
+ * the edit part for which the label is edited
+ * @param separator
+ * the separator used to split the string representing the
+ * stereotypes.
+ * @param stereotypesToDisplay
+ * the list of stereotypes displayed
+ * @param stereotypeWithQualifiedName
+ * the list of stereotypes displayed using their qualified names
+ * @param stereotypesPropertiesToDisplay
+ * the list of properties to display
+ * @return a string that displays stereotypes (using their simple name or
+ * their qualified name) and their properties
+ */
+ public String stereotypesAndPropertiesToDisplay(GraphicalEditPart editPart, String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName, String stereotypesPropertiesToDisplay) {
+ // Get the preference from PreferenceStore. there should be an assert
+ final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ assert store != null : "The preference store was not found";
+ if(store == null) {
+ return "";
+ }
+ // retrieve if the name of the stereotype has to put to lower case or
+ // not
+ String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
+ // changes the string of properties into a map, where the entries of the
+ // map are the
+ // stereotype qualified name, and the properties to display are the data
+ Map<String, List<String>> propertiesToDisplay = parseStereotypeProperties(editPart, stereotypesToDisplay, stereotypesPropertiesToDisplay);
+ StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
+ String out = "";
+ while(strQualifiedName.hasMoreElements()) {
+ String currentStereotype = strQualifiedName.nextToken();
+ // check if current stereotype is applied
+ final Element umlElement = getUMLElement(editPart);
+ Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
+ if(stereotype != null) {
+ String name = currentStereotype;
+ if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
+ // property value contains qualifiedName ==> extract name
+ // from it
+ StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
+ while(strToken.hasMoreTokens()) {
+ name = strToken.nextToken();
+ }
+ }
+ // AL Changes Feb. 07 - Beg
+ // Handling STEREOTYPE_NAME_APPEARANCE preference (from
+ // ProfileApplicationPreferencePage)
+ // Previously lowercase forced onto first letter (standard UML)
+ // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
+ // 1).toLowerCase()+name.substring(1,
+ // name.length())+","+separator;
+ // check that the name has not already been added to the
+ // displayed string
+ if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
+ if(out.indexOf(name) == -1) {
+ out = out + Activator.ST_LEFT + name + Activator.ST_RIGHT + separator;
+ }
+ } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
+ // {
+ name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
+ if(out.indexOf(name) == -1) {
+ out = out + Activator.ST_LEFT + name + Activator.ST_RIGHT + separator;
+ }
+ }
+ // now should add all properties associated to this stereotype
+ List<String> properties = propertiesToDisplay.get(stereotype.getQualifiedName());
+ if(properties != null) {
+ // retrieve property
+ for(String propertyName : properties) {
+ out = out + StereotypeUtil.displayPropertyValue(stereotype, StereotypeUtil.getPropertyByName(stereotype, propertyName), getUMLElement(editPart), " ");
+ }
+ }
+ }
+ }
+ if(out.endsWith(",")) {
+ return out.substring(0, out.length() - 1);
+ }
+ if(out.endsWith(separator)) {
+ return out.substring(0, out.length() - separator.length());
+ }
+ return out;
+ }
+
+ /**
+ * get the list of stereotype to display from the eannotation
+ *
+ * @return the list of stereotypes to display
+ */
+ public String stereotypesToDisplay(GraphicalEditPart editPart) {
+ View view = (View)editPart.getModel();
+ // retrieve all stereotypes to be displayed
+ // try to display stereotype properties
+ String stereotypesPropertiesToDisplay = AppliedStereotypeHelper.getAppliedStereotypesPropertiesToDisplay(view);
+ String stereotypesToDisplay = AppliedStereotypeHelper.getStereotypesToDisplay(view);
+ String stereotypespresentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(view);
+ // now check presentation.
+ // if horizontal => equivalent to the inBrace visualization in nodes
+ // (i.e. only name =
+ // value, separator = comma, delimited with brace
+ // if vertical => equivalent to compartment visualization name of
+ // stereotype, NL, property =
+ // value, NL, etC.
+ // check the presentation kind. if only icon => do not display
+ // stereotype, only values
+ if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(stereotypespresentationKind)) {
+ return StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement(editPart));
+ }
+ String stereotypesToDisplayWithQN = AppliedStereotypeHelper.getStereotypesQNToDisplay(view);
+ String display = "";
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(stereotypespresentationKind)) {
+ display += stereotypesAndPropertiesToDisplay(editPart, "\n", stereotypesToDisplay, stereotypesToDisplayWithQN, stereotypesPropertiesToDisplay);
+ } else {
+ final String st = stereotypesToDisplay(editPart, ", ", stereotypesToDisplay, stereotypesToDisplayWithQN);
+ if(st != null && !st.equals("")) {
+ display += Activator.ST_LEFT + st + Activator.ST_RIGHT + " ";
+ }
+ final String propSt = StereotypeUtil.getPropertiesValuesInBrace(stereotypesPropertiesToDisplay, getUMLElement(editPart));
+ if(propSt != null && !propSt.equals("")) {
+ if(st != null && !st.equals("")) {
+ // display += "\n";
+ }
+ display += "{" + propSt + "} ";
+ }
+ }
+ return display;
+ }
+
+ /**
+ * Computes the string that displays the stereotypes for the current element
+ *
+ * @param separator
+ * the separator used to split the string representing the
+ * stereotypes.
+ * @param stereotypesToDisplay
+ * the list of stereotypes displayed
+ * @param stereotypeWithQualifiedName
+ * the list of stereotypes displayed using their qualified names
+ * @return the string that represent the stereotypes
+ */
+ public String stereotypesToDisplay(GraphicalEditPart editPart, String separator, String stereotypesToDisplay, String stereotypeWithQualifiedName) {
+ // AL Changes Feb. 07 - Beg
+ // Style Handling for STEREOTYPE_NAME_APPEARANCE from
+ // ProfileApplicationPreferencePage
+ // Stereotype displayed according to UML standard (first letter forced
+ // to lower case) -
+ // default -
+ // or kept as entered by user (user controlled)
+ // Get the preference from PreferenceStore. there should be an assert
+ final IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+ assert store != null : "The preference store was not found";
+ if(store == null) {
+ return "";
+ }
+ String sNameAppearance = store.getString(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE);
+ StringTokenizer strQualifiedName = new StringTokenizer(stereotypesToDisplay, ",");
+ String out = "";
+ while(strQualifiedName.hasMoreElements()) {
+ String currentStereotype = strQualifiedName.nextToken();
+ // check if current stereotype is applied
+ final Element umlElement = getUMLElement(editPart);
+ Stereotype stereotype = umlElement.getAppliedStereotype(currentStereotype);
+ if(stereotype != null) {
+ String name = currentStereotype;
+ if((stereotypeWithQualifiedName.indexOf(currentStereotype)) == -1) {
+ // property value contains qualifiedName ==> extract name
+ // from it
+ StringTokenizer strToken = new StringTokenizer(currentStereotype, "::");
+ while(strToken.hasMoreTokens()) {
+ name = strToken.nextToken();
+ }
+ }
+ // AL Changes Feb. 07 - Beg
+ // Handling STEREOTYPE_NAME_APPEARANCE preference (from
+ // ProfileApplicationPreferencePage)
+ // Previously lowercase forced onto first letter (standard UML)
+ // stereotypesToDisplay = stereotypesToDisplay+name.substring(0,
+ // 1).toLowerCase()+name.substring(1,
+ // name.length())+","+separator;
+ // check that the name has not already been added to the
+ // displayed string
+ if(sNameAppearance.equals(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED)) {
+ if(out.indexOf(name) == -1) {
+ out = out + name + separator;
+ }
+ } else { // VisualInformationPapyrusConstants.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM))
+ // {
+ name = name.substring(0, 1).toLowerCase() + name.substring(1, name.length());
+ if(out.indexOf(name) == -1) {
+ out = out + name + separator;
+ }
+ }
+ }
+ }
+ if(out.endsWith(",")) {
+ return out.substring(0, out.length() - 1);
+ }
+ if(out.endsWith(separator)) {
+ return out.substring(0, out.length() - separator.length());
+ }
+ return out;
+ }
+
+ /**
+ * Refreshes the label of the figure associated to the specified edit part
+ *
+ * @param editPart
+ * the edit part managing the refreshed figure
+ */
+ public void refreshEditPartDisplay(GraphicalEditPart editPart) {
+ IFigure figure = editPart.getFigure();
+ // computes the icon to be displayed
+ final Collection<Image> imageToDisplay = stereotypeIconsToDisplay(editPart);
+ // should check if edit part has to display the element icon or not
+ if(NameLabelIconHelper.showLabelIcon((View)editPart.getModel())) {
+ imageToDisplay.add(getImage(editPart));
+ }
+ // for each element in the list of stereotype icon, adds it to the icons
+ // list of the
+ // wrapping label
+ // problem (RS - CEA LIST): more icons were displayed before refresh:
+ // has to clean
+ // problem 2 (RS - CEA LIST): no method to know how many icons were
+ // displayed => should fix
+ // a max number ?!
+ // solution: set all images to null, and then add the correct icons
+ int i = 0;
+ if(figure instanceof WrappingLabel) {
+ while(((WrappingLabel)figure).getIcon(i) != null) {
+ ((WrappingLabel)figure).setIcon(null, i);
+ i++;
+ }
+ i = 0;
+ for(Image image : imageToDisplay) {
+ ((WrappingLabel)figure).setIcon(image, i);
+ i++;
+ }
+ ((WrappingLabel)figure).setText(labelToDisplay(editPart));
+ }
+ }
+
+ /**
+ * Computes the label to be displayed for the property
+ */
+ protected String labelToDisplay(GraphicalEditPart editPart) {
+ StringBuffer buffer = new StringBuffer();
+ // computes the label for the stereotype (horizontal presentation)
+ buffer.append(stereotypesToDisplay(editPart));
+ // computes the string label to be displayed
+ buffer.append(elementLabel(editPart));
+ // buffer.append(PropertyUtil.getCustomLabel(getUMLElement(), 0));
+ return buffer.toString();
+ }
+
+ /**
+ * Computes the label corresponding to the semantic element
+ *
+ * @param editPart
+ * the graphical part managing the semantic element
+ * @return the string corresponding to the display of the semantic element
+ */
+ protected abstract String elementLabel(GraphicalEditPart editPart);
+
+ /**
+ * Returns the image for the element
+ *
+ * @param editPart
+ * the edit part that displays the element
+ * @return the image
+ */
+ public Image getImage(GraphicalEditPart editPart) {
+ Element element = getUMLElement(editPart);
+ String key = "";
+ if(element instanceof NamedElement) {
+ key = ((NamedElement)element).getName() + "::" + ((NamedElement)element).getVisibility();
+ } else if(element != null) {
+ key = element.getClass().getName();
+ } else {
+ return null;
+ }
+ ImageRegistry imageRegistry = Activator.getDefault().getImageRegistry();
+ Image image = imageRegistry.get(key);
+ ImageDescriptor descriptor = null;
+ if(image == null) {
+ AdapterFactory factory = Activator.getDefault().getItemProvidersAdapterFactory();
+ IItemLabelProvider labelProvider = (IItemLabelProvider)factory.adapt(getUMLElement(editPart), IItemLabelProvider.class);
+ if(labelProvider != null) {
+ descriptor = ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(getUMLElement(editPart)));
+ }
+ if(descriptor == null) {
+ descriptor = ImageDescriptor.getMissingImageDescriptor();
+ }
+ imageRegistry.put(key, descriptor);
+ image = imageRegistry.get(key);
+ }
+ return image;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeConstraintHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeConstraintHelper.java
index 6691f5cf043..d30590c481f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeConstraintHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeConstraintHelper.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.TimeConstraint;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This helper provides interesting features for TimeConstraint objects
- */
-public class TimeConstraintHelper {
-
- /**
- * Get the list of all TimeConstraint constraining a given element
- *
- * @param element
- * the constrained element
- * @return list of TimeConstraint
- */
- public static List<TimeConstraint> getTimeConstraintsOn(NamedElement element) {
- Collection<Setting> inverseReferences = EMFHelper.getUsages(element);
- // TimeConstraint referencing element
- List<TimeConstraint> referencing = new LinkedList<TimeConstraint>();
- for(Setting ref : inverseReferences) {
- if(UMLPackage.eINSTANCE.getConstraint_ConstrainedElement().equals(ref.getEStructuralFeature()) && ref.getEObject() instanceof TimeConstraint && ref.getEObject().eContainer() != null) {
- referencing.add((TimeConstraint)ref.getEObject());
- }
- }
- return referencing;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.TimeConstraint;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This helper provides interesting features for TimeConstraint objects
+ */
+public class TimeConstraintHelper {
+
+ /**
+ * Get the list of all TimeConstraint constraining a given element
+ *
+ * @param element
+ * the constrained element
+ * @return list of TimeConstraint
+ */
+ public static List<TimeConstraint> getTimeConstraintsOn(NamedElement element) {
+ Collection<Setting> inverseReferences = EMFHelper.getUsages(element);
+ // TimeConstraint referencing element
+ List<TimeConstraint> referencing = new LinkedList<TimeConstraint>();
+ for(Setting ref : inverseReferences) {
+ if(UMLPackage.eINSTANCE.getConstraint_ConstrainedElement().equals(ref.getEStructuralFeature()) && ref.getEObject() instanceof TimeConstraint && ref.getEObject().eContainer() != null) {
+ referencing.add((TimeConstraint)ref.getEObject());
+ }
+ }
+ return referencing;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeObservationHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeObservationHelper.java
index a197f8acce9..e81602cd436 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeObservationHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/TimeObservationHelper.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.TimeObservation;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * This helper provides interesting features for TimeObservation objects
- */
-public class TimeObservationHelper {
-
- /**
- * Get the list of all TimeObservation observing a given element
- *
- * @param element
- * the observed element
- * @return list of TimeObservation
- */
- public static List<TimeObservation> getTimeObservations(NamedElement element) {
- Collection<Setting> inverseReferences = EMFHelper.getUsages(element);
- // TimeConstraint referencing element
- List<TimeObservation> referencing = new LinkedList<TimeObservation>();
- for(Setting ref : inverseReferences) {
- if(UMLPackage.eINSTANCE.getTimeObservation_Event().equals(ref.getEStructuralFeature()) && ref.getEObject().eContainer() != null) {
- referencing.add((TimeObservation)ref.getEObject());
- }
- }
- return referencing;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.TimeObservation;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * This helper provides interesting features for TimeObservation objects
+ */
+public class TimeObservationHelper {
+
+ /**
+ * Get the list of all TimeObservation observing a given element
+ *
+ * @param element
+ * the observed element
+ * @return list of TimeObservation
+ */
+ public static List<TimeObservation> getTimeObservations(NamedElement element) {
+ Collection<Setting> inverseReferences = EMFHelper.getUsages(element);
+ // TimeConstraint referencing element
+ List<TimeObservation> referencing = new LinkedList<TimeObservation>();
+ for(Setting ref : inverseReferences) {
+ if(UMLPackage.eINSTANCE.getTimeObservation_Event().equals(ref.getEStructuralFeature()) && ref.getEObject().eContainer() != null) {
+ referencing.add((TimeObservation)ref.getEObject());
+ }
+ }
+ return referencing;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/UMLBaseEditHelper.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/UMLBaseEditHelper.java
index c57e882efae..60350b788b8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/UMLBaseEditHelper.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/helper/UMLBaseEditHelper.java
@@ -1,109 +1,109 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.helper;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
-import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.uml.diagram.common.commands.UnapplyAllStereotypesCommand;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * @generated
- */
-public class UMLBaseEditHelper extends AbstractEditHelper {
-
- /**
- * @generated
- */
- public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- public static final String CONTEXT_ELEMENT_TYPE = "context element type"; //$NON-NLS-1$
-
- /**
- * @generated
- */
- protected IEditHelperAdvice[] getEditHelperAdvice(IEditCommandRequest req) {
- if(req.getParameter(CONTEXT_ELEMENT_TYPE) instanceof IElementType) {
- return ElementTypeRegistry.getInstance().getEditHelperAdvice((IElementType)req.getParameter(CONTEXT_ELEMENT_TYPE));
- }
- return super.getEditHelperAdvice(req);
- }
-
- /**
- * @generated
- */
- protected ICommand getInsteadCommand(IEditCommandRequest req) {
- ICommand epCommand = (ICommand)req.getParameter(EDIT_POLICY_COMMAND);
- req.setParameter(EDIT_POLICY_COMMAND, null);
- ICommand ehCommand = super.getInsteadCommand(req);
- if(epCommand == null) {
- return ehCommand;
- }
- if(ehCommand == null) {
- return epCommand;
- }
- CompositeCommand command = new CompositeCommand(null);
- command.add(epCommand);
- command.add(ehCommand);
- return command;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateCommand(CreateElementRequest req) {
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
- return null;
- }
-
- /**
- * @generated NOT handle unapply stereotypes before delete
- */
- protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
- EObject elementToDestroy = req.getElementToDestroy();
- if(elementToDestroy instanceof Element) {
- UnapplyAllStereotypesCommand command = new UnapplyAllStereotypesCommand(req.getEditingDomain(), req.getLabel(), (Element)elementToDestroy);
- if(!command.isEmpty()) {
- return command;
- }
- }
- return null;
- }
-
- /**
- * @generated
- */
- protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req) {
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.helper;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.AbstractEditHelper;
+import org.eclipse.gmf.runtime.emf.type.core.edithelper.IEditHelperAdvice;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.uml.diagram.common.commands.UnapplyAllStereotypesCommand;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * @generated
+ */
+public class UMLBaseEditHelper extends AbstractEditHelper {
+
+ /**
+ * @generated
+ */
+ public static final String EDIT_POLICY_COMMAND = "edit policy command"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ public static final String CONTEXT_ELEMENT_TYPE = "context element type"; //$NON-NLS-1$
+
+ /**
+ * @generated
+ */
+ protected IEditHelperAdvice[] getEditHelperAdvice(IEditCommandRequest req) {
+ if(req.getParameter(CONTEXT_ELEMENT_TYPE) instanceof IElementType) {
+ return ElementTypeRegistry.getInstance().getEditHelperAdvice((IElementType)req.getParameter(CONTEXT_ELEMENT_TYPE));
+ }
+ return super.getEditHelperAdvice(req);
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getInsteadCommand(IEditCommandRequest req) {
+ ICommand epCommand = (ICommand)req.getParameter(EDIT_POLICY_COMMAND);
+ req.setParameter(EDIT_POLICY_COMMAND, null);
+ ICommand ehCommand = super.getInsteadCommand(req);
+ if(epCommand == null) {
+ return ehCommand;
+ }
+ if(ehCommand == null) {
+ return epCommand;
+ }
+ CompositeCommand command = new CompositeCommand(null);
+ command.add(epCommand);
+ command.add(ehCommand);
+ return command;
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getCreateCommand(CreateElementRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getCreateRelationshipCommand(CreateRelationshipRequest req) {
+ return null;
+ }
+
+ /**
+ * @generated NOT handle unapply stereotypes before delete
+ */
+ protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
+ EObject elementToDestroy = req.getElementToDestroy();
+ if(elementToDestroy instanceof Element) {
+ UnapplyAllStereotypesCommand command = new UnapplyAllStereotypesCommand(req.getEditingDomain(), req.getLabel(), (Element)elementToDestroy);
+ if(!command.isEmpty()) {
+ return command;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @generated
+ */
+ protected ICommand getDestroyReferenceCommand(DestroyReferenceRequest req) {
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ids/ReorientLinkIDs.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ids/ReorientLinkIDs.java
index a2171d1e66d..82c398b879e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ids/ReorientLinkIDs.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ids/ReorientLinkIDs.java
@@ -1,27 +1,27 @@
-/*******************************************************************************
- * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana .
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ids;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class ReorientLinkIDs.
- *
- * @author <a href="mailto:fjcano@prodevelop.es">Francisco Javier Cano Muñoz</a>
- */
-public class ReorientLinkIDs {
-
- /** The node edit part. */
- public static String nodeEditPart = "nodeEditPart";
-
- /** The link edit part. */
- public static String linkEditPart = "linkEditPart";
-}
+/*******************************************************************************
+ * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana .
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ids;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ReorientLinkIDs.
+ *
+ * @author <a href="mailto:fjcano@prodevelop.es">Francisco Javier Cano Muñoz</a>
+ */
+public class ReorientLinkIDs {
+
+ /** The node edit part. */
+ public static String nodeEditPart = "nodeEditPart";
+
+ /** The link edit part. */
+ public static String linkEditPart = "linkEditPart";
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/AlignmentTree.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/AlignmentTree.java
index cc6f91e5980..07c3e25438e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/AlignmentTree.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/AlignmentTree.java
@@ -1,182 +1,182 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import java.util.List;
-
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.tools.ToolUtilities;
-
-/**
- *
- * A special tree for the alignment action
- *
- */
-public class AlignmentTree extends EditPartTree {
-
- /**
- * this UDI can be used to serialize this class
- */
- private static final long serialVersionUID = 3095221342551975246L;
-
- /**
- *
- * Constructor.
- *
- * @param editpart
- * the editpart represented by this tree
- * @param isSelected
- * Indicates if the represented editpart is selected or not
- *
- */
- public AlignmentTree(Object editpart, boolean isSelected) {
- super(editpart, isSelected);
- }
-
- /**
- *
- * Constructor.
- *
- * @param editparts
- * the editparts used to build the tree
- */
- public AlignmentTree(List<EditPart> editparts) {
- super(editparts);
- }
-
- /**
- * The new position for this element
- */
- private PrecisionRectangle newPosition = null;
-
- /**
- * Gets the new alignment position for the editpart.
- *
- * @return the new alignment position for the editpart
- */
- public PrecisionRectangle getNewPosition() {
- return newPosition;
- }
-
- /**
- * Returns the new bounds of the container
- *
- * @return <ul>
- * <li>{@link EditPartTree#diagramRect} if the container is the diagram</li>
- * <li>the bounds of the container after the shift</li>
- * </ul>
- */
- public PrecisionRectangle getNewContainerBounds() {
- AlignmentTree treeParent = (AlignmentTree)this.getParent();
- PrecisionRectangle newContainerBounds;
-
- if(treeParent.getEditPart() != null) {
- Point oldParentLocation = LayoutUtils.getAbsolutePosition(treeParent.getEditPart()).getLocation();
- Point newParentLocation = treeParent.getNewPosition().getLocation();
-
- // shift between the two positions
- Point shift = newParentLocation.getTranslated(oldParentLocation.getNegated());
-
- // we want know the final position for the container
- PrecisionRectangle oldContainerBounds = LayoutUtils.getAbsolutePosition(this.getEditPart().getParent());
- newContainerBounds = new PrecisionRectangle(oldContainerBounds);
- newContainerBounds.translate(shift);
- } else {// treeParent is the root of the tree
- EditPart containerEditPart = this.getEditPart().getParent();
- newContainerBounds = LayoutUtils.getAbsolutePosition(containerEditPart);
- }
- return newContainerBounds;
- }
-
- /**
- * Returns the absolute position for the editpart in the new container
- *
- * @return the absolute position for the editpart in the new container.
- * That's to say the intermediate position, when the container has
- * moved, and the editpart hasn't moved
- */
- public PrecisionRectangle getAbsolutePositionInTheNewContainerPosition() {
- PrecisionRectangle newPosition = new PrecisionRectangle(LayoutUtils.getAbsolutePosition(getEditPart()));
- PrecisionRectangle newContainerPosition = getNewContainerBounds();
- PrecisionRectangle oldContainerPosition = LayoutUtils.getAbsolutePosition(getEditPart().getParent());
- PrecisionRectangle distance = (PrecisionRectangle)newContainerPosition.translate(oldContainerPosition.getLocation().getNegated());
- return (PrecisionRectangle)newPosition.translate(distance.getLocation());
- }
-
- /**
- * Sets the alignment position for the editpart
- *
- * @param newPosition
- * the new alignment position for the editpart
- */
- public void setNewPosition(PrecisionRectangle newPosition) {
- this.newPosition = newPosition;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.layout.EditPartTree#createChildrenTree(java.util.List, java.util.List)
- *
- * @param editparts
- * the selected editpart
- * @param parentsList
- * parents of editparts which could be interesting to add to the
- * tree
- * @return
- */
- @Override
- protected EditPartTree createChildrenTree(List<EditPart> editparts, List<EditPart> parentsList) {
- EditPartTree childTree = null;
- for(EditPart editpart : parentsList) {
-
- /*
- * the editparts are interesting only if they are selected or if its
- * parent is selected!
- */
- if(editparts.contains(editpart) || ((!editparts.contains(editpart)) && ToolUtilities.isAncestorContainedIn(editparts, editpart))) {
- boolean isSelected = editparts.contains(editpart);
- AlignmentTree parentTree = new AlignmentTree(editpart, isSelected);
- if(!isSelected) {
- // this editpart won't move, so we can precise now its
- // position
- parentTree.setNewPosition(LayoutUtils.getAbsolutePosition(editpart));
- }
- if(childTree != null) {
- parentTree.add(childTree);
- }
- childTree = parentTree;
- }
- }
- return childTree;
- }
-
- /**
- * Specifies in the tree which editpart in the selected editpart is used
- * like reference to do the alignment action
- *
- * @see org.eclipse.papyrus.uml.diagram.common.layout.EditPartTree#postBuildOperations(java.util.List)
- *
- * @param editparts
- * the editparts list
- */
- @Override
- protected void postBuildOperations(List<EditPart> editparts) {
- // the reference for the alignment is the last selected element
- ((AlignmentTree)this.getTree(editparts.get(editparts.size() - 1))).setNewPosition(LayoutUtils.getAbsolutePosition(editparts.get(editparts.size() - 1)));
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import java.util.List;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.tools.ToolUtilities;
+
+/**
+ *
+ * A special tree for the alignment action
+ *
+ */
+public class AlignmentTree extends EditPartTree {
+
+ /**
+ * this UDI can be used to serialize this class
+ */
+ private static final long serialVersionUID = 3095221342551975246L;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editpart
+ * the editpart represented by this tree
+ * @param isSelected
+ * Indicates if the represented editpart is selected or not
+ *
+ */
+ public AlignmentTree(Object editpart, boolean isSelected) {
+ super(editpart, isSelected);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editparts
+ * the editparts used to build the tree
+ */
+ public AlignmentTree(List<EditPart> editparts) {
+ super(editparts);
+ }
+
+ /**
+ * The new position for this element
+ */
+ private PrecisionRectangle newPosition = null;
+
+ /**
+ * Gets the new alignment position for the editpart.
+ *
+ * @return the new alignment position for the editpart
+ */
+ public PrecisionRectangle getNewPosition() {
+ return newPosition;
+ }
+
+ /**
+ * Returns the new bounds of the container
+ *
+ * @return <ul>
+ * <li>{@link EditPartTree#diagramRect} if the container is the diagram</li>
+ * <li>the bounds of the container after the shift</li>
+ * </ul>
+ */
+ public PrecisionRectangle getNewContainerBounds() {
+ AlignmentTree treeParent = (AlignmentTree)this.getParent();
+ PrecisionRectangle newContainerBounds;
+
+ if(treeParent.getEditPart() != null) {
+ Point oldParentLocation = LayoutUtils.getAbsolutePosition(treeParent.getEditPart()).getLocation();
+ Point newParentLocation = treeParent.getNewPosition().getLocation();
+
+ // shift between the two positions
+ Point shift = newParentLocation.getTranslated(oldParentLocation.getNegated());
+
+ // we want know the final position for the container
+ PrecisionRectangle oldContainerBounds = LayoutUtils.getAbsolutePosition(this.getEditPart().getParent());
+ newContainerBounds = new PrecisionRectangle(oldContainerBounds);
+ newContainerBounds.translate(shift);
+ } else {// treeParent is the root of the tree
+ EditPart containerEditPart = this.getEditPart().getParent();
+ newContainerBounds = LayoutUtils.getAbsolutePosition(containerEditPart);
+ }
+ return newContainerBounds;
+ }
+
+ /**
+ * Returns the absolute position for the editpart in the new container
+ *
+ * @return the absolute position for the editpart in the new container.
+ * That's to say the intermediate position, when the container has
+ * moved, and the editpart hasn't moved
+ */
+ public PrecisionRectangle getAbsolutePositionInTheNewContainerPosition() {
+ PrecisionRectangle newPosition = new PrecisionRectangle(LayoutUtils.getAbsolutePosition(getEditPart()));
+ PrecisionRectangle newContainerPosition = getNewContainerBounds();
+ PrecisionRectangle oldContainerPosition = LayoutUtils.getAbsolutePosition(getEditPart().getParent());
+ PrecisionRectangle distance = (PrecisionRectangle)newContainerPosition.translate(oldContainerPosition.getLocation().getNegated());
+ return (PrecisionRectangle)newPosition.translate(distance.getLocation());
+ }
+
+ /**
+ * Sets the alignment position for the editpart
+ *
+ * @param newPosition
+ * the new alignment position for the editpart
+ */
+ public void setNewPosition(PrecisionRectangle newPosition) {
+ this.newPosition = newPosition;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.layout.EditPartTree#createChildrenTree(java.util.List, java.util.List)
+ *
+ * @param editparts
+ * the selected editpart
+ * @param parentsList
+ * parents of editparts which could be interesting to add to the
+ * tree
+ * @return
+ */
+ @Override
+ protected EditPartTree createChildrenTree(List<EditPart> editparts, List<EditPart> parentsList) {
+ EditPartTree childTree = null;
+ for(EditPart editpart : parentsList) {
+
+ /*
+ * the editparts are interesting only if they are selected or if its
+ * parent is selected!
+ */
+ if(editparts.contains(editpart) || ((!editparts.contains(editpart)) && ToolUtilities.isAncestorContainedIn(editparts, editpart))) {
+ boolean isSelected = editparts.contains(editpart);
+ AlignmentTree parentTree = new AlignmentTree(editpart, isSelected);
+ if(!isSelected) {
+ // this editpart won't move, so we can precise now its
+ // position
+ parentTree.setNewPosition(LayoutUtils.getAbsolutePosition(editpart));
+ }
+ if(childTree != null) {
+ parentTree.add(childTree);
+ }
+ childTree = parentTree;
+ }
+ }
+ return childTree;
+ }
+
+ /**
+ * Specifies in the tree which editpart in the selected editpart is used
+ * like reference to do the alignment action
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.layout.EditPartTree#postBuildOperations(java.util.List)
+ *
+ * @param editparts
+ * the editparts list
+ */
+ @Override
+ protected void postBuildOperations(List<EditPart> editparts) {
+ // the reference for the alignment is the last selected element
+ ((AlignmentTree)this.getTree(editparts.get(editparts.size() - 1))).setNewPosition(LayoutUtils.getAbsolutePosition(editparts.get(editparts.size() - 1)));
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionConstants.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionConstants.java
index 15d6e72bd6d..360e629a6eb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionConstants.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionConstants.java
@@ -1,130 +1,130 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-
-/**
- *
- * This class provides constants for the distribution actions
- *
- */
-public class DistributionConstants {
-
- /**
- * the list of the horizontal values for the distribution and the alignment
- * actions
- */
- public static final List<Integer> horizontalValuesList = createArrayList(new int[]{ PositionConstants.NORTH, PositionConstants.SOUTH, PositionConstants.NORTH_EAST, PositionConstants.NORTH_WEST, PositionConstants.SOUTH_EAST, PositionConstants.SOUTH_WEST });
-
- /**
- * the list of the vertical values for the distribution and the alignment
- * actions
- */
- public static final List<Integer> verticalValuesList = createArrayList(new int[]{ PositionConstants.EAST, PositionConstants.WEST, PositionConstants.NORTH_EAST, PositionConstants.NORTH_WEST, PositionConstants.SOUTH_EAST, PositionConstants.SOUTH_WEST });
-
- /**
- * Constant used to identify the horizontal distribution in the parent
- * container
- */
- public static final int DISTRIBUTE_H_CONTAINER_INT = PositionConstants.HORIZONTAL;
-
- /** Constant used to identify the horizontal distribution between nodes */
- public static final int DISTRIBUTE_H_NODES_INT = PositionConstants.HORIZONTAL | PositionConstants.CENTER;
-
- /**
- * Constant used to identify the vertical distribution in the parent
- * container
- */
- public static final int DISTRIBUTE_V_CONTAINER_INT = PositionConstants.VERTICAL;
-
- /** Constant used to identify the vertical distribution between nodes */
- public static final int DISTRIBUTE_V_NODES_INT = PositionConstants.VERTICAL | PositionConstants.MIDDLE;
-
- /** id for the horizontal distribution in the parent container */
- public static final String DISTRIBUTE_H_CONTAINER = "org.eclipse.papyrus.uml.diagram.common.distribute_horizontally"; //$NON-NLS-1$
-
- /** id for the horizontal distribution between nodes */
- public static final String DISTRIBUTE_H_NODES = "org.eclipse.papyrus.uml.diagram.common.distribute_horizontally_between_nodes"; //$NON-NLS-1$
-
- /** id for the vertical distribution in the parent container */
- public static final String DISTRIBUTE_V_CONTAINER = "org.eclipse.papyrus.uml.diagram.common.distribute_vertically"; //$NON-NLS-1$
-
- /** id for the vertical distribution between nodes */
- public static final String DISTRIBUTE_V_NODES = "org.eclipse.papyrus.uml.diagram.common.distribute_vertically_between_nodes"; //$NON-NLS-1$
-
- /** id for the horizontal distribution in container action */
- public static final String ACTION_DISTRIBUTE_H_CONTAINER = "org.eclipse.papyrus.uml.diagram.common.distribute_horizontally_action"; //$NON-NLS-1$
-
- /** id for the horizontal distribution between nodes action */
- public static final String ACTION_DISTRIBUTE_H_NODES = "org.eclipse.papyrus.uml.diagram.common.distribute_horizontally_between_nodes_action"; //$NON-NLS-1$
-
- /** id for the vertical distribution in container action */
- public static final String ACTION_DISTRIBUTE_V_CONTAINER = "org.eclipse.papyrus.uml.diagram.common.distribute_vertically_action"; //$NON-NLS-1$
-
- /** id for the vertical distribution between nodes action */
- public static final String ACTION_DISTRIBUTE_V_NODES = "org.eclipse.papyrus.uml.diagram.common.distribute_vertically_between_nodes_action"; //$NON-NLS-1$
-
- /** id for the distribute menu */
- public static final String MENU_DISTRIBUTE = "distributeMenu"; //$NON-NLS-1$
-
- /** the icon path */
- public static final String ICON_PATH = "icons/"; //$NON-NLS-1$
-
- /** the icon for the horizontal distribution */
- public static final String ICON_D_HORIZONTALLY = ICON_PATH + "distribute_horizontally.gif"; //$NON-NLS-1$
-
- /** the icon for the horizontal distribution between nodes */
- public static final String ICON_D_HORIZONTALLY_WITHIN_BOUNDS = ICON_PATH + "distribute_horizontally_between_nodes.gif"; //$NON-NLS-1$
-
- /** the icon for the vertical distribution */
- public static final String ICON_D_VERTICALLY = ICON_PATH + "distibute_vertically.gif"; //$NON-NLS-1$
-
- /** the icon for the vertical distribution between nodes */
- public static final String ICON_D_VERTICALLY_WITHIN_BOUNDS = ICON_PATH + "distribute_vertically_between_nodes.gif"; //$NON-NLS-1$
-
- public static final String DistributeActionMenu_DistributeMenu = Messages.DistributionConstants_DistributionTitle;
-
- /** Message for horizontal distribution */
- public static final String DistributeHorizontally = Messages.DistributionConstants_Distribute_Horizontally;
-
- /** Message for horizontal distribution between nodes */
- public static final String DistributeHorizontallyBetweenNodes = Messages.DistributionConstants_Distribute_Horizontally_Between_Nodes;
-
- /** Message for vertical distribution */
- public static final String DistributeVertically = Messages.DistributionConstants_Distribute_Vertically;
-
- /** Message for vertical distribution between nodes */
- public static final String DistributeVerticallyBetweenNodes = Messages.DistributionConstants_Distribute_Vertically_Between_Nodes;
-
- /**
- * Returns an {@link ArrayList}<{@link Integer}> filled with {@code array}
- *
- * @param array
- * the array used to create an {@link ArrayList}<{@link Integer}>
- * @return an {@link ArrayList}<{@link Integer}> filled with {@code array}
- */
- private static List<Integer> createArrayList(int[] array) {
- ArrayList<Integer> values = new ArrayList<Integer>();
- for(int i = 0; i < array.length; i++) {
- values.add(array[i]);
- }
- return values;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+
+/**
+ *
+ * This class provides constants for the distribution actions
+ *
+ */
+public class DistributionConstants {
+
+ /**
+ * the list of the horizontal values for the distribution and the alignment
+ * actions
+ */
+ public static final List<Integer> horizontalValuesList = createArrayList(new int[]{ PositionConstants.NORTH, PositionConstants.SOUTH, PositionConstants.NORTH_EAST, PositionConstants.NORTH_WEST, PositionConstants.SOUTH_EAST, PositionConstants.SOUTH_WEST });
+
+ /**
+ * the list of the vertical values for the distribution and the alignment
+ * actions
+ */
+ public static final List<Integer> verticalValuesList = createArrayList(new int[]{ PositionConstants.EAST, PositionConstants.WEST, PositionConstants.NORTH_EAST, PositionConstants.NORTH_WEST, PositionConstants.SOUTH_EAST, PositionConstants.SOUTH_WEST });
+
+ /**
+ * Constant used to identify the horizontal distribution in the parent
+ * container
+ */
+ public static final int DISTRIBUTE_H_CONTAINER_INT = PositionConstants.HORIZONTAL;
+
+ /** Constant used to identify the horizontal distribution between nodes */
+ public static final int DISTRIBUTE_H_NODES_INT = PositionConstants.HORIZONTAL | PositionConstants.CENTER;
+
+ /**
+ * Constant used to identify the vertical distribution in the parent
+ * container
+ */
+ public static final int DISTRIBUTE_V_CONTAINER_INT = PositionConstants.VERTICAL;
+
+ /** Constant used to identify the vertical distribution between nodes */
+ public static final int DISTRIBUTE_V_NODES_INT = PositionConstants.VERTICAL | PositionConstants.MIDDLE;
+
+ /** id for the horizontal distribution in the parent container */
+ public static final String DISTRIBUTE_H_CONTAINER = "org.eclipse.papyrus.uml.diagram.common.distribute_horizontally"; //$NON-NLS-1$
+
+ /** id for the horizontal distribution between nodes */
+ public static final String DISTRIBUTE_H_NODES = "org.eclipse.papyrus.uml.diagram.common.distribute_horizontally_between_nodes"; //$NON-NLS-1$
+
+ /** id for the vertical distribution in the parent container */
+ public static final String DISTRIBUTE_V_CONTAINER = "org.eclipse.papyrus.uml.diagram.common.distribute_vertically"; //$NON-NLS-1$
+
+ /** id for the vertical distribution between nodes */
+ public static final String DISTRIBUTE_V_NODES = "org.eclipse.papyrus.uml.diagram.common.distribute_vertically_between_nodes"; //$NON-NLS-1$
+
+ /** id for the horizontal distribution in container action */
+ public static final String ACTION_DISTRIBUTE_H_CONTAINER = "org.eclipse.papyrus.uml.diagram.common.distribute_horizontally_action"; //$NON-NLS-1$
+
+ /** id for the horizontal distribution between nodes action */
+ public static final String ACTION_DISTRIBUTE_H_NODES = "org.eclipse.papyrus.uml.diagram.common.distribute_horizontally_between_nodes_action"; //$NON-NLS-1$
+
+ /** id for the vertical distribution in container action */
+ public static final String ACTION_DISTRIBUTE_V_CONTAINER = "org.eclipse.papyrus.uml.diagram.common.distribute_vertically_action"; //$NON-NLS-1$
+
+ /** id for the vertical distribution between nodes action */
+ public static final String ACTION_DISTRIBUTE_V_NODES = "org.eclipse.papyrus.uml.diagram.common.distribute_vertically_between_nodes_action"; //$NON-NLS-1$
+
+ /** id for the distribute menu */
+ public static final String MENU_DISTRIBUTE = "distributeMenu"; //$NON-NLS-1$
+
+ /** the icon path */
+ public static final String ICON_PATH = "icons/"; //$NON-NLS-1$
+
+ /** the icon for the horizontal distribution */
+ public static final String ICON_D_HORIZONTALLY = ICON_PATH + "distribute_horizontally.gif"; //$NON-NLS-1$
+
+ /** the icon for the horizontal distribution between nodes */
+ public static final String ICON_D_HORIZONTALLY_WITHIN_BOUNDS = ICON_PATH + "distribute_horizontally_between_nodes.gif"; //$NON-NLS-1$
+
+ /** the icon for the vertical distribution */
+ public static final String ICON_D_VERTICALLY = ICON_PATH + "distibute_vertically.gif"; //$NON-NLS-1$
+
+ /** the icon for the vertical distribution between nodes */
+ public static final String ICON_D_VERTICALLY_WITHIN_BOUNDS = ICON_PATH + "distribute_vertically_between_nodes.gif"; //$NON-NLS-1$
+
+ public static final String DistributeActionMenu_DistributeMenu = Messages.DistributionConstants_DistributionTitle;
+
+ /** Message for horizontal distribution */
+ public static final String DistributeHorizontally = Messages.DistributionConstants_Distribute_Horizontally;
+
+ /** Message for horizontal distribution between nodes */
+ public static final String DistributeHorizontallyBetweenNodes = Messages.DistributionConstants_Distribute_Horizontally_Between_Nodes;
+
+ /** Message for vertical distribution */
+ public static final String DistributeVertically = Messages.DistributionConstants_Distribute_Vertically;
+
+ /** Message for vertical distribution between nodes */
+ public static final String DistributeVerticallyBetweenNodes = Messages.DistributionConstants_Distribute_Vertically_Between_Nodes;
+
+ /**
+ * Returns an {@link ArrayList}<{@link Integer}> filled with {@code array}
+ *
+ * @param array
+ * the array used to create an {@link ArrayList}<{@link Integer}>
+ * @return an {@link ArrayList}<{@link Integer}> filled with {@code array}
+ */
+ private static List<Integer> createArrayList(int[] array) {
+ ArrayList<Integer> values = new ArrayList<Integer>();
+ for(int i = 0; i < array.length; i++) {
+ values.add(array[i]);
+ }
+ return values;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionTree.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionTree.java
index 0ff260ed0ef..7b883eb04c6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionTree.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/DistributionTree.java
@@ -1,96 +1,96 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-
-/**
- *
- * A special tree for the distribution actions
- *
- */
-public class DistributionTree extends EditPartTree {
-
- /**
- * this UDI can be used to serialize this class
- */
- private static final long serialVersionUID = 5339900684765896876L;
-
- /**
- *
- * Constructor.
- *
- * @param editpart
- * the editpart represented by this tree
- * @param isSelected
- * Indicates if the represented editpart is selected or not
- *
- */
- public DistributionTree(Object editpart, boolean isSelected) {
- super(editpart, isSelected);
- }
-
- /**
- *
- * Constructor.
- *
- * @param editparts
- * the editparts used to build the tree
- */
- public DistributionTree(List<EditPart> editparts) {
- super(editparts);
-
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.layout.EditPartTree#createChildrenTree(java.util.List, java.util.List)
- *
- * @param editparts
- * the selected editpart
- * @param childrenList
- * parents of editparts which could be interesting to add to the
- * tree
- * @return a new tree
- */
- @Override
- protected EditPartTree createChildrenTree(List<EditPart> editparts, List<EditPart> childrenList) {
- EditPartTree childTree = null;
- for(EditPart editpart : childrenList) {
-
- boolean isSelected = editparts.contains(editpart);
- EditPartTree parentTree = new DistributionTree(editpart, isSelected);
- if(childTree != null) {
- parentTree.add(childTree);
- }
- childTree = parentTree;
- }
- return childTree;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.layout.EditPartTree#postBuildOperations(java.util.List)
- *
- * @param editparts
- */
- @Override
- protected void postBuildOperations(List<EditPart> editparts) {
- // nothing to do
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import java.util.List;
+
+import org.eclipse.gef.EditPart;
+
+/**
+ *
+ * A special tree for the distribution actions
+ *
+ */
+public class DistributionTree extends EditPartTree {
+
+ /**
+ * this UDI can be used to serialize this class
+ */
+ private static final long serialVersionUID = 5339900684765896876L;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editpart
+ * the editpart represented by this tree
+ * @param isSelected
+ * Indicates if the represented editpart is selected or not
+ *
+ */
+ public DistributionTree(Object editpart, boolean isSelected) {
+ super(editpart, isSelected);
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editparts
+ * the editparts used to build the tree
+ */
+ public DistributionTree(List<EditPart> editparts) {
+ super(editparts);
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.layout.EditPartTree#createChildrenTree(java.util.List, java.util.List)
+ *
+ * @param editparts
+ * the selected editpart
+ * @param childrenList
+ * parents of editparts which could be interesting to add to the
+ * tree
+ * @return a new tree
+ */
+ @Override
+ protected EditPartTree createChildrenTree(List<EditPart> editparts, List<EditPart> childrenList) {
+ EditPartTree childTree = null;
+ for(EditPart editpart : childrenList) {
+
+ boolean isSelected = editparts.contains(editpart);
+ EditPartTree parentTree = new DistributionTree(editpart, isSelected);
+ if(childTree != null) {
+ parentTree.add(childTree);
+ }
+ childTree = parentTree;
+ }
+ return childTree;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.layout.EditPartTree#postBuildOperations(java.util.List)
+ *
+ * @param editparts
+ */
+ @Override
+ protected void postBuildOperations(List<EditPart> editparts) {
+ // nothing to do
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartRepresentation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartRepresentation.java
index 6101bd69887..07b161c8c2b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartRepresentation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartRepresentation.java
@@ -1,111 +1,111 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-
-/**
- *
- * This class provides methods to represent an EditPart.
- *
- */
-public class EditPartRepresentation {
-
- /** the represented {@linkplain EditPart} */
- private final EditPart representedEditPart;
-
- /** the request to move this editpart */
- private Request request = null;
-
- /** value of the shift */
- private Dimension delta = new Dimension(0, 0);
-
- /**
- *
- * Constructor.
- *
- * @param ep
- */
- public EditPartRepresentation(EditPart ep) {
- this.representedEditPart = ep;
- }
-
- /**
- * Getter for {@link #representedEditPart}
- *
- * @return {@link #representedEditPart}
- */
- public EditPart getRepresentedEditPart() {
- return representedEditPart;
- }
-
- /**
- * Returns the position of the {@link EditPart} before its shift
- *
- *
- * @return the position of the {@link EditPart} before its shift
- */
- public PrecisionRectangle getPosition() {
- return LayoutUtils.getAbsolutePosition(representedEditPart);
- }
-
- /**
- *
- * Returns the command for this {@link EditPart}
- *
- * @return the command for this {@link EditPart}
- */
- public Command getCommand() {
- if(request != null) {
- return representedEditPart.getCommand(request);
- }
-
- return null;
- }
-
- /**
- * Setter for {@link #request}
- *
- * @param req
- * the request
- */
- public void setRequest(ChangeBoundsRequest req) {
- this.request = req;
-
- }
-
- /**
- * Setter for {@link #delta}
- *
- * @param delta
- * the delta between initial position and new position
- */
- public void setMoveDelta(Dimension delta) {
- this.delta = delta;
- }
-
- /**
- * Getter for {@link EditPartRepresentation#delta}
- *
- * @return {@link #delta}
- */
- public Dimension getMoveDelta() {
- return this.delta;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+
+/**
+ *
+ * This class provides methods to represent an EditPart.
+ *
+ */
+public class EditPartRepresentation {
+
+ /** the represented {@linkplain EditPart} */
+ private final EditPart representedEditPart;
+
+ /** the request to move this editpart */
+ private Request request = null;
+
+ /** value of the shift */
+ private Dimension delta = new Dimension(0, 0);
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param ep
+ */
+ public EditPartRepresentation(EditPart ep) {
+ this.representedEditPart = ep;
+ }
+
+ /**
+ * Getter for {@link #representedEditPart}
+ *
+ * @return {@link #representedEditPart}
+ */
+ public EditPart getRepresentedEditPart() {
+ return representedEditPart;
+ }
+
+ /**
+ * Returns the position of the {@link EditPart} before its shift
+ *
+ *
+ * @return the position of the {@link EditPart} before its shift
+ */
+ public PrecisionRectangle getPosition() {
+ return LayoutUtils.getAbsolutePosition(representedEditPart);
+ }
+
+ /**
+ *
+ * Returns the command for this {@link EditPart}
+ *
+ * @return the command for this {@link EditPart}
+ */
+ public Command getCommand() {
+ if(request != null) {
+ return representedEditPart.getCommand(request);
+ }
+
+ return null;
+ }
+
+ /**
+ * Setter for {@link #request}
+ *
+ * @param req
+ * the request
+ */
+ public void setRequest(ChangeBoundsRequest req) {
+ this.request = req;
+
+ }
+
+ /**
+ * Setter for {@link #delta}
+ *
+ * @param delta
+ * the delta between initial position and new position
+ */
+ public void setMoveDelta(Dimension delta) {
+ this.delta = delta;
+ }
+
+ /**
+ * Getter for {@link EditPartRepresentation#delta}
+ *
+ * @return {@link #delta}
+ */
+ public Dimension getMoveDelta() {
+ return this.delta;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartTree.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartTree.java
index 7fe24142f67..d1b6913f3e1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartTree.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/EditPartTree.java
@@ -1,467 +1,467 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeNode;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.RootEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-
-/**
- * This class is used to represent the hierarchy between selected editparts
- *
- *
- */
-public abstract class EditPartTree extends DefaultMutableTreeNode {
-
- /**
- * this UDI can be used to serialize this class
- */
- private static final long serialVersionUID = 1557787740787257844L;
-
- /**
- * Used to precise if this tree is the first selected element in the branch
- */
- private boolean isFirstSelected = false;
-
- /**
- * Used to precise if this tree is the reference of the alignment
- */
- private boolean isReference = false;
-
- /**
- * Indicates if the represented editpart is selected or not
- */
- private boolean isSelected = false;
-
- /**
- * the request for the editpart
- */
- private Request request;
-
- /**
- *
- * Constructor.
- *
- * @param editpart
- * the editpart represented by this Tree
- * @param isSelected
- * indicates if the represented editpart is selected or not
- *
- */
- public EditPartTree(Object editpart, boolean isSelected) {
- super(editpart, true);
- this.isSelected = isSelected;
- }
-
- /**
- *
- * Constructor.
- *
- * @param editparts
- * the editparts used to build the tree
- */
- public EditPartTree(List<EditPart> editparts) {
- this(null, false);
- buildTree(editparts);
- }
-
- /**
- * Gets the alignment request for the editpart.
- *
- * @return the alignment request for the editpart
- */
- public Request getRequest() {
- return request;
- }
-
- /**
- * Sets the alignment request for the editpart.
- *
- * @param request
- * the new alignment request for the editpart
- */
- public void setRequest(Request request) {
- this.request = request;
- }
-
- /**
- * Sets the used to precise if this tree is the reference of the alignment.
- *
- * @param isReference
- * the new used to precise if this tree is the reference of the
- * alignment
- */
- public void setIsReference(boolean isReference) {
- this.isReference = true;
- }
-
- /**
- * Gets {@link #isReference()}
- *
- * @return the {@link #isReference()} value
- */
- public boolean isReference() {
- return isReference;
- }
-
- /**
- * Sets the {@link #isSelected} value
- *
- * @param isSelected
- * the new value for {@link #isSelected}
- */
- public void setIsSelected(boolean isSelected) {
- this.isSelected = isSelected;
- }
-
- /**
- * Gets {@link #isSelected}
- *
- * @return the {@link #isSelected} value
- */
- public boolean isSelected() {
- return isSelected;
- }
-
- /**
- * Gets the editpart represented by this tree
- *
- * @return the editpart represented by this tree
- */
- public EditPart getEditPart() {
- return (EditPart)getUserObject();
- }
-
- /**
- * @see javax.swing.tree.DefaultMutableTreeNode#toString()
- *
- * @return the string representing the tree with its children
- */
-
- @Override
- public String toString() {
- getLevel();
- String str = ""; //$NON-NLS-1$
- for(int i = 0; i < getLevel(); i++) {
- str += " "; //$NON-NLS-1$
- }
-
- str += "isSelected =" + isSelected() + " depth =" + getDepth() + " Node =" + userObject + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- if(children != null) {
- for(int i = 0; i < children.size(); i++) {
- str += children.get(i).toString();
- }
- } else {
- for(int i = 0; i < getLevel() + 2; i++) {
- str += " "; //$NON-NLS-1$
- }
- str += "No child\n"; //$NON-NLS-1$
- }
-
- return str;
- }
-
- /**
- * Gets the subtree containing the editpart.
- *
- * @param editpart
- * the editpart that we look for
- * @return the tree, or {@code null} if not found
- */
- public EditPartTree getTree(EditPart editpart) {
- if(this.getEditPart() == editpart) {
- return this;
- }
- if(children != null) {
- for(int i = 0; i < children.size(); i++) {
- EditPart ep = ((EditPartTree)children.get(i)).getEditPart();
- if(ep == editpart) {
- return ((EditPartTree)children.get(i));
- } else {
- EditPartTree ept = ((EditPartTree)children.get(i)).getTree(editpart);
- if(ept != null) {
- return ept;
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Contains.
- *
- * @param editpart
- * the editpart that we look for
- * @return <ul>
- * <li> {@code true}</li> if the tree contains the editpart
- * <li> {@code false}</li> if not
- * </ul>
- */
- public boolean contains(EditPart editpart) {
- return (getTree(editpart) == null) ? false : true;
- }
-
- /**
- * Gets the child level.
- *
- * @param level
- * the level
- * @return the child level
- */
- public List<EditPartTree> getChildLevel(int level) {
- List<EditPartTree> epList = new ArrayList<EditPartTree>();
- if(level > 0) {
- if((level == 1 && this.children != null) && this.children.size() != 0) {
-
- epList.addAll(this.children);
-
- } else if(children != null) {
- for(int iter = 0; iter < this.children.size(); iter++) {
- epList.addAll(((EditPartTree)this.children.get(iter)).getChildLevel(level - 1));
- }
- }
- }
- return epList;
- }
-
- /**
- * Sets the first selected element.
- *
- * @param value
- * the new first selected element
- */
- public void setFirstSelectedElement(boolean value) {
- this.isFirstSelected = value;
- }
-
- /**
- * Checks if is first selected element in branch.
- *
- * @return true, if is first selected element in branch
- */
- public boolean isFirstSelected() {
- return this.isFirstSelected;
- }
-
- /**
- * Gets the level for the first selected element in the full tree. This
- * level is calculated from the root of this node.
- *
- * @param index
- * the index
- * @return <ul>
- * <li>the level for first selected element</li>
- * <li> {@code -1}</li> if the first selected element can't be found
- * </ul>
- */
- public int getLevelForFirstSelectedElement() {
- // We search the first level in the tree
- TreeNode[] path = this.getPath();
- if(path.length > 1) {
- EditPartTree result = getSelectedFirstEditPart((EditPartTree)path[1]);
- if(result != null) {
- return result.getLevel();
- }
- }
- return -1;
- }
-
- /**
- * Gets the selected first edit part.
- *
- * @param treeNode
- * the tree node (level one of a tree) where we search the first
- * selected element
- * @return the selected first edit part or {@code null} if not found
- */
- protected EditPartTree getSelectedFirstEditPart(EditPartTree treeNode) {
- if(treeNode.isFirstSelected) {
- return treeNode;
- } else if((treeNode.children != null) && (!treeNode.children.isEmpty())) {
- for(int iter = 0; iter < treeNode.getChildCount(); iter++) {
- EditPartTree result = getSelectedFirstEditPart((EditPartTree)treeNode.children.get(iter));
- if(result != null) {
- return result;
- }
- }
- }
- return null;
- }
-
- /**
- * Test if this node have child that are not selected
- *
- * @return <ul>
- * <li>{@code true}</li> it exists a child which is not selected
- * <li>{@code false}</li> all the children are selected
- * </ul>
- */
- public boolean existsUnselectedChild() {
- return (getDistanceWithTheFirstUnselectedChild() == -1) ? false : true;
- }
-
- /**
- * Returns the distance between the tree and the first unselected child
- *
- * @return <ul>
- * <li>the distance between this tree and the first unselected child</li>
- * <li> {@code -1} when all the children are selected</li>
- * </ul>
- */
- public int getDistanceWithTheFirstUnselectedChild() {
- int depth = this.getDepth();
- for(int i = 0; i < depth; i++) {
- List<EditPartTree> localChildren = getChildLevel(i);
- for(EditPartTree tree : localChildren) {
- if(!tree.isSelected()) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Returns the first unselected child or {@code null} if all the children
- * are selected
- *
- * @return the first unselected child or {@code null} if all the children
- * are selected
- */
- public EditPartTree getFirstUnselectedChild() {
- int depth = this.getDepth();
- for(int i = 0; i < depth; i++) {
- List<EditPartTree> localChildren = getChildLevel(i);
- for(EditPartTree tree : localChildren) {
- if(!tree.isSelected()) {
- return tree;
- }
- }
- }
- return null;
- }
-
- /**
- * Sorts the editparts in the tree In this tree, we have the selected
- * editparts. Moreover, we add the intermediate packages, even if they
- * aren't selected. These intermediate packages are used to determine the
- * final position of their parents, if the reference is inside on of these
- * packages
- *
- * @param editparts
- * the editparts to sort
- */
- public void buildTree(List<EditPart> editparts) {
- List<EditPart> parentsList;
- if(editparts.size() >= 2) {
-
- // we build the tree
- for(EditPart currentEP : editparts) {
- parentsList = new ArrayList<EditPart>();
- EditPart parent = currentEP;
- EditPartTree grandFatherTree = this;
- int i = 0;
- while(parent != null) {
- if(this.contains(parent)) {
- grandFatherTree = this.getTree(parent);
- break; // on sort du while
- } else {
- // we add all the parent in this list!
- /*
- * we don't add the parent if it's a comparment , except
- * if the parent is the selected element (property,
- * enumeration literal...), of course, a property or a
- * enumeration literal can't move in there compartment
- * (in class diagram) but this choice allows avoid some
- * NullPointerException. (see bug 317691)
- */
- if(!(parent instanceof CompartmentEditPart) || (parent instanceof CompartmentEditPart && parent == currentEP)) {
- if(!(parent instanceof RootEditPart)) {
- if(!(parent.getParent() instanceof RootEditPart)) {
- parentsList.add(i, parent);
- i++;
- }
- }
- }
- }
- parent = parent.getParent();
- }
-
- // We add all the node in the rootTree
- EditPartTree childTree = createChildrenTree(editparts, parentsList);
-
- // we add the node to the tree
- if(childTree != null) {
- grandFatherTree.add(childTree);
- }
-
- }
-
- // we precise which element is the reference (the last selected
- // element)
- this.getTree(editparts.get(editparts.size() - 1)).setIsReference(true);
-
- /*
- * we precise for each branch the first selected element it's this
- * element (and its brothers) which are really align on the
- * reference
- */
-
- Enumeration childrenEnum = this.children();
- while(childrenEnum.hasMoreElements()) {
- EditPartTree currentTree = (EditPartTree)childrenEnum.nextElement();
- for(int i = 0; i < editparts.size(); i++) {
- if(currentTree.contains(editparts.get(i))) {
- currentTree.getTree(editparts.get(i)).setFirstSelectedElement(true);
- break;
- }
- }
- }
-
- postBuildOperations(editparts);
-
- }
- }
-
- /**
- * This method is used to create an EditPartTree with {@code the List<EditPart> children}
- *
- * @param editparts
- * the selected editparts for this action
- * @param children
- * intermediate children which could be interesting to add like
- * node in the tree
- * @return a new EditPartTree
- */
- protected abstract EditPartTree createChildrenTree(List<EditPart> editparts, List<EditPart> children);
-
- /**
- * Action that can be done to conclude the tree construction
- *
- * @param editparts
- * an editparts list
- */
- protected abstract void postBuildOperations(List<EditPart> editparts);
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreeNode;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.RootEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+
+/**
+ * This class is used to represent the hierarchy between selected editparts
+ *
+ *
+ */
+public abstract class EditPartTree extends DefaultMutableTreeNode {
+
+ /**
+ * this UDI can be used to serialize this class
+ */
+ private static final long serialVersionUID = 1557787740787257844L;
+
+ /**
+ * Used to precise if this tree is the first selected element in the branch
+ */
+ private boolean isFirstSelected = false;
+
+ /**
+ * Used to precise if this tree is the reference of the alignment
+ */
+ private boolean isReference = false;
+
+ /**
+ * Indicates if the represented editpart is selected or not
+ */
+ private boolean isSelected = false;
+
+ /**
+ * the request for the editpart
+ */
+ private Request request;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editpart
+ * the editpart represented by this Tree
+ * @param isSelected
+ * indicates if the represented editpart is selected or not
+ *
+ */
+ public EditPartTree(Object editpart, boolean isSelected) {
+ super(editpart, true);
+ this.isSelected = isSelected;
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param editparts
+ * the editparts used to build the tree
+ */
+ public EditPartTree(List<EditPart> editparts) {
+ this(null, false);
+ buildTree(editparts);
+ }
+
+ /**
+ * Gets the alignment request for the editpart.
+ *
+ * @return the alignment request for the editpart
+ */
+ public Request getRequest() {
+ return request;
+ }
+
+ /**
+ * Sets the alignment request for the editpart.
+ *
+ * @param request
+ * the new alignment request for the editpart
+ */
+ public void setRequest(Request request) {
+ this.request = request;
+ }
+
+ /**
+ * Sets the used to precise if this tree is the reference of the alignment.
+ *
+ * @param isReference
+ * the new used to precise if this tree is the reference of the
+ * alignment
+ */
+ public void setIsReference(boolean isReference) {
+ this.isReference = true;
+ }
+
+ /**
+ * Gets {@link #isReference()}
+ *
+ * @return the {@link #isReference()} value
+ */
+ public boolean isReference() {
+ return isReference;
+ }
+
+ /**
+ * Sets the {@link #isSelected} value
+ *
+ * @param isSelected
+ * the new value for {@link #isSelected}
+ */
+ public void setIsSelected(boolean isSelected) {
+ this.isSelected = isSelected;
+ }
+
+ /**
+ * Gets {@link #isSelected}
+ *
+ * @return the {@link #isSelected} value
+ */
+ public boolean isSelected() {
+ return isSelected;
+ }
+
+ /**
+ * Gets the editpart represented by this tree
+ *
+ * @return the editpart represented by this tree
+ */
+ public EditPart getEditPart() {
+ return (EditPart)getUserObject();
+ }
+
+ /**
+ * @see javax.swing.tree.DefaultMutableTreeNode#toString()
+ *
+ * @return the string representing the tree with its children
+ */
+
+ @Override
+ public String toString() {
+ getLevel();
+ String str = ""; //$NON-NLS-1$
+ for(int i = 0; i < getLevel(); i++) {
+ str += " "; //$NON-NLS-1$
+ }
+
+ str += "isSelected =" + isSelected() + " depth =" + getDepth() + " Node =" + userObject + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ if(children != null) {
+ for(int i = 0; i < children.size(); i++) {
+ str += children.get(i).toString();
+ }
+ } else {
+ for(int i = 0; i < getLevel() + 2; i++) {
+ str += " "; //$NON-NLS-1$
+ }
+ str += "No child\n"; //$NON-NLS-1$
+ }
+
+ return str;
+ }
+
+ /**
+ * Gets the subtree containing the editpart.
+ *
+ * @param editpart
+ * the editpart that we look for
+ * @return the tree, or {@code null} if not found
+ */
+ public EditPartTree getTree(EditPart editpart) {
+ if(this.getEditPart() == editpart) {
+ return this;
+ }
+ if(children != null) {
+ for(int i = 0; i < children.size(); i++) {
+ EditPart ep = ((EditPartTree)children.get(i)).getEditPart();
+ if(ep == editpart) {
+ return ((EditPartTree)children.get(i));
+ } else {
+ EditPartTree ept = ((EditPartTree)children.get(i)).getTree(editpart);
+ if(ept != null) {
+ return ept;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Contains.
+ *
+ * @param editpart
+ * the editpart that we look for
+ * @return <ul>
+ * <li> {@code true}</li> if the tree contains the editpart
+ * <li> {@code false}</li> if not
+ * </ul>
+ */
+ public boolean contains(EditPart editpart) {
+ return (getTree(editpart) == null) ? false : true;
+ }
+
+ /**
+ * Gets the child level.
+ *
+ * @param level
+ * the level
+ * @return the child level
+ */
+ public List<EditPartTree> getChildLevel(int level) {
+ List<EditPartTree> epList = new ArrayList<EditPartTree>();
+ if(level > 0) {
+ if((level == 1 && this.children != null) && this.children.size() != 0) {
+
+ epList.addAll(this.children);
+
+ } else if(children != null) {
+ for(int iter = 0; iter < this.children.size(); iter++) {
+ epList.addAll(((EditPartTree)this.children.get(iter)).getChildLevel(level - 1));
+ }
+ }
+ }
+ return epList;
+ }
+
+ /**
+ * Sets the first selected element.
+ *
+ * @param value
+ * the new first selected element
+ */
+ public void setFirstSelectedElement(boolean value) {
+ this.isFirstSelected = value;
+ }
+
+ /**
+ * Checks if is first selected element in branch.
+ *
+ * @return true, if is first selected element in branch
+ */
+ public boolean isFirstSelected() {
+ return this.isFirstSelected;
+ }
+
+ /**
+ * Gets the level for the first selected element in the full tree. This
+ * level is calculated from the root of this node.
+ *
+ * @param index
+ * the index
+ * @return <ul>
+ * <li>the level for first selected element</li>
+ * <li> {@code -1}</li> if the first selected element can't be found
+ * </ul>
+ */
+ public int getLevelForFirstSelectedElement() {
+ // We search the first level in the tree
+ TreeNode[] path = this.getPath();
+ if(path.length > 1) {
+ EditPartTree result = getSelectedFirstEditPart((EditPartTree)path[1]);
+ if(result != null) {
+ return result.getLevel();
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Gets the selected first edit part.
+ *
+ * @param treeNode
+ * the tree node (level one of a tree) where we search the first
+ * selected element
+ * @return the selected first edit part or {@code null} if not found
+ */
+ protected EditPartTree getSelectedFirstEditPart(EditPartTree treeNode) {
+ if(treeNode.isFirstSelected) {
+ return treeNode;
+ } else if((treeNode.children != null) && (!treeNode.children.isEmpty())) {
+ for(int iter = 0; iter < treeNode.getChildCount(); iter++) {
+ EditPartTree result = getSelectedFirstEditPart((EditPartTree)treeNode.children.get(iter));
+ if(result != null) {
+ return result;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Test if this node have child that are not selected
+ *
+ * @return <ul>
+ * <li>{@code true}</li> it exists a child which is not selected
+ * <li>{@code false}</li> all the children are selected
+ * </ul>
+ */
+ public boolean existsUnselectedChild() {
+ return (getDistanceWithTheFirstUnselectedChild() == -1) ? false : true;
+ }
+
+ /**
+ * Returns the distance between the tree and the first unselected child
+ *
+ * @return <ul>
+ * <li>the distance between this tree and the first unselected child</li>
+ * <li> {@code -1} when all the children are selected</li>
+ * </ul>
+ */
+ public int getDistanceWithTheFirstUnselectedChild() {
+ int depth = this.getDepth();
+ for(int i = 0; i < depth; i++) {
+ List<EditPartTree> localChildren = getChildLevel(i);
+ for(EditPartTree tree : localChildren) {
+ if(!tree.isSelected()) {
+ return i;
+ }
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Returns the first unselected child or {@code null} if all the children
+ * are selected
+ *
+ * @return the first unselected child or {@code null} if all the children
+ * are selected
+ */
+ public EditPartTree getFirstUnselectedChild() {
+ int depth = this.getDepth();
+ for(int i = 0; i < depth; i++) {
+ List<EditPartTree> localChildren = getChildLevel(i);
+ for(EditPartTree tree : localChildren) {
+ if(!tree.isSelected()) {
+ return tree;
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Sorts the editparts in the tree In this tree, we have the selected
+ * editparts. Moreover, we add the intermediate packages, even if they
+ * aren't selected. These intermediate packages are used to determine the
+ * final position of their parents, if the reference is inside on of these
+ * packages
+ *
+ * @param editparts
+ * the editparts to sort
+ */
+ public void buildTree(List<EditPart> editparts) {
+ List<EditPart> parentsList;
+ if(editparts.size() >= 2) {
+
+ // we build the tree
+ for(EditPart currentEP : editparts) {
+ parentsList = new ArrayList<EditPart>();
+ EditPart parent = currentEP;
+ EditPartTree grandFatherTree = this;
+ int i = 0;
+ while(parent != null) {
+ if(this.contains(parent)) {
+ grandFatherTree = this.getTree(parent);
+ break; // on sort du while
+ } else {
+ // we add all the parent in this list!
+ /*
+ * we don't add the parent if it's a comparment , except
+ * if the parent is the selected element (property,
+ * enumeration literal...), of course, a property or a
+ * enumeration literal can't move in there compartment
+ * (in class diagram) but this choice allows avoid some
+ * NullPointerException. (see bug 317691)
+ */
+ if(!(parent instanceof CompartmentEditPart) || (parent instanceof CompartmentEditPart && parent == currentEP)) {
+ if(!(parent instanceof RootEditPart)) {
+ if(!(parent.getParent() instanceof RootEditPart)) {
+ parentsList.add(i, parent);
+ i++;
+ }
+ }
+ }
+ }
+ parent = parent.getParent();
+ }
+
+ // We add all the node in the rootTree
+ EditPartTree childTree = createChildrenTree(editparts, parentsList);
+
+ // we add the node to the tree
+ if(childTree != null) {
+ grandFatherTree.add(childTree);
+ }
+
+ }
+
+ // we precise which element is the reference (the last selected
+ // element)
+ this.getTree(editparts.get(editparts.size() - 1)).setIsReference(true);
+
+ /*
+ * we precise for each branch the first selected element it's this
+ * element (and its brothers) which are really align on the
+ * reference
+ */
+
+ Enumeration childrenEnum = this.children();
+ while(childrenEnum.hasMoreElements()) {
+ EditPartTree currentTree = (EditPartTree)childrenEnum.nextElement();
+ for(int i = 0; i < editparts.size(); i++) {
+ if(currentTree.contains(editparts.get(i))) {
+ currentTree.getTree(editparts.get(i)).setFirstSelectedElement(true);
+ break;
+ }
+ }
+ }
+
+ postBuildOperations(editparts);
+
+ }
+ }
+
+ /**
+ * This method is used to create an EditPartTree with {@code the List<EditPart> children}
+ *
+ * @param editparts
+ * the selected editparts for this action
+ * @param children
+ * intermediate children which could be interesting to add like
+ * node in the tree
+ * @return a new EditPartTree
+ */
+ protected abstract EditPartTree createChildrenTree(List<EditPart> editparts, List<EditPart> children);
+
+ /**
+ * Action that can be done to conclude the tree construction
+ *
+ * @param editparts
+ * an editparts list
+ */
+ protected abstract void postBuildOperations(List<EditPart> editparts);
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
index 3b3d2d2a21d..afc4aecdc89 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LayoutUtils.java
@@ -1,638 +1,638 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-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.ShapeEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.IOvalAnchorableFigure;
-import org.eclipse.papyrus.extensionpoints.editors.Activator;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-
-/**
- * This class provides utilities for the layout actions
- *
- *
- */
-public class LayoutUtils {
-
- public final static String alignementCmdId = "org.eclipse.papyrus.uml.diagram.common.commands.AlignmentCommand"; //$NON-NLS-1$
-
- public final static String routingCmdId = "org.eclipse.papyrus.uml.diagram.common.commands.RoutingCommand"; //$NON-NLS-1$
-
- /** the parameter for the left command (alignment and routing command) */
- final public static String LEFT = "parameter_left"; //$NON-NLS-1$
-
- /** the parameter for the right commands (alignment and routing command) */
- final public static String RIGHT = "parameter_right"; //$NON-NLS-1$
-
- /** the parameter for the top commands (alignment and routing command) */
- final public static String TOP = "parameter_top"; //$NON-NLS-1$
-
- /** the parameter for the bottom commands (alignment and routing command) */
- final public static String BOTTOM = "parameter_bottom"; //$NON-NLS-1$
-
- /** the parameter for the center alignment */
- final public static String CENTER = "parameter_center"; //$NON-NLS-1$
-
- /** the parameter for the horizontal distribution */
- final public static String MIDDLE = "parameter_middle"; //$NON-NLS-1$
-
- /** the parameter for the horizontal distribution */
- final public static String HORIZONTALLY = "parameter_horizontally"; //$NON-NLS-1$
-
- /** the parameter for the horizontal distribution between nodes */
- final public static String HORIZONTALLY_BETWEEN_NODES = "parameter_horizontally_between_nodes"; //$NON-NLS-1$
-
- /** the parameter for the vertical distribution */
- final public static String VERTICALLY = "parameter_vertically"; //$NON-NLS-1$
-
- /** the parameter for the vertical distribution between nodes */
- final public static String VERTICALLY_BETWEEN_NODES = "parameter_vertically_between_nodes"; //$NON-NLS-1$
-
- /**
- * the shift to avoid the scrollbar If there is no scrollBar, set
- * scrollBarSize to 0.0!
- */
- public static final double scrollBarSize = 6;
-
- /**
- *
- * A {@link Rectangle} with the absolute position from the {@link EditPart}
- *
- * @param ep
- * the {@link EditPart} that we want the position
- * @return a {@link Rectangle} with the absolute position from the {@link EditPart}
- *
- */
- public static PrecisionRectangle getAbsolutePosition(EditPart ep) {
- GraphicalEditPart part = (GraphicalEditPart)ep;
- PrecisionRectangle rect = new PrecisionRectangle(part.getFigure().getBounds());
- part.getFigure().translateToAbsolute(rect);
- return rect;
- }
-
- /**
- * Returns the side on which the anchor is on the {@link EditPart}
- *
- * @param node
- * the node where is located the anchor
- * @param anchor
- * the anchor. the anchor must in absolute coordinate before call
- * this method.
- * @return the side on which the anchor is on the {@link EditPart} The
- * returned values can be :
- * <ul>
- * <li>{@linkplain PositionConstants#NONE}
- * <ul>
- * <li>if the figure is not not known. (This algorithm depends on the figure form).</li>
- * <li>Maybe you forgot to translate the anchor in absolute coordinate or the anchor is not attached to the figure</li>
- * </ul>
- * </li>
- * <li>{@linkplain PositionConstants#NORTH}</li>
- * <li> {@linkplain PositionConstants#SOUTH}</li>
- * <li>
- * {@linkplain PositionConstants#EAST}</li>
- * <li> {@linkplain PositionConstants#WEST}</li>
- * <li>
- * {@linkplain PositionConstants#NORTH_EAST}</li>
- * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
- * <li>
- * {@linkplain PositionConstants#SOUTH_EAST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
- * </ul>
- */
- public static int getAnchorPosition(EditPart node, Point anchor) {
- int position = PositionConstants.NONE;
- PrecisionRectangle bounds = LayoutUtils.getAbsolutePosition(node);
-
- // we are not on EAST, not on WEST, but we are on the NORTH
- if((anchor.y == bounds.y) && (anchor.x != bounds.x) && (anchor.x != bounds.getRight().x)) {
- position = PositionConstants.NORTH;
-
- // we are not on the EAST and not on the WEST, but we are on the
- // SOUTH
- } else if((anchor.y == bounds.getBottom().y) && (anchor.x != bounds.x) && (anchor.x != bounds.getRight().x)) {
- position = PositionConstants.SOUTH;
-
- // we are on the EAST, but we are not on the NORTH and not on the
- // SOUTH
- } else if((anchor.x == bounds.getRight().x) && (anchor.y != bounds.y) && (anchor.y != bounds.getBottom().y)) {
- position = PositionConstants.EAST;
-
- // we are on the WEST, but we are not on the on the NORTH and not on
- // the SOUTH
- } else if((anchor.x == bounds.x) && (anchor.y != bounds.getTop().y) && (anchor.y != bounds.getBottom().y)) {
- position = PositionConstants.WEST;
-
- // we are on the NORTH and on the EAST
- } else if(anchor.equals(bounds.getLeft())) {
- position = PositionConstants.NORTH_EAST;
-
- // we are on the NORTH and on the WEST
- } else if(anchor.equals(bounds.getRight())) {
- position = PositionConstants.NORTH_WEST;
-
- // we are on the EAST and on the SOUTH
- } else if(anchor.equals(bounds.getBottomRight())) {
- position = PositionConstants.SOUTH_EAST;
-
- // we are on the WEST and on the SOUTH
- } else if(anchor.equals(bounds.getBottomLeft())) {
- position = PositionConstants.SOUTH_WEST;
- }
-
- if(position == PositionConstants.NONE) {// the figure is not a
- // rectangle
- if(node instanceof ShapeEditPart) {
- for(Object obj : node.getChildren()) {
- if(obj instanceof CompartmentEditPart && position == PositionConstants.NONE) {
- position = getAnchorPosition((EditPart)obj, anchor);
- }
- }
- if(position == PositionConstants.NONE) {// the figure is not a
- // rectangle
- IFigure figure = ((ShapeEditPart)node).getFigure();
- if(figure instanceof IOvalAnchorableFigure) {
- Rectangle bounds2 = ((IOvalAnchorableFigure)figure).getOvalBounds().getCopy();
- figure.translateToAbsolute(bounds2);
- Rectangle northWestBounds = new Rectangle(bounds2.x, bounds2.y, bounds2.width / 2, bounds2.height / 2);
- Rectangle southWestBounds = new Rectangle(bounds2.getLeft().x, bounds2.getLeft().y, bounds2.width / 2, bounds2.height / 2);
- Rectangle northEAstBounds = new Rectangle(bounds2.getTop().x, bounds2.getTop().y, bounds2.width / 2, bounds2.height / 2);
- Rectangle southEAstBounds = new Rectangle(bounds2.getTop().x, bounds2.getLeft().y, bounds2.width / 2, bounds2.height / 2);
- if(northEAstBounds.contains(anchor)) {
- return PositionConstants.NORTH_EAST;
- } else if(southEAstBounds.contains(anchor)) {
- return PositionConstants.SOUTH_EAST;
- } else if(southWestBounds.contains(anchor)) {
- return PositionConstants.SOUTH_WEST;
- } else if(northWestBounds.contains(anchor)) {
- return PositionConstants.NORTH_WEST;
- }
- }
- }
- }
- }
- return position;
- }
-
- private final static int[] northArray = { PositionConstants.NORTH, PositionConstants.NORTH_EAST, PositionConstants.NORTH_WEST };
-
- private final static int[] southArray = { PositionConstants.SOUTH, PositionConstants.SOUTH_EAST, PositionConstants.SOUTH_WEST };
-
- private final static int[] eastArray = { PositionConstants.EAST, PositionConstants.NORTH_EAST, PositionConstants.SOUTH_EAST };
-
- private final static int[] westArray = { PositionConstants.WEST, PositionConstants.NORTH_WEST, PositionConstants.SOUTH_WEST };
-
- public final static List<Integer> northPositions = fillList(northArray);
-
- public final static List<Integer> southPositions = fillList(southArray);
-
- public final static List<Integer> eastPositions = fillList(eastArray);
-
- public final static List<Integer> westPositions = fillList(westArray);
-
- private static List<Integer> fillList(int[] array) {
- List<Integer> list = new ArrayList<Integer>();
- for(int i = 0; i < array.length; i++) {
- list.add(new Integer(array[i]));
- }
- return list;
- }
-
- /**
- * This method return the position of the ends for the link to have a nice
- * representation. Some cases can be distinguish :
- * <ul>
- * <li>The 2 EditParts do not have intersection</li>
- * <li>An EditPart is included in the other</li>
- * <li>An EditPart intersects a part of the other : we calculate nothing</li>
- * </ul>
- *
- * Moreover this method includes a specific algorithm when the EditPart is
- * an Affixed Child Node
- *
- * @param sourceEditPart
- * he source EditPart
- * @param targetEditPart
- * the targetEditPart
- * @return <ul>
- * <li>Point[0] is the source Anchor</li>
- * <li>Point[1] is the target Anchor</li>
- * </ul>
- */
- public static Point[] getLinkAnchor(IGraphicalEditPart sourceEditPart, IGraphicalEditPart targetEditPart) {
- Point sourceLocation = new Point();
- Point targetLocation = new Point();
- int targetPosition = PositionConstants.NONE;
- PrecisionRectangle sourceBounds = getAbsolutePosition(sourceEditPart);
- PrecisionRectangle targetBounds = getAbsolutePosition(targetEditPart);
- EditPart diagramEP = sourceEditPart;
- while(!(diagramEP instanceof DiagramEditPart)) {
- diagramEP = diagramEP.getParent();
- }
- PrecisionRectangle diagramBounds = getAbsolutePosition(diagramEP);
-
- if(!sourceBounds.intersects(targetBounds)) {
- /*
- * there is no intersection between the 2 EditParts we look for the
- * position of targetEditPart/sourceEditPart
- */
- targetPosition = getRelativePositionFor(sourceBounds, targetBounds, diagramBounds);
- // calculate source location
- if(!Util.isAffixedChildNode(sourceEditPart)) {
- switch(targetPosition) {
- case PositionConstants.NORTH:// 1
- sourceLocation = sourceBounds.getTop();
- if(sourceBounds.preciseX() >= targetBounds.preciseX() && sourceBounds.getRight().preciseX() <= targetBounds.getRight().preciseX()) {
- // nothing to do
- } else if(sourceBounds.preciseX() <= targetBounds.preciseX() && sourceBounds.getRight().preciseX() >= targetBounds.getRight().preciseX()) {
- sourceLocation.x = (int)targetBounds.getBottom().preciseX();
- } else if(sourceBounds.preciseX() <= targetBounds.preciseX() && sourceBounds.getRight().preciseX() <= targetBounds.getRight().preciseX()) {
- sourceLocation.x = (int)(((targetBounds.preciseX() + sourceBounds.getRight().preciseX()) / 2));
- } else {
- sourceLocation.x = (int)(((sourceBounds.preciseX() + targetBounds.getRight().preciseX()) / 2));
- }
- break;
- case PositionConstants.SOUTH:// 4
- sourceLocation = sourceBounds.getBottom();
- if(sourceBounds.preciseX() >= targetBounds.preciseX() && sourceBounds.getRight().preciseX() <= targetBounds.getRight().preciseX()) {
- // nothing to do
- } else if(sourceBounds.preciseX() <= targetBounds.preciseX() && sourceBounds.getRight().preciseX() >= targetBounds.getRight().preciseX()) {
- sourceLocation.x = (int)targetBounds.getBottom().preciseX();
- } else if(sourceBounds.preciseX() <= targetBounds.preciseX() && sourceBounds.getRight().preciseX() <= targetBounds.getRight().preciseX()) {
- sourceLocation.x = (int)(((targetBounds.preciseX() + sourceBounds.getRight().preciseX()) / 2));
- } else {
- sourceLocation.x = (int)(((sourceBounds.preciseX() + targetBounds.getRight().preciseX()) / 2));
- }
- // sourceLocation = sourceBounds.getBottom();
- break;
- case PositionConstants.EAST:// 16
- sourceLocation = sourceBounds.getRight();
- if(sourceBounds.preciseY() >= targetBounds.preciseY() && sourceBounds.getBottom().preciseY() <= targetBounds.getBottom().preciseY()) {
- // nothing to do
- } else if(sourceBounds.preciseY() <= targetBounds.preciseY() && sourceBounds.getBottom().preciseY() >= targetBounds.getBottom().preciseY()) {
- sourceLocation.y = (int)targetBounds.getLeft().preciseY();
- } else if(sourceBounds.preciseY() >= targetBounds.preciseY() && sourceBounds.getBottom().preciseY() >= targetBounds.getBottom().preciseY()) {
- sourceLocation.y = (int)((targetBounds.getBottom().preciseY() + sourceBounds.preciseY()) / 2);
- } else {
- sourceLocation.y = (int)((sourceBounds.getBottom().preciseY() + targetBounds.preciseY()) / 2);
- }
- // sourceLocation = sourceBounds.getRight();
- break;
- case PositionConstants.WEST:// 8
- sourceLocation = sourceBounds.getLeft();
- if(sourceBounds.preciseY() > targetBounds.preciseY() && sourceBounds.getBottom().preciseY() < targetBounds.getBottom().preciseY()) {
- // nothing to do
- } else if(sourceBounds.preciseY() < targetBounds.preciseY() && sourceBounds.getBottom().preciseY() > targetBounds.getBottom().preciseY()) {
- sourceLocation.y = (int)targetBounds.getLeft().preciseY();
- } else if(sourceBounds.preciseY() > targetBounds.preciseY() && sourceBounds.getBottom().preciseY() > targetBounds.getBottom().preciseY()) {
- sourceLocation.y = (int)((targetBounds.getBottom().preciseY() + sourceBounds.preciseY()) / 2);
- } else {
- sourceLocation.y = (int)((sourceBounds.getBottom().preciseY() + targetBounds.preciseY()) / 2);
- }
- // sourceLocation = sourceBounds.getLeft();
- break;
- case PositionConstants.NORTH_EAST:// 17
- sourceLocation = sourceBounds.getTop();
- break;
- case PositionConstants.NORTH_WEST:// 9
- sourceLocation = sourceBounds.getTop();
- break;
- case PositionConstants.SOUTH_EAST:// 20
- sourceLocation = sourceBounds.getBottom();
- break;
- case PositionConstants.SOUTH_WEST:// 12
- sourceLocation = sourceBounds.getBottom();
- break;
- default:
- break;
- }
- } else {
- IBorderItemLocator loc = ((IBorderItemEditPart)sourceEditPart).getBorderItemLocator();
- int side = loc.getCurrentSideOfParent();
- switch(targetPosition) {
- case PositionConstants.NORTH:// 1
- sourceLocation = sourceBounds.getTop();
- break;
- case PositionConstants.SOUTH:// 4
- sourceLocation = sourceBounds.getBottom();
- break;
- case PositionConstants.EAST:// 16
- sourceLocation = sourceBounds.getRight();
- break;
- case PositionConstants.WEST:// 8
- sourceLocation = sourceBounds.getLeft();
- break;
- case PositionConstants.NORTH_EAST:// 17
- if(eastPositions.contains(new Integer(side))) {
- sourceLocation = sourceBounds.getRight();
- } else if(westPositions.contains(new Integer(side))) {
- sourceLocation = sourceBounds.getRight();
- } else {// side is NORTH or SOUTH
- sourceLocation = sourceBounds.getTop();
- }
- break;
- case PositionConstants.NORTH_WEST:// 9
- if(eastPositions.contains(new Integer(side))) {
- sourceLocation = sourceBounds.getLeft();
- } else if(westPositions.contains(new Integer(side))) {
- sourceLocation = sourceBounds.getLeft();
- } else {// side is NORTH or SOUTH
- sourceLocation = sourceBounds.getTop();
- }
- break;
- case PositionConstants.SOUTH_EAST:// 20
- if(northPositions.contains(new Integer(side))) {
- sourceLocation = sourceBounds.getBottom();
- } else if(southPositions.contains(new Integer(side))) {
- sourceLocation = sourceBounds.getBottom();
- } else {// SIDE is EAST or WEST
- sourceLocation = sourceBounds.getRight();
- }
- break;
- case PositionConstants.SOUTH_WEST:// 12
- if(northPositions.contains(new Integer(side))) {
- sourceLocation = sourceBounds.getBottom();
- } else if(southPositions.contains(new Integer(side))) {
- sourceLocation = sourceBounds.getBottom();
- } else {// SIDE is EAST or WEST
- sourceLocation = sourceBounds.getLeft();
- }
- break;
- default:
- break;
- }
- }
-
- // calculate target location
- if(!Util.isAffixedChildNode(targetEditPart)) {
- switch(targetPosition) {
- case PositionConstants.NORTH:// 1
- targetLocation.setLocation(sourceLocation.x, (int)targetBounds.getBottom().preciseY());
- // targetLocation = targetBounds.getBottom();
- break;
- case PositionConstants.SOUTH:// 4
- targetLocation.setLocation(sourceLocation.x, (int)targetBounds.getTop().preciseY());
- // targetLocation = targetBounds.getTop();
- break;
- case PositionConstants.EAST:// 16
- targetLocation.setLocation((int)targetBounds.preciseX(), (int)sourceLocation.preciseY());
- // targetLocation = targetBounds.getLeft();
- break;
- case PositionConstants.WEST:// 8
- targetLocation.setLocation((int)targetBounds.preciseX(), (int)sourceLocation.preciseY());
- // targetLocation = targetBounds.getRight();
- break;
- case PositionConstants.NORTH_EAST:// 17
- targetLocation = targetBounds.getLeft();
- break;
- case PositionConstants.NORTH_WEST:// 9
- targetLocation = targetBounds.getRight();
- break;
- case PositionConstants.SOUTH_EAST:// 20
- targetLocation = targetBounds.getLeft();
- break;
- case PositionConstants.SOUTH_WEST:// 12
- targetLocation = targetBounds.getRight();
- break;
- default:
- break;
- }
- } else {
- IBorderItemLocator loc = ((IBorderItemEditPart)targetEditPart).getBorderItemLocator();
- int side = loc.getCurrentSideOfParent();
- switch(targetPosition) {
- case PositionConstants.NORTH:// 1
- targetLocation = targetBounds.getBottom();
- break;
- case PositionConstants.SOUTH:// 4
- targetLocation = targetBounds.getTop();
- break;
- case PositionConstants.EAST:// 16
- targetLocation = targetBounds.getLeft();
- break;
- case PositionConstants.WEST:// 8
- targetLocation = targetBounds.getRight();
- break;
- case PositionConstants.NORTH_EAST:// 17
- if(eastPositions.contains(new Integer(side))) {
- targetLocation = targetBounds.getRight();
- } else if(westPositions.contains(new Integer(side))) {
- targetLocation = targetBounds.getRight();
- } else {
- targetLocation = targetBounds.getTop();
- }
- break;
- case PositionConstants.NORTH_WEST:// 9
- if(eastPositions.contains(new Integer(side))) {
- targetLocation = targetBounds.getLeft();
- } else if(westPositions.contains(new Integer(side))) {
- targetLocation = targetBounds.getLeft();
- } else {
- targetLocation = targetBounds.getTop();
- }
- break;
- case PositionConstants.SOUTH_EAST:// 20
- if(northPositions.contains(new Integer(side))) {
- targetLocation = targetBounds.getTop();
- } else if(southPositions.contains(new Integer(side))) {
- targetLocation = targetBounds.getTop();
- } else {
- targetLocation = targetBounds.getLeft();
- }
- break;
- case PositionConstants.SOUTH_WEST:// 12
- if(northPositions.contains(new Integer(side))) {
- targetLocation = targetBounds.getTop();
- } else if(southPositions.contains(new Integer(side))) {
- targetLocation = targetBounds.getTop();
- } else {
- targetLocation = targetBounds.getRight();
- }
- break;
- default:
- break;
- }
- }
-
- } else {
- // source and target intersect them
- // test if one editpart is included in other
- if(sourceBounds.contains(targetBounds)) {
- sourceLocation.setLocation((int)targetBounds.getBottom().preciseX(), (int)sourceBounds.getBottom().preciseY());
- targetLocation = targetBounds.getBottom();
- } else if(targetBounds.contains(sourceBounds)) {
- sourceLocation = sourceBounds.getBottom();
- targetLocation.setLocation((int)sourceBounds.getBottom().preciseX(), (int)targetBounds.getBottom().preciseY());
- } else {
- Rectangle rect = new Rectangle(sourceBounds);
- Rectangle intersection = rect.getCopy().intersect(targetBounds);
- int intersectPosition = getRelativePositionFor(sourceBounds, new PrecisionRectangle(intersection), diagramBounds);
- // Currently we do nothing in this case
- }
- }
- // return new Point[]{ new Point(), new Point() };
- return new Point[]{ sourceLocation, targetLocation };
- }
-
- /**
- * Return the Position of rect compared with reference
- *
- * @param reference
- * the reference
- * @param rect
- * another rectangle
- * @return the position of rect compared with reference Returned values can
- * be :
- * <ul>
- * <li> {@link PositionConstants#NORTH}</li>
- * <li> {@link PositionConstants#SOUTH}</li>
- * <li> {@link PositionConstants#EAST}</li>
- * <li>{@link PositionConstants#WEST}</li>
- * <li> {@link PositionConstants#NORTH_EAST}</li>
- * <li> {@link PositionConstants#NORTH_WEST}</li>
- * <li> {@link PositionConstants#SOUTH_EAST}</li>
- * <li> {@link PositionConstants#SOUTH_WEST}</li>
- * </ul>
- * If the 2 Rectangles intersect between them, the answer will be
- * one of NORTH_EAST or SOUTH_EAST or NORTH_WEST or SOUTH_WEST
- */
- public static int getRelativePositionFor(PrecisionRectangle reference, PrecisionRectangle rect, PrecisionRectangle diagramBounds) {
- // | |
- // NOTHING | NORTH |NOTHING
- // | |
- // ----------------- +-+-+-+-+-+-+-+-+-+-+-+-+ --------------------
- // | |
- // + +
- // | |
- // WEST + REFERENCE + EAST
- // | |
- // + +
- // | |
- // ----------------- +-+-+-+-+-+-+-+-+-+-+-+-+ -------------------
- // NOTHING | |NOTHING
- // SOUTH
-
- PrecisionRectangle pos = new PrecisionRectangle();
- // NORTH
- pos.setX(reference.preciseX());
- pos.setY(0);
- pos.setHeight(reference.preciseY());
- pos.setWidth(reference.preciseWidth());
- if(pos.intersects(rect)) {
- return PositionConstants.NORTH;// 1
- }
- // SOUTH
- pos.setX(reference.preciseX());
- pos.setY(reference.getBottom().preciseY());
- pos.setHeight(diagramBounds.preciseHeight() - reference.getBottom().preciseY());
- pos.setWidth(reference.preciseWidth());
- if(pos.intersects(rect)) {
- return PositionConstants.SOUTH;// 4
- }
- // EAST
- pos.setX(reference.getRight().preciseX());
- pos.setY(reference.getTop().preciseY());
- pos.setHeight(reference.preciseHeight());
- pos.setWidth(diagramBounds.preciseWidth() - reference.getLeft().preciseY());
- if(pos.intersects(rect)) {
- return PositionConstants.EAST;// 16
- }
-
- // WEST
- pos.setX(0);
- pos.setY(reference.preciseY());
- pos.setHeight(reference.preciseHeight());
- pos.setWidth(reference.preciseX());
- if(pos.intersects(rect)) {
- return PositionConstants.WEST;// 8
- }
-
- // |
- // NORTH-WEST | NORTH-EAST
- // |
- // |
- // |
- // +-+-+-+-+-+-+-+-+-+-+-+-+
- // | | |
- // + REF | REF +
- // | | |
- // --------------- + ----------+---------- + ----------------------
- // | | |
- // + REF | REF +
- // | | |
- // +-+-+-+-+-+-+-+-+-+-+-+-+
- // |
- // SOUTH-WEST | SOUTH-EAST
- // |
- // |
- // |
-
- // NORTH_EAST
- pos.setX(reference.getTop().preciseX());
- pos.setY(0);
- pos.setHeight(reference.getRight().preciseY());
- pos.setWidth(diagramBounds.preciseWidth() - reference.getTop().preciseX());
- if(pos.intersects(rect)) {
- return PositionConstants.NORTH_EAST;// 17
- }
- // NORTH_WEST
- pos = new PrecisionRectangle();
- pos.setX(0);
- pos.setY(0);
- pos.setHeight(reference.getLeft().preciseY());
- pos.setWidth(reference.getTop().preciseX());
- if(pos.intersects(rect)) {
- return PositionConstants.NORTH_WEST;// 9
- }
-
- // SOUTH_EAST
- pos = new PrecisionRectangle();
- pos.setX(reference.getBottom().preciseX());
- pos.setY(reference.getRight().preciseY());
- pos.setHeight(diagramBounds.preciseHeight() - reference.getRight().preciseY());
- pos.setWidth(diagramBounds.preciseWidth() - reference.getBottom().preciseX());
- if(pos.intersects(rect)) {
- return PositionConstants.SOUTH_EAST;// 20
- }
-
- // SOUTH_WEST
- pos = new PrecisionRectangle();
- pos.setX(0);
- pos.setY(reference.getLeft().preciseY());
- pos.setHeight(diagramBounds.preciseHeight() - reference.getLeft().preciseY());
- pos.setWidth(reference.getBottom().preciseX());
- if(pos.intersects(rect)) {
- return PositionConstants.SOUTH_WEST;// 12
- }
-
- Activator.log("I can't find the relative position for " + rect + " compared to " + reference + " ."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- return PositionConstants.NONE;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+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.ShapeEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.IOvalAnchorableFigure;
+import org.eclipse.papyrus.extensionpoints.editors.Activator;
+import org.eclipse.papyrus.uml.diagram.common.util.Util;
+
+/**
+ * This class provides utilities for the layout actions
+ *
+ *
+ */
+public class LayoutUtils {
+
+ public final static String alignementCmdId = "org.eclipse.papyrus.uml.diagram.common.commands.AlignmentCommand"; //$NON-NLS-1$
+
+ public final static String routingCmdId = "org.eclipse.papyrus.uml.diagram.common.commands.RoutingCommand"; //$NON-NLS-1$
+
+ /** the parameter for the left command (alignment and routing command) */
+ final public static String LEFT = "parameter_left"; //$NON-NLS-1$
+
+ /** the parameter for the right commands (alignment and routing command) */
+ final public static String RIGHT = "parameter_right"; //$NON-NLS-1$
+
+ /** the parameter for the top commands (alignment and routing command) */
+ final public static String TOP = "parameter_top"; //$NON-NLS-1$
+
+ /** the parameter for the bottom commands (alignment and routing command) */
+ final public static String BOTTOM = "parameter_bottom"; //$NON-NLS-1$
+
+ /** the parameter for the center alignment */
+ final public static String CENTER = "parameter_center"; //$NON-NLS-1$
+
+ /** the parameter for the horizontal distribution */
+ final public static String MIDDLE = "parameter_middle"; //$NON-NLS-1$
+
+ /** the parameter for the horizontal distribution */
+ final public static String HORIZONTALLY = "parameter_horizontally"; //$NON-NLS-1$
+
+ /** the parameter for the horizontal distribution between nodes */
+ final public static String HORIZONTALLY_BETWEEN_NODES = "parameter_horizontally_between_nodes"; //$NON-NLS-1$
+
+ /** the parameter for the vertical distribution */
+ final public static String VERTICALLY = "parameter_vertically"; //$NON-NLS-1$
+
+ /** the parameter for the vertical distribution between nodes */
+ final public static String VERTICALLY_BETWEEN_NODES = "parameter_vertically_between_nodes"; //$NON-NLS-1$
+
+ /**
+ * the shift to avoid the scrollbar If there is no scrollBar, set
+ * scrollBarSize to 0.0!
+ */
+ public static final double scrollBarSize = 6;
+
+ /**
+ *
+ * A {@link Rectangle} with the absolute position from the {@link EditPart}
+ *
+ * @param ep
+ * the {@link EditPart} that we want the position
+ * @return a {@link Rectangle} with the absolute position from the {@link EditPart}
+ *
+ */
+ public static PrecisionRectangle getAbsolutePosition(EditPart ep) {
+ GraphicalEditPart part = (GraphicalEditPart)ep;
+ PrecisionRectangle rect = new PrecisionRectangle(part.getFigure().getBounds());
+ part.getFigure().translateToAbsolute(rect);
+ return rect;
+ }
+
+ /**
+ * Returns the side on which the anchor is on the {@link EditPart}
+ *
+ * @param node
+ * the node where is located the anchor
+ * @param anchor
+ * the anchor. the anchor must in absolute coordinate before call
+ * this method.
+ * @return the side on which the anchor is on the {@link EditPart} The
+ * returned values can be :
+ * <ul>
+ * <li>{@linkplain PositionConstants#NONE}
+ * <ul>
+ * <li>if the figure is not not known. (This algorithm depends on the figure form).</li>
+ * <li>Maybe you forgot to translate the anchor in absolute coordinate or the anchor is not attached to the figure</li>
+ * </ul>
+ * </li>
+ * <li>{@linkplain PositionConstants#NORTH}</li>
+ * <li> {@linkplain PositionConstants#SOUTH}</li>
+ * <li>
+ * {@linkplain PositionConstants#EAST}</li>
+ * <li> {@linkplain PositionConstants#WEST}</li>
+ * <li>
+ * {@linkplain PositionConstants#NORTH_EAST}</li>
+ * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
+ * <li>
+ * {@linkplain PositionConstants#SOUTH_EAST}</li>
+ * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
+ * </ul>
+ */
+ public static int getAnchorPosition(EditPart node, Point anchor) {
+ int position = PositionConstants.NONE;
+ PrecisionRectangle bounds = LayoutUtils.getAbsolutePosition(node);
+
+ // we are not on EAST, not on WEST, but we are on the NORTH
+ if((anchor.y == bounds.y) && (anchor.x != bounds.x) && (anchor.x != bounds.getRight().x)) {
+ position = PositionConstants.NORTH;
+
+ // we are not on the EAST and not on the WEST, but we are on the
+ // SOUTH
+ } else if((anchor.y == bounds.getBottom().y) && (anchor.x != bounds.x) && (anchor.x != bounds.getRight().x)) {
+ position = PositionConstants.SOUTH;
+
+ // we are on the EAST, but we are not on the NORTH and not on the
+ // SOUTH
+ } else if((anchor.x == bounds.getRight().x) && (anchor.y != bounds.y) && (anchor.y != bounds.getBottom().y)) {
+ position = PositionConstants.EAST;
+
+ // we are on the WEST, but we are not on the on the NORTH and not on
+ // the SOUTH
+ } else if((anchor.x == bounds.x) && (anchor.y != bounds.getTop().y) && (anchor.y != bounds.getBottom().y)) {
+ position = PositionConstants.WEST;
+
+ // we are on the NORTH and on the EAST
+ } else if(anchor.equals(bounds.getLeft())) {
+ position = PositionConstants.NORTH_EAST;
+
+ // we are on the NORTH and on the WEST
+ } else if(anchor.equals(bounds.getRight())) {
+ position = PositionConstants.NORTH_WEST;
+
+ // we are on the EAST and on the SOUTH
+ } else if(anchor.equals(bounds.getBottomRight())) {
+ position = PositionConstants.SOUTH_EAST;
+
+ // we are on the WEST and on the SOUTH
+ } else if(anchor.equals(bounds.getBottomLeft())) {
+ position = PositionConstants.SOUTH_WEST;
+ }
+
+ if(position == PositionConstants.NONE) {// the figure is not a
+ // rectangle
+ if(node instanceof ShapeEditPart) {
+ for(Object obj : node.getChildren()) {
+ if(obj instanceof CompartmentEditPart && position == PositionConstants.NONE) {
+ position = getAnchorPosition((EditPart)obj, anchor);
+ }
+ }
+ if(position == PositionConstants.NONE) {// the figure is not a
+ // rectangle
+ IFigure figure = ((ShapeEditPart)node).getFigure();
+ if(figure instanceof IOvalAnchorableFigure) {
+ Rectangle bounds2 = ((IOvalAnchorableFigure)figure).getOvalBounds().getCopy();
+ figure.translateToAbsolute(bounds2);
+ Rectangle northWestBounds = new Rectangle(bounds2.x, bounds2.y, bounds2.width / 2, bounds2.height / 2);
+ Rectangle southWestBounds = new Rectangle(bounds2.getLeft().x, bounds2.getLeft().y, bounds2.width / 2, bounds2.height / 2);
+ Rectangle northEAstBounds = new Rectangle(bounds2.getTop().x, bounds2.getTop().y, bounds2.width / 2, bounds2.height / 2);
+ Rectangle southEAstBounds = new Rectangle(bounds2.getTop().x, bounds2.getLeft().y, bounds2.width / 2, bounds2.height / 2);
+ if(northEAstBounds.contains(anchor)) {
+ return PositionConstants.NORTH_EAST;
+ } else if(southEAstBounds.contains(anchor)) {
+ return PositionConstants.SOUTH_EAST;
+ } else if(southWestBounds.contains(anchor)) {
+ return PositionConstants.SOUTH_WEST;
+ } else if(northWestBounds.contains(anchor)) {
+ return PositionConstants.NORTH_WEST;
+ }
+ }
+ }
+ }
+ }
+ return position;
+ }
+
+ private final static int[] northArray = { PositionConstants.NORTH, PositionConstants.NORTH_EAST, PositionConstants.NORTH_WEST };
+
+ private final static int[] southArray = { PositionConstants.SOUTH, PositionConstants.SOUTH_EAST, PositionConstants.SOUTH_WEST };
+
+ private final static int[] eastArray = { PositionConstants.EAST, PositionConstants.NORTH_EAST, PositionConstants.SOUTH_EAST };
+
+ private final static int[] westArray = { PositionConstants.WEST, PositionConstants.NORTH_WEST, PositionConstants.SOUTH_WEST };
+
+ public final static List<Integer> northPositions = fillList(northArray);
+
+ public final static List<Integer> southPositions = fillList(southArray);
+
+ public final static List<Integer> eastPositions = fillList(eastArray);
+
+ public final static List<Integer> westPositions = fillList(westArray);
+
+ private static List<Integer> fillList(int[] array) {
+ List<Integer> list = new ArrayList<Integer>();
+ for(int i = 0; i < array.length; i++) {
+ list.add(new Integer(array[i]));
+ }
+ return list;
+ }
+
+ /**
+ * This method return the position of the ends for the link to have a nice
+ * representation. Some cases can be distinguish :
+ * <ul>
+ * <li>The 2 EditParts do not have intersection</li>
+ * <li>An EditPart is included in the other</li>
+ * <li>An EditPart intersects a part of the other : we calculate nothing</li>
+ * </ul>
+ *
+ * Moreover this method includes a specific algorithm when the EditPart is
+ * an Affixed Child Node
+ *
+ * @param sourceEditPart
+ * he source EditPart
+ * @param targetEditPart
+ * the targetEditPart
+ * @return <ul>
+ * <li>Point[0] is the source Anchor</li>
+ * <li>Point[1] is the target Anchor</li>
+ * </ul>
+ */
+ public static Point[] getLinkAnchor(IGraphicalEditPart sourceEditPart, IGraphicalEditPart targetEditPart) {
+ Point sourceLocation = new Point();
+ Point targetLocation = new Point();
+ int targetPosition = PositionConstants.NONE;
+ PrecisionRectangle sourceBounds = getAbsolutePosition(sourceEditPart);
+ PrecisionRectangle targetBounds = getAbsolutePosition(targetEditPart);
+ EditPart diagramEP = sourceEditPart;
+ while(!(diagramEP instanceof DiagramEditPart)) {
+ diagramEP = diagramEP.getParent();
+ }
+ PrecisionRectangle diagramBounds = getAbsolutePosition(diagramEP);
+
+ if(!sourceBounds.intersects(targetBounds)) {
+ /*
+ * there is no intersection between the 2 EditParts we look for the
+ * position of targetEditPart/sourceEditPart
+ */
+ targetPosition = getRelativePositionFor(sourceBounds, targetBounds, diagramBounds);
+ // calculate source location
+ if(!Util.isAffixedChildNode(sourceEditPart)) {
+ switch(targetPosition) {
+ case PositionConstants.NORTH:// 1
+ sourceLocation = sourceBounds.getTop();
+ if(sourceBounds.preciseX() >= targetBounds.preciseX() && sourceBounds.getRight().preciseX() <= targetBounds.getRight().preciseX()) {
+ // nothing to do
+ } else if(sourceBounds.preciseX() <= targetBounds.preciseX() && sourceBounds.getRight().preciseX() >= targetBounds.getRight().preciseX()) {
+ sourceLocation.x = (int)targetBounds.getBottom().preciseX();
+ } else if(sourceBounds.preciseX() <= targetBounds.preciseX() && sourceBounds.getRight().preciseX() <= targetBounds.getRight().preciseX()) {
+ sourceLocation.x = (int)(((targetBounds.preciseX() + sourceBounds.getRight().preciseX()) / 2));
+ } else {
+ sourceLocation.x = (int)(((sourceBounds.preciseX() + targetBounds.getRight().preciseX()) / 2));
+ }
+ break;
+ case PositionConstants.SOUTH:// 4
+ sourceLocation = sourceBounds.getBottom();
+ if(sourceBounds.preciseX() >= targetBounds.preciseX() && sourceBounds.getRight().preciseX() <= targetBounds.getRight().preciseX()) {
+ // nothing to do
+ } else if(sourceBounds.preciseX() <= targetBounds.preciseX() && sourceBounds.getRight().preciseX() >= targetBounds.getRight().preciseX()) {
+ sourceLocation.x = (int)targetBounds.getBottom().preciseX();
+ } else if(sourceBounds.preciseX() <= targetBounds.preciseX() && sourceBounds.getRight().preciseX() <= targetBounds.getRight().preciseX()) {
+ sourceLocation.x = (int)(((targetBounds.preciseX() + sourceBounds.getRight().preciseX()) / 2));
+ } else {
+ sourceLocation.x = (int)(((sourceBounds.preciseX() + targetBounds.getRight().preciseX()) / 2));
+ }
+ // sourceLocation = sourceBounds.getBottom();
+ break;
+ case PositionConstants.EAST:// 16
+ sourceLocation = sourceBounds.getRight();
+ if(sourceBounds.preciseY() >= targetBounds.preciseY() && sourceBounds.getBottom().preciseY() <= targetBounds.getBottom().preciseY()) {
+ // nothing to do
+ } else if(sourceBounds.preciseY() <= targetBounds.preciseY() && sourceBounds.getBottom().preciseY() >= targetBounds.getBottom().preciseY()) {
+ sourceLocation.y = (int)targetBounds.getLeft().preciseY();
+ } else if(sourceBounds.preciseY() >= targetBounds.preciseY() && sourceBounds.getBottom().preciseY() >= targetBounds.getBottom().preciseY()) {
+ sourceLocation.y = (int)((targetBounds.getBottom().preciseY() + sourceBounds.preciseY()) / 2);
+ } else {
+ sourceLocation.y = (int)((sourceBounds.getBottom().preciseY() + targetBounds.preciseY()) / 2);
+ }
+ // sourceLocation = sourceBounds.getRight();
+ break;
+ case PositionConstants.WEST:// 8
+ sourceLocation = sourceBounds.getLeft();
+ if(sourceBounds.preciseY() > targetBounds.preciseY() && sourceBounds.getBottom().preciseY() < targetBounds.getBottom().preciseY()) {
+ // nothing to do
+ } else if(sourceBounds.preciseY() < targetBounds.preciseY() && sourceBounds.getBottom().preciseY() > targetBounds.getBottom().preciseY()) {
+ sourceLocation.y = (int)targetBounds.getLeft().preciseY();
+ } else if(sourceBounds.preciseY() > targetBounds.preciseY() && sourceBounds.getBottom().preciseY() > targetBounds.getBottom().preciseY()) {
+ sourceLocation.y = (int)((targetBounds.getBottom().preciseY() + sourceBounds.preciseY()) / 2);
+ } else {
+ sourceLocation.y = (int)((sourceBounds.getBottom().preciseY() + targetBounds.preciseY()) / 2);
+ }
+ // sourceLocation = sourceBounds.getLeft();
+ break;
+ case PositionConstants.NORTH_EAST:// 17
+ sourceLocation = sourceBounds.getTop();
+ break;
+ case PositionConstants.NORTH_WEST:// 9
+ sourceLocation = sourceBounds.getTop();
+ break;
+ case PositionConstants.SOUTH_EAST:// 20
+ sourceLocation = sourceBounds.getBottom();
+ break;
+ case PositionConstants.SOUTH_WEST:// 12
+ sourceLocation = sourceBounds.getBottom();
+ break;
+ default:
+ break;
+ }
+ } else {
+ IBorderItemLocator loc = ((IBorderItemEditPart)sourceEditPart).getBorderItemLocator();
+ int side = loc.getCurrentSideOfParent();
+ switch(targetPosition) {
+ case PositionConstants.NORTH:// 1
+ sourceLocation = sourceBounds.getTop();
+ break;
+ case PositionConstants.SOUTH:// 4
+ sourceLocation = sourceBounds.getBottom();
+ break;
+ case PositionConstants.EAST:// 16
+ sourceLocation = sourceBounds.getRight();
+ break;
+ case PositionConstants.WEST:// 8
+ sourceLocation = sourceBounds.getLeft();
+ break;
+ case PositionConstants.NORTH_EAST:// 17
+ if(eastPositions.contains(new Integer(side))) {
+ sourceLocation = sourceBounds.getRight();
+ } else if(westPositions.contains(new Integer(side))) {
+ sourceLocation = sourceBounds.getRight();
+ } else {// side is NORTH or SOUTH
+ sourceLocation = sourceBounds.getTop();
+ }
+ break;
+ case PositionConstants.NORTH_WEST:// 9
+ if(eastPositions.contains(new Integer(side))) {
+ sourceLocation = sourceBounds.getLeft();
+ } else if(westPositions.contains(new Integer(side))) {
+ sourceLocation = sourceBounds.getLeft();
+ } else {// side is NORTH or SOUTH
+ sourceLocation = sourceBounds.getTop();
+ }
+ break;
+ case PositionConstants.SOUTH_EAST:// 20
+ if(northPositions.contains(new Integer(side))) {
+ sourceLocation = sourceBounds.getBottom();
+ } else if(southPositions.contains(new Integer(side))) {
+ sourceLocation = sourceBounds.getBottom();
+ } else {// SIDE is EAST or WEST
+ sourceLocation = sourceBounds.getRight();
+ }
+ break;
+ case PositionConstants.SOUTH_WEST:// 12
+ if(northPositions.contains(new Integer(side))) {
+ sourceLocation = sourceBounds.getBottom();
+ } else if(southPositions.contains(new Integer(side))) {
+ sourceLocation = sourceBounds.getBottom();
+ } else {// SIDE is EAST or WEST
+ sourceLocation = sourceBounds.getLeft();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ // calculate target location
+ if(!Util.isAffixedChildNode(targetEditPart)) {
+ switch(targetPosition) {
+ case PositionConstants.NORTH:// 1
+ targetLocation.setLocation(sourceLocation.x, (int)targetBounds.getBottom().preciseY());
+ // targetLocation = targetBounds.getBottom();
+ break;
+ case PositionConstants.SOUTH:// 4
+ targetLocation.setLocation(sourceLocation.x, (int)targetBounds.getTop().preciseY());
+ // targetLocation = targetBounds.getTop();
+ break;
+ case PositionConstants.EAST:// 16
+ targetLocation.setLocation((int)targetBounds.preciseX(), (int)sourceLocation.preciseY());
+ // targetLocation = targetBounds.getLeft();
+ break;
+ case PositionConstants.WEST:// 8
+ targetLocation.setLocation((int)targetBounds.preciseX(), (int)sourceLocation.preciseY());
+ // targetLocation = targetBounds.getRight();
+ break;
+ case PositionConstants.NORTH_EAST:// 17
+ targetLocation = targetBounds.getLeft();
+ break;
+ case PositionConstants.NORTH_WEST:// 9
+ targetLocation = targetBounds.getRight();
+ break;
+ case PositionConstants.SOUTH_EAST:// 20
+ targetLocation = targetBounds.getLeft();
+ break;
+ case PositionConstants.SOUTH_WEST:// 12
+ targetLocation = targetBounds.getRight();
+ break;
+ default:
+ break;
+ }
+ } else {
+ IBorderItemLocator loc = ((IBorderItemEditPart)targetEditPart).getBorderItemLocator();
+ int side = loc.getCurrentSideOfParent();
+ switch(targetPosition) {
+ case PositionConstants.NORTH:// 1
+ targetLocation = targetBounds.getBottom();
+ break;
+ case PositionConstants.SOUTH:// 4
+ targetLocation = targetBounds.getTop();
+ break;
+ case PositionConstants.EAST:// 16
+ targetLocation = targetBounds.getLeft();
+ break;
+ case PositionConstants.WEST:// 8
+ targetLocation = targetBounds.getRight();
+ break;
+ case PositionConstants.NORTH_EAST:// 17
+ if(eastPositions.contains(new Integer(side))) {
+ targetLocation = targetBounds.getRight();
+ } else if(westPositions.contains(new Integer(side))) {
+ targetLocation = targetBounds.getRight();
+ } else {
+ targetLocation = targetBounds.getTop();
+ }
+ break;
+ case PositionConstants.NORTH_WEST:// 9
+ if(eastPositions.contains(new Integer(side))) {
+ targetLocation = targetBounds.getLeft();
+ } else if(westPositions.contains(new Integer(side))) {
+ targetLocation = targetBounds.getLeft();
+ } else {
+ targetLocation = targetBounds.getTop();
+ }
+ break;
+ case PositionConstants.SOUTH_EAST:// 20
+ if(northPositions.contains(new Integer(side))) {
+ targetLocation = targetBounds.getTop();
+ } else if(southPositions.contains(new Integer(side))) {
+ targetLocation = targetBounds.getTop();
+ } else {
+ targetLocation = targetBounds.getLeft();
+ }
+ break;
+ case PositionConstants.SOUTH_WEST:// 12
+ if(northPositions.contains(new Integer(side))) {
+ targetLocation = targetBounds.getTop();
+ } else if(southPositions.contains(new Integer(side))) {
+ targetLocation = targetBounds.getTop();
+ } else {
+ targetLocation = targetBounds.getRight();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ } else {
+ // source and target intersect them
+ // test if one editpart is included in other
+ if(sourceBounds.contains(targetBounds)) {
+ sourceLocation.setLocation((int)targetBounds.getBottom().preciseX(), (int)sourceBounds.getBottom().preciseY());
+ targetLocation = targetBounds.getBottom();
+ } else if(targetBounds.contains(sourceBounds)) {
+ sourceLocation = sourceBounds.getBottom();
+ targetLocation.setLocation((int)sourceBounds.getBottom().preciseX(), (int)targetBounds.getBottom().preciseY());
+ } else {
+ Rectangle rect = new Rectangle(sourceBounds);
+ Rectangle intersection = rect.getCopy().intersect(targetBounds);
+ int intersectPosition = getRelativePositionFor(sourceBounds, new PrecisionRectangle(intersection), diagramBounds);
+ // Currently we do nothing in this case
+ }
+ }
+ // return new Point[]{ new Point(), new Point() };
+ return new Point[]{ sourceLocation, targetLocation };
+ }
+
+ /**
+ * Return the Position of rect compared with reference
+ *
+ * @param reference
+ * the reference
+ * @param rect
+ * another rectangle
+ * @return the position of rect compared with reference Returned values can
+ * be :
+ * <ul>
+ * <li> {@link PositionConstants#NORTH}</li>
+ * <li> {@link PositionConstants#SOUTH}</li>
+ * <li> {@link PositionConstants#EAST}</li>
+ * <li>{@link PositionConstants#WEST}</li>
+ * <li> {@link PositionConstants#NORTH_EAST}</li>
+ * <li> {@link PositionConstants#NORTH_WEST}</li>
+ * <li> {@link PositionConstants#SOUTH_EAST}</li>
+ * <li> {@link PositionConstants#SOUTH_WEST}</li>
+ * </ul>
+ * If the 2 Rectangles intersect between them, the answer will be
+ * one of NORTH_EAST or SOUTH_EAST or NORTH_WEST or SOUTH_WEST
+ */
+ public static int getRelativePositionFor(PrecisionRectangle reference, PrecisionRectangle rect, PrecisionRectangle diagramBounds) {
+ // | |
+ // NOTHING | NORTH |NOTHING
+ // | |
+ // ----------------- +-+-+-+-+-+-+-+-+-+-+-+-+ --------------------
+ // | |
+ // + +
+ // | |
+ // WEST + REFERENCE + EAST
+ // | |
+ // + +
+ // | |
+ // ----------------- +-+-+-+-+-+-+-+-+-+-+-+-+ -------------------
+ // NOTHING | |NOTHING
+ // SOUTH
+
+ PrecisionRectangle pos = new PrecisionRectangle();
+ // NORTH
+ pos.setX(reference.preciseX());
+ pos.setY(0);
+ pos.setHeight(reference.preciseY());
+ pos.setWidth(reference.preciseWidth());
+ if(pos.intersects(rect)) {
+ return PositionConstants.NORTH;// 1
+ }
+ // SOUTH
+ pos.setX(reference.preciseX());
+ pos.setY(reference.getBottom().preciseY());
+ pos.setHeight(diagramBounds.preciseHeight() - reference.getBottom().preciseY());
+ pos.setWidth(reference.preciseWidth());
+ if(pos.intersects(rect)) {
+ return PositionConstants.SOUTH;// 4
+ }
+ // EAST
+ pos.setX(reference.getRight().preciseX());
+ pos.setY(reference.getTop().preciseY());
+ pos.setHeight(reference.preciseHeight());
+ pos.setWidth(diagramBounds.preciseWidth() - reference.getLeft().preciseY());
+ if(pos.intersects(rect)) {
+ return PositionConstants.EAST;// 16
+ }
+
+ // WEST
+ pos.setX(0);
+ pos.setY(reference.preciseY());
+ pos.setHeight(reference.preciseHeight());
+ pos.setWidth(reference.preciseX());
+ if(pos.intersects(rect)) {
+ return PositionConstants.WEST;// 8
+ }
+
+ // |
+ // NORTH-WEST | NORTH-EAST
+ // |
+ // |
+ // |
+ // +-+-+-+-+-+-+-+-+-+-+-+-+
+ // | | |
+ // + REF | REF +
+ // | | |
+ // --------------- + ----------+---------- + ----------------------
+ // | | |
+ // + REF | REF +
+ // | | |
+ // +-+-+-+-+-+-+-+-+-+-+-+-+
+ // |
+ // SOUTH-WEST | SOUTH-EAST
+ // |
+ // |
+ // |
+
+ // NORTH_EAST
+ pos.setX(reference.getTop().preciseX());
+ pos.setY(0);
+ pos.setHeight(reference.getRight().preciseY());
+ pos.setWidth(diagramBounds.preciseWidth() - reference.getTop().preciseX());
+ if(pos.intersects(rect)) {
+ return PositionConstants.NORTH_EAST;// 17
+ }
+ // NORTH_WEST
+ pos = new PrecisionRectangle();
+ pos.setX(0);
+ pos.setY(0);
+ pos.setHeight(reference.getLeft().preciseY());
+ pos.setWidth(reference.getTop().preciseX());
+ if(pos.intersects(rect)) {
+ return PositionConstants.NORTH_WEST;// 9
+ }
+
+ // SOUTH_EAST
+ pos = new PrecisionRectangle();
+ pos.setX(reference.getBottom().preciseX());
+ pos.setY(reference.getRight().preciseY());
+ pos.setHeight(diagramBounds.preciseHeight() - reference.getRight().preciseY());
+ pos.setWidth(diagramBounds.preciseWidth() - reference.getBottom().preciseX());
+ if(pos.intersects(rect)) {
+ return PositionConstants.SOUTH_EAST;// 20
+ }
+
+ // SOUTH_WEST
+ pos = new PrecisionRectangle();
+ pos.setX(0);
+ pos.setY(reference.getLeft().preciseY());
+ pos.setHeight(diagramBounds.preciseHeight() - reference.getLeft().preciseY());
+ pos.setWidth(reference.getBottom().preciseX());
+ if(pos.intersects(rect)) {
+ return PositionConstants.SOUTH_WEST;// 12
+ }
+
+ Activator.log("I can't find the relative position for " + rect + " compared to " + reference + " ."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ return PositionConstants.NONE;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentation.java
index 111823f42e7..cc641c1bbcd 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentation.java
@@ -1,370 +1,370 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.PrecisionPoint;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.gef.ConnectionEditPart;
-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.commands.CompoundCommand;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.requests.SetAllBendpointRequest;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-
-/**
- *
- * This class is used to represent a link, to allow an alignment action. Its
- * provides fields to store the sources and the target and methods to do the
- * needed action to align the link extremities.
- *
- * This alignment align the two anchors of a link. To do this, only one {@link EditPart} can moves.
- *
- * TODO should be merge with LinkRepresentationForLayoutAction
- */
-public class LinkRepresentation {
-
- /** the alignment */
- private final int align;
-
- /** the represented link */
- private final EditPart link;
-
- /** the representation of the source for the {@link #link} */
- private final EditPartRepresentation target;
-
- /** the representation of the target for the {@link #link} */
- private final EditPartRepresentation source;
-
- /** the {@link EditPartRepresentation} for the fixed {@link EditPart} */
- private EditPartRepresentation fixedEditPart = null;
-
- /** the {@link EditPartRepresentation} for the mowing {@link EditPart} */
- private EditPartRepresentation movedEditPart = null;
-
- /** the reference point for this action (this point will not move) */
- private Point referencePoint;
-
- /** the point which moves to do the action */
- private Point movedPoint;
-
- /**
- *
- * Constructor.
- *
- * @param link
- * the represented link
- * @param source
- * the representation of the source of the link
- * @param target
- * the representation of the target of the link
- * @param alignment
- * the alignment
- */
- public LinkRepresentation(EditPart link, EditPartRepresentation source, EditPartRepresentation target, int alignment) {
- this.link = link;
- this.target = target;
- this.source = source;
- this.align = alignment;
- }
-
- /**
- * Getter for {@link #link}
- *
- * @return {@link #link}
- */
- public EditPart getLink() {
- return this.link;
- }
-
- /**
- * Getter for {@link #source}
- *
- * @return {@link #source}
- */
- public EditPartRepresentation getSource() {
- return this.source;
- }
-
- /**
- * Getter for {@link #target}
- *
- * @return {@link #target}
- */
- public EditPartRepresentation getTarget() {
- return this.target;
- }
-
- /**
- * Returns the command to align the node with a common link
- *
- * @return the command to align the node with a common link
- */
- public Command getCommand() {
- initializeReferences();
- buildRequest();
- CompoundCommand command = new CompoundCommand("Align with a link"); //$NON-NLS-1$
- Command cmd;
-
- // the command to align the node
- cmd = movedEditPart.getCommand();
- if(cmd != null && cmd.canExecute()) {
- command.add(cmd);
- }
-
- // the command to reset the anchor location
- cmd = preserveAnchorLocationCommand();
- if(cmd.canExecute()) {
- command.add(cmd);
- }
-
- // we want zero bendpoint, and keep the current source and target
- Request onlyTwoBendpoints = new SetAllBendpointRequest(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_SET_ALL_BENDPOINT, new PointList(), null, null);
- command.add(link.getCommand(onlyTwoBendpoints));
-
- return command;
- }
-
- /**
- * Builds the requests for this {@link LinkRepresentation}
- */
- protected void buildRequest() {
- int shift = 0;
- PrecisionRectangle absolutePosition = movedEditPart.getPosition();
- PrecisionPoint oldLocation = new PrecisionPoint(absolutePosition.getTopLeft());
- PrecisionPoint newLocation = new PrecisionPoint(oldLocation);
-
- /* we calculate the shift for the editpart */
- switch(this.align) {
- case PositionConstants.LEFT:// it's the left figure we move
- shift = referencePoint.y - movedPoint.y;
- movedPoint.y += shift;
- newLocation.setLocation(newLocation.x, newLocation.y + shift);
- break;
- case PositionConstants.RIGHT:// it's the right figure we move
- shift = referencePoint.y - movedPoint.y;
- movedPoint.y += shift;
- newLocation.setLocation(newLocation.x, newLocation.y + shift);
- break;
-
- case PositionConstants.TOP:// it's the top figure we move
- shift = referencePoint.x - movedPoint.x;
- movedPoint.x += shift;
- newLocation.setLocation(newLocation.x + shift, newLocation.y);
- break;
- case PositionConstants.BOTTOM:// it's the bottom figure we move
- shift = referencePoint.x - movedPoint.x;
- movedPoint.x += shift;
- newLocation.setLocation(newLocation.x + shift, newLocation.y);
- break;
- }
-
- // we correct the location to avoid the scrollbar!
- // the parent bounds
- PrecisionRectangle parentBounds = LayoutUtils.getAbsolutePosition(movedEditPart.getRepresentedEditPart().getParent());
- if(this.align == PositionConstants.LEFT || this.align == PositionConstants.RIGHT) {
- if((newLocation.y < (parentBounds.y + LayoutUtils.scrollBarSize)) && (shift < 0)) {
- newLocation.setLocation(newLocation.x, parentBounds.y + (int)LayoutUtils.scrollBarSize);
- } else if(((newLocation.y + absolutePosition.height) > parentBounds.getBottomLeft().y) && (shift > 0)) {
- newLocation.setLocation(newLocation.x, parentBounds.getBottomLeft().y - ((int)LayoutUtils.scrollBarSize + absolutePosition.height));
- }
- } else if(this.align == PositionConstants.TOP || this.align == PositionConstants.BOTTOM) {
- if((newLocation.x < (parentBounds.x + LayoutUtils.scrollBarSize)) && (shift < 0)) {
- newLocation.setLocation(parentBounds.x + (int)LayoutUtils.scrollBarSize, newLocation.y);
- } else if(((newLocation.x + absolutePosition.width) > parentBounds.getBottomRight().x) && (shift > 0)) {
- newLocation.setLocation(parentBounds.getBottomRight().x - ((int)LayoutUtils.scrollBarSize + absolutePosition.width), newLocation.y);
- }
- }
-
- // request creation
- ChangeBoundsRequest req = new ChangeBoundsRequest(RequestConstants.REQ_MOVE);
- req.setEditParts(movedEditPart.getRepresentedEditPart());
-
- Dimension delta = newLocation.getDifference(oldLocation);
- req.setMoveDelta(new Point(delta.width, delta.height));
- req.setSizeDelta(new Dimension(0, 0));
- movedEditPart.setRequest(req);
- movedEditPart.setMoveDelta(delta);
- }
-
- /**
- * This method initializes the following fields :
- * <ul>
- * <li> {@link #fixedEditPart}</li>
- * <li> {@link #movedEditPart}</li>
- * <li> {@link #referencePoint}</li>
- * <li> {@link #movedPoint}</li>
- * </ul>
- *
- * It determines the reference point and the reference editpart for the
- * alignment
- */
- protected void initializeReferences() {
- PrecisionRectangle absolutePositionSource = LayoutUtils.getAbsolutePosition(source.getRepresentedEditPart());
- PrecisionRectangle absolutePositionTarget = LayoutUtils.getAbsolutePosition(target.getRepresentedEditPart());
-
- switch(this.align) {
- case PositionConstants.LEFT:
- if(absolutePositionSource.preciseX < absolutePositionTarget.preciseX) {// the
- // left
- // node
- // moves
- fixedEditPart = target;
- } else {
- fixedEditPart = source;
- }
- break;
- case PositionConstants.RIGHT:
- if(absolutePositionSource.preciseX > absolutePositionTarget.preciseX) {// the
- // right
- // node
- // moves
- fixedEditPart = target;
- } else {
- fixedEditPart = source;
- }
- break;
- case PositionConstants.TOP:
- if(absolutePositionSource.preciseY < absolutePositionTarget.preciseY) {// the
- // top
- // node
- // moves
- fixedEditPart = target;
- } else {
- fixedEditPart = source;
- }
- break;
- case PositionConstants.BOTTOM:
- if(absolutePositionSource.preciseY > absolutePositionTarget.preciseY) {// the
- // bottom
- // node
- // moves
- fixedEditPart = target;
- } else {
- fixedEditPart = source;
- }
- break;
- }
- assert (fixedEditPart != null);
- movedEditPart = (source == fixedEditPart) ? target : source;
-
- PolylineConnectionEx figure = (PolylineConnectionEx)((AbstractConnectionEditPart)link).getFigure();
-
- if(fixedEditPart == source) {
- referencePoint = figure.getStart();
- movedPoint = figure.getEnd();
- } else {
- referencePoint = figure.getEnd();
- movedPoint = figure.getStart();
- }
-
- // we move the reference point with its delta. This delta comes from
- // another shift, were the editpart was the moved editpart and not the
- // reference
- Dimension delta = fixedEditPart.getMoveDelta();
- referencePoint.translate(delta);
-
- figure.translateToAbsolute(referencePoint);
- figure.translateToAbsolute(movedPoint);
- }
-
- /**
- * Returns the side on which the anchor is on the {@link #source}
- *
- * @return the side on which the anchor is on the {@link #source}
- */
- public int getLinkSideOnSource() {
-
- PolylineConnectionEx figure = (PolylineConnectionEx)((AbstractConnectionEditPart)link).getFigure();
- Point sourcePoint = figure.getStart();
- figure.translateToAbsolute(sourcePoint);
- return LayoutUtils.getAnchorPosition(source.getRepresentedEditPart(), sourcePoint);
- }
-
- /**
- * Returns the side on which the anchor is on the {@link #target}
- *
- * @return the side on which the anchor is on the {@link #target}
- */
- public int getLinkSideOnTarget() {
-
- PolylineConnectionEx figure = (PolylineConnectionEx)((AbstractConnectionEditPart)link).getFigure();
- Point targetPoint = figure.getEnd();
- figure.translateToAbsolute(targetPoint);
- return LayoutUtils.getAnchorPosition(target.getRepresentedEditPart(), targetPoint);
- }
-
- /**
- * Creates and returns the command to reset the connection anchors after
- * alignment to their initial location
- *
- *
- *
- * @return the command to reset the connection anchors to their initial
- * location after the node shifting
- *
- */
- protected Command preserveAnchorLocationCommand() {
- CompoundCommand command = new CompoundCommand("Preserve Anchor"); //$NON-NLS-1$
-
- Command cmd;
- if(movedEditPart == source) {
- // the moved editpart is the source
- ReconnectRequest reconnectRequest = new ReconnectRequest();
- reconnectRequest.setType(GraphicalNodeEditPolicy.REQ_RECONNECT_SOURCE);
- reconnectRequest.setConnectionEditPart((ConnectionEditPart)this.link);
- reconnectRequest.setTargetEditPart(source.getRepresentedEditPart());
- reconnectRequest.setLocation(movedPoint.getTranslated(-movedEditPart.getMoveDelta().width, -movedEditPart.getMoveDelta().height));
- cmd = source.getRepresentedEditPart().getCommand(reconnectRequest);
- command.add(cmd);
-
- // the fixed editpart is the target
- ReconnectRequest reconnectRequestTarget = new ReconnectRequest();
- reconnectRequestTarget.setType(GraphicalNodeEditPolicy.REQ_RECONNECT_TARGET);
- reconnectRequestTarget.setConnectionEditPart((ConnectionEditPart)this.link);
- reconnectRequestTarget.setTargetEditPart(target.getRepresentedEditPart());
- reconnectRequestTarget.setLocation(referencePoint.getTranslated(-fixedEditPart.getMoveDelta().width, -fixedEditPart.getMoveDelta().height));
- cmd = target.getRepresentedEditPart().getCommand(reconnectRequestTarget);
- command.add(cmd);
- } else {
- // the moved editpart is the target
- ReconnectRequest reconnectRequest = new ReconnectRequest();
- reconnectRequest.setType(GraphicalNodeEditPolicy.REQ_RECONNECT_TARGET);
- reconnectRequest.setConnectionEditPart((ConnectionEditPart)this.link);
- reconnectRequest.setTargetEditPart(target.getRepresentedEditPart());
- reconnectRequest.setLocation(movedPoint.getTranslated(-movedEditPart.getMoveDelta().width, -movedEditPart.getMoveDelta().height));
- cmd = target.getRepresentedEditPart().getCommand(reconnectRequest);
- command.add(cmd);
-
- // the fixed editpart is the source
- ReconnectRequest reconnectRequestTarget = new ReconnectRequest();
- reconnectRequestTarget.setType(GraphicalNodeEditPolicy.REQ_RECONNECT_SOURCE);
- reconnectRequestTarget.setConnectionEditPart((ConnectionEditPart)this.link);
- reconnectRequestTarget.setTargetEditPart(source.getRepresentedEditPart());
- reconnectRequestTarget.setLocation(referencePoint.getTranslated(-fixedEditPart.getMoveDelta().width, -fixedEditPart.getMoveDelta().height));
- cmd = source.getRepresentedEditPart().getCommand(reconnectRequestTarget);
- command.add(cmd);
- }
- return command;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
+import org.eclipse.draw2d.geometry.PrecisionPoint;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.gef.ConnectionEditPart;
+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.commands.CompoundCommand;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.requests.SetAllBendpointRequest;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+
+/**
+ *
+ * This class is used to represent a link, to allow an alignment action. Its
+ * provides fields to store the sources and the target and methods to do the
+ * needed action to align the link extremities.
+ *
+ * This alignment align the two anchors of a link. To do this, only one {@link EditPart} can moves.
+ *
+ * TODO should be merge with LinkRepresentationForLayoutAction
+ */
+public class LinkRepresentation {
+
+ /** the alignment */
+ private final int align;
+
+ /** the represented link */
+ private final EditPart link;
+
+ /** the representation of the source for the {@link #link} */
+ private final EditPartRepresentation target;
+
+ /** the representation of the target for the {@link #link} */
+ private final EditPartRepresentation source;
+
+ /** the {@link EditPartRepresentation} for the fixed {@link EditPart} */
+ private EditPartRepresentation fixedEditPart = null;
+
+ /** the {@link EditPartRepresentation} for the mowing {@link EditPart} */
+ private EditPartRepresentation movedEditPart = null;
+
+ /** the reference point for this action (this point will not move) */
+ private Point referencePoint;
+
+ /** the point which moves to do the action */
+ private Point movedPoint;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param link
+ * the represented link
+ * @param source
+ * the representation of the source of the link
+ * @param target
+ * the representation of the target of the link
+ * @param alignment
+ * the alignment
+ */
+ public LinkRepresentation(EditPart link, EditPartRepresentation source, EditPartRepresentation target, int alignment) {
+ this.link = link;
+ this.target = target;
+ this.source = source;
+ this.align = alignment;
+ }
+
+ /**
+ * Getter for {@link #link}
+ *
+ * @return {@link #link}
+ */
+ public EditPart getLink() {
+ return this.link;
+ }
+
+ /**
+ * Getter for {@link #source}
+ *
+ * @return {@link #source}
+ */
+ public EditPartRepresentation getSource() {
+ return this.source;
+ }
+
+ /**
+ * Getter for {@link #target}
+ *
+ * @return {@link #target}
+ */
+ public EditPartRepresentation getTarget() {
+ return this.target;
+ }
+
+ /**
+ * Returns the command to align the node with a common link
+ *
+ * @return the command to align the node with a common link
+ */
+ public Command getCommand() {
+ initializeReferences();
+ buildRequest();
+ CompoundCommand command = new CompoundCommand("Align with a link"); //$NON-NLS-1$
+ Command cmd;
+
+ // the command to align the node
+ cmd = movedEditPart.getCommand();
+ if(cmd != null && cmd.canExecute()) {
+ command.add(cmd);
+ }
+
+ // the command to reset the anchor location
+ cmd = preserveAnchorLocationCommand();
+ if(cmd.canExecute()) {
+ command.add(cmd);
+ }
+
+ // we want zero bendpoint, and keep the current source and target
+ Request onlyTwoBendpoints = new SetAllBendpointRequest(org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants.REQ_SET_ALL_BENDPOINT, new PointList(), null, null);
+ command.add(link.getCommand(onlyTwoBendpoints));
+
+ return command;
+ }
+
+ /**
+ * Builds the requests for this {@link LinkRepresentation}
+ */
+ protected void buildRequest() {
+ int shift = 0;
+ PrecisionRectangle absolutePosition = movedEditPart.getPosition();
+ PrecisionPoint oldLocation = new PrecisionPoint(absolutePosition.getTopLeft());
+ PrecisionPoint newLocation = new PrecisionPoint(oldLocation);
+
+ /* we calculate the shift for the editpart */
+ switch(this.align) {
+ case PositionConstants.LEFT:// it's the left figure we move
+ shift = referencePoint.y - movedPoint.y;
+ movedPoint.y += shift;
+ newLocation.setLocation(newLocation.x, newLocation.y + shift);
+ break;
+ case PositionConstants.RIGHT:// it's the right figure we move
+ shift = referencePoint.y - movedPoint.y;
+ movedPoint.y += shift;
+ newLocation.setLocation(newLocation.x, newLocation.y + shift);
+ break;
+
+ case PositionConstants.TOP:// it's the top figure we move
+ shift = referencePoint.x - movedPoint.x;
+ movedPoint.x += shift;
+ newLocation.setLocation(newLocation.x + shift, newLocation.y);
+ break;
+ case PositionConstants.BOTTOM:// it's the bottom figure we move
+ shift = referencePoint.x - movedPoint.x;
+ movedPoint.x += shift;
+ newLocation.setLocation(newLocation.x + shift, newLocation.y);
+ break;
+ }
+
+ // we correct the location to avoid the scrollbar!
+ // the parent bounds
+ PrecisionRectangle parentBounds = LayoutUtils.getAbsolutePosition(movedEditPart.getRepresentedEditPart().getParent());
+ if(this.align == PositionConstants.LEFT || this.align == PositionConstants.RIGHT) {
+ if((newLocation.y < (parentBounds.y + LayoutUtils.scrollBarSize)) && (shift < 0)) {
+ newLocation.setLocation(newLocation.x, parentBounds.y + (int)LayoutUtils.scrollBarSize);
+ } else if(((newLocation.y + absolutePosition.height) > parentBounds.getBottomLeft().y) && (shift > 0)) {
+ newLocation.setLocation(newLocation.x, parentBounds.getBottomLeft().y - ((int)LayoutUtils.scrollBarSize + absolutePosition.height));
+ }
+ } else if(this.align == PositionConstants.TOP || this.align == PositionConstants.BOTTOM) {
+ if((newLocation.x < (parentBounds.x + LayoutUtils.scrollBarSize)) && (shift < 0)) {
+ newLocation.setLocation(parentBounds.x + (int)LayoutUtils.scrollBarSize, newLocation.y);
+ } else if(((newLocation.x + absolutePosition.width) > parentBounds.getBottomRight().x) && (shift > 0)) {
+ newLocation.setLocation(parentBounds.getBottomRight().x - ((int)LayoutUtils.scrollBarSize + absolutePosition.width), newLocation.y);
+ }
+ }
+
+ // request creation
+ ChangeBoundsRequest req = new ChangeBoundsRequest(RequestConstants.REQ_MOVE);
+ req.setEditParts(movedEditPart.getRepresentedEditPart());
+
+ Dimension delta = newLocation.getDifference(oldLocation);
+ req.setMoveDelta(new Point(delta.width, delta.height));
+ req.setSizeDelta(new Dimension(0, 0));
+ movedEditPart.setRequest(req);
+ movedEditPart.setMoveDelta(delta);
+ }
+
+ /**
+ * This method initializes the following fields :
+ * <ul>
+ * <li> {@link #fixedEditPart}</li>
+ * <li> {@link #movedEditPart}</li>
+ * <li> {@link #referencePoint}</li>
+ * <li> {@link #movedPoint}</li>
+ * </ul>
+ *
+ * It determines the reference point and the reference editpart for the
+ * alignment
+ */
+ protected void initializeReferences() {
+ PrecisionRectangle absolutePositionSource = LayoutUtils.getAbsolutePosition(source.getRepresentedEditPart());
+ PrecisionRectangle absolutePositionTarget = LayoutUtils.getAbsolutePosition(target.getRepresentedEditPart());
+
+ switch(this.align) {
+ case PositionConstants.LEFT:
+ if(absolutePositionSource.preciseX < absolutePositionTarget.preciseX) {// the
+ // left
+ // node
+ // moves
+ fixedEditPart = target;
+ } else {
+ fixedEditPart = source;
+ }
+ break;
+ case PositionConstants.RIGHT:
+ if(absolutePositionSource.preciseX > absolutePositionTarget.preciseX) {// the
+ // right
+ // node
+ // moves
+ fixedEditPart = target;
+ } else {
+ fixedEditPart = source;
+ }
+ break;
+ case PositionConstants.TOP:
+ if(absolutePositionSource.preciseY < absolutePositionTarget.preciseY) {// the
+ // top
+ // node
+ // moves
+ fixedEditPart = target;
+ } else {
+ fixedEditPart = source;
+ }
+ break;
+ case PositionConstants.BOTTOM:
+ if(absolutePositionSource.preciseY > absolutePositionTarget.preciseY) {// the
+ // bottom
+ // node
+ // moves
+ fixedEditPart = target;
+ } else {
+ fixedEditPart = source;
+ }
+ break;
+ }
+ assert (fixedEditPart != null);
+ movedEditPart = (source == fixedEditPart) ? target : source;
+
+ PolylineConnectionEx figure = (PolylineConnectionEx)((AbstractConnectionEditPart)link).getFigure();
+
+ if(fixedEditPart == source) {
+ referencePoint = figure.getStart();
+ movedPoint = figure.getEnd();
+ } else {
+ referencePoint = figure.getEnd();
+ movedPoint = figure.getStart();
+ }
+
+ // we move the reference point with its delta. This delta comes from
+ // another shift, were the editpart was the moved editpart and not the
+ // reference
+ Dimension delta = fixedEditPart.getMoveDelta();
+ referencePoint.translate(delta);
+
+ figure.translateToAbsolute(referencePoint);
+ figure.translateToAbsolute(movedPoint);
+ }
+
+ /**
+ * Returns the side on which the anchor is on the {@link #source}
+ *
+ * @return the side on which the anchor is on the {@link #source}
+ */
+ public int getLinkSideOnSource() {
+
+ PolylineConnectionEx figure = (PolylineConnectionEx)((AbstractConnectionEditPart)link).getFigure();
+ Point sourcePoint = figure.getStart();
+ figure.translateToAbsolute(sourcePoint);
+ return LayoutUtils.getAnchorPosition(source.getRepresentedEditPart(), sourcePoint);
+ }
+
+ /**
+ * Returns the side on which the anchor is on the {@link #target}
+ *
+ * @return the side on which the anchor is on the {@link #target}
+ */
+ public int getLinkSideOnTarget() {
+
+ PolylineConnectionEx figure = (PolylineConnectionEx)((AbstractConnectionEditPart)link).getFigure();
+ Point targetPoint = figure.getEnd();
+ figure.translateToAbsolute(targetPoint);
+ return LayoutUtils.getAnchorPosition(target.getRepresentedEditPart(), targetPoint);
+ }
+
+ /**
+ * Creates and returns the command to reset the connection anchors after
+ * alignment to their initial location
+ *
+ *
+ *
+ * @return the command to reset the connection anchors to their initial
+ * location after the node shifting
+ *
+ */
+ protected Command preserveAnchorLocationCommand() {
+ CompoundCommand command = new CompoundCommand("Preserve Anchor"); //$NON-NLS-1$
+
+ Command cmd;
+ if(movedEditPart == source) {
+ // the moved editpart is the source
+ ReconnectRequest reconnectRequest = new ReconnectRequest();
+ reconnectRequest.setType(GraphicalNodeEditPolicy.REQ_RECONNECT_SOURCE);
+ reconnectRequest.setConnectionEditPart((ConnectionEditPart)this.link);
+ reconnectRequest.setTargetEditPart(source.getRepresentedEditPart());
+ reconnectRequest.setLocation(movedPoint.getTranslated(-movedEditPart.getMoveDelta().width, -movedEditPart.getMoveDelta().height));
+ cmd = source.getRepresentedEditPart().getCommand(reconnectRequest);
+ command.add(cmd);
+
+ // the fixed editpart is the target
+ ReconnectRequest reconnectRequestTarget = new ReconnectRequest();
+ reconnectRequestTarget.setType(GraphicalNodeEditPolicy.REQ_RECONNECT_TARGET);
+ reconnectRequestTarget.setConnectionEditPart((ConnectionEditPart)this.link);
+ reconnectRequestTarget.setTargetEditPart(target.getRepresentedEditPart());
+ reconnectRequestTarget.setLocation(referencePoint.getTranslated(-fixedEditPart.getMoveDelta().width, -fixedEditPart.getMoveDelta().height));
+ cmd = target.getRepresentedEditPart().getCommand(reconnectRequestTarget);
+ command.add(cmd);
+ } else {
+ // the moved editpart is the target
+ ReconnectRequest reconnectRequest = new ReconnectRequest();
+ reconnectRequest.setType(GraphicalNodeEditPolicy.REQ_RECONNECT_TARGET);
+ reconnectRequest.setConnectionEditPart((ConnectionEditPart)this.link);
+ reconnectRequest.setTargetEditPart(target.getRepresentedEditPart());
+ reconnectRequest.setLocation(movedPoint.getTranslated(-movedEditPart.getMoveDelta().width, -movedEditPart.getMoveDelta().height));
+ cmd = target.getRepresentedEditPart().getCommand(reconnectRequest);
+ command.add(cmd);
+
+ // the fixed editpart is the source
+ ReconnectRequest reconnectRequestTarget = new ReconnectRequest();
+ reconnectRequestTarget.setType(GraphicalNodeEditPolicy.REQ_RECONNECT_SOURCE);
+ reconnectRequestTarget.setConnectionEditPart((ConnectionEditPart)this.link);
+ reconnectRequestTarget.setTargetEditPart(source.getRepresentedEditPart());
+ reconnectRequestTarget.setLocation(referencePoint.getTranslated(-fixedEditPart.getMoveDelta().width, -fixedEditPart.getMoveDelta().height));
+ cmd = source.getRepresentedEditPart().getCommand(reconnectRequestTarget);
+ command.add(cmd);
+ }
+ return command;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentationForLayoutAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentationForLayoutAction.java
index 5e24753fe9a..f04ffe9753c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentationForLayoutAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/LinkRepresentationForLayoutAction.java
@@ -1,284 +1,284 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.emf.common.command.IdentityCommand;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
-import org.eclipse.gef.requests.ReconnectRequest;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-
-/**
- *
- * This class allow to represent easily a link for the Layout Action
- *
- */
-public class LinkRepresentationForLayoutAction {
-
- /** the source of the link */
- private EditPart source = null;
-
- /** the target of the link */
- private EditPart target = null;
-
- /** new source position */
- private Point newSourcePosition = null;
-
- /** old source position */
- private Point oldSourcePosition = null;
-
- /** new target position */
- private Point newTargetPosition = null;
-
- /** old target position */
- private Point oldTargetPosition = null;
-
- /** the link represented by this class */
- private ConnectionEditPart link;
-
- /**
- *
- * Constructor.
- *
- * @param link
- * the represented link
- *
- */
- public LinkRepresentationForLayoutAction(ConnectionEditPart link) {
- this.link = link;
- this.source = link.getSource();
- this.target = link.getTarget();
- IFigure fig = ((AbstractConnectionEditPart)link).getFigure();
- Assert.isTrue(fig instanceof PolylineConnectionEx);
- PolylineConnectionEx linkFigure = (PolylineConnectionEx)fig;
-
- Point start = linkFigure.getStart();// source
- Point end = linkFigure.getEnd();// target
- linkFigure.translateToAbsolute(start);
- linkFigure.translateToAbsolute(end);
- oldSourcePosition = start;
- oldTargetPosition = end;
- }
-
- /**
- *
- * @see java.lang.Object#toString()
- *
- * @return
- */
- @Override
- public String toString() {
- return ((View)(link.getModel())).getElement().toString();
- }
-
- /**
- * Return the command to move this link, following {@link #newSourcePosition} and {@link #newTargetPosition}
- *
- * @return the command to move this link, following {@link #newSourcePosition} and {@link #newTargetPosition}
- */
- public Command getCommand() {
- /*
- * Sometimes, the anchors of the link move on the diagram, even if the
- * location is the same! see GMF bug 324208
- */
- if((newSourcePosition == null && newTargetPosition == null) || (oldSourcePosition.equals(newSourcePosition)) && oldTargetPosition.equals(newTargetPosition)) {
- return new EMFtoGEFCommandWrapper(new IdentityCommand());
- } else {
- CompoundCommand command = new CompoundCommand();
- command.add(source.getCommand(getRequestForSource()));
- command.add(target.getCommand(getRequestForTarget()));
- return command.canExecute() ? command : UnexecutableCommand.INSTANCE;
- }
- }
-
- /**
- * Returns the request to move the source anchor.
- *
- * @return the request to move the source anchor.
- */
- public Request getRequestForSource() {
- ReconnectRequest request = new ReconnectRequest(GraphicalNodeEditPolicy.REQ_RECONNECT_SOURCE);
- request.setConnectionEditPart(this.link);
- request.setTargetEditPart(this.source);
- request.setLocation(getNewSourceLocation());
- return request;
- }
-
- /**
- * Return the source location to move this link
- *
- * @return the source location to move this link
- * <ul>
- * <li> {@link #newSourcePosition} if not <code>null</code></li>
- * <li>{@link #oldSourcePosition} if {@link #newSourcePosition} is <code>null</code></li>
- * </ul>
- */
- protected Point getNewSourceLocation() {
- if(this.newSourcePosition != null) {
- return this.newSourcePosition;
- } else {
- return this.oldSourcePosition;
- }
- }
-
- /**
- * Return the target location to move this link
- *
- * @return the target location to move this link
- * <ul>
- * <li> {@link #newTargetPosition} if not <code>null</code></li>
- * <li>{@link #oldTargetPosition} if {@link #newTargetPosition} is <code>null</code></li>
- * </ul>
- */
- protected Point getNewTargetLocation() {
- if(this.newTargetPosition != null) {
- return this.newTargetPosition;
- } else {
- return this.oldTargetPosition;
- }
- }
-
- /**
- * Setter for {@link #newSourcePosition} and {@link #newTargetPosition}
- *
- * @param node
- * a node, should be the source or the target of the link
- * @param location
- * the neuw location on this node
- */
- public void setNewLocationFor(EditPart node, Point location) {
- if(source == node) {
- newSourcePosition = location;
- } else if(target == node) {
- newTargetPosition = location;
- } else {
- Activator.log.error("Can't find the EditPart " + node + " (from " + this.getClass().getName() + ")", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- /**
- * Returns the request to relocate the fixed anchor.
- *
- * @return The request to locate the fixed anchor.
- */
- public Request getRequestForTarget() {
- ReconnectRequest request = new ReconnectRequest(GraphicalNodeEditPolicy.REQ_RECONNECT_TARGET);
- request.setConnectionEditPart(this.link);
- request.setTargetEditPart(this.target);
- request.setLocation(getNewTargetLocation());
- return request;
- }
-
- /**
- * Return the current position of the link on the node
- *
- * @param node
- * node should be the source or the target of the link
- * @return
- * @see LayoutUtils#getAnchorPosition(EditPart, Point)
- */
- public int getCurrentSideOn(EditPart node) {
- if(node == source) {
- return LayoutUtils.getAnchorPosition(source, oldSourcePosition);
- } else if(node == target) {
- return LayoutUtils.getAnchorPosition(target, oldTargetPosition);
- } else {
- Activator.log.error("Can't find the EditPart " + node + " (from " + this.getClass().getName() + ")", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return 0;
- }
-
- /**
- * Gets the represented link.
- *
- * @return the represented link
- */
- public ConnectionEditPart getRepresentedLink() {
- return this.link;
- }
-
- /**
- * Return a PrecisionRectangle representing the current position of the
- * anchor on this node (with width=height=1)
- *
- * @param node
- * node should be the source or the target of the link
- * @return A PrecisionRectangle representing the current position of the
- * anchor on this node (with width=height=1)
- */
- public PrecisionRectangle getAbsolutePositionOn(EditPart node) {
- PrecisionRectangle rect = new PrecisionRectangle();
- rect.setSize(new Dimension(1, 1));
- if(source == node) {
- rect.setX(oldSourcePosition.x);
- rect.setY(oldSourcePosition.y);
- } else if(target == node) {
- rect.setX(oldTargetPosition.x);
- rect.setY(oldTargetPosition.y);
- } else {
- Activator.log.error("Can't find the EditPart " + node + " (from " + this.getClass().getName() + ")", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return rect;
- }
-
- /**
- * Return the current absolute location of the anchor on this node
- *
- * @param node
- * node should be the source or the target of the link
- * @return the current absolute location of the anchor on this node
- */
- public Point getAbsoluteLocationOn(EditPart node) {
- if(source == node) {
- return oldSourcePosition;
- } else if(target == node) {
- return oldTargetPosition;
- } else {
- Activator.log.error("Can't find the EditPart " + node + " (from " + this.getClass().getName() + ")", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- return new Point();
- }
-
- /**
- * Gets the side on source.
- *
- * @return the side on source
- */
- public int getSideOnSource() {
- return getCurrentSideOn(source);
- }
-
- /**
- * Gets the side on target.
- *
- * @return the side on target
- */
- public int getSideOnTarget() {
- return getCurrentSideOn(target);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.emf.common.command.IdentityCommand;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.commands.UnexecutableCommand;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy;
+import org.eclipse.gef.requests.ReconnectRequest;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+
+/**
+ *
+ * This class allow to represent easily a link for the Layout Action
+ *
+ */
+public class LinkRepresentationForLayoutAction {
+
+ /** the source of the link */
+ private EditPart source = null;
+
+ /** the target of the link */
+ private EditPart target = null;
+
+ /** new source position */
+ private Point newSourcePosition = null;
+
+ /** old source position */
+ private Point oldSourcePosition = null;
+
+ /** new target position */
+ private Point newTargetPosition = null;
+
+ /** old target position */
+ private Point oldTargetPosition = null;
+
+ /** the link represented by this class */
+ private ConnectionEditPart link;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param link
+ * the represented link
+ *
+ */
+ public LinkRepresentationForLayoutAction(ConnectionEditPart link) {
+ this.link = link;
+ this.source = link.getSource();
+ this.target = link.getTarget();
+ IFigure fig = ((AbstractConnectionEditPart)link).getFigure();
+ Assert.isTrue(fig instanceof PolylineConnectionEx);
+ PolylineConnectionEx linkFigure = (PolylineConnectionEx)fig;
+
+ Point start = linkFigure.getStart();// source
+ Point end = linkFigure.getEnd();// target
+ linkFigure.translateToAbsolute(start);
+ linkFigure.translateToAbsolute(end);
+ oldSourcePosition = start;
+ oldTargetPosition = end;
+ }
+
+ /**
+ *
+ * @see java.lang.Object#toString()
+ *
+ * @return
+ */
+ @Override
+ public String toString() {
+ return ((View)(link.getModel())).getElement().toString();
+ }
+
+ /**
+ * Return the command to move this link, following {@link #newSourcePosition} and {@link #newTargetPosition}
+ *
+ * @return the command to move this link, following {@link #newSourcePosition} and {@link #newTargetPosition}
+ */
+ public Command getCommand() {
+ /*
+ * Sometimes, the anchors of the link move on the diagram, even if the
+ * location is the same! see GMF bug 324208
+ */
+ if((newSourcePosition == null && newTargetPosition == null) || (oldSourcePosition.equals(newSourcePosition)) && oldTargetPosition.equals(newTargetPosition)) {
+ return new EMFtoGEFCommandWrapper(new IdentityCommand());
+ } else {
+ CompoundCommand command = new CompoundCommand();
+ command.add(source.getCommand(getRequestForSource()));
+ command.add(target.getCommand(getRequestForTarget()));
+ return command.canExecute() ? command : UnexecutableCommand.INSTANCE;
+ }
+ }
+
+ /**
+ * Returns the request to move the source anchor.
+ *
+ * @return the request to move the source anchor.
+ */
+ public Request getRequestForSource() {
+ ReconnectRequest request = new ReconnectRequest(GraphicalNodeEditPolicy.REQ_RECONNECT_SOURCE);
+ request.setConnectionEditPart(this.link);
+ request.setTargetEditPart(this.source);
+ request.setLocation(getNewSourceLocation());
+ return request;
+ }
+
+ /**
+ * Return the source location to move this link
+ *
+ * @return the source location to move this link
+ * <ul>
+ * <li> {@link #newSourcePosition} if not <code>null</code></li>
+ * <li>{@link #oldSourcePosition} if {@link #newSourcePosition} is <code>null</code></li>
+ * </ul>
+ */
+ protected Point getNewSourceLocation() {
+ if(this.newSourcePosition != null) {
+ return this.newSourcePosition;
+ } else {
+ return this.oldSourcePosition;
+ }
+ }
+
+ /**
+ * Return the target location to move this link
+ *
+ * @return the target location to move this link
+ * <ul>
+ * <li> {@link #newTargetPosition} if not <code>null</code></li>
+ * <li>{@link #oldTargetPosition} if {@link #newTargetPosition} is <code>null</code></li>
+ * </ul>
+ */
+ protected Point getNewTargetLocation() {
+ if(this.newTargetPosition != null) {
+ return this.newTargetPosition;
+ } else {
+ return this.oldTargetPosition;
+ }
+ }
+
+ /**
+ * Setter for {@link #newSourcePosition} and {@link #newTargetPosition}
+ *
+ * @param node
+ * a node, should be the source or the target of the link
+ * @param location
+ * the neuw location on this node
+ */
+ public void setNewLocationFor(EditPart node, Point location) {
+ if(source == node) {
+ newSourcePosition = location;
+ } else if(target == node) {
+ newTargetPosition = location;
+ } else {
+ Activator.log.error("Can't find the EditPart " + node + " (from " + this.getClass().getName() + ")", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ }
+
+ /**
+ * Returns the request to relocate the fixed anchor.
+ *
+ * @return The request to locate the fixed anchor.
+ */
+ public Request getRequestForTarget() {
+ ReconnectRequest request = new ReconnectRequest(GraphicalNodeEditPolicy.REQ_RECONNECT_TARGET);
+ request.setConnectionEditPart(this.link);
+ request.setTargetEditPart(this.target);
+ request.setLocation(getNewTargetLocation());
+ return request;
+ }
+
+ /**
+ * Return the current position of the link on the node
+ *
+ * @param node
+ * node should be the source or the target of the link
+ * @return
+ * @see LayoutUtils#getAnchorPosition(EditPart, Point)
+ */
+ public int getCurrentSideOn(EditPart node) {
+ if(node == source) {
+ return LayoutUtils.getAnchorPosition(source, oldSourcePosition);
+ } else if(node == target) {
+ return LayoutUtils.getAnchorPosition(target, oldTargetPosition);
+ } else {
+ Activator.log.error("Can't find the EditPart " + node + " (from " + this.getClass().getName() + ")", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ return 0;
+ }
+
+ /**
+ * Gets the represented link.
+ *
+ * @return the represented link
+ */
+ public ConnectionEditPart getRepresentedLink() {
+ return this.link;
+ }
+
+ /**
+ * Return a PrecisionRectangle representing the current position of the
+ * anchor on this node (with width=height=1)
+ *
+ * @param node
+ * node should be the source or the target of the link
+ * @return A PrecisionRectangle representing the current position of the
+ * anchor on this node (with width=height=1)
+ */
+ public PrecisionRectangle getAbsolutePositionOn(EditPart node) {
+ PrecisionRectangle rect = new PrecisionRectangle();
+ rect.setSize(new Dimension(1, 1));
+ if(source == node) {
+ rect.setX(oldSourcePosition.x);
+ rect.setY(oldSourcePosition.y);
+ } else if(target == node) {
+ rect.setX(oldTargetPosition.x);
+ rect.setY(oldTargetPosition.y);
+ } else {
+ Activator.log.error("Can't find the EditPart " + node + " (from " + this.getClass().getName() + ")", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ return rect;
+ }
+
+ /**
+ * Return the current absolute location of the anchor on this node
+ *
+ * @param node
+ * node should be the source or the target of the link
+ * @return the current absolute location of the anchor on this node
+ */
+ public Point getAbsoluteLocationOn(EditPart node) {
+ if(source == node) {
+ return oldSourcePosition;
+ } else if(target == node) {
+ return oldTargetPosition;
+ } else {
+ Activator.log.error("Can't find the EditPart " + node + " (from " + this.getClass().getName() + ")", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ return new Point();
+ }
+
+ /**
+ * Gets the side on source.
+ *
+ * @return the side on source
+ */
+ public int getSideOnSource() {
+ return getCurrentSideOn(source);
+ }
+
+ /**
+ * Gets the side on target.
+ *
+ * @return the side on target
+ */
+ public int getSideOnTarget() {
+ return getCurrentSideOn(target);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/OverlayLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/OverlayLocator.java
index 30a2fb5fb73..edf7152c389 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/OverlayLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/OverlayLocator.java
@@ -1,104 +1,104 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http.equals(this.position)){//www.eclipse.org/legal/epl-v10.html
- *
- * Contributors.equals(this.position)){
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.handles.HandleBounds;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction;
-
-/**
- *
- * A locator to add an overlay to an IFigure. The Overlay can be located
- * following theses value :
- * <ul>
- * <li> {@link Direction#NORTH}</li>
- * <li> {@link Direction#NORTH_EAST}</li>
- * <li> {@link Direction#NORTH_WEST}</li>
- * <li> {@link Direction#EAST}</li>
- * <li> {@link Direction#WEST}</li>
- * <li> {@link Direction#SOUTH}</li>
- * <li> {@link Direction#SOUTH_EAST}</li>
- * <li> {@link Direction#SOUTH_WEST}</li>
- * <li> {@link Direction#CENTER}</li>
- * </ul>
- *
- */
-
-public class OverlayLocator implements Locator {
-
- /** the reference figure */
- private IFigure reference;
-
- /** the Overlay Position */
- private Direction position = null;
-
- /**
- *
- * Constructor.
- *
- * @param reference
- * the reference figure
- * @param position
- * the overlay position
- */
- public OverlayLocator(IFigure reference, IDecoratorTarget.Direction position) {
- assert reference != null;
- this.reference = reference;
- this.position = position;
- }
-
- /**
- *
- * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
- *
- * @param target
- * the overlay figure to locate
- */
- public void relocate(IFigure target) {
- Rectangle bounds = reference instanceof HandleBounds ? new PrecisionRectangle(((HandleBounds)reference).getHandleBounds()) : new PrecisionRectangle(reference.getBounds());
-
- reference.translateToAbsolute(bounds);
- target.translateToRelative(bounds);
-
- int width = target.getBounds().width;
- int halfWidth = width / 2;
-
- int height = target.getBounds().height;
- int halfHeight = height / 2;
-
- if(Direction.NORTH_WEST.equals(this.position)) {
- target.setLocation(bounds.getTopLeft().getTranslated(-halfWidth, -halfHeight));
- } else if(Direction.NORTH.equals(this.position)) {
- target.setLocation(bounds.getTop().getTranslated(-halfWidth, -halfHeight));
- } else if(Direction.NORTH_EAST.equals(this.position)) {
- target.setLocation(bounds.getTopRight().getTranslated(-halfWidth, -halfHeight));
- } else if(Direction.SOUTH_WEST.equals(this.position)) {
- target.setLocation(bounds.getBottomLeft().getTranslated(-halfWidth, -halfHeight));
- } else if(Direction.SOUTH.equals(this.position)) {
- target.setLocation(bounds.getBottom().getTranslated(-halfWidth, -halfHeight));
- } else if(Direction.SOUTH_EAST.equals(this.position)) {
- target.setLocation(bounds.getBottomRight().getTranslated(-halfWidth, -halfHeight));
- } else if(Direction.WEST.equals(this.position)) {
- target.setLocation(bounds.getLeft().getTranslated(-halfWidth, -halfHeight));
- } else if(Direction.EAST.equals(this.position)) {
- target.setLocation(bounds.getRight().getTranslated(-halfWidth, -halfHeight));
- } else if(Direction.CENTER.equals(this.position)) {
- target.setLocation(bounds.getCenter().getTranslated(-halfWidth, -halfHeight));
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http.equals(this.position)){//www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors.equals(this.position)){
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Locator;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.handles.HandleBounds;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction;
+
+/**
+ *
+ * A locator to add an overlay to an IFigure. The Overlay can be located
+ * following theses value :
+ * <ul>
+ * <li> {@link Direction#NORTH}</li>
+ * <li> {@link Direction#NORTH_EAST}</li>
+ * <li> {@link Direction#NORTH_WEST}</li>
+ * <li> {@link Direction#EAST}</li>
+ * <li> {@link Direction#WEST}</li>
+ * <li> {@link Direction#SOUTH}</li>
+ * <li> {@link Direction#SOUTH_EAST}</li>
+ * <li> {@link Direction#SOUTH_WEST}</li>
+ * <li> {@link Direction#CENTER}</li>
+ * </ul>
+ *
+ */
+
+public class OverlayLocator implements Locator {
+
+ /** the reference figure */
+ private IFigure reference;
+
+ /** the Overlay Position */
+ private Direction position = null;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param reference
+ * the reference figure
+ * @param position
+ * the overlay position
+ */
+ public OverlayLocator(IFigure reference, IDecoratorTarget.Direction position) {
+ assert reference != null;
+ this.reference = reference;
+ this.position = position;
+ }
+
+ /**
+ *
+ * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
+ *
+ * @param target
+ * the overlay figure to locate
+ */
+ public void relocate(IFigure target) {
+ Rectangle bounds = reference instanceof HandleBounds ? new PrecisionRectangle(((HandleBounds)reference).getHandleBounds()) : new PrecisionRectangle(reference.getBounds());
+
+ reference.translateToAbsolute(bounds);
+ target.translateToRelative(bounds);
+
+ int width = target.getBounds().width;
+ int halfWidth = width / 2;
+
+ int height = target.getBounds().height;
+ int halfHeight = height / 2;
+
+ if(Direction.NORTH_WEST.equals(this.position)) {
+ target.setLocation(bounds.getTopLeft().getTranslated(-halfWidth, -halfHeight));
+ } else if(Direction.NORTH.equals(this.position)) {
+ target.setLocation(bounds.getTop().getTranslated(-halfWidth, -halfHeight));
+ } else if(Direction.NORTH_EAST.equals(this.position)) {
+ target.setLocation(bounds.getTopRight().getTranslated(-halfWidth, -halfHeight));
+ } else if(Direction.SOUTH_WEST.equals(this.position)) {
+ target.setLocation(bounds.getBottomLeft().getTranslated(-halfWidth, -halfHeight));
+ } else if(Direction.SOUTH.equals(this.position)) {
+ target.setLocation(bounds.getBottom().getTranslated(-halfWidth, -halfHeight));
+ } else if(Direction.SOUTH_EAST.equals(this.position)) {
+ target.setLocation(bounds.getBottomRight().getTranslated(-halfWidth, -halfHeight));
+ } else if(Direction.WEST.equals(this.position)) {
+ target.setLocation(bounds.getLeft().getTranslated(-halfWidth, -halfHeight));
+ } else if(Direction.EAST.equals(this.position)) {
+ target.setLocation(bounds.getRight().getTranslated(-halfWidth, -halfHeight));
+ } else if(Direction.CENTER.equals(this.position)) {
+ target.setLocation(bounds.getCenter().getTranslated(-halfWidth, -halfHeight));
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/RoutingConstants.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/RoutingConstants.java
index d3a8c46b270..3545f3eb5f8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/RoutingConstants.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/RoutingConstants.java
@@ -1,111 +1,111 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-
-/**
- *
- * This class provides constants for the routing actions
- *
- */
-public class RoutingConstants {
-
- /** id for the distribute menu */
- public static final String MENU_ROUTE = "routingMenu"; //$NON-NLS-1$
-
- /** id for the vertical routing moving the left anchor */
- public static final String ROUTING_HORIZONTALLY_BY_LEFT = "org.eclipse.papyrus.uml.diagram.common.routing_horizontally_by_left"; //$NON-NLS-1$
-
- /** id for the vertical routing moving the right anchor */
- public static final String ROUTING_HORIZONTALLY_BY_RIGHT = "org.eclipse.papyrus.uml.diagram.common.routing_horizontally_by_right"; //$NON-NLS-1$
-
- /** id for the vertical routing moving the top anchor */
- public static final String ROUTING_VERTICALLY_BY_TOP = "org.eclipse.papyrus.uml.diagram.common.routing_vertically_by_top"; //$NON-NLS-1$
-
- /** id for the vertical routing moving the bottom anchor */
- public static final String ROUTING_VERTICALLY_BY_BOTTOM = "org.eclipse.papyrus.uml.diagram.common.routing_vertically_by_bottom"; //$NON-NLS-1$
-
- /** id for the vertical routing moving the left anchor for popup menu action */
- public static final String ROUTING_HORIZONTALLY_BY_LEFT_ACTION = "org.eclipse.papyrus.uml.diagram.common.routing_horizontally_by_left_action";; //$NON-NLS-1$
-
- /**
- * id for the vertical routing moving the right anchor for popup menu action
- */
- public static final String ROUTING_HORIZONTALLY_BY_RIGHT_ACTION = "org.eclipse.papyrus.uml.diagram.common.routing_horizontally_by_right_action"; //$NON-NLS-1$
-
- /** id for the vertical routing moving the top anchor for popup menu action */
- public static final String ROUTING_VERTICALLY_BY_TOP_ACTION = "org.eclipse.papyrus.uml.diagram.common.routing_vertically_by_top_action"; //$NON-NLS-1$
-
- /** id for the vertical routing moving the bottom anchor for popup menu */
- public static final String ROUTING_VERTICALLY_BY_BOTTOM_ACTION = "org.eclipse.papyrus.uml.diagram.common.routing_vertically_by_bottom_action"; //$NON-NLS-1$
-
- /** The icon folder */
- public static final String ICON_PATH = "icons/"; //$NON-NLS-1$
-
- /** Icon path to set link horizontal by left */
- public static final String ICON_SET_HORIZONTAL_BY_LEFT = ICON_PATH + "horizontal_by_left.gif"; //$NON-NLS-1$
-
- /** Icon path to set link horizontal by right */
- public static final String ICON_SET_HORIZONTAL_BY_RIGHT = ICON_PATH + "horizontal_by_right.gif"; //$NON-NLS-1$
-
- /** Icon path to set link horizontal by top */
- public static final String ICON_SET_VERTICAL_BY_TOP = ICON_PATH + "vertical_by_top.gif"; //$NON-NLS-1$
-
- /** Icon path to set link horizontal by bottom */
- public static final String ICON_SET_VERTICAL_BY_BOTTOM = ICON_PATH + "vertical_by_bottom.gif"; //$NON-NLS-1$
-
- /** Menu title for the routing action */
- public static String RouteActionMenu_MenuTitleText = Messages.RoutingConstants_MenuTitle;
-
- /** Menu ToolTip for the routing action */
- public static String RouteActionMenu_MenuTitleToolTipText = Messages.RoutingConstants_MenuToolTip;
-
- /** Message for horizontal routing by right action */
- public static String RouteHorizontallyByRightAction = Messages.RoutingConstants_Right;
-
- /** Message for horizontal routing by top action */
- public static String RouteVerticallyByTopAction = Messages.RoutingConstants_Top;
-
- /** Message for horizontal routing by left action */
- public static String RouteHorizontallyByLeftAction = Messages.RoutingConstants_Left;
-
- /** Message for horizontal routing by bottom action */
- public static String RouteVerticallyByBottomAction = Messages.RoutingConstants_Bottom;
-
- /** Message for horizontal routing by left */
- public static final String RouteHorizontallyByLeft = Messages.RoutingConstants_HorizontalByLeft;
-
- /** Message for horizontal routing by right */
- public static final String RouteHorizontallyByRight = Messages.RoutingConstants_HorizontalByRight;
-
- /** Message for horizontal routing by top */
- public static final String RouteVerticallyByTop = Messages.RoutingConstants_VerticalByTop;
-
- /** Message for horizontal routing by bottom */
- public static final String RouteVerticallyByBottom = Messages.RoutingConstants_VerticalByBottom;
-
- /** Tooltip message for horizontal routing by left */
- public static String RouteHorizontallyByLeftToolTipText = RouteHorizontallyByLeft;
-
- /** Tooltip message for horizontal routing by right */
- public static String RouteHorizontallyByRightToolTipText = RouteHorizontallyByRight;
-
- /** Tooltip message for horizontal routing by top */
- public static String RouteVerticallyByTopToolTipText = RouteVerticallyByTop;
-
- /** Tooltip message for horizontal routing by bottom */
- public static String RouteVerticallyByBottomToolTipText = RouteVerticallyByBottom;
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+
+/**
+ *
+ * This class provides constants for the routing actions
+ *
+ */
+public class RoutingConstants {
+
+ /** id for the distribute menu */
+ public static final String MENU_ROUTE = "routingMenu"; //$NON-NLS-1$
+
+ /** id for the vertical routing moving the left anchor */
+ public static final String ROUTING_HORIZONTALLY_BY_LEFT = "org.eclipse.papyrus.uml.diagram.common.routing_horizontally_by_left"; //$NON-NLS-1$
+
+ /** id for the vertical routing moving the right anchor */
+ public static final String ROUTING_HORIZONTALLY_BY_RIGHT = "org.eclipse.papyrus.uml.diagram.common.routing_horizontally_by_right"; //$NON-NLS-1$
+
+ /** id for the vertical routing moving the top anchor */
+ public static final String ROUTING_VERTICALLY_BY_TOP = "org.eclipse.papyrus.uml.diagram.common.routing_vertically_by_top"; //$NON-NLS-1$
+
+ /** id for the vertical routing moving the bottom anchor */
+ public static final String ROUTING_VERTICALLY_BY_BOTTOM = "org.eclipse.papyrus.uml.diagram.common.routing_vertically_by_bottom"; //$NON-NLS-1$
+
+ /** id for the vertical routing moving the left anchor for popup menu action */
+ public static final String ROUTING_HORIZONTALLY_BY_LEFT_ACTION = "org.eclipse.papyrus.uml.diagram.common.routing_horizontally_by_left_action";; //$NON-NLS-1$
+
+ /**
+ * id for the vertical routing moving the right anchor for popup menu action
+ */
+ public static final String ROUTING_HORIZONTALLY_BY_RIGHT_ACTION = "org.eclipse.papyrus.uml.diagram.common.routing_horizontally_by_right_action"; //$NON-NLS-1$
+
+ /** id for the vertical routing moving the top anchor for popup menu action */
+ public static final String ROUTING_VERTICALLY_BY_TOP_ACTION = "org.eclipse.papyrus.uml.diagram.common.routing_vertically_by_top_action"; //$NON-NLS-1$
+
+ /** id for the vertical routing moving the bottom anchor for popup menu */
+ public static final String ROUTING_VERTICALLY_BY_BOTTOM_ACTION = "org.eclipse.papyrus.uml.diagram.common.routing_vertically_by_bottom_action"; //$NON-NLS-1$
+
+ /** The icon folder */
+ public static final String ICON_PATH = "icons/"; //$NON-NLS-1$
+
+ /** Icon path to set link horizontal by left */
+ public static final String ICON_SET_HORIZONTAL_BY_LEFT = ICON_PATH + "horizontal_by_left.gif"; //$NON-NLS-1$
+
+ /** Icon path to set link horizontal by right */
+ public static final String ICON_SET_HORIZONTAL_BY_RIGHT = ICON_PATH + "horizontal_by_right.gif"; //$NON-NLS-1$
+
+ /** Icon path to set link horizontal by top */
+ public static final String ICON_SET_VERTICAL_BY_TOP = ICON_PATH + "vertical_by_top.gif"; //$NON-NLS-1$
+
+ /** Icon path to set link horizontal by bottom */
+ public static final String ICON_SET_VERTICAL_BY_BOTTOM = ICON_PATH + "vertical_by_bottom.gif"; //$NON-NLS-1$
+
+ /** Menu title for the routing action */
+ public static String RouteActionMenu_MenuTitleText = Messages.RoutingConstants_MenuTitle;
+
+ /** Menu ToolTip for the routing action */
+ public static String RouteActionMenu_MenuTitleToolTipText = Messages.RoutingConstants_MenuToolTip;
+
+ /** Message for horizontal routing by right action */
+ public static String RouteHorizontallyByRightAction = Messages.RoutingConstants_Right;
+
+ /** Message for horizontal routing by top action */
+ public static String RouteVerticallyByTopAction = Messages.RoutingConstants_Top;
+
+ /** Message for horizontal routing by left action */
+ public static String RouteHorizontallyByLeftAction = Messages.RoutingConstants_Left;
+
+ /** Message for horizontal routing by bottom action */
+ public static String RouteVerticallyByBottomAction = Messages.RoutingConstants_Bottom;
+
+ /** Message for horizontal routing by left */
+ public static final String RouteHorizontallyByLeft = Messages.RoutingConstants_HorizontalByLeft;
+
+ /** Message for horizontal routing by right */
+ public static final String RouteHorizontallyByRight = Messages.RoutingConstants_HorizontalByRight;
+
+ /** Message for horizontal routing by top */
+ public static final String RouteVerticallyByTop = Messages.RoutingConstants_VerticalByTop;
+
+ /** Message for horizontal routing by bottom */
+ public static final String RouteVerticallyByBottom = Messages.RoutingConstants_VerticalByBottom;
+
+ /** Tooltip message for horizontal routing by left */
+ public static String RouteHorizontallyByLeftToolTipText = RouteHorizontallyByLeft;
+
+ /** Tooltip message for horizontal routing by right */
+ public static String RouteHorizontallyByRightToolTipText = RouteHorizontallyByRight;
+
+ /** Tooltip message for horizontal routing by top */
+ public static String RouteVerticallyByTopToolTipText = RouteVerticallyByTop;
+
+ /** Tooltip message for horizontal routing by bottom */
+ public static String RouteVerticallyByBottomToolTipText = RouteVerticallyByBottom;
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/SameAlignment.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/SameAlignment.java
index 4cd72430616..80cc44ea73e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/SameAlignment.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/layout/SameAlignment.java
@@ -1,323 +1,323 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.layout;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
-
-/**
- *
- * This class allows to regroup all the nodes which are linked by the selected
- * links.
- *
- */
-public class SameAlignment {
-
- /** the alignment */
- private int alignment;
-
- /** list of the links representation */
- private List<LinkRepresentation> linksRepresentation;
-
- /** list of the editpart representation */
- private List<EditPartRepresentation> editpartRepresentation;
-
- /**
- *
- * Constructor.
- *
- * @param align
- */
- public SameAlignment(int align) {
- this.alignment = align;
- this.linksRepresentation = new ArrayList<LinkRepresentation>();
- this.editpartRepresentation = new ArrayList<EditPartRepresentation>();
- }
-
- /**
- * Returns the command to align all the selected {@linkplain EditPart}
- *
- * @return the command to align all the selected {@linkplain EditPart}
- */
- public Command getCommand() {
- Collections.sort(linksRepresentation, new LinkComparator());
- if(this.alignment == PositionConstants.RIGHT || this.alignment == PositionConstants.BOTTOM) {// we need to
- // inverse the
- // selection to
- // do the
- // correct
- // action
- Collections.reverse(linksRepresentation);
- }
- // we remove the selected link which are not interesting
- removeBadSideLink();
-
- CompoundCommand cmd = new CompoundCommand("command for alignment"); //$NON-NLS-1$
- if(isCorrectSelection()) {
- Command tmp;
- for(LinkRepresentation currentLink : linksRepresentation) {
- tmp = currentLink.getCommand();
- if(tmp != null) {
- cmd.add(tmp);
- }
- }
- }
- return cmd;
- }
-
- /**
- * Returns a list with the link linked to the {@link EditPartRepresentation} {@code epRepresentation}
- *
- * @param epRepresentation
- * an {@linkplain EditPartRepresentation}
- * @return a list with the link linked to the {@link EditPartRepresentation} {@code epRepresentation}
- */
- protected List<LinkRepresentation> getLinkFor(EditPartRepresentation epRepresentation) {
- List<LinkRepresentation> list = new ArrayList<LinkRepresentation>();
- for(LinkRepresentation link : linksRepresentation) {
- if(link.getSource() == epRepresentation || link.getTarget() == epRepresentation) {
- list.add(link);
- }
- }
- return list;
- }
-
- /**
- * Tests if each editpart is linked with only one or two other editparts
- *
- * @return <ul>
- * <li>{@code true}</li> all the node are linked with only one or two other editparts
- * <li> {@code false}</li> if not
- *
- * </ul>
- */
- protected boolean isCorrectSelection() {
- for(EditPartRepresentation current : editpartRepresentation) {
- if(getLinkFor(current).size() > 2) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Adds a link, with its source and target to the {@link SameAlignment}
- *
- * @param link
- * the link
- * @param sourceRep
- * the source representation for this link
- * @param targetRep
- * the target representation for this link
- */
- public void addTriplet(EditPart link, EditPartRepresentation sourceRep, EditPartRepresentation targetRep) {
- addEditPartRepresentation(sourceRep);
- addEditPartRepresentation(targetRep);
- linksRepresentation.add(new LinkRepresentation(link, sourceRep, targetRep, alignment));
-
- }
-
- /**
- * Adds an {@link EditPartRepresentation} to the {@link SameAlignment}
- *
- * @param rep
- * the {@link EditPartRepresentation} to add
- */
- protected void addEditPartRepresentation(EditPartRepresentation rep) {
- if(!editpartRepresentation.contains(rep)) {
- editpartRepresentation.add(rep);
- }
- }
-
- /**
- * Adds {@code family} to this family
- *
- * @param family
- * adds this {@code family} to the family
- */
- public void addFamily(SameAlignment family) {
- for(LinkRepresentation currentLink : family.getLinks()) {
- addEditPartRepresentation(currentLink.getSource());
- addEditPartRepresentation(currentLink.getTarget());
- }
-
- linksRepresentation.addAll(family.getLinks());
-
- }
-
- /**
- * Getter for {@link #alignment}
- *
- * @return
- * @link {@link #alignment}
- */
- public int getAlignment() {
- return this.alignment;
- }
-
- /**
- * Getter for {@link #linksRepresentation}
- *
- * @return {@link #linksRepresentation}
- */
- public List<LinkRepresentation> getLinks() {
- return this.linksRepresentation;
- }
-
- /**
- *
- * @param representedEditPart
- * the {@linkplain EditPart} that we are looking for
- * @return <ul>
- * <li>the {@linkplain EditPartRepresentation} for this editpart if it exists</li>
- * <li>{@code null}if the representation for this editpart doesn't exist</li>
- * </ul>
- *
- */
- public EditPartRepresentation getEditPartRepresentationFor(EditPart representedEditPart) {
- for(EditPartRepresentation currentRepresentation : editpartRepresentation) {
- if(currentRepresentation.getRepresentedEditPart() == representedEditPart) {
- return currentRepresentation;
- }
- }
- return null;
- }
-
- /**
- * This method removes the following links :
- * <ul>
- * <li>links which are not on a correct side to do the action</li>
- * <li>links whose Figure is not an instanceof PolylineConnectionEx</li>
- * </ul>
- */
- protected void removeBadSideLink() {
- List<LinkRepresentation> linksToRemove = new ArrayList<LinkRepresentation>();
-
- // we test if the tow anchors for the selected link are opposite or not
- for(LinkRepresentation link : linksRepresentation) {
- int side1 = link.getLinkSideOnSource();
- int side2 = link.getLinkSideOnTarget();
- if(alignment == PositionConstants.LEFT || alignment == PositionConstants.RIGHT) {
- if(!DistributionConstants.verticalValuesList.contains(side1) || !DistributionConstants.verticalValuesList.contains(side2)) {
- linksToRemove.add(link);
- }
-
- } else if(alignment == PositionConstants.TOP || alignment == PositionConstants.BOTTOM) {
- if(!DistributionConstants.horizontalValuesList.contains(side1) || !DistributionConstants.horizontalValuesList.contains(side2)) {
- linksToRemove.add(link);
- }
- }
- if(!(((AbstractConnectionEditPart)link.getLink()).getFigure() instanceof PolylineConnectionEx)) {
- linksToRemove.add(link);
- }
- }
- linksRepresentation.removeAll(linksToRemove);
- }
-
- /**
- *
- * This class provides a comparator for the {@link EditPart}, using the
- * coordinates of the representing {@link EditPart} The used coordinate is
- * the top left corner
- */
- protected class LinkComparator implements Comparator<Object> {
-
- /**
- *
- *
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- *
- * @param o1
- * @param o2
- * @return
- */
- public int compare(Object o1, Object o2) {
- // the two figures to compare
- PolylineConnectionEx figure1 = (PolylineConnectionEx)((AbstractConnectionEditPart)((LinkRepresentation)o1).getLink()).getFigure();
- PolylineConnectionEx figure2 = (PolylineConnectionEx)((AbstractConnectionEditPart)((LinkRepresentation)o2).getLink()).getFigure();
-
- // the point for the first figure
- Point pt11;
- Point pt12;
-
- // the point for the second figure
- Point pt21;
- Point pt22;
-
- // we want pt11.x<pt12.x<pt21.x<pt22.x
- if(alignment == PositionConstants.LEFT || alignment == PositionConstants.RIGHT) {
- pt11 = (figure1.getStart().x < figure1.getEnd().x) ? figure1.getStart() : figure1.getEnd();
- if(pt11.equals(figure1.getStart())) {
- pt12 = figure1.getEnd();
- } else {
- pt12 = figure1.getStart();
- }
-
- pt21 = (figure2.getStart().x < figure2.getEnd().x) ? figure2.getStart() : figure2.getEnd();
- if(pt21.equals(figure2.getStart())) {
- pt22 = figure2.getEnd();
- } else {
- pt22 = figure2.getStart();
- }
-
- if(pt11.x < pt21.x && pt12.x < pt22.x) {
- return -1;
- } else if(pt11.equals(pt21) && pt12.equals(pt22)) {
- return 0;
- } else if(pt11.x > pt21.x && pt12.x > pt22.x) {
- return 1;
- } else {
- return 0; // it's a strange model, if we come here
- }
-
- } else if(alignment == PositionConstants.TOP || alignment == PositionConstants.BOTTOM) {
- pt11 = (figure1.getStart().y < figure1.getEnd().y) ? figure1.getStart() : figure1.getEnd();
- if(pt11.equals(figure1.getStart())) {
- pt12 = figure1.getEnd();
- } else {
- pt12 = figure1.getStart();
- }
-
- pt21 = (figure2.getStart().y < figure2.getEnd().y) ? figure2.getStart() : figure2.getEnd();
- if(pt21.equals(figure2.getStart())) {
- pt22 = figure2.getEnd();
- } else {
- pt22 = figure2.getStart();
- }
- if(pt11.y < pt21.y && pt12.y < pt22.y) {
- return -1;
- } else if(pt11.equals(pt21) && pt12.equals(pt22)) {
- return 0;
- } else if(pt11.y > pt21.y && pt12.y > pt22.y) {
- return 1;
- } else {
- return 0; // it's a strange model, if we come here
- }
-
- }
- return 0;
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.layout;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.editparts.AbstractConnectionEditPart;
+import org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx;
+
+/**
+ *
+ * This class allows to regroup all the nodes which are linked by the selected
+ * links.
+ *
+ */
+public class SameAlignment {
+
+ /** the alignment */
+ private int alignment;
+
+ /** list of the links representation */
+ private List<LinkRepresentation> linksRepresentation;
+
+ /** list of the editpart representation */
+ private List<EditPartRepresentation> editpartRepresentation;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param align
+ */
+ public SameAlignment(int align) {
+ this.alignment = align;
+ this.linksRepresentation = new ArrayList<LinkRepresentation>();
+ this.editpartRepresentation = new ArrayList<EditPartRepresentation>();
+ }
+
+ /**
+ * Returns the command to align all the selected {@linkplain EditPart}
+ *
+ * @return the command to align all the selected {@linkplain EditPart}
+ */
+ public Command getCommand() {
+ Collections.sort(linksRepresentation, new LinkComparator());
+ if(this.alignment == PositionConstants.RIGHT || this.alignment == PositionConstants.BOTTOM) {// we need to
+ // inverse the
+ // selection to
+ // do the
+ // correct
+ // action
+ Collections.reverse(linksRepresentation);
+ }
+ // we remove the selected link which are not interesting
+ removeBadSideLink();
+
+ CompoundCommand cmd = new CompoundCommand("command for alignment"); //$NON-NLS-1$
+ if(isCorrectSelection()) {
+ Command tmp;
+ for(LinkRepresentation currentLink : linksRepresentation) {
+ tmp = currentLink.getCommand();
+ if(tmp != null) {
+ cmd.add(tmp);
+ }
+ }
+ }
+ return cmd;
+ }
+
+ /**
+ * Returns a list with the link linked to the {@link EditPartRepresentation} {@code epRepresentation}
+ *
+ * @param epRepresentation
+ * an {@linkplain EditPartRepresentation}
+ * @return a list with the link linked to the {@link EditPartRepresentation} {@code epRepresentation}
+ */
+ protected List<LinkRepresentation> getLinkFor(EditPartRepresentation epRepresentation) {
+ List<LinkRepresentation> list = new ArrayList<LinkRepresentation>();
+ for(LinkRepresentation link : linksRepresentation) {
+ if(link.getSource() == epRepresentation || link.getTarget() == epRepresentation) {
+ list.add(link);
+ }
+ }
+ return list;
+ }
+
+ /**
+ * Tests if each editpart is linked with only one or two other editparts
+ *
+ * @return <ul>
+ * <li>{@code true}</li> all the node are linked with only one or two other editparts
+ * <li> {@code false}</li> if not
+ *
+ * </ul>
+ */
+ protected boolean isCorrectSelection() {
+ for(EditPartRepresentation current : editpartRepresentation) {
+ if(getLinkFor(current).size() > 2) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Adds a link, with its source and target to the {@link SameAlignment}
+ *
+ * @param link
+ * the link
+ * @param sourceRep
+ * the source representation for this link
+ * @param targetRep
+ * the target representation for this link
+ */
+ public void addTriplet(EditPart link, EditPartRepresentation sourceRep, EditPartRepresentation targetRep) {
+ addEditPartRepresentation(sourceRep);
+ addEditPartRepresentation(targetRep);
+ linksRepresentation.add(new LinkRepresentation(link, sourceRep, targetRep, alignment));
+
+ }
+
+ /**
+ * Adds an {@link EditPartRepresentation} to the {@link SameAlignment}
+ *
+ * @param rep
+ * the {@link EditPartRepresentation} to add
+ */
+ protected void addEditPartRepresentation(EditPartRepresentation rep) {
+ if(!editpartRepresentation.contains(rep)) {
+ editpartRepresentation.add(rep);
+ }
+ }
+
+ /**
+ * Adds {@code family} to this family
+ *
+ * @param family
+ * adds this {@code family} to the family
+ */
+ public void addFamily(SameAlignment family) {
+ for(LinkRepresentation currentLink : family.getLinks()) {
+ addEditPartRepresentation(currentLink.getSource());
+ addEditPartRepresentation(currentLink.getTarget());
+ }
+
+ linksRepresentation.addAll(family.getLinks());
+
+ }
+
+ /**
+ * Getter for {@link #alignment}
+ *
+ * @return
+ * @link {@link #alignment}
+ */
+ public int getAlignment() {
+ return this.alignment;
+ }
+
+ /**
+ * Getter for {@link #linksRepresentation}
+ *
+ * @return {@link #linksRepresentation}
+ */
+ public List<LinkRepresentation> getLinks() {
+ return this.linksRepresentation;
+ }
+
+ /**
+ *
+ * @param representedEditPart
+ * the {@linkplain EditPart} that we are looking for
+ * @return <ul>
+ * <li>the {@linkplain EditPartRepresentation} for this editpart if it exists</li>
+ * <li>{@code null}if the representation for this editpart doesn't exist</li>
+ * </ul>
+ *
+ */
+ public EditPartRepresentation getEditPartRepresentationFor(EditPart representedEditPart) {
+ for(EditPartRepresentation currentRepresentation : editpartRepresentation) {
+ if(currentRepresentation.getRepresentedEditPart() == representedEditPart) {
+ return currentRepresentation;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * This method removes the following links :
+ * <ul>
+ * <li>links which are not on a correct side to do the action</li>
+ * <li>links whose Figure is not an instanceof PolylineConnectionEx</li>
+ * </ul>
+ */
+ protected void removeBadSideLink() {
+ List<LinkRepresentation> linksToRemove = new ArrayList<LinkRepresentation>();
+
+ // we test if the tow anchors for the selected link are opposite or not
+ for(LinkRepresentation link : linksRepresentation) {
+ int side1 = link.getLinkSideOnSource();
+ int side2 = link.getLinkSideOnTarget();
+ if(alignment == PositionConstants.LEFT || alignment == PositionConstants.RIGHT) {
+ if(!DistributionConstants.verticalValuesList.contains(side1) || !DistributionConstants.verticalValuesList.contains(side2)) {
+ linksToRemove.add(link);
+ }
+
+ } else if(alignment == PositionConstants.TOP || alignment == PositionConstants.BOTTOM) {
+ if(!DistributionConstants.horizontalValuesList.contains(side1) || !DistributionConstants.horizontalValuesList.contains(side2)) {
+ linksToRemove.add(link);
+ }
+ }
+ if(!(((AbstractConnectionEditPart)link.getLink()).getFigure() instanceof PolylineConnectionEx)) {
+ linksToRemove.add(link);
+ }
+ }
+ linksRepresentation.removeAll(linksToRemove);
+ }
+
+ /**
+ *
+ * This class provides a comparator for the {@link EditPart}, using the
+ * coordinates of the representing {@link EditPart} The used coordinate is
+ * the top left corner
+ */
+ protected class LinkComparator implements Comparator<Object> {
+
+ /**
+ *
+ *
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ *
+ * @param o1
+ * @param o2
+ * @return
+ */
+ public int compare(Object o1, Object o2) {
+ // the two figures to compare
+ PolylineConnectionEx figure1 = (PolylineConnectionEx)((AbstractConnectionEditPart)((LinkRepresentation)o1).getLink()).getFigure();
+ PolylineConnectionEx figure2 = (PolylineConnectionEx)((AbstractConnectionEditPart)((LinkRepresentation)o2).getLink()).getFigure();
+
+ // the point for the first figure
+ Point pt11;
+ Point pt12;
+
+ // the point for the second figure
+ Point pt21;
+ Point pt22;
+
+ // we want pt11.x<pt12.x<pt21.x<pt22.x
+ if(alignment == PositionConstants.LEFT || alignment == PositionConstants.RIGHT) {
+ pt11 = (figure1.getStart().x < figure1.getEnd().x) ? figure1.getStart() : figure1.getEnd();
+ if(pt11.equals(figure1.getStart())) {
+ pt12 = figure1.getEnd();
+ } else {
+ pt12 = figure1.getStart();
+ }
+
+ pt21 = (figure2.getStart().x < figure2.getEnd().x) ? figure2.getStart() : figure2.getEnd();
+ if(pt21.equals(figure2.getStart())) {
+ pt22 = figure2.getEnd();
+ } else {
+ pt22 = figure2.getStart();
+ }
+
+ if(pt11.x < pt21.x && pt12.x < pt22.x) {
+ return -1;
+ } else if(pt11.equals(pt21) && pt12.equals(pt22)) {
+ return 0;
+ } else if(pt11.x > pt21.x && pt12.x > pt22.x) {
+ return 1;
+ } else {
+ return 0; // it's a strange model, if we come here
+ }
+
+ } else if(alignment == PositionConstants.TOP || alignment == PositionConstants.BOTTOM) {
+ pt11 = (figure1.getStart().y < figure1.getEnd().y) ? figure1.getStart() : figure1.getEnd();
+ if(pt11.equals(figure1.getStart())) {
+ pt12 = figure1.getEnd();
+ } else {
+ pt12 = figure1.getStart();
+ }
+
+ pt21 = (figure2.getStart().y < figure2.getEnd().y) ? figure2.getStart() : figure2.getEnd();
+ if(pt21.equals(figure2.getStart())) {
+ pt22 = figure2.getEnd();
+ } else {
+ pt22 = figure2.getStart();
+ }
+ if(pt11.y < pt21.y && pt12.y < pt22.y) {
+ return -1;
+ } else if(pt11.equals(pt21) && pt12.equals(pt22)) {
+ return 0;
+ } else if(pt11.y > pt21.y && pt12.y > pt22.y) {
+ return 1;
+ } else {
+ return 0; // it's a strange model, if we come here
+ }
+
+ }
+ return 0;
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/AbstractPapyrusModifcationTriggerListener.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/AbstractPapyrusModifcationTriggerListener.java
index 893be5b65cb..3c2709ee53c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/AbstractPapyrusModifcationTriggerListener.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/listeners/AbstractPapyrusModifcationTriggerListener.java
@@ -1,128 +1,128 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- * Arthur Daussy Bug 366026 - [ActivityDiagram] Refactoring in order to try respect Generation Gap Pattern
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.listeners;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.TriggerListener;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-/**
- * Abstract method used to trigger model modification by listenning the ressource set
- * @author adaussy
- *
- */
-public abstract class AbstractPapyrusModifcationTriggerListener extends TriggerListener {
- @Override
- protected Command trigger(TransactionalEditingDomain domain, Notification notification) {
- if(notification != null) {
- ICommand cc = getModificationCommand(notification);
- if(cc != null) {
- return new GMFtoEMFCommandWrapper(cc);
- }
- }
- return null;
- }
-
- @Override
- public abstract NotificationFilter getFilter();
-
- /**
- * Command which will react to the trigger
- * @param notif
- * @return
- */
- protected abstract ICommand getModificationCommand(Notification notif);
-
- /**
- * Return the main edipart which correspond to the {@link EObject} passed in argument
- *
- * @param eObject
- * @param rootEditPart
- * {@link IGraphicalEditPart} root from which the search will start
- * @return
- */
- protected IGraphicalEditPart getChildByEObject(final EObject eObject, IGraphicalEditPart rootEditPart, boolean isEdge) {
- return DiagramEditPartsUtil.getChildByEObject(eObject, rootEditPart, isEdge);
- }
-
-
- /**
- * Get the referencing views
- * @param oldEObject
- * @param predicates Additionnal predecate use to speciy search
- * @return
- */
- protected Iterable<View> getReferencingView(EObject oldEObject, Predicate<? super View>... predicates) {
- ECrossReferenceAdapter eCrossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(oldEObject);
- Collection<Setting> settings = eCrossReferencer.getInverseReferences(oldEObject,false);
- Predicate<Setting> predicate = new Predicate<Setting>() {
-
- public boolean apply(Setting input) {
- EObject from = input.getEObject();
- /*
- * Is a view
- */
- if (from instanceof View &&NotationPackage.Literals.VIEW__ELEMENT.equals(input.getEStructuralFeature())){
- return true;
- }
- return false;
- }
- };
-
- Iterable<Setting> referencingView = Iterables.filter(settings, predicate);
- Iterable<View> views = Iterables.transform(referencingView, new Function<Setting, View>() {
-
- public View apply(Setting from) {
- return (View)from.getEObject();
- }
- });
-
- return Iterables.filter(views, Predicates.and(predicates));
- }
-
- /**
- * Get the transactionnal editing domain from EObject
- * @param o
- * @return
- */
- protected TransactionalEditingDomain getEditingDomain(Object o){
- EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(o);
- if (editingDomain instanceof TransactionalEditingDomain) {
- TransactionalEditingDomain transEditingDomain = (TransactionalEditingDomain) editingDomain;
- return transEditingDomain;
- }
- throw new RuntimeException("Enable to retreive editing domin from object");
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ * Arthur Daussy Bug 366026 - [ActivityDiagram] Refactoring in order to try respect Generation Gap Pattern
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.listeners;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.transaction.NotificationFilter;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.TriggerListener;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+/**
+ * Abstract method used to trigger model modification by listenning the ressource set
+ * @author adaussy
+ *
+ */
+public abstract class AbstractPapyrusModifcationTriggerListener extends TriggerListener {
+ @Override
+ protected Command trigger(TransactionalEditingDomain domain, Notification notification) {
+ if(notification != null) {
+ ICommand cc = getModificationCommand(notification);
+ if(cc != null) {
+ return new GMFtoEMFCommandWrapper(cc);
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public abstract NotificationFilter getFilter();
+
+ /**
+ * Command which will react to the trigger
+ * @param notif
+ * @return
+ */
+ protected abstract ICommand getModificationCommand(Notification notif);
+
+ /**
+ * Return the main edipart which correspond to the {@link EObject} passed in argument
+ *
+ * @param eObject
+ * @param rootEditPart
+ * {@link IGraphicalEditPart} root from which the search will start
+ * @return
+ */
+ protected IGraphicalEditPart getChildByEObject(final EObject eObject, IGraphicalEditPart rootEditPart, boolean isEdge) {
+ return DiagramEditPartsUtil.getChildByEObject(eObject, rootEditPart, isEdge);
+ }
+
+
+ /**
+ * Get the referencing views
+ * @param oldEObject
+ * @param predicates Additionnal predecate use to speciy search
+ * @return
+ */
+ protected Iterable<View> getReferencingView(EObject oldEObject, Predicate<? super View>... predicates) {
+ ECrossReferenceAdapter eCrossReferencer = CrossReferenceAdapter.getCrossReferenceAdapter(oldEObject);
+ Collection<Setting> settings = eCrossReferencer.getInverseReferences(oldEObject,false);
+ Predicate<Setting> predicate = new Predicate<Setting>() {
+
+ public boolean apply(Setting input) {
+ EObject from = input.getEObject();
+ /*
+ * Is a view
+ */
+ if (from instanceof View &&NotationPackage.Literals.VIEW__ELEMENT.equals(input.getEStructuralFeature())){
+ return true;
+ }
+ return false;
+ }
+ };
+
+ Iterable<Setting> referencingView = Iterables.filter(settings, predicate);
+ Iterable<View> views = Iterables.transform(referencingView, new Function<Setting, View>() {
+
+ public View apply(Setting from) {
+ return (View)from.getEObject();
+ }
+ });
+
+ return Iterables.filter(views, Predicates.and(predicates));
+ }
+
+ /**
+ * Get the transactionnal editing domain from EObject
+ * @param o
+ * @return
+ */
+ protected TransactionalEditingDomain getEditingDomain(Object o){
+ EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(o);
+ if (editingDomain instanceof TransactionalEditingDomain) {
+ TransactionalEditingDomain transEditingDomain = (TransactionalEditingDomain) editingDomain;
+ return transEditingDomain;
+ }
+ throw new RuntimeException("Enable to retreive editing domin from object");
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/AdvancedBorderItemLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/AdvancedBorderItemLocator.java
index c1ddac72ff3..79d5ca4b3cb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/AdvancedBorderItemLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/AdvancedBorderItemLocator.java
@@ -1,64 +1,64 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.locator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
-
-/**
- * this is a border item locator that can be used to place childreen where you
- * want I order to constraint movement and localization, specialize {@link ItemBorderLocagetValidLocation.getValidLocation}
- *
- * @author Patrick Tessier
- */
-public class AdvancedBorderItemLocator extends BorderItemLocator {
-
- public AdvancedBorderItemLocator(IFigure parentFigure) {
- super(parentFigure);
- }
-
- public AdvancedBorderItemLocator(IFigure borderItem, IFigure parentFigure, Rectangle constraint) {
- super(borderItem, parentFigure, constraint);
- }
-
- public AdvancedBorderItemLocator(IFigure parentFigure, int preferredSide) {
- super(parentFigure, preferredSide);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
- // do nothing to respecialize
- return proposedLocation;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- @Override
- public void relocate(IFigure borderItem) {
- Dimension size = getSize(borderItem);
- Rectangle rectSuggested = getConstraint();
- rectSuggested.setSize(size);
- setConstraint(getValidLocation(rectSuggested, borderItem));
- borderItem.setBounds(getConstraint().getCopy());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.locator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
+
+/**
+ * this is a border item locator that can be used to place childreen where you
+ * want I order to constraint movement and localization, specialize {@link ItemBorderLocagetValidLocation.getValidLocation}
+ *
+ * @author Patrick Tessier
+ */
+public class AdvancedBorderItemLocator extends BorderItemLocator {
+
+ public AdvancedBorderItemLocator(IFigure parentFigure) {
+ super(parentFigure);
+ }
+
+ public AdvancedBorderItemLocator(IFigure borderItem, IFigure parentFigure, Rectangle constraint) {
+ super(borderItem, parentFigure, constraint);
+ }
+
+ public AdvancedBorderItemLocator(IFigure parentFigure, int preferredSide) {
+ super(parentFigure, preferredSide);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
+ // do nothing to respecialize
+ return proposedLocation;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void relocate(IFigure borderItem) {
+ Dimension size = getSize(borderItem);
+ Rectangle rectSuggested = getConstraint();
+ rectSuggested.setSize(size);
+ setConstraint(getValidLocation(rectSuggested, borderItem));
+ borderItem.setBounds(getConstraint().getCopy());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ConstraintParameterPositionLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ConstraintParameterPositionLocator.java
new file mode 100644
index 00000000000..3470da2f32f
--- /dev/null
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ConstraintParameterPositionLocator.java
@@ -0,0 +1,108 @@
+/*****************************************************************************
+ * Copyright (c) 2009-2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ * Vincent Lorenzo(CEA-List) vincent.lorenzo@cea.fr - getCurrentSideOfParent()
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.locator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ *
+ * This code comes form composite diagram. I was copied to avoid dependencies
+ * This class is used to constrain the position of ConstraintParameter when they are added on a ConstraintProperty
+ *
+ * <pre>
+ * +-------------------+
+ * | [Constraint] |
+ * +-------------------+
+ * | |
+ * | |
+ * | +-+ - Expected position of ConstraintParameter
+ * | +-+
+ * | |
+ * +-------------------+
+ *
+ * </pre>
+ *
+ * <pre>
+ * TODO : The ConstraintParameter is not re-sizable
+ * </pre>
+ */
+public class ConstraintParameterPositionLocator extends PortPositionLocator {
+
+ /** the width of the area surrounding the parent figure where border item can be put */
+
+ private int constraintParameterSize = 20;
+
+ /** Constructor **/
+ public ConstraintParameterPositionLocator(IFigure parentFigure, int preferredSide) {
+ super(parentFigure, preferredSide);
+ borderItemOffset = 0;
+ }
+
+ /**
+ *
+ * @param proposedLocation
+ * the proposed location
+ * @return a possible location on parent figure border
+ */
+ public Rectangle getPreferredLocation(Rectangle proposedLocation) {
+
+ // Initialize port location with proposed location
+ // and resolve the bounds of it graphical parent
+ Rectangle realLocation = new Rectangle(proposedLocation);
+
+ Rectangle parentRec = getParentFigure().getBounds().getCopy();
+
+ // Calculate Max position around the graphical parent (1/2 size or the port around
+ // the graphical parent bounds.
+ int xMin = parentRec.x;
+ int xMax = parentRec.x + parentRec.width - constraintParameterSize;
+ int yMin = parentRec.y;
+ int yMax = parentRec.y + parentRec.height - constraintParameterSize;
+
+ // Modify Port location if MAX X or Y are exceeded
+ if(realLocation.x < xMin) {
+ realLocation.x = xMin;
+ }
+
+ if(realLocation.x > xMax) {
+ realLocation.x = xMax;
+ }
+
+ if(realLocation.y < yMin) {
+ realLocation.y = yMin;
+ }
+
+ if(realLocation.y > yMax) {
+ realLocation.y = yMax;
+ }
+
+ // Ensure the port is positioned on its parent borders and not in the middle.
+ // Modify position if needed.
+ if((realLocation.y != yMin) && (realLocation.y != yMax)) {
+ if((realLocation.x != xMin) && (realLocation.x != xMax)) {
+
+ if(realLocation.x <= (xMin + (parentRec.width / 2))) {
+ realLocation.x = xMin;
+ } else {
+ realLocation.x = xMax;
+ }
+ }
+ }
+
+ // Return constrained location
+ return realLocation;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ExternalLabelPositionLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ExternalLabelPositionLocator.java
index fe8a0be0817..b6c7107e93c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ExternalLabelPositionLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/ExternalLabelPositionLocator.java
@@ -1,97 +1,97 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.locator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-
-/**
- * This class is used to constrain the position of ExternalNodeLabel. The
- * locator let the external node label be freely located by used anywhere around
- * the parent figure.
- */
-public class ExternalLabelPositionLocator implements IBorderItemLocator {
-
- /** the figure around which this label appears */
- protected IFigure parentFigure = null;
-
- /** the position constraint */
- protected Rectangle constraint = new Rectangle(0, 0, 0, 0);
-
- /**
- * get the location constraint
- *
- * @return the constraint
- */
- public Rectangle getConstraint() {
- return constraint;
- }
-
- /** Constructor **/
- public ExternalLabelPositionLocator(IFigure parentFigure) {
- this.parentFigure = parentFigure;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle,
- * org.eclipse.draw2d.IFigure)
- *
- * @param proposedLocation
- * @param borderItem
- * @return the valid location
- */
- public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
- return new Rectangle(proposedLocation);
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#setConstraint(org.eclipse.draw2d.geometry.Rectangle)
- *
- * @param constraint
- */
- public void setConstraint(Rectangle constraint) {
- this.constraint = constraint;
-
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getCurrentSideOfParent()
- *
- * @return current side of parent
- */
- public int getCurrentSideOfParent() {
- // Not used.
- return PositionConstants.NONE;
- }
-
- /**
- *
- * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
- *
- * @param target
- */
- public void relocate(IFigure target) {
-
- Rectangle proposedBounds = constraint.getCopy();
- proposedBounds.setLocation(constraint.getLocation().translate(parentFigure.getBounds().getTopLeft()));
- proposedBounds.setSize(target.getPreferredSize());
-
- target.setBounds(proposedBounds);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.locator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+
+/**
+ * This class is used to constrain the position of ExternalNodeLabel. The
+ * locator let the external node label be freely located by used anywhere around
+ * the parent figure.
+ */
+public class ExternalLabelPositionLocator implements IBorderItemLocator {
+
+ /** the figure around which this label appears */
+ protected IFigure parentFigure = null;
+
+ /** the position constraint */
+ protected Rectangle constraint = new Rectangle(0, 0, 0, 0);
+
+ /**
+ * get the location constraint
+ *
+ * @return the constraint
+ */
+ public Rectangle getConstraint() {
+ return constraint;
+ }
+
+ /** Constructor **/
+ public ExternalLabelPositionLocator(IFigure parentFigure) {
+ this.parentFigure = parentFigure;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle,
+ * org.eclipse.draw2d.IFigure)
+ *
+ * @param proposedLocation
+ * @param borderItem
+ * @return the valid location
+ */
+ public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
+ return new Rectangle(proposedLocation);
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#setConstraint(org.eclipse.draw2d.geometry.Rectangle)
+ *
+ * @param constraint
+ */
+ public void setConstraint(Rectangle constraint) {
+ this.constraint = constraint;
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getCurrentSideOfParent()
+ *
+ * @return current side of parent
+ */
+ public int getCurrentSideOfParent() {
+ // Not used.
+ return PositionConstants.NONE;
+ }
+
+ /**
+ *
+ * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
+ *
+ * @param target
+ */
+ public void relocate(IFigure target) {
+
+ Rectangle proposedBounds = constraint.getCopy();
+ proposedBounds.setLocation(constraint.getLocation().translate(parentFigure.getBounds().getTopLeft()));
+ proposedBounds.setSize(target.getPreferredSize());
+
+ target.setBounds(proposedBounds);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocator.java
index aee57d8f9d6..d1f43aa6e19 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocator.java
@@ -1,232 +1,232 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- * Vincent Lorenzo(CEA-List) vincent.lorenzo@cea.fr - getCurrentSideOfParent()
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.locator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
-
-/**
- *
- * This code comes form composite diagram. I was copied to avoid dependencies
- * This class is used to constrain the position of Port when they are added on a Property or a
- * StructuredClassifier
- *
- * <pre>
- * +-------------------+
- * | [Class] |
- * +-------------------+
- * | |
- * | |
- * | +-+ - Expected position of Port
- * | +-+
- * | |
- * +-------------------+
- *
- * </pre>
- *
- * <pre>
- * TODO : The port is not re-sizable
- * </pre>
- */
-public class PortPositionLocator implements IBorderItemLocator {
-
- /** the figure around which this border item appears */
- protected IFigure parentFigure = null;
-
- /** the width of the area surrounding the parent figure where border item can be put */
- protected int borderItemOffset = 10;
-
-
- public int getBorderItemOffset() {
- return borderItemOffset;
- }
-
-
- public void setBorderItemOffset(int borderItemOffset) {
- this.borderItemOffset = borderItemOffset;
- }
-
- /**
- * get the parent figure
- *
- * @return the parent figure
- */
- public IFigure getParentFigure() {
- return parentFigure;
- }
-
- /** the position constraint */
- protected Rectangle constraint = new Rectangle(0, 0, 0, 0);
-
- /** Constructor **/
- public PortPositionLocator(IFigure parentFigure, int preferredSide) {
- // The preferredSide parameter is not used, just kept here to ensure compatibility
- // with GMF generated code.
- this.parentFigure = parentFigure;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle,
- * org.eclipse.draw2d.IFigure)
- *
- * @param proposedLocation
- * @param borderItem
- * @return a valid location
- */
- public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
- return getPreferredLocation(proposedLocation);
- }
-
- /**
- *
- * @param proposedLocation
- * the proposed location
- * @return a possible location on parent figure border
- */
- public Rectangle getPreferredLocation(Rectangle proposedLocation) {
-
- // Initialize port location with proposed location
- // and resolve the bounds of it graphical parent
- Rectangle realLocation = new Rectangle(proposedLocation);
-
- Rectangle parentRec = getParentFigure().getBounds().getCopy();
-
- // Calculate Max position around the graphical parent (1/2 size or the port around
- // the graphical parent bounds.
- int xMin = parentRec.x - borderItemOffset;
- int xMax = parentRec.x - borderItemOffset + parentRec.width;
- int yMin = parentRec.y - borderItemOffset;
- int yMax = parentRec.y - borderItemOffset + parentRec.height;
-
- // Modify Port location if MAX X or Y are exceeded
- if(realLocation.x < xMin) {
- realLocation.x = xMin;
- }
-
- if(realLocation.x > xMax) {
- realLocation.x = xMax;
- }
-
- if(realLocation.y < yMin) {
- realLocation.y = yMin;
- }
-
- if(realLocation.y > yMax) {
- realLocation.y = yMax;
- }
-
- // Ensure the port is positioned on its parent borders and not in the middle.
- // Modify position if needed.
- if((realLocation.y != yMin) && (realLocation.y != yMax)) {
- if((realLocation.x != xMin) && (realLocation.x != xMax)) {
-
- if(realLocation.x <= (xMin + (parentRec.width / 2))) {
- realLocation.x = xMin;
- } else {
- realLocation.x = xMax;
- }
- }
- }
-
- // Return constrained location
- return realLocation;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getCurrentSideOfParent()
- *
- * @return
- * the position of the port around its parent. This position can be
- * <ul>
- * <li>{@linkplain PositionConstants#NORTH}</li>
- * <li> {@linkplain PositionConstants#SOUTH}</li>
- * <li> {@linkplain PositionConstants#EAST}</li>
- * <li> {@linkplain PositionConstants#WEST}</li>
- * <li> {@linkplain PositionConstants#NORTH_EAST}</li>
- * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_EAST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
- * </ul>
- */
- public int getCurrentSideOfParent() {
- int position = PositionConstants.NONE;
-
- //we are not on EAST, not on WEST, but we are on the NORTH
- if((constraint.x != parentFigure.getBounds().width - borderItemOffset) && (constraint.x != -this.borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
- position = PositionConstants.NORTH;
-
- //we are not on the EAST and not on the WEST, but we are on the SOUTH
- } else if((constraint.x != parentFigure.getBounds().width - borderItemOffset) && (constraint.x != -this.borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.SOUTH;
-
- //we are on the EAST, but we are not on the NORTH and not on the SOUTH
- } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y != -this.borderItemOffset) && (constraint.y != parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.EAST;
-
- //we are on the WEST, but we are not on the on the NORTH and not on the SOUTH
- } else if((constraint.x == -this.borderItemOffset) && (constraint.y != -this.borderItemOffset) && (constraint.y != parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.WEST;
-
- //we are on the NORTH and on the EAST
- } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
- position = PositionConstants.NORTH_EAST;
-
- //we are on the NORTH and on the WEST
- } else if((constraint.x == -this.borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
- position = PositionConstants.NORTH_WEST;
-
- //we are on the EAST and on the SOUTH
- } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.SOUTH_EAST;
-
- //we are on the WEST and on the SOUTH
- } else if((constraint.x == -this.borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
- position = PositionConstants.SOUTH_WEST;
- }
-
- return position;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#setConstraint(org.eclipse.draw2d.geometry.Rectangle)
- *
- * @param constraint
- */
- public void setConstraint(Rectangle constraint) {
- this.constraint = constraint;
-
- }
-
- /**
- *
- * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
- *
- * @param target
- */
- public void relocate(IFigure target) {
-
- Rectangle proposedLocation = constraint.getCopy();
- proposedLocation.setLocation(constraint.getLocation().translate(parentFigure.getBounds().getTopLeft()));
-
- Point validLocation = getValidLocation(proposedLocation, target).getLocation();
-
- target.setBounds(new Rectangle(validLocation, target.getPreferredSize()));
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ * Vincent Lorenzo(CEA-List) vincent.lorenzo@cea.fr - getCurrentSideOfParent()
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.locator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator;
+
+/**
+ *
+ * This code comes form composite diagram. I was copied to avoid dependencies
+ * This class is used to constrain the position of Port when they are added on a Property or a
+ * StructuredClassifier
+ *
+ * <pre>
+ * +-------------------+
+ * | [Class] |
+ * +-------------------+
+ * | |
+ * | |
+ * | +-+ - Expected position of Port
+ * | +-+
+ * | |
+ * +-------------------+
+ *
+ * </pre>
+ *
+ * <pre>
+ * TODO : The port is not re-sizable
+ * </pre>
+ */
+public class PortPositionLocator implements IBorderItemLocator {
+
+ /** the figure around which this border item appears */
+ protected IFigure parentFigure = null;
+
+ /** the width of the area surrounding the parent figure where border item can be put */
+ protected int borderItemOffset = 10;
+
+
+ public int getBorderItemOffset() {
+ return borderItemOffset;
+ }
+
+
+ public void setBorderItemOffset(int borderItemOffset) {
+ this.borderItemOffset = borderItemOffset;
+ }
+
+ /**
+ * get the parent figure
+ *
+ * @return the parent figure
+ */
+ public IFigure getParentFigure() {
+ return parentFigure;
+ }
+
+ /** the position constraint */
+ protected Rectangle constraint = new Rectangle(0, 0, 0, 0);
+
+ /** Constructor **/
+ public PortPositionLocator(IFigure parentFigure, int preferredSide) {
+ // The preferredSide parameter is not used, just kept here to ensure compatibility
+ // with GMF generated code.
+ this.parentFigure = parentFigure;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle,
+ * org.eclipse.draw2d.IFigure)
+ *
+ * @param proposedLocation
+ * @param borderItem
+ * @return a valid location
+ */
+ public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
+ return getPreferredLocation(proposedLocation);
+ }
+
+ /**
+ *
+ * @param proposedLocation
+ * the proposed location
+ * @return a possible location on parent figure border
+ */
+ public Rectangle getPreferredLocation(Rectangle proposedLocation) {
+
+ // Initialize port location with proposed location
+ // and resolve the bounds of it graphical parent
+ Rectangle realLocation = new Rectangle(proposedLocation);
+
+ Rectangle parentRec = getParentFigure().getBounds().getCopy();
+
+ // Calculate Max position around the graphical parent (1/2 size or the port around
+ // the graphical parent bounds.
+ int xMin = parentRec.x - borderItemOffset;
+ int xMax = parentRec.x - borderItemOffset + parentRec.width;
+ int yMin = parentRec.y - borderItemOffset;
+ int yMax = parentRec.y - borderItemOffset + parentRec.height;
+
+ // Modify Port location if MAX X or Y are exceeded
+ if(realLocation.x < xMin) {
+ realLocation.x = xMin;
+ }
+
+ if(realLocation.x > xMax) {
+ realLocation.x = xMax;
+ }
+
+ if(realLocation.y < yMin) {
+ realLocation.y = yMin;
+ }
+
+ if(realLocation.y > yMax) {
+ realLocation.y = yMax;
+ }
+
+ // Ensure the port is positioned on its parent borders and not in the middle.
+ // Modify position if needed.
+ if((realLocation.y != yMin) && (realLocation.y != yMax)) {
+ if((realLocation.x != xMin) && (realLocation.x != xMax)) {
+
+ if(realLocation.x <= (xMin + (parentRec.width / 2))) {
+ realLocation.x = xMin;
+ } else {
+ realLocation.x = xMax;
+ }
+ }
+ }
+
+ // Return constrained location
+ return realLocation;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getCurrentSideOfParent()
+ *
+ * @return
+ * the position of the port around its parent. This position can be
+ * <ul>
+ * <li>{@linkplain PositionConstants#NORTH}</li>
+ * <li> {@linkplain PositionConstants#SOUTH}</li>
+ * <li> {@linkplain PositionConstants#EAST}</li>
+ * <li> {@linkplain PositionConstants#WEST}</li>
+ * <li> {@linkplain PositionConstants#NORTH_EAST}</li>
+ * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
+ * <li> {@linkplain PositionConstants#SOUTH_EAST}</li>
+ * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
+ * </ul>
+ */
+ public int getCurrentSideOfParent() {
+ int position = PositionConstants.NONE;
+
+ //we are not on EAST, not on WEST, but we are on the NORTH
+ if((constraint.x != parentFigure.getBounds().width - borderItemOffset) && (constraint.x != -this.borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
+ position = PositionConstants.NORTH;
+
+ //we are not on the EAST and not on the WEST, but we are on the SOUTH
+ } else if((constraint.x != parentFigure.getBounds().width - borderItemOffset) && (constraint.x != -this.borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
+ position = PositionConstants.SOUTH;
+
+ //we are on the EAST, but we are not on the NORTH and not on the SOUTH
+ } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y != -this.borderItemOffset) && (constraint.y != parentFigure.getBounds().height - borderItemOffset)) {
+ position = PositionConstants.EAST;
+
+ //we are on the WEST, but we are not on the on the NORTH and not on the SOUTH
+ } else if((constraint.x == -this.borderItemOffset) && (constraint.y != -this.borderItemOffset) && (constraint.y != parentFigure.getBounds().height - borderItemOffset)) {
+ position = PositionConstants.WEST;
+
+ //we are on the NORTH and on the EAST
+ } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
+ position = PositionConstants.NORTH_EAST;
+
+ //we are on the NORTH and on the WEST
+ } else if((constraint.x == -this.borderItemOffset) && (constraint.y == -this.borderItemOffset)) {
+ position = PositionConstants.NORTH_WEST;
+
+ //we are on the EAST and on the SOUTH
+ } else if((constraint.x == parentFigure.getBounds().width - borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
+ position = PositionConstants.SOUTH_EAST;
+
+ //we are on the WEST and on the SOUTH
+ } else if((constraint.x == -this.borderItemOffset) && (constraint.y == parentFigure.getBounds().height - borderItemOffset)) {
+ position = PositionConstants.SOUTH_WEST;
+ }
+
+ return position;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#setConstraint(org.eclipse.draw2d.geometry.Rectangle)
+ *
+ * @param constraint
+ */
+ public void setConstraint(Rectangle constraint) {
+ this.constraint = constraint;
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure)
+ *
+ * @param target
+ */
+ public void relocate(IFigure target) {
+
+ Rectangle proposedLocation = constraint.getCopy();
+ proposedLocation.setLocation(constraint.getLocation().translate(parentFigure.getBounds().getTopLeft()));
+
+ Point validLocation = getValidLocation(proposedLocation, target).getLocation();
+
+ target.setBounds(new Rectangle(validLocation, target.getPreferredSize()));
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocatorUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocatorUtils.java
index e0c3c107c9a..694a5019c9e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocatorUtils.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/PortPositionLocatorUtils.java
@@ -1,149 +1,149 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.locator;
-
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * <pre>
- * This class provides convenience methods to manage Port location.
- *
- * The method are base on the Port and its graphical parent bounds (given as Rectangle), which can either be
- * based on the figure bounds or the view bounds.
- * </pre>
- */
-public class PortPositionLocatorUtils {
-
- /**
- * Get the valid border location of the Port with the proposed location on
- * the parent.
- * @param parentFigureBounds the parent bounds.
- * @param proposedFigureBounds the proposed Port bounds.
- * @param borderItemOffset the overlapping size of the Port over its parent figure.
- * @return the allowed bounds for the Port (location relative to parent
- * TopLeft point).
- */
- public static Rectangle getBorderLocation(Rectangle parentFigureBounds, Rectangle proposedFigureBounds, int borderItemOffset) {
-
- // Initialize port location with proposed location
- // and resolve the bounds of it graphical parent
- Rectangle realLocation = proposedFigureBounds.getCopy();
-
- Rectangle parentRec = parentFigureBounds.getCopy();
-
- // Calculate Max position around the graphical parent (1/2 size or the
- // port around
- // the graphical parent bounds.
- int xMin = - borderItemOffset;
- int xMax = - borderItemOffset + parentRec.width;
- int yMin = - borderItemOffset;
- int yMax = - borderItemOffset + parentRec.height;
-
- // Modify Port location if MAX X or Y are exceeded
- if(realLocation.x < xMin) {
- realLocation.x = xMin;
- }
-
- if(realLocation.x > xMax) {
- realLocation.x = xMax;
- }
-
- if(realLocation.y < yMin) {
- realLocation.y = yMin;
- }
-
- if(realLocation.y > yMax) {
- realLocation.y = yMax;
- }
-
- // Ensure the port is positioned on its parent borders and not in the
- // middle.
- // Modify position if needed.
- if((realLocation.y != yMin) && (realLocation.y != yMax)) {
- if((realLocation.x != xMin) && (realLocation.x != xMax)) {
-
- if(realLocation.x <= (xMin + (parentRec.width / 2))) {
- realLocation.x = xMin;
- } else {
- realLocation.x = xMax;
- }
- }
- }
-
- // Return constrained location
- return realLocation;
- }
-
- /**
- * Get the current side (on the parent) where the Port is located.
- * @param parentFigureBounds the parent bounds.
- * @param proposedFigureBounds the proposed Port bounds.
- * @param borderItemOffset the overlapping size of the Port over its parent figure.
-
- * @return the position of the port around its parent. This position can be
- * <ul>
- * <li>{@linkplain PositionConstants#NORTH}</li>
- * <li> {@linkplain PositionConstants#SOUTH}</li>
- * <li> {@linkplain PositionConstants#EAST}</li>
- * <li> {@linkplain PositionConstants#WEST}</li>
- * <li> {@linkplain PositionConstants#NORTH_EAST}</li>
- * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_EAST}</li>
- * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
- * </ul>
- */
- public static int getCurrentSideOfParent(Rectangle parentFigureBounds, Rectangle figureBounds, int borderItemOffset) {
- int position = PositionConstants.NONE;
-
- // we are not on EAST, not on WEST, but we are on the NORTH
- if((figureBounds.x != parentFigureBounds.width - borderItemOffset) && (figureBounds.x != -borderItemOffset) && (figureBounds.y == -borderItemOffset)) {
- position = PositionConstants.NORTH;
-
- // we are not on the EAST and not on the WEST, but we are on the
- // SOUTH
- } else if((figureBounds.x != parentFigureBounds.width - borderItemOffset) && (figureBounds.x != -borderItemOffset) && (figureBounds.y == parentFigureBounds.height - borderItemOffset)) {
- position = PositionConstants.SOUTH;
-
- // we are on the EAST, but we are not on the NORTH and not on the
- // SOUTH
- } else if((figureBounds.x == parentFigureBounds.width - borderItemOffset) && (figureBounds.y != -borderItemOffset) && (figureBounds.y != parentFigureBounds.height - borderItemOffset)) {
- position = PositionConstants.EAST;
-
- // we are on the WEST, but we are not on the on the NORTH and not on
- // the SOUTH
- } else if((figureBounds.x == -borderItemOffset) && (figureBounds.y != -borderItemOffset) && (figureBounds.y != parentFigureBounds.height - borderItemOffset)) {
- position = PositionConstants.WEST;
-
- // we are on the NORTH and on the EAST
- } else if((figureBounds.x == parentFigureBounds.width - borderItemOffset) && (figureBounds.y == -borderItemOffset)) {
- position = PositionConstants.NORTH_EAST;
-
- // we are on the NORTH and on the WEST
- } else if((figureBounds.x == -borderItemOffset) && (figureBounds.y == -borderItemOffset)) {
- position = PositionConstants.NORTH_WEST;
-
- // we are on the EAST and on the SOUTH
- } else if((figureBounds.x == parentFigureBounds.width - borderItemOffset) && (figureBounds.y == parentFigureBounds.height - borderItemOffset)) {
- position = PositionConstants.SOUTH_EAST;
-
- // we are on the WEST and on the SOUTH
- } else if((figureBounds.x == -borderItemOffset) && (figureBounds.y == parentFigureBounds.height - borderItemOffset)) {
- position = PositionConstants.SOUTH_WEST;
- }
-
- return position;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.locator;
+
+import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ * <pre>
+ * This class provides convenience methods to manage Port location.
+ *
+ * The method are base on the Port and its graphical parent bounds (given as Rectangle), which can either be
+ * based on the figure bounds or the view bounds.
+ * </pre>
+ */
+public class PortPositionLocatorUtils {
+
+ /**
+ * Get the valid border location of the Port with the proposed location on
+ * the parent.
+ * @param parentFigureBounds the parent bounds.
+ * @param proposedFigureBounds the proposed Port bounds.
+ * @param borderItemOffset the overlapping size of the Port over its parent figure.
+ * @return the allowed bounds for the Port (location relative to parent
+ * TopLeft point).
+ */
+ public static Rectangle getBorderLocation(Rectangle parentFigureBounds, Rectangle proposedFigureBounds, int borderItemOffset) {
+
+ // Initialize port location with proposed location
+ // and resolve the bounds of it graphical parent
+ Rectangle realLocation = proposedFigureBounds.getCopy();
+
+ Rectangle parentRec = parentFigureBounds.getCopy();
+
+ // Calculate Max position around the graphical parent (1/2 size or the
+ // port around
+ // the graphical parent bounds.
+ int xMin = - borderItemOffset;
+ int xMax = - borderItemOffset + parentRec.width;
+ int yMin = - borderItemOffset;
+ int yMax = - borderItemOffset + parentRec.height;
+
+ // Modify Port location if MAX X or Y are exceeded
+ if(realLocation.x < xMin) {
+ realLocation.x = xMin;
+ }
+
+ if(realLocation.x > xMax) {
+ realLocation.x = xMax;
+ }
+
+ if(realLocation.y < yMin) {
+ realLocation.y = yMin;
+ }
+
+ if(realLocation.y > yMax) {
+ realLocation.y = yMax;
+ }
+
+ // Ensure the port is positioned on its parent borders and not in the
+ // middle.
+ // Modify position if needed.
+ if((realLocation.y != yMin) && (realLocation.y != yMax)) {
+ if((realLocation.x != xMin) && (realLocation.x != xMax)) {
+
+ if(realLocation.x <= (xMin + (parentRec.width / 2))) {
+ realLocation.x = xMin;
+ } else {
+ realLocation.x = xMax;
+ }
+ }
+ }
+
+ // Return constrained location
+ return realLocation;
+ }
+
+ /**
+ * Get the current side (on the parent) where the Port is located.
+ * @param parentFigureBounds the parent bounds.
+ * @param proposedFigureBounds the proposed Port bounds.
+ * @param borderItemOffset the overlapping size of the Port over its parent figure.
+
+ * @return the position of the port around its parent. This position can be
+ * <ul>
+ * <li>{@linkplain PositionConstants#NORTH}</li>
+ * <li> {@linkplain PositionConstants#SOUTH}</li>
+ * <li> {@linkplain PositionConstants#EAST}</li>
+ * <li> {@linkplain PositionConstants#WEST}</li>
+ * <li> {@linkplain PositionConstants#NORTH_EAST}</li>
+ * <li> {@linkplain PositionConstants#NORTH_WEST}</li>
+ * <li> {@linkplain PositionConstants#SOUTH_EAST}</li>
+ * <li> {@linkplain PositionConstants#SOUTH_WEST}</li>
+ * </ul>
+ */
+ public static int getCurrentSideOfParent(Rectangle parentFigureBounds, Rectangle figureBounds, int borderItemOffset) {
+ int position = PositionConstants.NONE;
+
+ // we are not on EAST, not on WEST, but we are on the NORTH
+ if((figureBounds.x != parentFigureBounds.width - borderItemOffset) && (figureBounds.x != -borderItemOffset) && (figureBounds.y == -borderItemOffset)) {
+ position = PositionConstants.NORTH;
+
+ // we are not on the EAST and not on the WEST, but we are on the
+ // SOUTH
+ } else if((figureBounds.x != parentFigureBounds.width - borderItemOffset) && (figureBounds.x != -borderItemOffset) && (figureBounds.y == parentFigureBounds.height - borderItemOffset)) {
+ position = PositionConstants.SOUTH;
+
+ // we are on the EAST, but we are not on the NORTH and not on the
+ // SOUTH
+ } else if((figureBounds.x == parentFigureBounds.width - borderItemOffset) && (figureBounds.y != -borderItemOffset) && (figureBounds.y != parentFigureBounds.height - borderItemOffset)) {
+ position = PositionConstants.EAST;
+
+ // we are on the WEST, but we are not on the on the NORTH and not on
+ // the SOUTH
+ } else if((figureBounds.x == -borderItemOffset) && (figureBounds.y != -borderItemOffset) && (figureBounds.y != parentFigureBounds.height - borderItemOffset)) {
+ position = PositionConstants.WEST;
+
+ // we are on the NORTH and on the EAST
+ } else if((figureBounds.x == parentFigureBounds.width - borderItemOffset) && (figureBounds.y == -borderItemOffset)) {
+ position = PositionConstants.NORTH_EAST;
+
+ // we are on the NORTH and on the WEST
+ } else if((figureBounds.x == -borderItemOffset) && (figureBounds.y == -borderItemOffset)) {
+ position = PositionConstants.NORTH_WEST;
+
+ // we are on the EAST and on the SOUTH
+ } else if((figureBounds.x == parentFigureBounds.width - borderItemOffset) && (figureBounds.y == parentFigureBounds.height - borderItemOffset)) {
+ position = PositionConstants.SOUTH_EAST;
+
+ // we are on the WEST and on the SOUTH
+ } else if((figureBounds.x == -borderItemOffset) && (figureBounds.y == parentFigureBounds.height - borderItemOffset)) {
+ position = PositionConstants.SOUTH_WEST;
+ }
+
+ return position;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateBorderItemLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateBorderItemLocator.java
index 2b78de53931..0a9c2b39a72 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateBorderItemLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateBorderItemLocator.java
@@ -1,114 +1,114 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.locator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- *
- * This code comes form composite diagram. I was copied to avoid dependencies
-
- * <pre> <---------+
- * +------------+------| |
- * | [Class] | |
- * +-------------------+ |
- * | +-+ | - Expected position of template signature
- * | +-+ |
- * | | \/
- * | |
- * | |
- * +-------------------+
- *
- * </pre>
- *
- * <pre>
- * TODO : The port is not re-sizable
- * </pre>
- */
-public class TemplateBorderItemLocator extends PortPositionLocator{
- /**
- * the width of the area surrounding the parent figure where border item can
- * be put
- */
- protected int borderItemOffset = 10;
-
- public TemplateBorderItemLocator(IFigure parentFigure, int preferredSide) {
- super(parentFigure, preferredSide);
- }
-
- /**
- *
- * @param proposedLocation
- * the proposed location
- * @return a possible location on parent figure border
- */
- public Rectangle getPreferredLocation(Rectangle proposedLocation) {
-
- // Initialize port location with proposed location
- // and resolve the bounds of it graphical parent
- Rectangle realLocation = new Rectangle(proposedLocation);
-
- Rectangle parentRec = getParentFigure().getBounds().getCopy();
-
- // Calculate Max position around the graphical parent (1/2 size or the
- // port around
- // the graphical parent bounds.
- int xMin = parentRec.x - borderItemOffset+parentRec.width/2;
- int xMax = parentRec.x - borderItemOffset + parentRec.width;
- int yMin = parentRec.y - borderItemOffset;
- int yMax = parentRec.y - borderItemOffset + parentRec.height/2;
-
- // Modify Port location if MAX X or Y are exceeded
- if(realLocation.x < xMin) {
- realLocation.x = xMin;
- }
-
- if(realLocation.x > xMax) {
- realLocation.x = xMax;
- }
-
- if(realLocation.y < yMin) {
- realLocation.y = yMin;
- }
-
- if(realLocation.y > yMax) {
- realLocation.y = yMax;
- }
-
- // Ensure the port is positioned on its parent borders and not in the
- // middle.
- // Modify position if needed.
- if((realLocation.y != yMin) && (realLocation.y != yMax)) {
- if((realLocation.x != xMin) && (realLocation.x != xMax)) {
-
- if(realLocation.x <= (xMin + (parentRec.width / 2))) {
- realLocation.x = xMin;
- } else {
- realLocation.x = xMax;
- }
- }
- }
- if(realLocation.x==xMin && (yMin<realLocation.y && realLocation.y<=yMax)){
- realLocation.x=xMax;
- }
-
- if((xMin<=realLocation.x && realLocation.x<xMax)&& realLocation.y==yMax){
- realLocation.y=yMin;
- }
- // Return constrained location
- return realLocation;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.locator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+/**
+ *
+ * This code comes form composite diagram. I was copied to avoid dependencies
+
+ * <pre> <---------+
+ * +------------+------| |
+ * | [Class] | |
+ * +-------------------+ |
+ * | +-+ | - Expected position of template signature
+ * | +-+ |
+ * | | \/
+ * | |
+ * | |
+ * +-------------------+
+ *
+ * </pre>
+ *
+ * <pre>
+ * TODO : The port is not re-sizable
+ * </pre>
+ */
+public class TemplateBorderItemLocator extends PortPositionLocator{
+ /**
+ * the width of the area surrounding the parent figure where border item can
+ * be put
+ */
+ protected int borderItemOffset = 10;
+
+ public TemplateBorderItemLocator(IFigure parentFigure, int preferredSide) {
+ super(parentFigure, preferredSide);
+ }
+
+ /**
+ *
+ * @param proposedLocation
+ * the proposed location
+ * @return a possible location on parent figure border
+ */
+ public Rectangle getPreferredLocation(Rectangle proposedLocation) {
+
+ // Initialize port location with proposed location
+ // and resolve the bounds of it graphical parent
+ Rectangle realLocation = new Rectangle(proposedLocation);
+
+ Rectangle parentRec = getParentFigure().getBounds().getCopy();
+
+ // Calculate Max position around the graphical parent (1/2 size or the
+ // port around
+ // the graphical parent bounds.
+ int xMin = parentRec.x - borderItemOffset+parentRec.width/2;
+ int xMax = parentRec.x - borderItemOffset + parentRec.width;
+ int yMin = parentRec.y - borderItemOffset;
+ int yMax = parentRec.y - borderItemOffset + parentRec.height/2;
+
+ // Modify Port location if MAX X or Y are exceeded
+ if(realLocation.x < xMin) {
+ realLocation.x = xMin;
+ }
+
+ if(realLocation.x > xMax) {
+ realLocation.x = xMax;
+ }
+
+ if(realLocation.y < yMin) {
+ realLocation.y = yMin;
+ }
+
+ if(realLocation.y > yMax) {
+ realLocation.y = yMax;
+ }
+
+ // Ensure the port is positioned on its parent borders and not in the
+ // middle.
+ // Modify position if needed.
+ if((realLocation.y != yMin) && (realLocation.y != yMax)) {
+ if((realLocation.x != xMin) && (realLocation.x != xMax)) {
+
+ if(realLocation.x <= (xMin + (parentRec.width / 2))) {
+ realLocation.x = xMin;
+ } else {
+ realLocation.x = xMax;
+ }
+ }
+ }
+ if(realLocation.x==xMin && (yMin<realLocation.y && realLocation.y<=yMax)){
+ realLocation.x=xMax;
+ }
+
+ if((xMin<=realLocation.x && realLocation.x<xMax)&& realLocation.y==yMax){
+ realLocation.y=yMin;
+ }
+ // Return constrained location
+ return realLocation;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateClassifierBorderItemLocator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateClassifierBorderItemLocator.java
index 98aa4e19259..18cd869d413 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateClassifierBorderItemLocator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/locator/TemplateClassifierBorderItemLocator.java
@@ -1,53 +1,53 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.locator;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-public class TemplateClassifierBorderItemLocator extends AdvancedBorderItemLocator {
-
- // @unused
- public TemplateClassifierBorderItemLocator(IFigure parentFigure) {
- super(parentFigure);
- }
-
- // @unused
- public TemplateClassifierBorderItemLocator(IFigure borderItem, IFigure parentFigure, Rectangle constraint) {
- super(borderItem, parentFigure, constraint);
- }
-
- public TemplateClassifierBorderItemLocator(IFigure parentFigure, int preferredSide) {
- super(parentFigure, preferredSide);
- }
-
- @Override
- public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
- Rectangle realLocation = new Rectangle(proposedLocation);
- Rectangle parentRec = getParentFigure().getBounds().getCopy();
- // position is constraint in the parent rectangle
- // WEST
- if(realLocation.x < parentRec.x + parentRec.getSize().width - borderItem.getBounds().width) {
- realLocation.x = parentRec.x + parentRec.getSize().width - borderItem.getBounds().width;
- }
- // EAST
- if(realLocation.x > parentRec.x + parentRec.getSize().width - borderItem.getBounds().width / 4) {
- realLocation.x = parentRec.x + parentRec.getSize().width - borderItem.getBounds().width / 4;
- }
- // NORTH
- realLocation.y = parentRec.y - (borderItem.getBounds().height / 2);
- return realLocation;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.locator;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Rectangle;
+
+public class TemplateClassifierBorderItemLocator extends AdvancedBorderItemLocator {
+
+ // @unused
+ public TemplateClassifierBorderItemLocator(IFigure parentFigure) {
+ super(parentFigure);
+ }
+
+ // @unused
+ public TemplateClassifierBorderItemLocator(IFigure borderItem, IFigure parentFigure, Rectangle constraint) {
+ super(borderItem, parentFigure, constraint);
+ }
+
+ public TemplateClassifierBorderItemLocator(IFigure parentFigure, int preferredSide) {
+ super(parentFigure, preferredSide);
+ }
+
+ @Override
+ public Rectangle getValidLocation(Rectangle proposedLocation, IFigure borderItem) {
+ Rectangle realLocation = new Rectangle(proposedLocation);
+ Rectangle parentRec = getParentFigure().getBounds().getCopy();
+ // position is constraint in the parent rectangle
+ // WEST
+ if(realLocation.x < parentRec.x + parentRec.getSize().width - borderItem.getBounds().width) {
+ realLocation.x = parentRec.x + parentRec.getSize().width - borderItem.getBounds().width;
+ }
+ // EAST
+ if(realLocation.x > parentRec.x + parentRec.getSize().width - borderItem.getBounds().width / 4) {
+ realLocation.x = parentRec.x + parentRec.getSize().width - borderItem.getBounds().width / 4;
+ }
+ // NORTH
+ realLocation.y = parentRec.y - (borderItem.getBounds().height / 2);
+ return realLocation;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/CommentParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/CommentParser.java
index a959e1a7933..77bd53908d6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/CommentParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/CommentParser.java
@@ -1,161 +1,161 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.papyrus.uml.tools.namereferences.NameReferencesHelper;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * Specific Parser for the comment, in case they have a html format.
- */
-public class CommentParser implements IParser {
-
- /**
- * {@inheritDoc}
- */
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public List getSemanticElementsBeingParsed(EObject element) {
- List list = new ArrayList();
- list.add(element);
- return list;
- }
-
- /**
- * {@inheritDoc}
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getEditString(IAdaptable element, int flags) {
- Comment comment = doAdapt(element);
- if(comment == null) {
- return "<NULL COMMENT>"; //$NON-NLS-1$
- }
- try {
- return HTMLCleaner.removeHTMLTags(HTMLCleaner.preClean(comment.getBody()));
- } catch (Exception e) {
- return comment.getBody();
- }
-
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
- Comment comment = doAdapt(element);
- if(comment == null) {
- return UnexecutableCommand.INSTANCE;
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(comment);
- if(editingDomain == null) {
- return UnexecutableCommand.INSTANCE;
- }
- CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Body"); //$NON-NLS-1$
- SetRequest request = new SetRequest(comment, UMLPackage.eINSTANCE.getComment_Body(), newString);
- command.compose(new SetValueCommand(request));
- return command;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- Comment comment = doAdapt(element);
- if(comment == null) {
- return "<NULL COMMENT>"; //$NON-NLS-1$
- }
-
- // remove all "<***>" characters, replace &gt;, etc...
- String roughBody = comment.getBody();
- if(roughBody == null || roughBody.length() == 0) {
- return "";//$NON-NLS-1$
- }
-
- Resource resource = comment.eResource();
-
- NameReferencesHelper helper = new NameReferencesHelper(resource);
-
- String displayText = helper.replaceReferences(roughBody);
-
- // comment not null, comment not empty, do the parse...
-
- return displayText;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
- if(event instanceof org.eclipse.emf.common.notify.Notification) {
- Object source = ((org.eclipse.emf.common.notify.Notification)event).getFeature();
- if(UMLPackage.eINSTANCE.getComment_Body().equals(source)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
- return ParserEditStatus.EDITABLE_STATUS;
- }
-
- /**
- * Get the property associated with the given IAdaptable and the
- * memberEndIndex .
- *
- * @param element
- * the given IAdaptable
- * @return the property associated or null if it can't be found.
- */
- protected Comment doAdapt(IAdaptable element) {
- Object obj = element.getAdapter(EObject.class);
- if(obj instanceof Comment) {
- return (Comment)obj;
- }
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.uml.tools.namereferences.NameReferencesHelper;
+import org.eclipse.uml2.uml.Comment;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * Specific Parser for the comment, in case they have a html format.
+ */
+public class CommentParser implements IParser {
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List getSemanticElementsBeingParsed(EObject element) {
+ List list = new ArrayList();
+ list.add(element);
+ return list;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEditString(IAdaptable element, int flags) {
+ Comment comment = doAdapt(element);
+ if(comment == null) {
+ return "<NULL COMMENT>"; //$NON-NLS-1$
+ }
+ try {
+ return HTMLCleaner.removeHTMLTags(HTMLCleaner.preClean(comment.getBody()));
+ } catch (Exception e) {
+ return comment.getBody();
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+ Comment comment = doAdapt(element);
+ if(comment == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(comment);
+ if(editingDomain == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Body"); //$NON-NLS-1$
+ SetRequest request = new SetRequest(comment, UMLPackage.eINSTANCE.getComment_Body(), newString);
+ command.compose(new SetValueCommand(request));
+ return command;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ Comment comment = doAdapt(element);
+ if(comment == null) {
+ return "<NULL COMMENT>"; //$NON-NLS-1$
+ }
+
+ // remove all "<***>" characters, replace &gt;, etc...
+ String roughBody = comment.getBody();
+ if(roughBody == null || roughBody.length() == 0) {
+ return "";//$NON-NLS-1$
+ }
+
+ Resource resource = comment.eResource();
+
+ NameReferencesHelper helper = new NameReferencesHelper(resource);
+
+ String displayText = helper.replaceReferences(roughBody);
+
+ // comment not null, comment not empty, do the parse...
+
+ return displayText;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ if(event instanceof org.eclipse.emf.common.notify.Notification) {
+ Object source = ((org.eclipse.emf.common.notify.Notification)event).getFeature();
+ if(UMLPackage.eINSTANCE.getComment_Body().equals(source)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ return ParserEditStatus.EDITABLE_STATUS;
+ }
+
+ /**
+ * Get the property associated with the given IAdaptable and the
+ * memberEndIndex .
+ *
+ * @param element
+ * the given IAdaptable
+ * @return the property associated or null if it can't be found.
+ */
+ protected Comment doAdapt(IAdaptable element) {
+ Object obj = element.getAdapter(EObject.class);
+ if(obj instanceof Comment) {
+ return (Comment)obj;
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintParser.java
index f5350fa12e3..0a4f206f036 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ConstraintParser.java
@@ -1,293 +1,293 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.papyrus.uml.diagram.common.helper.NamedElementHelper;
-import org.eclipse.uml2.uml.Constraint;
-import org.eclipse.uml2.uml.Duration;
-import org.eclipse.uml2.uml.DurationInterval;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Interval;
-import org.eclipse.uml2.uml.LiteralInteger;
-import org.eclipse.uml2.uml.LiteralString;
-import org.eclipse.uml2.uml.OpaqueExpression;
-import org.eclipse.uml2.uml.TimeExpression;
-import org.eclipse.uml2.uml.TimeInterval;
-import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.ValueSpecification;
-
-/**
- * The Class ConstraintParser.
- */
-public class ConstraintParser implements IParser, ISemanticParser {
-
- protected static final String OPAQUE_EXPRESSION_BEGIN_LANGUAGE = "{";
- protected static final String OPAQUE_EXPRESSION_END_LANGUAGE = "} ";
-
- /**
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getEditString(org.eclipse.core.runtime.IAdaptable, int)
- *
- */
-
- public String getEditString(IAdaptable element, int flags) {
- Constraint constraint = doAdapt(element);
- if(constraint == null || constraint.getSpecification() == null) {
- return "<NULL Constraint>"; //$NON-NLS-1$
- }
- if(constraint.getSpecification() instanceof LiteralString) {
- return ((LiteralString)constraint.getSpecification()).getValue();
- }
- if(constraint.getSpecification() instanceof DurationInterval) {
- if((((DurationInterval)constraint.getSpecification()).getMin())!=null && (((DurationInterval)constraint.getSpecification()).getMax()!=null)){
- return ((DurationInterval)constraint.getSpecification()).getMin().stringValue()+".."+((DurationInterval)constraint.getSpecification()).getMax().stringValue();
- }
- else{
- return "0..0";}
- }
-
- if(constraint.getSpecification() instanceof TimeInterval) {
- if((((TimeInterval)constraint.getSpecification()).getMin())!=null && (((TimeInterval)constraint.getSpecification()).getMax()!=null)){
- return ((TimeInterval)constraint.getSpecification()).getMin().stringValue()+".."+((TimeInterval)constraint.getSpecification()).getMax().stringValue();
- }
- else{
- return "0..0";}
- }
- if(constraint.getSpecification() instanceof Interval) {
- if((((Interval)constraint.getSpecification()).getMin())!=null && (((Interval)constraint.getSpecification()).getMax()!=null)){
- return ((Interval)constraint.getSpecification()).getMin().stringValue()+".."+((Interval)constraint.getSpecification()).getMax().stringValue();
- }
- else{
- return "0..0";}
- }
- if(constraint.getSpecification() instanceof OpaqueExpression) {
- OpaqueExpression opaqueExpression = (OpaqueExpression)constraint.getSpecification();
- if(opaqueExpression.getBodies().size() > 0) {
- StringBuilder b = new StringBuilder();
- if (opaqueExpression.getLanguages().size() > 0) {
- b.append(OPAQUE_EXPRESSION_BEGIN_LANGUAGE);
- b.append(opaqueExpression.getLanguages().get(0));
- b.append(OPAQUE_EXPRESSION_END_LANGUAGE);
- }
- b.append(opaqueExpression.getBodies().get(0));
- return b.toString();
- }
- else{return OPAQUE_EXPRESSION_BEGIN_LANGUAGE+"NATURAL"+OPAQUE_EXPRESSION_END_LANGUAGE;}
- }
- return "";
- }
-
- /**
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isValidEditString(org.eclipse.core.runtime.IAdaptable, java.lang.String)
- *
- */
-
- public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
- return ParserEditStatus.EDITABLE_STATUS;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getParseCommand(org.eclipse.core.runtime.IAdaptable, java.lang.String, int)
- *
- */
-
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
- Constraint constraint = doAdapt(element);
- if(constraint == null || constraint.getSpecification() == null) {
- return UnexecutableCommand.INSTANCE;
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(constraint);
- if(editingDomain == null || constraint.getSpecification() == null) {
- return UnexecutableCommand.INSTANCE;
- }
- ICommand command=UnexecutableCommand.INSTANCE;
- if(constraint.getSpecification() instanceof LiteralString) {
- LiteralString specif = (LiteralString)constraint.getSpecification();
- command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
- SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getLiteralString_Value(), newString);
- command.compose(new SetValueCommand(request));
- }
- if(constraint.getSpecification() instanceof OpaqueExpression) {
- OpaqueExpression specif = (OpaqueExpression)constraint.getSpecification();
- command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
- ArrayList<String> stringBodyList=new ArrayList<String>();
- ArrayList<String> stringLanguageList=new ArrayList<String>();
- stringLanguageList.add(newString.substring(1, newString.indexOf(OPAQUE_EXPRESSION_END_LANGUAGE)).toUpperCase());
- stringBodyList.add( newString.substring(newString.indexOf(OPAQUE_EXPRESSION_END_LANGUAGE)+2,newString.length()));
- SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getOpaqueExpression_Body(), stringBodyList);
- command.compose(new SetValueCommand(request));
- request = new SetRequest(specif, UMLPackage.eINSTANCE.getOpaqueExpression_Language(), stringLanguageList);
- command.compose(new SetValueCommand(request));
- return command;
- }
-
- if(constraint.getSpecification() instanceof DurationInterval) {
- Interval specif = (Interval)constraint.getSpecification();
- command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
- Duration durationMin= UMLFactory.eINSTANCE.createDuration();
- durationMin.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(constraint, durationMin.eClass()));
- Duration durationMax= UMLFactory.eINSTANCE.createDuration();
- durationMax.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(constraint, durationMax.eClass()));
-
- LiteralString exp1 =UMLFactory.eINSTANCE.createLiteralString();
- LiteralString exp2 =UMLFactory.eINSTANCE.createLiteralString();
- exp1.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(durationMin, exp1.eClass()));
- exp1.setValue(newString.substring(0, newString.indexOf("..")));
- exp2.setValue( newString.substring(newString.indexOf("..")+2,newString.length()));
- exp2.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(durationMax, exp2.eClass()));
- durationMin.setExpr(exp1);
- durationMax.setExpr(exp2);
- SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Min(),durationMin);
- command.compose(new SetValueCommand(request));
- request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Max(), durationMax);
- command.compose(new SetValueCommand(request));
- return command;
- }
-
- if(constraint.getSpecification() instanceof TimeInterval) {
- TimeInterval specif = (TimeInterval)constraint.getSpecification();
- command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
- TimeExpression timeMin= UMLFactory.eINSTANCE.createTimeExpression();
- timeMin.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(constraint, timeMin.eClass()));
- TimeExpression timeMax= UMLFactory.eINSTANCE.createTimeExpression();
- timeMax.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(constraint, timeMax.eClass()));
-
- LiteralString exp1 =UMLFactory.eINSTANCE.createLiteralString();
- LiteralString exp2 =UMLFactory.eINSTANCE.createLiteralString();
- exp1.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(timeMin, exp1.eClass()));
- exp1.setValue(newString.substring(0, newString.indexOf("..")));
- exp2.setValue( newString.substring(newString.indexOf("..")+2,newString.length()));
- exp2.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(timeMax, exp2.eClass()));
- timeMin.setExpr(exp1);
- timeMax.setExpr(exp2);
- SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Min(),timeMin);
- command.compose(new SetValueCommand(request));
- request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Max(), timeMax);
- command.compose(new SetValueCommand(request));
- return command;
- }
-
- if(constraint.getSpecification() instanceof Interval) {
-
- Interval specif = (Interval)constraint.getSpecification();
- command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
- LiteralInteger min = UMLFactory.eINSTANCE.createLiteralInteger();
- LiteralInteger max = UMLFactory.eINSTANCE.createLiteralInteger();
- min.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(min, min.eClass()));
- max.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(max, max.eClass()));
- Integer minInt= new Integer(newString.substring(0, newString.indexOf("..")));
- Integer maxInt= new Integer( newString.substring(newString.indexOf("..")+2,newString.length()));
- min.setValue(minInt.intValue());
- max.setValue( maxInt.intValue());
-
- SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Min(),min);
- command.compose(new SetValueCommand(request));
- request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Max(), max);
- command.compose(new SetValueCommand(request));
- return command;
- }
- return command;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getPrintString(org.eclipse.core.runtime.IAdaptable, int)
- *
- */
-
- public String getPrintString(IAdaptable element, int flags) {
- return getEditString(element, flags);
- }
-
- /**
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isAffectingEvent(java.lang.Object, int)
- *
- */
-
- public boolean isAffectingEvent(Object event, int flags) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getCompletionProcessor(org.eclipse.core.runtime.IAdaptable)
- *
- */
-
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * used to obtain the constraint element.
- *
- * @param element
- * the given IAdaptable
- * @return the constraint or null if it can't be found.
- */
- protected Constraint doAdapt(IAdaptable element) {
- Object obj = element.getAdapter(EObject.class);
- if(obj instanceof Constraint) {
- return (Constraint)obj;
- }
- return null;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed(org.eclipse.emf.ecore.EObject)
- *
- */
-
- public List getSemanticElementsBeingParsed(EObject element) {
- Element umlElement = (Element)element;
- List<EObject> result = new LinkedList<EObject>();
- if(umlElement instanceof Constraint) {
- Constraint constraint = (Constraint)umlElement;
- if(constraint.getSpecification() != null) {
- ValueSpecification value = constraint.getSpecification();
- result.add(value);
- }
- }
- return result;
- }
-
- /**
- * @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) {
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.uml.diagram.common.helper.NamedElementHelper;
+import org.eclipse.uml2.uml.Constraint;
+import org.eclipse.uml2.uml.Duration;
+import org.eclipse.uml2.uml.DurationInterval;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Interval;
+import org.eclipse.uml2.uml.LiteralInteger;
+import org.eclipse.uml2.uml.LiteralString;
+import org.eclipse.uml2.uml.OpaqueExpression;
+import org.eclipse.uml2.uml.TimeExpression;
+import org.eclipse.uml2.uml.TimeInterval;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.ValueSpecification;
+
+/**
+ * The Class ConstraintParser.
+ */
+public class ConstraintParser implements IParser, ISemanticParser {
+
+ protected static final String OPAQUE_EXPRESSION_BEGIN_LANGUAGE = "{";
+ protected static final String OPAQUE_EXPRESSION_END_LANGUAGE = "} ";
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getEditString(org.eclipse.core.runtime.IAdaptable, int)
+ *
+ */
+
+ public String getEditString(IAdaptable element, int flags) {
+ Constraint constraint = doAdapt(element);
+ if(constraint == null || constraint.getSpecification() == null) {
+ return "<NULL Constraint>"; //$NON-NLS-1$
+ }
+ if(constraint.getSpecification() instanceof LiteralString) {
+ return ((LiteralString)constraint.getSpecification()).getValue();
+ }
+ if(constraint.getSpecification() instanceof DurationInterval) {
+ if((((DurationInterval)constraint.getSpecification()).getMin())!=null && (((DurationInterval)constraint.getSpecification()).getMax()!=null)){
+ return ((DurationInterval)constraint.getSpecification()).getMin().stringValue()+".."+((DurationInterval)constraint.getSpecification()).getMax().stringValue();
+ }
+ else{
+ return "0..0";}
+ }
+
+ if(constraint.getSpecification() instanceof TimeInterval) {
+ if((((TimeInterval)constraint.getSpecification()).getMin())!=null && (((TimeInterval)constraint.getSpecification()).getMax()!=null)){
+ return ((TimeInterval)constraint.getSpecification()).getMin().stringValue()+".."+((TimeInterval)constraint.getSpecification()).getMax().stringValue();
+ }
+ else{
+ return "0..0";}
+ }
+ if(constraint.getSpecification() instanceof Interval) {
+ if((((Interval)constraint.getSpecification()).getMin())!=null && (((Interval)constraint.getSpecification()).getMax()!=null)){
+ return ((Interval)constraint.getSpecification()).getMin().stringValue()+".."+((Interval)constraint.getSpecification()).getMax().stringValue();
+ }
+ else{
+ return "0..0";}
+ }
+ if(constraint.getSpecification() instanceof OpaqueExpression) {
+ OpaqueExpression opaqueExpression = (OpaqueExpression)constraint.getSpecification();
+ if(opaqueExpression.getBodies().size() > 0) {
+ StringBuilder b = new StringBuilder();
+ if (opaqueExpression.getLanguages().size() > 0) {
+ b.append(OPAQUE_EXPRESSION_BEGIN_LANGUAGE);
+ b.append(opaqueExpression.getLanguages().get(0));
+ b.append(OPAQUE_EXPRESSION_END_LANGUAGE);
+ }
+ b.append(opaqueExpression.getBodies().get(0));
+ return b.toString();
+ }
+ else{return OPAQUE_EXPRESSION_BEGIN_LANGUAGE+"NATURAL"+OPAQUE_EXPRESSION_END_LANGUAGE;}
+ }
+ return "";
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isValidEditString(org.eclipse.core.runtime.IAdaptable, java.lang.String)
+ *
+ */
+
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ return ParserEditStatus.EDITABLE_STATUS;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getParseCommand(org.eclipse.core.runtime.IAdaptable, java.lang.String, int)
+ *
+ */
+
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+ Constraint constraint = doAdapt(element);
+ if(constraint == null || constraint.getSpecification() == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(constraint);
+ if(editingDomain == null || constraint.getSpecification() == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ ICommand command=UnexecutableCommand.INSTANCE;
+ if(constraint.getSpecification() instanceof LiteralString) {
+ LiteralString specif = (LiteralString)constraint.getSpecification();
+ command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
+ SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getLiteralString_Value(), newString);
+ command.compose(new SetValueCommand(request));
+ }
+ if(constraint.getSpecification() instanceof OpaqueExpression) {
+ OpaqueExpression specif = (OpaqueExpression)constraint.getSpecification();
+ command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
+ ArrayList<String> stringBodyList=new ArrayList<String>();
+ ArrayList<String> stringLanguageList=new ArrayList<String>();
+ stringLanguageList.add(newString.substring(1, newString.indexOf(OPAQUE_EXPRESSION_END_LANGUAGE)).toUpperCase());
+ stringBodyList.add( newString.substring(newString.indexOf(OPAQUE_EXPRESSION_END_LANGUAGE)+2,newString.length()));
+ SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getOpaqueExpression_Body(), stringBodyList);
+ command.compose(new SetValueCommand(request));
+ request = new SetRequest(specif, UMLPackage.eINSTANCE.getOpaqueExpression_Language(), stringLanguageList);
+ command.compose(new SetValueCommand(request));
+ return command;
+ }
+
+ if(constraint.getSpecification() instanceof DurationInterval) {
+ Interval specif = (Interval)constraint.getSpecification();
+ command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
+ Duration durationMin= UMLFactory.eINSTANCE.createDuration();
+ durationMin.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(constraint, durationMin.eClass()));
+ Duration durationMax= UMLFactory.eINSTANCE.createDuration();
+ durationMax.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(constraint, durationMax.eClass()));
+
+ LiteralString exp1 =UMLFactory.eINSTANCE.createLiteralString();
+ LiteralString exp2 =UMLFactory.eINSTANCE.createLiteralString();
+ exp1.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(durationMin, exp1.eClass()));
+ exp1.setValue(newString.substring(0, newString.indexOf("..")));
+ exp2.setValue( newString.substring(newString.indexOf("..")+2,newString.length()));
+ exp2.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(durationMax, exp2.eClass()));
+ durationMin.setExpr(exp1);
+ durationMax.setExpr(exp2);
+ SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Min(),durationMin);
+ command.compose(new SetValueCommand(request));
+ request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Max(), durationMax);
+ command.compose(new SetValueCommand(request));
+ return command;
+ }
+
+ if(constraint.getSpecification() instanceof TimeInterval) {
+ TimeInterval specif = (TimeInterval)constraint.getSpecification();
+ command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
+ TimeExpression timeMin= UMLFactory.eINSTANCE.createTimeExpression();
+ timeMin.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(constraint, timeMin.eClass()));
+ TimeExpression timeMax= UMLFactory.eINSTANCE.createTimeExpression();
+ timeMax.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(constraint, timeMax.eClass()));
+
+ LiteralString exp1 =UMLFactory.eINSTANCE.createLiteralString();
+ LiteralString exp2 =UMLFactory.eINSTANCE.createLiteralString();
+ exp1.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(timeMin, exp1.eClass()));
+ exp1.setValue(newString.substring(0, newString.indexOf("..")));
+ exp2.setValue( newString.substring(newString.indexOf("..")+2,newString.length()));
+ exp2.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(timeMax, exp2.eClass()));
+ timeMin.setExpr(exp1);
+ timeMax.setExpr(exp2);
+ SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Min(),timeMin);
+ command.compose(new SetValueCommand(request));
+ request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Max(), timeMax);
+ command.compose(new SetValueCommand(request));
+ return command;
+ }
+
+ if(constraint.getSpecification() instanceof Interval) {
+
+ Interval specif = (Interval)constraint.getSpecification();
+ command = new CompositeTransactionalCommand(editingDomain, "Set Value Constraint"); //$NON-NLS-1$
+ LiteralInteger min = UMLFactory.eINSTANCE.createLiteralInteger();
+ LiteralInteger max = UMLFactory.eINSTANCE.createLiteralInteger();
+ min.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(min, min.eClass()));
+ max.setName(NamedElementHelper.EINSTANCE.getNewUMLElementName(max, max.eClass()));
+ Integer minInt= new Integer(newString.substring(0, newString.indexOf("..")));
+ Integer maxInt= new Integer( newString.substring(newString.indexOf("..")+2,newString.length()));
+ min.setValue(minInt.intValue());
+ max.setValue( maxInt.intValue());
+
+ SetRequest request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Min(),min);
+ command.compose(new SetValueCommand(request));
+ request = new SetRequest(specif, UMLPackage.eINSTANCE.getInterval_Max(), max);
+ command.compose(new SetValueCommand(request));
+ return command;
+ }
+ return command;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getPrintString(org.eclipse.core.runtime.IAdaptable, int)
+ *
+ */
+
+ public String getPrintString(IAdaptable element, int flags) {
+ return getEditString(element, flags);
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isAffectingEvent(java.lang.Object, int)
+ *
+ */
+
+ public boolean isAffectingEvent(Object event, int flags) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getCompletionProcessor(org.eclipse.core.runtime.IAdaptable)
+ *
+ */
+
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * used to obtain the constraint element.
+ *
+ * @param element
+ * the given IAdaptable
+ * @return the constraint or null if it can't be found.
+ */
+ protected Constraint doAdapt(IAdaptable element) {
+ Object obj = element.getAdapter(EObject.class);
+ if(obj instanceof Constraint) {
+ return (Constraint)obj;
+ }
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed(org.eclipse.emf.ecore.EObject)
+ *
+ */
+
+ public List getSemanticElementsBeingParsed(EObject element) {
+ Element umlElement = (Element)element;
+ List<EObject> result = new LinkedList<EObject>();
+ if(umlElement instanceof Constraint) {
+ Constraint constraint = (Constraint)umlElement;
+ if(constraint.getSpecification() != null) {
+ ValueSpecification value = constraint.getSpecification();
+ result.add(value);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * @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) {
+ return true;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ShortcutDiagramParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ShortcutDiagramParser.java
index 30e7a219799..04954159f5e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ShortcutDiagramParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/ShortcutDiagramParser.java
@@ -1,124 +1,124 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier(CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-
-/**
- * parser to display the name of diagram in the case of a short cut
- *
- */
-public class ShortcutDiagramParser implements IParser {
-
- /**
- *
- * {@inheritDoc}
- */
- public String getEditString(IAdaptable element, int flags) {
- Diagram diagram = doAdapt(element);
- if(diagram == null || diagram.eResource() == null) {
- return Messages.DiagramNotFound;
- }
-
- return diagram.getName();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
- return ParserEditStatus.EDITABLE_STATUS;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
- Diagram diagram = doAdapt(element);
- if(diagram == null || diagram.eResource() == null) {
- return UnexecutableCommand.INSTANCE;
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(diagram);
- if(editingDomain == null) {
- return UnexecutableCommand.INSTANCE;
- }
- CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, Messages.SetNameDiagram); //$NON-NLS-1$
- SetRequest request = new SetRequest(diagram, NotationPackage.eINSTANCE.getDiagram_Name(), newString);
- command.compose(new SetValueCommand(request));
- return command;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- Diagram diagram = doAdapt(element);
- if(diagram == null || diagram.eResource() == null) {
- return Messages.DiagramNotFound;
- }
-
- return diagram.getName();
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
- // TODO Auto-generated method stub
- return false;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * used to obtain the diagram element.
- *
- * @param element
- * the given IAdaptable
- * @return the diagram or null if it can't be found.
- */
- protected Diagram doAdapt(IAdaptable element) {
- Object obj = element.getAdapter(EObject.class);
- if(obj instanceof Diagram) {
- return (Diagram)obj;
- }
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier(CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+
+/**
+ * parser to display the name of diagram in the case of a short cut
+ *
+ */
+public class ShortcutDiagramParser implements IParser {
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String getEditString(IAdaptable element, int flags) {
+ Diagram diagram = doAdapt(element);
+ if(diagram == null || diagram.eResource() == null) {
+ return Messages.DiagramNotFound;
+ }
+
+ return diagram.getName();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ return ParserEditStatus.EDITABLE_STATUS;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+ Diagram diagram = doAdapt(element);
+ if(diagram == null || diagram.eResource() == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(diagram);
+ if(editingDomain == null) {
+ return UnexecutableCommand.INSTANCE;
+ }
+ CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, Messages.SetNameDiagram); //$NON-NLS-1$
+ SetRequest request = new SetRequest(diagram, NotationPackage.eINSTANCE.getDiagram_Name(), newString);
+ command.compose(new SetValueCommand(request));
+ return command;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ Diagram diagram = doAdapt(element);
+ if(diagram == null || diagram.eResource() == null) {
+ return Messages.DiagramNotFound;
+ }
+
+ return diagram.getName();
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * used to obtain the diagram element.
+ *
+ * @param element
+ * the given IAdaptable
+ * @return the diagram or null if it can't be found.
+ */
+ protected Diagram doAdapt(IAdaptable element) {
+ Object obj = element.getAdapter(EObject.class);
+ if(obj instanceof Diagram) {
+ return (Diagram)obj;
+ }
+ return null;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/StereotypePropertyParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/StereotypePropertyParser.java
index 166bd71722c..54b9268ee8b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/StereotypePropertyParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/StereotypePropertyParser.java
@@ -1,190 +1,190 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
-import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.util.UMLUtil;
-
-/**
- * this is a parser to display a slot in the diagram
- *
- */
-public class StereotypePropertyParser implements IParser, ISemanticParser {
-
- /**
- *
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getCompletionProcessor(org.eclipse.core.runtime.IAdaptable)
- *
- * @param element
- * @return
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getEditString(org.eclipse.core.runtime.IAdaptable, int)
- *
- * @param element
- * @param flags
- * @return
- */
- public String getEditString(IAdaptable element, int flags) {
- if(element instanceof IAdaptable) {
- final Property property = ((Property)((IAdaptable)element).getAdapter(EObject.class));
- final View view=((View)((IAdaptable)element).getAdapter(View.class));
- final EObject stereotypeApplication=((View)view.eContainer()).getElement();
- final Stereotype stereotype=UMLUtil.getStereotype(stereotypeApplication);
- final Element umlElement=UMLUtil.getBaseElement(stereotypeApplication);
-
-
- String result= StereotypeUtil.displayPropertyValue(stereotype, property, umlElement, "");
- if( result.contains("=")){
- result=result.substring(property.getName().length()+1);
- return result;
- }
- else{return "";}
-
- }
- return "<UNDEFINED>";
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getParseCommand(org.eclipse.core.runtime.IAdaptable, java.lang.String, int)
- *
- * @param element
- * @param newString
- * @param flags
- * @return
- */
- public ICommand getParseCommand(IAdaptable element, final String newString, int flags) {
- if(element instanceof IAdaptable) {
- final Property property = ((Property)((IAdaptable)element).getAdapter(EObject.class));
- final View view=((View)((IAdaptable)element).getAdapter(View.class));
- final EObject stereotypeApplication=((View)view.eContainer()).getElement();
- final Stereotype stereotype=UMLUtil.getStereotype(stereotypeApplication);
- final Element umlElement=UMLUtil.getBaseElement(stereotypeApplication);
- final Object oldValue= umlElement.getValue(stereotype, property.getName());
- ICommand cmd= new AbstractCommand("AppliedStereotypeProperty") {
-
- @Override
- protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- umlElement.setValue(stereotype, property.getName(), oldValue);
- return null;
- }
-
- @Override
- protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- umlElement.setValue(stereotype, property.getName(), newString);
- return null;
- }
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
- umlElement.setValue(stereotype, property.getName(), newString);
- return null;
-
- }
- };
- return cmd;
- }
- //TO Modify
- return UnexecutableCommand.INSTANCE;
- }
-
-
-
-
- /**
- *
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getPrintString(org.eclipse.core.runtime.IAdaptable, int)
- *
- * @param element
- * @param flags
- * @return
- */
- public String getPrintString(IAdaptable element, int flags) {
-
- if(element instanceof IAdaptable) {
- final Property property = ((Property)((IAdaptable)element).getAdapter(EObject.class));
- final View view=((View)((IAdaptable)element).getAdapter(View.class));
- final EObject stereotypeApplication=((View)view.eContainer()).getElement();
- final Stereotype stereotype=UMLUtil.getStereotype(stereotypeApplication);
- final Element umlElement=UMLUtil.getBaseElement(stereotypeApplication);
- if(stereotype!=null && property!=null && umlElement!=null){
- return StereotypeUtil.displayPropertyValue(stereotype, property, umlElement, "");
- }
- }
- return "<UNDEFINED>";
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isAffectingEvent(java.lang.Object, int)
- *
- * @param event
- * @param flags
- * @return
- */
- public boolean isAffectingEvent(Object event, int flags) {
- // TODO Auto-generated method stub
- return true;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isValidEditString(org.eclipse.core.runtime.IAdaptable, java.lang.String)
- *
- * @param element
- * @param editString
- * @return
- */
- public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
- return new ParserEditStatus("Papyrus Edition for property of stereotype", IParserEditStatus.OK, "");
- }
-
- @SuppressWarnings("rawtypes")
- public List getSemanticElementsBeingParsed(EObject element) {
- return new ArrayList();
- }
-
- public boolean areSemanticElementsAffected(EObject listener, Object notification) {
- return true;
- }
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.common.core.command.AbstractCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * this is a parser to display a slot in the diagram
+ *
+ */
+public class StereotypePropertyParser implements IParser, ISemanticParser {
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getCompletionProcessor(org.eclipse.core.runtime.IAdaptable)
+ *
+ * @param element
+ * @return
+ */
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getEditString(org.eclipse.core.runtime.IAdaptable, int)
+ *
+ * @param element
+ * @param flags
+ * @return
+ */
+ public String getEditString(IAdaptable element, int flags) {
+ if(element instanceof IAdaptable) {
+ final Property property = ((Property)((IAdaptable)element).getAdapter(EObject.class));
+ final View view=((View)((IAdaptable)element).getAdapter(View.class));
+ final EObject stereotypeApplication=((View)view.eContainer()).getElement();
+ final Stereotype stereotype=UMLUtil.getStereotype(stereotypeApplication);
+ final Element umlElement=UMLUtil.getBaseElement(stereotypeApplication);
+
+
+ String result= StereotypeUtil.displayPropertyValue(stereotype, property, umlElement, "");
+ if( result.contains("=")){
+ result=result.substring(property.getName().length()+1);
+ return result;
+ }
+ else{return "";}
+
+ }
+ return "<UNDEFINED>";
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getParseCommand(org.eclipse.core.runtime.IAdaptable, java.lang.String, int)
+ *
+ * @param element
+ * @param newString
+ * @param flags
+ * @return
+ */
+ public ICommand getParseCommand(IAdaptable element, final String newString, int flags) {
+ if(element instanceof IAdaptable) {
+ final Property property = ((Property)((IAdaptable)element).getAdapter(EObject.class));
+ final View view=((View)((IAdaptable)element).getAdapter(View.class));
+ final EObject stereotypeApplication=((View)view.eContainer()).getElement();
+ final Stereotype stereotype=UMLUtil.getStereotype(stereotypeApplication);
+ final Element umlElement=UMLUtil.getBaseElement(stereotypeApplication);
+ final Object oldValue= umlElement.getValue(stereotype, property.getName());
+ ICommand cmd= new AbstractCommand("AppliedStereotypeProperty") {
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ umlElement.setValue(stereotype, property.getName(), oldValue);
+ return null;
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ umlElement.setValue(stereotype, property.getName(), newString);
+ return null;
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ umlElement.setValue(stereotype, property.getName(), newString);
+ return null;
+
+ }
+ };
+ return cmd;
+ }
+ //TO Modify
+ return UnexecutableCommand.INSTANCE;
+ }
+
+
+
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#getPrintString(org.eclipse.core.runtime.IAdaptable, int)
+ *
+ * @param element
+ * @param flags
+ * @return
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+
+ if(element instanceof IAdaptable) {
+ final Property property = ((Property)((IAdaptable)element).getAdapter(EObject.class));
+ final View view=((View)((IAdaptable)element).getAdapter(View.class));
+ final EObject stereotypeApplication=((View)view.eContainer()).getElement();
+ final Stereotype stereotype=UMLUtil.getStereotype(stereotypeApplication);
+ final Element umlElement=UMLUtil.getBaseElement(stereotypeApplication);
+ if(stereotype!=null && property!=null && umlElement!=null){
+ return StereotypeUtil.displayPropertyValue(stereotype, property, umlElement, "");
+ }
+ }
+ return "<UNDEFINED>";
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isAffectingEvent(java.lang.Object, int)
+ *
+ * @param event
+ * @param flags
+ * @return
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.common.ui.services.parser.IParser#isValidEditString(org.eclipse.core.runtime.IAdaptable, java.lang.String)
+ *
+ * @param element
+ * @param editString
+ * @return
+ */
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ return new ParserEditStatus("Papyrus Edition for property of stereotype", IParserEditStatus.OK, "");
+ }
+
+ @SuppressWarnings("rawtypes")
+ public List getSemanticElementsBeingParsed(EObject element) {
+ return new ArrayList();
+ }
+
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ return true;
+ }
+
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AbstractAssociationEndParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AbstractAssociationEndParser.java
index c74cb65f9ec..1ab94f44176 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AbstractAssociationEndParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AbstractAssociationEndParser.java
@@ -1,108 +1,108 @@
-/****************************************************************************
- * 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:
- * Thibault Landre (Atos Origin) - Initial API and implementation
- *
- ****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser.custom;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.uml2.uml.Association;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * A specific parser to manage the property of association end.
- *
- * @author tlandre
- */
-public abstract class AbstractAssociationEndParser implements IParser {
-
- private final int memberEndIndex;
-
- public AbstractAssociationEndParser(int memberEndIndex) {
- this.memberEndIndex = memberEndIndex;
- }
-
- /**
- * Get the EStructuralFeature of the given notification
- *
- * @param notification
- * the notification
- * @return the EStructuralFeature
- */
- 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;
- }
-
- /**
- * {@inheritDoc}
- */
- public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getEditString(IAdaptable element, int flags) {
- return null;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /**
- * Get the property associated with the given IAdaptable and the
- * memberEndIndex .
- *
- * @param element
- * the given IAdaptable
- * @return the property associated or null if it can't be found.
- */
- protected Property doAdapt(IAdaptable element) {
- Object obj = element.getAdapter(EObject.class);
- Property property = null;
- if(obj instanceof Association) {
- Association association = (Association)obj;
- if(association.getMemberEnds() != null && association.getMemberEnds().size() > memberEndIndex)
- property = association.getMemberEnds().get(memberEndIndex);
- }
- return property;
- }
-
-}
+/****************************************************************************
+ * 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:
+ * Thibault Landre (Atos Origin) - Initial API and implementation
+ *
+ ****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser.custom;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Property;
+
+/**
+ * A specific parser to manage the property of association end.
+ *
+ * @author tlandre
+ */
+public abstract class AbstractAssociationEndParser implements IParser {
+
+ private final int memberEndIndex;
+
+ public AbstractAssociationEndParser(int memberEndIndex) {
+ this.memberEndIndex = memberEndIndex;
+ }
+
+ /**
+ * Get the EStructuralFeature of the given notification
+ *
+ * @param notification
+ * the notification
+ * @return the EStructuralFeature
+ */
+ 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;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public IContentAssistProcessor getCompletionProcessor(IAdaptable element) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getEditString(IAdaptable element, int flags) {
+ return null;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public ICommand getParseCommand(IAdaptable element, String newString, int flags) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public IParserEditStatus isValidEditString(IAdaptable element, String editString) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * Get the property associated with the given IAdaptable and the
+ * memberEndIndex .
+ *
+ * @param element
+ * the given IAdaptable
+ * @return the property associated or null if it can't be found.
+ */
+ protected Property doAdapt(IAdaptable element) {
+ Object obj = element.getAdapter(EObject.class);
+ Property property = null;
+ if(obj instanceof Association) {
+ Association association = (Association)obj;
+ if(association.getMemberEnds() != null && association.getMemberEnds().size() > memberEndIndex)
+ property = association.getMemberEnds().get(memberEndIndex);
+ }
+ return property;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationEndParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationEndParser.java
index daf79cd55e5..65479b9b7d1 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationEndParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationEndParser.java
@@ -1,90 +1,90 @@
-/****************************************************************************
- * 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:
- * Thibault Landre (Atos Origin) - Initial API and implementation
- *
- ****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser.custom;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * A parser to handle the displayed role of an association end
- *
- * @author tlandre
- */
-public class AssociationEndParser extends AbstractAssociationEndParser {
-
- /**
- *
- * @param index
- */
- public AssociationEndParser(int memberEndIndex) {
- super(memberEndIndex);
- }
-
- /**
- * Test if the model changed on one of the following property's attributes :
- * <ul>
- * <li>{@link org.eclipse.uml2.uml.UMLPackage#NAMED_ELEMENT__NAME <em>Name </em>}</li>
- * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__REDEFINED_PROPERTY
- * <em>Redefined Property</em>}</li>
- * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__SUBSETTED_PROPERTY
- * <em>Ordered Property </em>}</li>
- * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__IS_DERIVED <em>is Derived</em>}</li>
- * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__IS_DERIVED_UNION
- * <em>is Derived Union </em>}</li>
- * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__IS_ORDERED <em>is Ordered</em>}</li>
- * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__IS_UNIQUE <em>is Unique</em>}</li>
- * <li>{@link org.eclipse.uml2.uml.UMLPackage#NAMED_ELEMENT__VISIBILITY <em> Visibility</em>}</li>
- * <li>
- * {@link org.eclipse.uml2.uml.UMLPackage#STRUCTURAL_FEATURE__IS_READ_ONLY
- * <em>is ReadOnly </em>}</li>
- * </ul> {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
- EStructuralFeature feature = getEStructuralFeature(event);
-
- boolean isAffectingEvent = false;
- if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getProperty_RedefinedProperty().equals(feature) || UMLPackage.eINSTANCE.getProperty_SubsettedProperty().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerived().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerivedUnion().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getNamedElement_Visibility().equals(feature) || UMLPackage.eINSTANCE.getStructuralFeature_IsReadOnly().equals(feature)) {
- isAffectingEvent = true;
- }
- return isAffectingEvent;
-
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- Property property = doAdapt(element);
- StringBuffer displayedString = new StringBuffer();
- if(property != null) {
- // Visibility of the property
- displayedString.append(NamedElementUtil.getVisibilityAsSign(property));
- // isDerived
- displayedString.append(PropertyUtil.getDerived(property));
- // name
- if(property.getName() != null) {
- displayedString.append(property.getName());
- }
-
- // modifiers
- displayedString.append(PropertyUtil.getModifiersAsString(property, false));
- }
- return displayedString.toString();
- }
-
-}
+/****************************************************************************
+ * 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:
+ * Thibault Landre (Atos Origin) - Initial API and implementation
+ *
+ ****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser.custom;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * A parser to handle the displayed role of an association end
+ *
+ * @author tlandre
+ */
+public class AssociationEndParser extends AbstractAssociationEndParser {
+
+ /**
+ *
+ * @param index
+ */
+ public AssociationEndParser(int memberEndIndex) {
+ super(memberEndIndex);
+ }
+
+ /**
+ * Test if the model changed on one of the following property's attributes :
+ * <ul>
+ * <li>{@link org.eclipse.uml2.uml.UMLPackage#NAMED_ELEMENT__NAME <em>Name </em>}</li>
+ * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__REDEFINED_PROPERTY
+ * <em>Redefined Property</em>}</li>
+ * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__SUBSETTED_PROPERTY
+ * <em>Ordered Property </em>}</li>
+ * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__IS_DERIVED <em>is Derived</em>}</li>
+ * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__IS_DERIVED_UNION
+ * <em>is Derived Union </em>}</li>
+ * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__IS_ORDERED <em>is Ordered</em>}</li>
+ * <li>{@link org.eclipse.uml2.uml.UMLPackage#PROPERTY__IS_UNIQUE <em>is Unique</em>}</li>
+ * <li>{@link org.eclipse.uml2.uml.UMLPackage#NAMED_ELEMENT__VISIBILITY <em> Visibility</em>}</li>
+ * <li>
+ * {@link org.eclipse.uml2.uml.UMLPackage#STRUCTURAL_FEATURE__IS_READ_ONLY
+ * <em>is ReadOnly </em>}</li>
+ * </ul> {@inheritDoc}
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ EStructuralFeature feature = getEStructuralFeature(event);
+
+ boolean isAffectingEvent = false;
+ if(UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature) || UMLPackage.eINSTANCE.getProperty_RedefinedProperty().equals(feature) || UMLPackage.eINSTANCE.getProperty_SubsettedProperty().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerived().equals(feature) || UMLPackage.eINSTANCE.getProperty_IsDerivedUnion().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsOrdered().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_IsUnique().equals(feature) || UMLPackage.eINSTANCE.getNamedElement_Visibility().equals(feature) || UMLPackage.eINSTANCE.getStructuralFeature_IsReadOnly().equals(feature)) {
+ isAffectingEvent = true;
+ }
+ return isAffectingEvent;
+
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ Property property = doAdapt(element);
+ StringBuffer displayedString = new StringBuffer();
+ if(property != null) {
+ // Visibility of the property
+ displayedString.append(NamedElementUtil.getVisibilityAsSign(property));
+ // isDerived
+ displayedString.append(PropertyUtil.getDerived(property));
+ // name
+ if(property.getName() != null) {
+ displayedString.append(property.getName());
+ }
+
+ // modifiers
+ displayedString.append(PropertyUtil.getModifiersAsString(property, false));
+ }
+ return displayedString.toString();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationMultiplicityParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationMultiplicityParser.java
index 83b45535a4b..c9e8bfc4f31 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationMultiplicityParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/parser/custom/AssociationMultiplicityParser.java
@@ -1,84 +1,84 @@
-/****************************************************************************
- * 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:
- * Thibault Landre (Atos Origin) - Initial API and implementation
- *
- ****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.parser.custom;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * A specific parser to manage association end multiplicity.
- *
- * @author tlandre
- */
-public class AssociationMultiplicityParser extends AbstractAssociationEndParser {
-
- /**
- * Constructor
- *
- * @param memberEndIndex
- * the position of the attribute end.
- */
- public AssociationMultiplicityParser(int memberEndIndex) {
- super(memberEndIndex);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public String getPrintString(IAdaptable element, int flags) {
- Property property = doAdapt(element);
- StringBuffer displayedString = new StringBuffer();
- if(property != null) {
- if(property.getLower() == property.getUpper()) {
- displayedString.append(property.getLower());
- } else {
- displayedString.append(validValue(property.getLower()));
- displayedString.append("...");
- displayedString.append(validValue(property.getUpper()));
- }
- }
- return displayedString.toString();
- }
-
- /**
- * Convert the int to a valid String to display. If the value is -1, then it
- * is converted to *
- *
- * @param val
- * the int to convert to String
- * @return the valid string
- */
- private String validValue(int val) {
- return val == -1 ? "*" : String.valueOf(val);
- }
-
- /**
- *
- * {@inheritDoc}
- */
- public boolean isAffectingEvent(Object event, int flags) {
-
- boolean isAffectingEvent = false;
-
- EStructuralFeature feature = getEStructuralFeature(event);
-
- if(UMLPackage.eINSTANCE.getMultiplicityElement_Lower().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_Lower().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getLiteralInteger_Value().equals(feature) || UMLPackage.eINSTANCE.getLiteralUnlimitedNatural_Value().equals(feature)) {
- isAffectingEvent = true;
- }
- return isAffectingEvent;
- }
-
-}
+/****************************************************************************
+ * 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:
+ * Thibault Landre (Atos Origin) - Initial API and implementation
+ *
+ ****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.parser.custom;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * A specific parser to manage association end multiplicity.
+ *
+ * @author tlandre
+ */
+public class AssociationMultiplicityParser extends AbstractAssociationEndParser {
+
+ /**
+ * Constructor
+ *
+ * @param memberEndIndex
+ * the position of the attribute end.
+ */
+ public AssociationMultiplicityParser(int memberEndIndex) {
+ super(memberEndIndex);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ Property property = doAdapt(element);
+ StringBuffer displayedString = new StringBuffer();
+ if(property != null) {
+ if(property.getLower() == property.getUpper()) {
+ displayedString.append(property.getLower());
+ } else {
+ displayedString.append(validValue(property.getLower()));
+ displayedString.append("...");
+ displayedString.append(validValue(property.getUpper()));
+ }
+ }
+ return displayedString.toString();
+ }
+
+ /**
+ * Convert the int to a valid String to display. If the value is -1, then it
+ * is converted to *
+ *
+ * @param val
+ * the int to convert to String
+ * @return the valid string
+ */
+ private String validValue(int val) {
+ return val == -1 ? "*" : String.valueOf(val);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+
+ boolean isAffectingEvent = false;
+
+ EStructuralFeature feature = getEStructuralFeature(event);
+
+ if(UMLPackage.eINSTANCE.getMultiplicityElement_Lower().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_UpperValue().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_Lower().equals(feature) || UMLPackage.eINSTANCE.getMultiplicityElement_LowerValue().equals(feature) || UMLPackage.eINSTANCE.getLiteralInteger_Value().equals(feature) || UMLPackage.eINSTANCE.getLiteralUnlimitedNatural_Value().equals(feature)) {
+ isAffectingEvent = true;
+ }
+ return isAffectingEvent;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/CachedResourcesDocumentProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/CachedResourcesDocumentProvider.java
index 6fa9640694a..6c98f43e9f2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/CachedResourcesDocumentProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/CachedResourcesDocumentProvider.java
@@ -1,1071 +1,1071 @@
-/*******************************************************************************
- * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte,
- * Generalitat de la Comunitat Valenciana .
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
- *
- ******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceStatus;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.core.runtime.jobs.MultiRule;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.ui.URIEditorInput;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.transaction.NotificationFilter;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.util.MDTUtil;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.part.FileEditorInput;
-
-// TODO: Auto-generated Javadoc
-/**
- * Provides support to keep the <ResourceSet> unloaded when changing the <IEditorInput> or contents
- * of the <Document>. Will be shared among several <IEditorPart>s using the same <EditingDomain> and
- * the same <Resource>.
- *
- * @author <a href="mailto:fjcano@prodevelop.es">Francisco Javier Cano Muñoz</a>
- */
-public class CachedResourcesDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider {
-
- // //
- // XXX: keep resource in dispose
- /** The unload on dispose. */
- private boolean unloadOnDispose = true;
-
- /**
- * The editing domain identifier.
- */
- private String editingDomainID = null;
-
- /**
- * Resource changes because of a save
- */
- private boolean changingResourceBySave = true;
-
- @Deprecated
- public CachedResourcesDocumentProvider() {
- editingDomainID = "";
- return;
- }
-
- public CachedResourcesDocumentProvider(String editingDomainID) {
- this.editingDomainID = editingDomainID;
- }
-
- /**
- * Checks if is unload on dispose.
- *
- * @return true, if is unload on dispose
- */
- // @unused
- public boolean isUnloadOnDispose() {
- return unloadOnDispose;
- }
-
- /**
- * Sets the unload on dispose.
- *
- * @param unloadOnDispose
- * the new unload on dispose
- */
- public void setUnloadOnDispose(boolean unloadOnDispose) {
- this.unloadOnDispose = unloadOnDispose;
- }
-
- synchronized public void setChangingResourceBySave(boolean changingResourceBySave) {
- this.changingResourceBySave = changingResourceBySave;
- }
-
- public boolean isChangingResourceBySave() {
- return changingResourceBySave;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.gmf.runtime.diagram.ui.resources.editor.document.
- * AbstractDocumentProvider#disposeElementInfo(java.lang.Object,
- * org.eclipse.
- * gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider
- * .ElementInfo)
- */
- @Override
- protected void disposeElementInfo(Object element, ElementInfo info) {
- if(info instanceof CachedResourceSetInfo) {
- CachedResourceSetInfo resourceSetInfo = (CachedResourceSetInfo)info;
- resourceSetInfo.disposeButUnload();
- }
- super.disposeElementInfo(element, info);
- }
-
- /**
- * Creates the editing domain.
- *
- * @param editorInput
- * the editor input
- *
- * @return the transactional editing domain
- */
- protected TransactionalEditingDomain createEditingDomain(IEditorInput editorInput) {
- String id = getEditingDomainID();
- String uri = null;
-
- if(editorInput instanceof FileEditorInput) {
- uri = ((FileEditorInput)editorInput).getPath().toString();
- uri = MDTUtil.fullFilePathToResourceURI(uri).toString();
- } else if(editorInput instanceof URIEditorInput) {
- uri = ((URIEditorInput)editorInput).getURI().trimFragment().toString();
- }
- TransactionalEditingDomain editingDomain = EditingDomainRegistry.getInstance().get(id, uri);
- return editingDomain;
- }
-
- /**
- * Compute modification stamp.
- *
- * @param info
- * the info
- *
- * @return the long
- */
- protected long computeModificationStamp(CachedResourceSetInfo info) {
- int result = 0;
- for(Object element : info.getResourceSet().getResources()) {
- Resource nextResource = (Resource)element;
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- if(file.getLocation() != null) {
- result += file.getLocation().toFile().lastModified();
- } else {
- result += file.getModificationStamp();
- }
- }
- }
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.gmf.runtime.diagram.ui.resources.editor.document.
- * AbstractDocumentProvider#createEmptyDocument()
- */
- @Override
- protected IDocument createEmptyDocument() {
- DiagramDocument document = new DiagramDocument();
- document.setEditingDomain(createEditingDomain(null));
- return document;
- }
-
- /**
- * Creates the empty document.
- *
- * @param editorInput
- * the editor input
- *
- * @return the i document
- */
- protected IDocument createEmptyDocument(IEditorInput editorInput) {
- DiagramDocument document = new DiagramDocument();
- document.setEditingDomain(createEditingDomain(editorInput));
- return document;
- }
-
- // //
- // XXX:
- /**
- * The Class CachedResourceSetInfo.
- */
- protected class CachedResourceSetInfo extends AbstractDocumentProvider.ElementInfo {
-
- /** The my modification stamp. */
- private long myModificationStamp = IResource.NULL_STAMP;
-
- /** The my synchronizer. */
- private WorkspaceSynchronizer mySynchronizer;
-
- /** The my un synchronized resources. */
- private final Collection myUnSynchronizedResources = new ArrayList();
-
- /** The my document. */
- private final IDiagramDocument myDocument;
-
- /** The my editor input. */
- private final IEditorInput myEditorInput;
-
- /** The my update cache. */
- private boolean myUpdateCache = true;
-
- /** The my modifiable. */
- private boolean myModifiable = false;
-
- /** The my read only. */
- private boolean myReadOnly = true;
-
- /** The my resource set listener. */
- private final ResourceSetModificationListener myResourceSetListener;
-
- /**
- * Instantiates a new cached resource set info.
- *
- * @param document
- * the document
- * @param editorInput
- * the editor input
- */
- public CachedResourceSetInfo(IDiagramDocument document, IEditorInput editorInput) {
- super(document);
- myDocument = document;
- myEditorInput = editorInput;
- startResourceListening();
- myResourceSetListener = new ResourceSetModificationListener(this);
- getResourceSet().eAdapters().add(myResourceSetListener);
- }
-
- /**
- * Gets the modification stamp.
- *
- * @return the modification stamp
- */
- // @unused
- public long getModificationStamp() {
- return myModificationStamp;
- }
-
- /**
- * Sets the modification stamp.
- *
- * @param modificationStamp
- * the modification stamp
- */
- public void setModificationStamp(long modificationStamp) {
- myModificationStamp = modificationStamp;
- }
-
- /**
- * Gets the editing domain.
- *
- * @return the editing domain
- */
- public TransactionalEditingDomain getEditingDomain() {
- return myDocument.getEditingDomain();
- }
-
- /**
- * Gets the resource set.
- *
- * @return the resource set
- */
- public ResourceSet getResourceSet() {
- return getEditingDomain().getResourceSet();
- }
-
- /**
- * Gets the editor input.
- *
- * @return the editor input
- */
- public IEditorInput getEditorInput() {
- return myEditorInput;
- }
-
- /**
- * Dispose.
- */
- public void disposeButUnload() {
- stopResourceListening();
- getResourceSet().eAdapters().remove(myResourceSetListener);
- }
-
- /**
- * Dispose.
- */
- // @unused
- public void dispose() {
- stopResourceListening();
- getResourceSet().eAdapters().remove(myResourceSetListener);
- for(Object element : getResourceSet().getResources()) {
- Resource resource = (Resource)element;
- resource.unload();
- }
- }
-
- /**
- * Checks if is synchronized.
- *
- * @return true, if checks if is synchronized
- */
- public boolean isSynchronized() {
- return myUnSynchronizedResources.size() == 0;
- }
-
- /**
- * Sets the un synchronized.
- *
- * @param resource
- * the resource
- */
- public void setUnSynchronized(Resource resource) {
- myUnSynchronizedResources.add(resource);
- }
-
- /**
- * Sets the synchronized.
- *
- * @param resource
- * the resource
- */
- public void setSynchronized(Resource resource) {
- myUnSynchronizedResources.remove(resource);
- }
-
- /**
- * Stop resource listening.
- */
- public final void stopResourceListening() {
- mySynchronizer.dispose();
- mySynchronizer = null;
- }
-
- /**
- * Start resource listening.
- */
- public final void startResourceListening() {
- mySynchronizer = new WorkspaceSynchronizer(getEditingDomain(), new SynchronizerDelegate());
- }
-
- /**
- * Checks if is update cache.
- *
- * @return true, if checks if is update cache
- */
- public boolean isUpdateCache() {
- return myUpdateCache;
- }
-
- /**
- * Sets the update cache.
- *
- * @param update
- * the update
- */
- public void setUpdateCache(boolean update) {
- myUpdateCache = update;
- }
-
- /**
- * Checks if is modifiable.
- *
- * @return true, if checks if is modifiable
- */
- public boolean isModifiable() {
- return myModifiable;
- }
-
- /**
- * Sets the modifiable.
- *
- * @param modifiable
- * the modifiable
- */
- public void setModifiable(boolean modifiable) {
- myModifiable = modifiable;
- }
-
- /**
- * Checks if is read only.
- *
- * @return true, if checks if is read only
- */
- public boolean isReadOnly() {
- return myReadOnly;
- }
-
- /**
- * Sets the read only.
- *
- * @param readOnly
- * the read only
- */
- public void setReadOnly(boolean readOnly) {
- myReadOnly = readOnly;
- }
-
- /**
- * Gets the loaded resources iterator.
- *
- * @return the loaded resources iterator
- */
- public Iterator getLoadedResourcesIterator() {
- return new ArrayList(getResourceSet().getResources()).iterator();
- }
-
- /**
- * The Class SynchronizerDelegate.
- */
- private class SynchronizerDelegate implements WorkspaceSynchronizer.Delegate {
-
- /**
- * Dispose.
- */
- public void dispose() {
- }
-
- /**
- * Handle resource changed.
- *
- * @param resource
- * the resource
- *
- * @return true, if handle resource changed
- */
- public boolean handleResourceChanged(final Resource resource) {
- synchronized(CachedResourceSetInfo.this) {
- // fjcano : if we are changing the resource in an internal
- // save, we need not mark it as unsynchronized or reload the
- // resource.
- if(CachedResourcesDocumentProvider.this.isChangingResourceBySave()) {
- return true;
- }
- // fjcano : if we get here the resource was modified
- // externally.
- if(CachedResourceSetInfo.this.fCanBeSaved) {
- CachedResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- handleElementChanged(CachedResourceSetInfo.this, resource, null);
- }
- });
- return true;
- }
-
- /**
- * Handle resource deleted.
- *
- * @param resource
- * the resource
- *
- * @return true, if handle resource deleted
- */
- public boolean handleResourceDeleted(Resource resource) {
- synchronized(CachedResourceSetInfo.this) {
- if(CachedResourceSetInfo.this.fCanBeSaved) {
- CachedResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- fireElementDeleted(CachedResourceSetInfo.this.getEditorInput());
- }
- });
- return true;
- }
-
- /**
- * Handle resource moved.
- *
- * @param resource
- * the resource
- * @param newURI
- * the new uri
- *
- * @return true, if handle resource moved
- */
- public boolean handleResourceMoved(Resource resource, final URI newURI) {
- synchronized(CachedResourceSetInfo.this) {
- if(CachedResourceSetInfo.this.fCanBeSaved) {
- CachedResourceSetInfo.this.setUnSynchronized(resource);
- return true;
- }
- }
- if(myDocument.getDiagram().eResource() == resource) {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- handleElementMoved(CachedResourceSetInfo.this.getEditorInput(), newURI);
- }
- });
- } else {
- handleResourceDeleted(resource);
- }
- return true;
- }
-
- }
-
- }
-
- /**
- * The listener interface for receiving resourceSetModification events. The
- * class that is interested in processing a resourceSetModification event
- * implements this interface, and the object created with that class is
- * registered with a component using the component's <code>addResourceSetModificationListener<code> method. When
- * the resourceSetModification event occurs, that object's appropriate
- * method is invoked.
- *
- * @see ResourceSetModificationEvent
- */
- private class ResourceSetModificationListener extends EContentAdapter {
-
- /** The my modified filter. */
- private final NotificationFilter myModifiedFilter;
-
- /** The my info. */
- private final CachedResourceSetInfo myInfo;
-
- /**
- * The Constructor.
- *
- * @param info
- * the info
- */
- public ResourceSetModificationListener(CachedResourceSetInfo info) {
- myInfo = info;
- myModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)).and(NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED));
- }
-
- /**
- * Notify changed.
- *
- * @param notification
- * the notification
- */
- @Override
- public void notifyChanged(Notification notification) {
- if(notification.getNotifier() instanceof ResourceSet) {
- super.notifyChanged(notification);
- }
- if(!notification.isTouch() && myModifiedFilter.matches(notification)) {
- if(notification.getNotifier() instanceof Resource) {
- Resource resource = (Resource)notification.getNotifier();
- if(resource.isLoaded()) {
- boolean modified = false;
- for(Iterator it = myInfo.getResourceSet().getResources().iterator(); it.hasNext() && !modified;) {
- Resource nextResource = (Resource)it.next();
- if(nextResource.isLoaded()) {
- modified = nextResource.isModified();
- }
- }
- boolean dirtyStateChanged = false;
- synchronized(myInfo) {
- if(modified != myInfo.fCanBeSaved) {
- myInfo.fCanBeSaved = modified;
- dirtyStateChanged = true;
- }
- if(!resource.isModified()) {
- myInfo.setSynchronized(resource);
- }
- }
- if(dirtyStateChanged) {
- fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
-
- if(!modified) {
- myInfo.setModificationStamp(computeModificationStamp(myInfo));
- }
- }
- }
- }
- }
- }
-
- }
-
- // // General and common DocumentProvider code for GMF diagrams ////
-
- @Override
- protected ElementInfo createElementInfo(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind("Messages.SqlmodelDocumentProvider_IncorrectInputError", new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- IEditorInput editorInput = (IEditorInput)element;
- IDiagramDocument document = (IDiagramDocument)createDocument(editorInput);
-
- CachedResourceSetInfo info = new CachedResourceSetInfo(document, editorInput);
- info.setModificationStamp(computeModificationStamp(info));
- info.fStatus = null;
- return info;
- }
-
- @Override
- protected IDocument createDocument(Object element) throws CoreException {
- if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind("Messages.SqlmodelDocumentProvider_IncorrectInputError", new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- IDocument document = createEmptyDocument((IEditorInput)element);
- setDocumentContent(document, (IEditorInput)element);
- setupDocument(element, document);
- return document;
- }
-
- /**
- * Sets up the given document as it would be provided for the given element.
- * The content of the document is not changed. This default implementation
- * is empty. Subclasses may reimplement.
- */
- protected void setupDocument(Object element, IDocument document) {
- // for subclasses
- }
-
- protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
- TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
- if(element instanceof FileEditorInput) {
- IStorage storage = ((FileEditorInput)element).getStorage();
- Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor());
- document.setContent(diagram);
- } else if(element instanceof URIEditorInput) {
- URI uri = ((URIEditorInput)element).getURI();
- Resource resource = null;
- try {
- resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
- if(resource == null) {
- resource = domain.getResourceSet().createResource(uri.trimFragment());
- }
- if(!resource.isLoaded()) {
- try {
- Map options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
- resource.load(options);
- } catch (IOException e) {
- resource.unload();
- throw e;
- }
- }
- if(uri.fragment() != null) {
- EObject rootElement = resource.getEObject(uri.fragment());
- if(rootElement instanceof Diagram) {
- document.setContent(rootElement);
- return;
- }
- } else {
- for(Object rootElement : resource.getContents()) {
- if(rootElement instanceof Diagram) {
- document.setContent(rootElement);
- return;
- }
- }
- }
- throw new RuntimeException("Messages.SqlmodelDocumentProvider_NoDiagramInResourceError");
- } catch (Exception e) {
- CoreException thrownExcp = null;
- if(e instanceof CoreException) {
- thrownExcp = (CoreException)e;
- } else {
- String msg = e.getLocalizedMessage();
- thrownExcp = new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, msg != null ? msg : "Messages.SqlmodelDocumentProvider_DiagramLoadingError", e));
- }
- throw thrownExcp;
- }
- } else {
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind("Messages.SqlmodelDocumentProvider_IncorrectInputError", new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- }
-
- @Override
- public long getModificationStamp(Object element) {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- return computeModificationStamp(info);
- }
- return super.getModificationStamp(element);
- }
-
- @Override
- public boolean isDeleted(Object element) {
- IDiagramDocument document = getDiagramDocument(element);
- if(document != null) {
- Resource diagramResource = document.getDiagram().eResource();
- if(diagramResource != null) {
- IFile file = WorkspaceSynchronizer.getFile(diagramResource);
- return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
- }
- }
- return super.isDeleted(element);
- }
-
- public CachedResourceSetInfo getResourceSetInfo(Object editorInput) {
- return (CachedResourceSetInfo)super.getElementInfo(editorInput);
- }
-
- @Override
- protected void doValidateState(Object element, Object computationContext) throws CoreException {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- Collection files2Validate = new ArrayList();
- for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
- files2Validate.add(file);
- }
- }
- ResourcesPlugin.getWorkspace().validateEdit((IFile[])files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
- }
-
- super.doValidateState(element, computationContext);
- }
-
- @Override
- public boolean isReadOnly(Object element) {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- Activator.getDefault().logError("Messages.SqlmodelDocumentProvider_isModifiable", ex);
- }
- }
- return info.isReadOnly();
- }
- return super.isReadOnly(element);
- }
-
- @Override
- public boolean isModifiable(Object element) {
- if(!isStateValidated(element)) {
- if(element instanceof FileEditorInput || element instanceof URIEditorInput) {
- return true;
- }
- }
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(info.isUpdateCache()) {
- try {
- updateCache(element);
- } catch (CoreException ex) {
- Activator.getDefault().logError("Messages.SqlmodelDocumentProvider_isModifiable", ex);
- }
- }
- return info.isModifiable();
- }
- return super.isModifiable(element);
- }
-
- protected void updateCache(Object element) throws CoreException {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null && file.isReadOnly()) {
- info.setReadOnly(true);
- info.setModifiable(false);
- return;
- }
- }
- info.setReadOnly(false);
- info.setModifiable(true);
- return;
- }
- }
-
- @Override
- protected void doUpdateStateCache(Object element) throws CoreException {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- info.setUpdateCache(true);
- }
- super.doUpdateStateCache(element);
- }
-
- @Override
- public boolean isSynchronized(Object element) {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- return info.isSynchronized();
- }
- return super.isSynchronized(element);
- }
-
- @Override
- protected ISchedulingRule getResetRule(Object element) {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- Collection rules = new ArrayList();
- for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- @Override
- protected ISchedulingRule getSaveRule(Object element) {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- Collection rules = new ArrayList();
- for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(computeSchedulingRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- @Override
- protected ISchedulingRule getSynchronizeRule(Object element) {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- Collection rules = new ArrayList();
- for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
- }
- }
- return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
- }
- return null;
- }
-
- @Override
- protected ISchedulingRule getValidateStateRule(Object element) {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- Collection files = new ArrayList();
- for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- IFile file = WorkspaceSynchronizer.getFile(nextResource);
- if(file != null) {
- files.add(file);
- }
- }
- return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule((IFile[])files.toArray(new IFile[files.size()]));
- }
- return null;
- }
-
- private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
- if(toCreateOrModify.exists()) {
- return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
- }
-
- IResource parent = toCreateOrModify;
- do {
- toCreateOrModify = parent;
- parent = toCreateOrModify.getParent();
- } while(parent != null && !parent.exists());
-
- return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
- }
-
- @Override
- protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- handleElementChanged(info, nextResource, monitor);
- }
- return;
- }
- super.doSynchronize(element, monitor);
- }
-
- @Override
- protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
- try {
- // fjcano : we are modifying the resource by an internal save.
- setChangingResourceBySave(true);
- CachedResourceSetInfo info = getResourceSetInfo(element);
- if(info != null) {
- if(!overwrite && !info.isSynchronized()) {
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, "Messages.SqlmodelDocumentProvider_UnsynchronizedFileSaveError", null));
- }
- info.stopResourceListening();
- fireElementStateChanging(element);
- try {
- monitor.beginTask("Messages.SqlmodelDocumentProvider_SaveDiagramTask", info.getResourceSet().getResources().size() + 1); // "Saving diagram"
- for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
- Resource nextResource = (Resource)it.next();
- monitor.setTaskName(NLS.bind("Messages.SqlmodelDocumentProvider_SaveNextResourceTask", nextResource.getURI()));
- if(nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
- try {
- nextResource.save(MDTUtil.getSaveOptions());
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, EditorStatusCodes.RESOURCE_FAILURE, e.getLocalizedMessage(), null));
- }
- }
- monitor.worked(1);
- }
- monitor.done();
- info.setModificationStamp(computeModificationStamp(info));
- } catch (RuntimeException x) {
- fireElementStateChangeFailed(element);
- throw x;
- } finally {
- info.startResourceListening();
- }
- } else {
- URI newResoruceURI;
- List affectedFiles = null;
- if(element instanceof FileEditorInput) {
- IFile newFile = ((FileEditorInput)element).getFile();
- affectedFiles = Collections.singletonList(newFile);
- newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true);
- } else if(element instanceof URIEditorInput) {
- newResoruceURI = ((URIEditorInput)element).getURI();
- } else {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind("Messages.SqlmodelDocumentProvider_IncorrectInputError", new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
- null));
- }
- if(false == document instanceof IDiagramDocument) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }
- IDiagramDocument diagramDocument = (IDiagramDocument)document;
- final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
- final Diagram diagramCopy = (Diagram)EcoreUtil.copy(diagramDocument.getDiagram());
- try {
- new AbstractTransactionalCommand(diagramDocument.getEditingDomain(), NLS.bind("Messages.SqlmodelDocumentProvider_SaveAsOperation", diagramCopy.getName()), affectedFiles) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- newResource.getContents().add(diagramCopy);
- return CommandResult.newOKCommandResult();
- }
- }.execute(monitor, null);
- newResource.save(MDTUtil.getSaveOptions());
- } catch (ExecutionException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, e.getLocalizedMessage(), null));
- } catch (IOException e) {
- fireElementStateChangeFailed(element);
- throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, e.getLocalizedMessage(), null));
- }
- newResource.unload();
- }
- } finally {
- // fjcano : the internal modification ended.
- setChangingResourceBySave(false);
- }
- }
-
- protected void handleElementChanged(CachedResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
- if(isChangingResourceBySave() == false) {
- IFile file = WorkspaceSynchronizer.getFile(changedResource);
- if(file != null) {
- try {
- file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- } catch (CoreException ex) {
- Activator.getDefault().logError("Messages.SqlmodelDocumentProvider_handleElementContentChanged", ex);
- }
- }
- changedResource.unload();
-
- fireElementContentAboutToBeReplaced(info.getEditorInput());
- removeUnchangedElementListeners(info.getEditorInput(), info);
- info.fStatus = null;
- try {
- setDocumentContent(info.fDocument, info.getEditorInput());
- } catch (CoreException e) {
- info.fStatus = e.getStatus();
- }
- if(!info.fCanBeSaved) {
- info.setModificationStamp(computeModificationStamp(info));
- }
- addUnchangedElementListeners(info.getEditorInput(), info);
- fireElementContentReplaced(info.getEditorInput());
- }
- }
-
- protected void handleElementMoved(IEditorInput input, URI uri) {
- if(input instanceof FileEditorInput) {
- IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1));
- fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile));
- return;
- }
- // TODO: append suffix to the URI! (use diagram as a parameter)
- fireElementMoved(input, new URIEditorInput(uri));
- }
-
- public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
- return editorInput;
- }
-
- public IDiagramDocument getDiagramDocument(Object element) {
- IDocument doc = getDocument(element);
- if(doc instanceof IDiagramDocument) {
- return (IDiagramDocument)doc;
- }
- return null;
- }
-
- @Override
- protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
- return null;
- }
-
- protected String getEditingDomainID() {
- return editingDomainID;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2008 Conselleria de Infraestructuras y Transporte,
+ * Generalitat de la Comunitat Valenciana .
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Francisco Javier Cano Muñoz (Prodevelop) - initial API implementation
+ *
+ ******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.core.runtime.jobs.MultiRule;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.ui.URIEditorInput;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.transaction.NotificationFilter;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DiagramDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.EditorStatusCodes;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.jface.operation.IRunnableContext;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.util.MDTUtil;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+
+// TODO: Auto-generated Javadoc
+/**
+ * Provides support to keep the <ResourceSet> unloaded when changing the <IEditorInput> or contents
+ * of the <Document>. Will be shared among several <IEditorPart>s using the same <EditingDomain> and
+ * the same <Resource>.
+ *
+ * @author <a href="mailto:fjcano@prodevelop.es">Francisco Javier Cano Muñoz</a>
+ */
+public class CachedResourcesDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider {
+
+ // //
+ // XXX: keep resource in dispose
+ /** The unload on dispose. */
+ private boolean unloadOnDispose = true;
+
+ /**
+ * The editing domain identifier.
+ */
+ private String editingDomainID = null;
+
+ /**
+ * Resource changes because of a save
+ */
+ private boolean changingResourceBySave = true;
+
+ @Deprecated
+ public CachedResourcesDocumentProvider() {
+ editingDomainID = "";
+ return;
+ }
+
+ public CachedResourcesDocumentProvider(String editingDomainID) {
+ this.editingDomainID = editingDomainID;
+ }
+
+ /**
+ * Checks if is unload on dispose.
+ *
+ * @return true, if is unload on dispose
+ */
+ // @unused
+ public boolean isUnloadOnDispose() {
+ return unloadOnDispose;
+ }
+
+ /**
+ * Sets the unload on dispose.
+ *
+ * @param unloadOnDispose
+ * the new unload on dispose
+ */
+ public void setUnloadOnDispose(boolean unloadOnDispose) {
+ this.unloadOnDispose = unloadOnDispose;
+ }
+
+ synchronized public void setChangingResourceBySave(boolean changingResourceBySave) {
+ this.changingResourceBySave = changingResourceBySave;
+ }
+
+ public boolean isChangingResourceBySave() {
+ return changingResourceBySave;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.gmf.runtime.diagram.ui.resources.editor.document.
+ * AbstractDocumentProvider#disposeElementInfo(java.lang.Object,
+ * org.eclipse.
+ * gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider
+ * .ElementInfo)
+ */
+ @Override
+ protected void disposeElementInfo(Object element, ElementInfo info) {
+ if(info instanceof CachedResourceSetInfo) {
+ CachedResourceSetInfo resourceSetInfo = (CachedResourceSetInfo)info;
+ resourceSetInfo.disposeButUnload();
+ }
+ super.disposeElementInfo(element, info);
+ }
+
+ /**
+ * Creates the editing domain.
+ *
+ * @param editorInput
+ * the editor input
+ *
+ * @return the transactional editing domain
+ */
+ protected TransactionalEditingDomain createEditingDomain(IEditorInput editorInput) {
+ String id = getEditingDomainID();
+ String uri = null;
+
+ if(editorInput instanceof FileEditorInput) {
+ uri = ((FileEditorInput)editorInput).getPath().toString();
+ uri = MDTUtil.fullFilePathToResourceURI(uri).toString();
+ } else if(editorInput instanceof URIEditorInput) {
+ uri = ((URIEditorInput)editorInput).getURI().trimFragment().toString();
+ }
+ TransactionalEditingDomain editingDomain = EditingDomainRegistry.getInstance().get(id, uri);
+ return editingDomain;
+ }
+
+ /**
+ * Compute modification stamp.
+ *
+ * @param info
+ * the info
+ *
+ * @return the long
+ */
+ protected long computeModificationStamp(CachedResourceSetInfo info) {
+ int result = 0;
+ for(Object element : info.getResourceSet().getResources()) {
+ Resource nextResource = (Resource)element;
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ if(file.getLocation() != null) {
+ result += file.getLocation().toFile().lastModified();
+ } else {
+ result += file.getModificationStamp();
+ }
+ }
+ }
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.gmf.runtime.diagram.ui.resources.editor.document.
+ * AbstractDocumentProvider#createEmptyDocument()
+ */
+ @Override
+ protected IDocument createEmptyDocument() {
+ DiagramDocument document = new DiagramDocument();
+ document.setEditingDomain(createEditingDomain(null));
+ return document;
+ }
+
+ /**
+ * Creates the empty document.
+ *
+ * @param editorInput
+ * the editor input
+ *
+ * @return the i document
+ */
+ protected IDocument createEmptyDocument(IEditorInput editorInput) {
+ DiagramDocument document = new DiagramDocument();
+ document.setEditingDomain(createEditingDomain(editorInput));
+ return document;
+ }
+
+ // //
+ // XXX:
+ /**
+ * The Class CachedResourceSetInfo.
+ */
+ protected class CachedResourceSetInfo extends AbstractDocumentProvider.ElementInfo {
+
+ /** The my modification stamp. */
+ private long myModificationStamp = IResource.NULL_STAMP;
+
+ /** The my synchronizer. */
+ private WorkspaceSynchronizer mySynchronizer;
+
+ /** The my un synchronized resources. */
+ private final Collection myUnSynchronizedResources = new ArrayList();
+
+ /** The my document. */
+ private final IDiagramDocument myDocument;
+
+ /** The my editor input. */
+ private final IEditorInput myEditorInput;
+
+ /** The my update cache. */
+ private boolean myUpdateCache = true;
+
+ /** The my modifiable. */
+ private boolean myModifiable = false;
+
+ /** The my read only. */
+ private boolean myReadOnly = true;
+
+ /** The my resource set listener. */
+ private final ResourceSetModificationListener myResourceSetListener;
+
+ /**
+ * Instantiates a new cached resource set info.
+ *
+ * @param document
+ * the document
+ * @param editorInput
+ * the editor input
+ */
+ public CachedResourceSetInfo(IDiagramDocument document, IEditorInput editorInput) {
+ super(document);
+ myDocument = document;
+ myEditorInput = editorInput;
+ startResourceListening();
+ myResourceSetListener = new ResourceSetModificationListener(this);
+ getResourceSet().eAdapters().add(myResourceSetListener);
+ }
+
+ /**
+ * Gets the modification stamp.
+ *
+ * @return the modification stamp
+ */
+ // @unused
+ public long getModificationStamp() {
+ return myModificationStamp;
+ }
+
+ /**
+ * Sets the modification stamp.
+ *
+ * @param modificationStamp
+ * the modification stamp
+ */
+ public void setModificationStamp(long modificationStamp) {
+ myModificationStamp = modificationStamp;
+ }
+
+ /**
+ * Gets the editing domain.
+ *
+ * @return the editing domain
+ */
+ public TransactionalEditingDomain getEditingDomain() {
+ return myDocument.getEditingDomain();
+ }
+
+ /**
+ * Gets the resource set.
+ *
+ * @return the resource set
+ */
+ public ResourceSet getResourceSet() {
+ return getEditingDomain().getResourceSet();
+ }
+
+ /**
+ * Gets the editor input.
+ *
+ * @return the editor input
+ */
+ public IEditorInput getEditorInput() {
+ return myEditorInput;
+ }
+
+ /**
+ * Dispose.
+ */
+ public void disposeButUnload() {
+ stopResourceListening();
+ getResourceSet().eAdapters().remove(myResourceSetListener);
+ }
+
+ /**
+ * Dispose.
+ */
+ // @unused
+ public void dispose() {
+ stopResourceListening();
+ getResourceSet().eAdapters().remove(myResourceSetListener);
+ for(Object element : getResourceSet().getResources()) {
+ Resource resource = (Resource)element;
+ resource.unload();
+ }
+ }
+
+ /**
+ * Checks if is synchronized.
+ *
+ * @return true, if checks if is synchronized
+ */
+ public boolean isSynchronized() {
+ return myUnSynchronizedResources.size() == 0;
+ }
+
+ /**
+ * Sets the un synchronized.
+ *
+ * @param resource
+ * the resource
+ */
+ public void setUnSynchronized(Resource resource) {
+ myUnSynchronizedResources.add(resource);
+ }
+
+ /**
+ * Sets the synchronized.
+ *
+ * @param resource
+ * the resource
+ */
+ public void setSynchronized(Resource resource) {
+ myUnSynchronizedResources.remove(resource);
+ }
+
+ /**
+ * Stop resource listening.
+ */
+ public final void stopResourceListening() {
+ mySynchronizer.dispose();
+ mySynchronizer = null;
+ }
+
+ /**
+ * Start resource listening.
+ */
+ public final void startResourceListening() {
+ mySynchronizer = new WorkspaceSynchronizer(getEditingDomain(), new SynchronizerDelegate());
+ }
+
+ /**
+ * Checks if is update cache.
+ *
+ * @return true, if checks if is update cache
+ */
+ public boolean isUpdateCache() {
+ return myUpdateCache;
+ }
+
+ /**
+ * Sets the update cache.
+ *
+ * @param update
+ * the update
+ */
+ public void setUpdateCache(boolean update) {
+ myUpdateCache = update;
+ }
+
+ /**
+ * Checks if is modifiable.
+ *
+ * @return true, if checks if is modifiable
+ */
+ public boolean isModifiable() {
+ return myModifiable;
+ }
+
+ /**
+ * Sets the modifiable.
+ *
+ * @param modifiable
+ * the modifiable
+ */
+ public void setModifiable(boolean modifiable) {
+ myModifiable = modifiable;
+ }
+
+ /**
+ * Checks if is read only.
+ *
+ * @return true, if checks if is read only
+ */
+ public boolean isReadOnly() {
+ return myReadOnly;
+ }
+
+ /**
+ * Sets the read only.
+ *
+ * @param readOnly
+ * the read only
+ */
+ public void setReadOnly(boolean readOnly) {
+ myReadOnly = readOnly;
+ }
+
+ /**
+ * Gets the loaded resources iterator.
+ *
+ * @return the loaded resources iterator
+ */
+ public Iterator getLoadedResourcesIterator() {
+ return new ArrayList(getResourceSet().getResources()).iterator();
+ }
+
+ /**
+ * The Class SynchronizerDelegate.
+ */
+ private class SynchronizerDelegate implements WorkspaceSynchronizer.Delegate {
+
+ /**
+ * Dispose.
+ */
+ public void dispose() {
+ }
+
+ /**
+ * Handle resource changed.
+ *
+ * @param resource
+ * the resource
+ *
+ * @return true, if handle resource changed
+ */
+ public boolean handleResourceChanged(final Resource resource) {
+ synchronized(CachedResourceSetInfo.this) {
+ // fjcano : if we are changing the resource in an internal
+ // save, we need not mark it as unsynchronized or reload the
+ // resource.
+ if(CachedResourcesDocumentProvider.this.isChangingResourceBySave()) {
+ return true;
+ }
+ // fjcano : if we get here the resource was modified
+ // externally.
+ if(CachedResourceSetInfo.this.fCanBeSaved) {
+ CachedResourceSetInfo.this.setUnSynchronized(resource);
+ return true;
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ handleElementChanged(CachedResourceSetInfo.this, resource, null);
+ }
+ });
+ return true;
+ }
+
+ /**
+ * Handle resource deleted.
+ *
+ * @param resource
+ * the resource
+ *
+ * @return true, if handle resource deleted
+ */
+ public boolean handleResourceDeleted(Resource resource) {
+ synchronized(CachedResourceSetInfo.this) {
+ if(CachedResourceSetInfo.this.fCanBeSaved) {
+ CachedResourceSetInfo.this.setUnSynchronized(resource);
+ return true;
+ }
+ }
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ fireElementDeleted(CachedResourceSetInfo.this.getEditorInput());
+ }
+ });
+ return true;
+ }
+
+ /**
+ * Handle resource moved.
+ *
+ * @param resource
+ * the resource
+ * @param newURI
+ * the new uri
+ *
+ * @return true, if handle resource moved
+ */
+ public boolean handleResourceMoved(Resource resource, final URI newURI) {
+ synchronized(CachedResourceSetInfo.this) {
+ if(CachedResourceSetInfo.this.fCanBeSaved) {
+ CachedResourceSetInfo.this.setUnSynchronized(resource);
+ return true;
+ }
+ }
+ if(myDocument.getDiagram().eResource() == resource) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ handleElementMoved(CachedResourceSetInfo.this.getEditorInput(), newURI);
+ }
+ });
+ } else {
+ handleResourceDeleted(resource);
+ }
+ return true;
+ }
+
+ }
+
+ }
+
+ /**
+ * The listener interface for receiving resourceSetModification events. The
+ * class that is interested in processing a resourceSetModification event
+ * implements this interface, and the object created with that class is
+ * registered with a component using the component's <code>addResourceSetModificationListener<code> method. When
+ * the resourceSetModification event occurs, that object's appropriate
+ * method is invoked.
+ *
+ * @see ResourceSetModificationEvent
+ */
+ private class ResourceSetModificationListener extends EContentAdapter {
+
+ /** The my modified filter. */
+ private final NotificationFilter myModifiedFilter;
+
+ /** The my info. */
+ private final CachedResourceSetInfo myInfo;
+
+ /**
+ * The Constructor.
+ *
+ * @param info
+ * the info
+ */
+ public ResourceSetModificationListener(CachedResourceSetInfo info) {
+ myInfo = info;
+ myModifiedFilter = NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)).and(NotificationFilter.createFeatureFilter(Resource.class, Resource.RESOURCE__IS_MODIFIED));
+ }
+
+ /**
+ * Notify changed.
+ *
+ * @param notification
+ * the notification
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ if(notification.getNotifier() instanceof ResourceSet) {
+ super.notifyChanged(notification);
+ }
+ if(!notification.isTouch() && myModifiedFilter.matches(notification)) {
+ if(notification.getNotifier() instanceof Resource) {
+ Resource resource = (Resource)notification.getNotifier();
+ if(resource.isLoaded()) {
+ boolean modified = false;
+ for(Iterator it = myInfo.getResourceSet().getResources().iterator(); it.hasNext() && !modified;) {
+ Resource nextResource = (Resource)it.next();
+ if(nextResource.isLoaded()) {
+ modified = nextResource.isModified();
+ }
+ }
+ boolean dirtyStateChanged = false;
+ synchronized(myInfo) {
+ if(modified != myInfo.fCanBeSaved) {
+ myInfo.fCanBeSaved = modified;
+ dirtyStateChanged = true;
+ }
+ if(!resource.isModified()) {
+ myInfo.setSynchronized(resource);
+ }
+ }
+ if(dirtyStateChanged) {
+ fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);
+
+ if(!modified) {
+ myInfo.setModificationStamp(computeModificationStamp(myInfo));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ // // General and common DocumentProvider code for GMF diagrams ////
+
+ @Override
+ protected ElementInfo createElementInfo(Object element) throws CoreException {
+ if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind("Messages.SqlmodelDocumentProvider_IncorrectInputError", new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ IEditorInput editorInput = (IEditorInput)element;
+ IDiagramDocument document = (IDiagramDocument)createDocument(editorInput);
+
+ CachedResourceSetInfo info = new CachedResourceSetInfo(document, editorInput);
+ info.setModificationStamp(computeModificationStamp(info));
+ info.fStatus = null;
+ return info;
+ }
+
+ @Override
+ protected IDocument createDocument(Object element) throws CoreException {
+ if(false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind("Messages.SqlmodelDocumentProvider_IncorrectInputError", new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ IDocument document = createEmptyDocument((IEditorInput)element);
+ setDocumentContent(document, (IEditorInput)element);
+ setupDocument(element, document);
+ return document;
+ }
+
+ /**
+ * Sets up the given document as it would be provided for the given element.
+ * The content of the document is not changed. This default implementation
+ * is empty. Subclasses may reimplement.
+ */
+ protected void setupDocument(Object element, IDocument document) {
+ // for subclasses
+ }
+
+ protected void setDocumentContent(IDocument document, IEditorInput element) throws CoreException {
+ IDiagramDocument diagramDocument = (IDiagramDocument)document;
+ TransactionalEditingDomain domain = diagramDocument.getEditingDomain();
+ if(element instanceof FileEditorInput) {
+ IStorage storage = ((FileEditorInput)element).getStorage();
+ Diagram diagram = DiagramIOUtil.load(domain, storage, true, getProgressMonitor());
+ document.setContent(diagram);
+ } else if(element instanceof URIEditorInput) {
+ URI uri = ((URIEditorInput)element).getURI();
+ Resource resource = null;
+ try {
+ resource = domain.getResourceSet().getResource(uri.trimFragment(), false);
+ if(resource == null) {
+ resource = domain.getResourceSet().createResource(uri.trimFragment());
+ }
+ if(!resource.isLoaded()) {
+ try {
+ Map options = new HashMap(GMFResourceFactory.getDefaultLoadOptions());
+ resource.load(options);
+ } catch (IOException e) {
+ resource.unload();
+ throw e;
+ }
+ }
+ if(uri.fragment() != null) {
+ EObject rootElement = resource.getEObject(uri.fragment());
+ if(rootElement instanceof Diagram) {
+ document.setContent(rootElement);
+ return;
+ }
+ } else {
+ for(Object rootElement : resource.getContents()) {
+ if(rootElement instanceof Diagram) {
+ document.setContent(rootElement);
+ return;
+ }
+ }
+ }
+ throw new RuntimeException("Messages.SqlmodelDocumentProvider_NoDiagramInResourceError");
+ } catch (Exception e) {
+ CoreException thrownExcp = null;
+ if(e instanceof CoreException) {
+ thrownExcp = (CoreException)e;
+ } else {
+ String msg = e.getLocalizedMessage();
+ thrownExcp = new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, msg != null ? msg : "Messages.SqlmodelDocumentProvider_DiagramLoadingError", e));
+ }
+ throw thrownExcp;
+ }
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind("Messages.SqlmodelDocumentProvider_IncorrectInputError", new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ }
+
+ @Override
+ public long getModificationStamp(Object element) {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ return computeModificationStamp(info);
+ }
+ return super.getModificationStamp(element);
+ }
+
+ @Override
+ public boolean isDeleted(Object element) {
+ IDiagramDocument document = getDiagramDocument(element);
+ if(document != null) {
+ Resource diagramResource = document.getDiagram().eResource();
+ if(diagramResource != null) {
+ IFile file = WorkspaceSynchronizer.getFile(diagramResource);
+ return file == null || file.getLocation() == null || !file.getLocation().toFile().exists();
+ }
+ }
+ return super.isDeleted(element);
+ }
+
+ public CachedResourceSetInfo getResourceSetInfo(Object editorInput) {
+ return (CachedResourceSetInfo)super.getElementInfo(editorInput);
+ }
+
+ @Override
+ protected void doValidateState(Object element, Object computationContext) throws CoreException {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection files2Validate = new ArrayList();
+ for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null && file.isReadOnly()) {
+ files2Validate.add(file);
+ }
+ }
+ ResourcesPlugin.getWorkspace().validateEdit((IFile[])files2Validate.toArray(new IFile[files2Validate.size()]), computationContext);
+ }
+
+ super.doValidateState(element, computationContext);
+ }
+
+ @Override
+ public boolean isReadOnly(Object element) {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ if(info.isUpdateCache()) {
+ try {
+ updateCache(element);
+ } catch (CoreException ex) {
+ Activator.getDefault().logError("Messages.SqlmodelDocumentProvider_isModifiable", ex);
+ }
+ }
+ return info.isReadOnly();
+ }
+ return super.isReadOnly(element);
+ }
+
+ @Override
+ public boolean isModifiable(Object element) {
+ if(!isStateValidated(element)) {
+ if(element instanceof FileEditorInput || element instanceof URIEditorInput) {
+ return true;
+ }
+ }
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ if(info.isUpdateCache()) {
+ try {
+ updateCache(element);
+ } catch (CoreException ex) {
+ Activator.getDefault().logError("Messages.SqlmodelDocumentProvider_isModifiable", ex);
+ }
+ }
+ return info.isModifiable();
+ }
+ return super.isModifiable(element);
+ }
+
+ protected void updateCache(Object element) throws CoreException {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null && file.isReadOnly()) {
+ info.setReadOnly(true);
+ info.setModifiable(false);
+ return;
+ }
+ }
+ info.setReadOnly(false);
+ info.setModifiable(true);
+ return;
+ }
+ }
+
+ @Override
+ protected void doUpdateStateCache(Object element) throws CoreException {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ info.setUpdateCache(true);
+ }
+ super.doUpdateStateCache(element);
+ }
+
+ @Override
+ public boolean isSynchronized(Object element) {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ return info.isSynchronized();
+ }
+ return super.isSynchronized(element);
+ }
+
+ @Override
+ protected ISchedulingRule getResetRule(Object element) {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection rules = new ArrayList();
+ for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(file));
+ }
+ }
+ return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ }
+ return null;
+ }
+
+ @Override
+ protected ISchedulingRule getSaveRule(Object element) {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection rules = new ArrayList();
+ for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ rules.add(computeSchedulingRule(file));
+ }
+ }
+ return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ }
+ return null;
+ }
+
+ @Override
+ protected ISchedulingRule getSynchronizeRule(Object element) {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection rules = new ArrayList();
+ for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ rules.add(ResourcesPlugin.getWorkspace().getRuleFactory().refreshRule(file));
+ }
+ }
+ return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
+ }
+ return null;
+ }
+
+ @Override
+ protected ISchedulingRule getValidateStateRule(Object element) {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ Collection files = new ArrayList();
+ for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ IFile file = WorkspaceSynchronizer.getFile(nextResource);
+ if(file != null) {
+ files.add(file);
+ }
+ }
+ return ResourcesPlugin.getWorkspace().getRuleFactory().validateEditRule((IFile[])files.toArray(new IFile[files.size()]));
+ }
+ return null;
+ }
+
+ private ISchedulingRule computeSchedulingRule(IResource toCreateOrModify) {
+ if(toCreateOrModify.exists()) {
+ return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(toCreateOrModify);
+ }
+
+ IResource parent = toCreateOrModify;
+ do {
+ toCreateOrModify = parent;
+ parent = toCreateOrModify.getParent();
+ } while(parent != null && !parent.exists());
+
+ return ResourcesPlugin.getWorkspace().getRuleFactory().createRule(toCreateOrModify);
+ }
+
+ @Override
+ protected void doSynchronize(Object element, IProgressMonitor monitor) throws CoreException {
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ handleElementChanged(info, nextResource, monitor);
+ }
+ return;
+ }
+ super.doSynchronize(element, monitor);
+ }
+
+ @Override
+ protected void doSaveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException {
+ try {
+ // fjcano : we are modifying the resource by an internal save.
+ setChangingResourceBySave(true);
+ CachedResourceSetInfo info = getResourceSetInfo(element);
+ if(info != null) {
+ if(!overwrite && !info.isSynchronized()) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, IResourceStatus.OUT_OF_SYNC_LOCAL, "Messages.SqlmodelDocumentProvider_UnsynchronizedFileSaveError", null));
+ }
+ info.stopResourceListening();
+ fireElementStateChanging(element);
+ try {
+ monitor.beginTask("Messages.SqlmodelDocumentProvider_SaveDiagramTask", info.getResourceSet().getResources().size() + 1); // "Saving diagram"
+ for(Iterator it = info.getLoadedResourcesIterator(); it.hasNext();) {
+ Resource nextResource = (Resource)it.next();
+ monitor.setTaskName(NLS.bind("Messages.SqlmodelDocumentProvider_SaveNextResourceTask", nextResource.getURI()));
+ if(nextResource.isLoaded() && !info.getEditingDomain().isReadOnly(nextResource)) {
+ try {
+ nextResource.save(MDTUtil.getSaveOptions());
+ } catch (IOException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, EditorStatusCodes.RESOURCE_FAILURE, e.getLocalizedMessage(), null));
+ }
+ }
+ monitor.worked(1);
+ }
+ monitor.done();
+ info.setModificationStamp(computeModificationStamp(info));
+ } catch (RuntimeException x) {
+ fireElementStateChangeFailed(element);
+ throw x;
+ } finally {
+ info.startResourceListening();
+ }
+ } else {
+ URI newResoruceURI;
+ List affectedFiles = null;
+ if(element instanceof FileEditorInput) {
+ IFile newFile = ((FileEditorInput)element).getFile();
+ affectedFiles = Collections.singletonList(newFile);
+ newResoruceURI = URI.createPlatformResourceURI(newFile.getFullPath().toString(), true);
+ } else if(element instanceof URIEditorInput) {
+ newResoruceURI = ((URIEditorInput)element).getURI();
+ } else {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, NLS.bind("Messages.SqlmodelDocumentProvider_IncorrectInputError", new Object[]{ element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ null));
+ }
+ if(false == document instanceof IDiagramDocument) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ IDiagramDocument diagramDocument = (IDiagramDocument)document;
+ final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
+ final Diagram diagramCopy = (Diagram)EcoreUtil.copy(diagramDocument.getDiagram());
+ try {
+ new AbstractTransactionalCommand(diagramDocument.getEditingDomain(), NLS.bind("Messages.SqlmodelDocumentProvider_SaveAsOperation", diagramCopy.getName()), affectedFiles) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ newResource.getContents().add(diagramCopy);
+ return CommandResult.newOKCommandResult();
+ }
+ }.execute(monitor, null);
+ newResource.save(MDTUtil.getSaveOptions());
+ } catch (ExecutionException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, e.getLocalizedMessage(), null));
+ } catch (IOException e) {
+ fireElementStateChangeFailed(element);
+ throw new CoreException(new Status(IStatus.ERROR, Activator.ID, 0, e.getLocalizedMessage(), null));
+ }
+ newResource.unload();
+ }
+ } finally {
+ // fjcano : the internal modification ended.
+ setChangingResourceBySave(false);
+ }
+ }
+
+ protected void handleElementChanged(CachedResourceSetInfo info, Resource changedResource, IProgressMonitor monitor) {
+ if(isChangingResourceBySave() == false) {
+ IFile file = WorkspaceSynchronizer.getFile(changedResource);
+ if(file != null) {
+ try {
+ file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ } catch (CoreException ex) {
+ Activator.getDefault().logError("Messages.SqlmodelDocumentProvider_handleElementContentChanged", ex);
+ }
+ }
+ changedResource.unload();
+
+ fireElementContentAboutToBeReplaced(info.getEditorInput());
+ removeUnchangedElementListeners(info.getEditorInput(), info);
+ info.fStatus = null;
+ try {
+ setDocumentContent(info.fDocument, info.getEditorInput());
+ } catch (CoreException e) {
+ info.fStatus = e.getStatus();
+ }
+ if(!info.fCanBeSaved) {
+ info.setModificationStamp(computeModificationStamp(info));
+ }
+ addUnchangedElementListeners(info.getEditorInput(), info);
+ fireElementContentReplaced(info.getEditorInput());
+ }
+ }
+
+ protected void handleElementMoved(IEditorInput input, URI uri) {
+ if(input instanceof FileEditorInput) {
+ IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(URI.decode(uri.path())).removeFirstSegments(1));
+ fireElementMoved(input, newFile == null ? null : new FileEditorInput(newFile));
+ return;
+ }
+ // TODO: append suffix to the URI! (use diagram as a parameter)
+ fireElementMoved(input, new URIEditorInput(uri));
+ }
+
+ public IEditorInput createInputWithEditingDomain(IEditorInput editorInput, TransactionalEditingDomain domain) {
+ return editorInput;
+ }
+
+ public IDiagramDocument getDiagramDocument(Object element) {
+ IDocument doc = getDocument(element);
+ if(doc instanceof IDiagramDocument) {
+ return (IDiagramDocument)doc;
+ }
+ return null;
+ }
+
+ @Override
+ protected IRunnableContext getOperationRunner(IProgressMonitor monitor) {
+ return null;
+ }
+
+ protected String getEditingDomainID() {
+ return editingDomainID;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/ICustomDiagramUpdater.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/ICustomDiagramUpdater.java
index 47b3beb2b1f..a547bf4034e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/ICustomDiagramUpdater.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/ICustomDiagramUpdater.java
@@ -1,23 +1,23 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.util.List;
-
-import org.eclipse.gmf.runtime.notation.View;
-
-public interface ICustomDiagramUpdater {
-
- public List getSemanticChildren(View view);
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.util.List;
+
+import org.eclipse.gmf.runtime.notation.View;
+
+public interface ICustomDiagramUpdater {
+
+ public List getSemanticChildren(View view);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/IPaletteDescription.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/IPaletteDescription.java
index e255131423a..1edc4f56579 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/IPaletteDescription.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/IPaletteDescription.java
@@ -1,66 +1,66 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
-
-/**
- * Interface that describes a palette.
- */
-public interface IPaletteDescription {
-
- /**
- * Returns the name of the palette
- *
- * @return the name of this palette
- */
- public String getName();
-
- /**
- * returns the ID of the palette
- *
- * @return the unique identifier of this palette
- */
- public String getPaletteID();
-
- /**
- * Returns the id of the editor for which this palette is defined.
- *
- * @return the id of the editor contributed
- */
- public String getContributionEditorID();
-
- /**
- * Returns the contribution of this palette
- *
- * @return the contribution of this palette
- */
- public Object getContributions();
-
- /**
- * returns the priority for this palette
- *
- * @return the priority for this palette
- */
- public ProviderPriority getPriority();
-
- /**
- * returns the properties map for this palette
- *
- * @return the properties map for this palette
- */
- public Map<String, String> getProperties();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.util.Map;
+
+import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
+
+/**
+ * Interface that describes a palette.
+ */
+public interface IPaletteDescription {
+
+ /**
+ * Returns the name of the palette
+ *
+ * @return the name of this palette
+ */
+ public String getName();
+
+ /**
+ * returns the ID of the palette
+ *
+ * @return the unique identifier of this palette
+ */
+ public String getPaletteID();
+
+ /**
+ * Returns the id of the editor for which this palette is defined.
+ *
+ * @return the id of the editor contributed
+ */
+ public String getContributionEditorID();
+
+ /**
+ * Returns the contribution of this palette
+ *
+ * @return the contribution of this palette
+ */
+ public Object getContributions();
+
+ /**
+ * returns the priority for this palette
+ *
+ * @return the priority for this palette
+ */
+ public ProviderPriority getPriority();
+
+ /**
+ * returns the properties map for this palette
+ *
+ * @return the properties map for this palette
+ */
+ public Map<String, String> getProperties();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteMenuAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteMenuAction.java
index b7574227db8..1940acf7a06 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteMenuAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteMenuAction.java
@@ -1,226 +1,226 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Action that builds the sub-menu for the palette viewer to configure the
- * palettes seen or not
- */
-public class PaletteMenuAction extends Action implements IMenuCreator {
-
- /** palette viewer on which the action is called */
- protected PaletteViewer viewer;
-
- /** List of action for the submenu */
- protected List<Action> actions;
-
- /**
- * Creates a new PaletteMenuAction
- *
- * @param viewer
- * the palette viewer on which this action is added
- */
- public PaletteMenuAction(PaletteViewer viewer) {
- this(viewer, false);
- }
-
- /**
- * Creates a new PaletteMenuAction
- *
- * @param viewer
- * the palette viewer on which this action is added
- * @param hasIcon
- * <code>true</code> if the menu action must display an icon
- */
- public PaletteMenuAction(PaletteViewer viewer, boolean hasIcon) {
- super(Messages.Palette_Action_Label);
- this.viewer = viewer;
- actions = createActions();
- setMenuCreator(this);
- setToolTipText(Messages.Palette_Action_Tooltip);
- }
-
- /**
- * Helper method that wraps the given action in an ActionContributionItem
- * and then adds it to the given menu.
- *
- * @param parent
- * The menu to which the given action is to be added
- * @param action
- * The action that is to be added to the given menu
- */
- protected void addActionToMenu(Menu parent, IAction action) {
- ActionContributionItem item = new ActionContributionItem(action);
- item.fill(parent, -1);
- }
-
- /**
- * Creates and returns a list of actions that can toggle palette providers
- * visiblity
- *
- * @return a list of actions that can toggle palette providers visiblity
- */
- protected List<Action> createActions() {
- // retrieve all palette availables for the current editor...
- ArrayList<Action> list = new ArrayList<Action>();
- Action action = null;
-
- final IEditorPart part = getActiveSashPage();
- final List<String> hiddenPalettes = PapyrusPalettePreferences.getHiddenPalettes(part);
-
- for(PapyrusPaletteService.ProviderDescriptor descriptor : PapyrusPaletteService.getInstance().getContributingProviders(part, getPaletteViewer().getPaletteRoot())) {
-
- action = new DisplayPaletteChangeAction(descriptor);
-
- // get provider name
- String name = descriptor.getContributionName();
- if(name == null || name.equals("")) {
- name = descriptor.getContributionID();
- }
- // get the provider ID
- String id = descriptor.getContributionID();
-
- action.setText(name);
- action.setChecked(!hiddenPalettes.contains(id));
- // check required profiles
- boolean requiredPlugins = PaletteUtil.areRequiredProfileApplied(part, descriptor);
- if(!requiredPlugins) {
- action.setEnabled(false);
- action.setToolTipText(Messages.PaletteContextMenu_MissingProfile);
- }
-
- list.add(action);
- }
- return list;
- }
-
- /**
- * Returns the palette viewer on which this action is build
- *
- * @return the palette viewer on which this action is build
- */
- protected PaletteViewer getPaletteViewer() {
- return viewer;
- }
-
- /**
- * Returns the current active sash page
- *
- * @return the current active sash page
- */
- protected IEditorPart getActiveSashPage() {
- // Lookup ServiceRegistry
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IEditorPart editorPart = page.getActiveEditor();
- assert editorPart != null;
- ISashWindowsContainer sashWindowsContainer = (ISashWindowsContainer)editorPart.getAdapter(ISashWindowsContainer.class);
- if(sashWindowsContainer != null) {
- return sashWindowsContainer.getActiveEditor();
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public void dispose() {
- }
-
- /**
- * Fills the menu for this action
- *
- * @param menu
- * the menu to contribute
- * @return the menu updated
- */
- protected Menu fillMenu(Menu menu) {
- for(Action action2 : actions) {
- DisplayPaletteChangeAction action = (DisplayPaletteChangeAction)action2;
- // action.setChecked(isPaletteEnabled(action.getProviderDescriptor()));
- addActionToMenu(menu, action);
- }
-
- setEnabled(!actions.isEmpty());
-
- return menu;
- }
-
- /**
- * {@inheritDoc}
- */
- public Menu getMenu(Control parent) {
- return fillMenu(new Menu(parent));
- }
-
- /**
- * {@inheritDoc}
- */
- public Menu getMenu(Menu parent) {
- return fillMenu(new Menu(parent));
- }
-
- /**
- * Action that toggles the visibility of a provider descriptor
- */
- public class DisplayPaletteChangeAction extends Action {
-
- /** provider descriptor managed by this action */
- private final PapyrusPaletteService.ProviderDescriptor providerDescriptor;
-
- /**
- * Creates a new DisplayPaletteChangeAction
- *
- * @param providerDescriptor
- * the provider descriptor that must be hidden/shown
- */
- public DisplayPaletteChangeAction(PapyrusPaletteService.ProviderDescriptor providerDescriptor) {
- this.providerDescriptor = providerDescriptor;
- }
-
- /**
- * Returns the provider descriptor on which this action runs
- *
- * @return the provider descriptor on which this action runs
- */
- public PapyrusPaletteService.ProviderDescriptor getProviderDescriptor() {
- return providerDescriptor;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void run() {
- PapyrusPalettePreferences.changePaletteVisibility(getProviderDescriptor().getContributionID(), getActiveSashPage().getClass().getName(), isChecked());
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.ui.palette.PaletteViewer;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * Action that builds the sub-menu for the palette viewer to configure the
+ * palettes seen or not
+ */
+public class PaletteMenuAction extends Action implements IMenuCreator {
+
+ /** palette viewer on which the action is called */
+ protected PaletteViewer viewer;
+
+ /** List of action for the submenu */
+ protected List<Action> actions;
+
+ /**
+ * Creates a new PaletteMenuAction
+ *
+ * @param viewer
+ * the palette viewer on which this action is added
+ */
+ public PaletteMenuAction(PaletteViewer viewer) {
+ this(viewer, false);
+ }
+
+ /**
+ * Creates a new PaletteMenuAction
+ *
+ * @param viewer
+ * the palette viewer on which this action is added
+ * @param hasIcon
+ * <code>true</code> if the menu action must display an icon
+ */
+ public PaletteMenuAction(PaletteViewer viewer, boolean hasIcon) {
+ super(Messages.Palette_Action_Label);
+ this.viewer = viewer;
+ actions = createActions();
+ setMenuCreator(this);
+ setToolTipText(Messages.Palette_Action_Tooltip);
+ }
+
+ /**
+ * Helper method that wraps the given action in an ActionContributionItem
+ * and then adds it to the given menu.
+ *
+ * @param parent
+ * The menu to which the given action is to be added
+ * @param action
+ * The action that is to be added to the given menu
+ */
+ protected void addActionToMenu(Menu parent, IAction action) {
+ ActionContributionItem item = new ActionContributionItem(action);
+ item.fill(parent, -1);
+ }
+
+ /**
+ * Creates and returns a list of actions that can toggle palette providers
+ * visiblity
+ *
+ * @return a list of actions that can toggle palette providers visiblity
+ */
+ protected List<Action> createActions() {
+ // retrieve all palette availables for the current editor...
+ ArrayList<Action> list = new ArrayList<Action>();
+ Action action = null;
+
+ final IEditorPart part = getActiveSashPage();
+ final List<String> hiddenPalettes = PapyrusPalettePreferences.getHiddenPalettes(part);
+
+ for(PapyrusPaletteService.ProviderDescriptor descriptor : PapyrusPaletteService.getInstance().getContributingProviders(part, getPaletteViewer().getPaletteRoot())) {
+
+ action = new DisplayPaletteChangeAction(descriptor);
+
+ // get provider name
+ String name = descriptor.getContributionName();
+ if(name == null || name.equals("")) {
+ name = descriptor.getContributionID();
+ }
+ // get the provider ID
+ String id = descriptor.getContributionID();
+
+ action.setText(name);
+ action.setChecked(!hiddenPalettes.contains(id));
+ // check required profiles
+ boolean requiredPlugins = PaletteUtil.areRequiredProfileApplied(part, descriptor);
+ if(!requiredPlugins) {
+ action.setEnabled(false);
+ action.setToolTipText(Messages.PaletteContextMenu_MissingProfile);
+ }
+
+ list.add(action);
+ }
+ return list;
+ }
+
+ /**
+ * Returns the palette viewer on which this action is build
+ *
+ * @return the palette viewer on which this action is build
+ */
+ protected PaletteViewer getPaletteViewer() {
+ return viewer;
+ }
+
+ /**
+ * Returns the current active sash page
+ *
+ * @return the current active sash page
+ */
+ protected IEditorPart getActiveSashPage() {
+ // Lookup ServiceRegistry
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorPart editorPart = page.getActiveEditor();
+ assert editorPart != null;
+ ISashWindowsContainer sashWindowsContainer = (ISashWindowsContainer)editorPart.getAdapter(ISashWindowsContainer.class);
+ if(sashWindowsContainer != null) {
+ return sashWindowsContainer.getActiveEditor();
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dispose() {
+ }
+
+ /**
+ * Fills the menu for this action
+ *
+ * @param menu
+ * the menu to contribute
+ * @return the menu updated
+ */
+ protected Menu fillMenu(Menu menu) {
+ for(Action action2 : actions) {
+ DisplayPaletteChangeAction action = (DisplayPaletteChangeAction)action2;
+ // action.setChecked(isPaletteEnabled(action.getProviderDescriptor()));
+ addActionToMenu(menu, action);
+ }
+
+ setEnabled(!actions.isEmpty());
+
+ return menu;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Menu getMenu(Control parent) {
+ return fillMenu(new Menu(parent));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Menu getMenu(Menu parent) {
+ return fillMenu(new Menu(parent));
+ }
+
+ /**
+ * Action that toggles the visibility of a provider descriptor
+ */
+ public class DisplayPaletteChangeAction extends Action {
+
+ /** provider descriptor managed by this action */
+ private final PapyrusPaletteService.ProviderDescriptor providerDescriptor;
+
+ /**
+ * Creates a new DisplayPaletteChangeAction
+ *
+ * @param providerDescriptor
+ * the provider descriptor that must be hidden/shown
+ */
+ public DisplayPaletteChangeAction(PapyrusPaletteService.ProviderDescriptor providerDescriptor) {
+ this.providerDescriptor = providerDescriptor;
+ }
+
+ /**
+ * Returns the provider descriptor on which this action runs
+ *
+ * @return the provider descriptor on which this action runs
+ */
+ public PapyrusPaletteService.ProviderDescriptor getProviderDescriptor() {
+ return providerDescriptor;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void run() {
+ PapyrusPalettePreferences.changePaletteVisibility(getProviderDescriptor().getContributionID(), getActiveSashPage().getClass().getName(), isChecked());
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteUtil.java
index 9d0f41eca2a..0038328f8ca 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PaletteUtil.java
@@ -1,498 +1,498 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.palette.PaletteContainer;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.gmf.runtime.common.core.service.IProvider;
-import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
-import org.eclipse.gmf.runtime.diagram.ui.internal.services.palette.ContributeToPaletteOperation;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette;
-import org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.SpecializationType;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.infra.core.utils.PapyrusTrace;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
-import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.papyrus.uml.diagram.common.service.IProfileDependantPaletteProvider;
-import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService;
-import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.ProviderDescriptor;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.AspectToolService;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectAction;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IPostAction;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IPreAction;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IMemento;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Profile;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Utility class for palette.
- */
-public class PaletteUtil {
-
- /**
- * Returns the parent container by its ID
- *
- * @param entry
- * the palette container for which parent container is looked
- * @param parentID
- * the id of the parent container
- * @return the parent
- */
- public static PaletteContainer getContainerByID(PaletteContainer container, String parentID) {
- // check this element is the searched parent;
- if(parentID.equals(container.getId())) {
- return container;
- }
-
- // element is not the parent. Look its children
- Iterator<PaletteContainer> it = getDirectChildContainers(container).iterator();
- while(it.hasNext()) {
- PaletteContainer tmp = getContainerByID(it.next(), parentID);
- if(tmp != null) {
- return tmp;
- }
- }
- return null;
- }
-
- /**
- * Returns the type of metaclasses created by the toolentry
- *
- * @param entry
- * the entry for which metaclass created is searched
- * @return the type of metaclasses created by the toolentry or <code>null</code>.
- */
- public static EClass getToolMetaclass(ToolEntry entry) {
- Tool tool = entry.createTool();
- List<IElementType> types = null;
- if(tool instanceof AspectUnspecifiedTypeCreationTool) {
- types = ((AspectUnspecifiedTypeCreationTool)tool).getElementTypes();
- } else if(tool instanceof AspectUnspecifiedTypeConnectionTool) {
- types = ((AspectUnspecifiedTypeConnectionTool)tool).getElementTypes();
- }
- if(types != null && types.size() > 0) {
- IElementType type = types.get(0);
-
- if(type instanceof SpecializationType) {
- type = ((SpecializationType)type).getSpecializedTypes()[0];
- }
- return type.getEClass();
- }
- return null;
- }
-
- /**
- * Returns the parent container by its ID
- *
- * @param entry
- * the palette entry for which parent container is looked
- * @param parentID
- * the id of the parent container
- * @return the parent
- */
- public static PaletteContainer getContainerByID(PaletteEntry entry, String parentID) {
- // retrieve the root
- PaletteContainer root = getRoot(entry);
- return getContainerByID(root, parentID);
- }
-
- /**
- * Return the child containers directly contained by the specified container
- *
- * @param container
- * the container to look in.
- * @return the list of directly contained elements
- */
- @SuppressWarnings("unchecked")
- public static List<PaletteContainer> getDirectChildContainers(PaletteContainer container) {
- List<PaletteContainer> containers = new ArrayList<PaletteContainer>();
- Iterator<PaletteEntry> it = container.getChildren().iterator();
- while(it.hasNext()) {
- PaletteEntry entry = it.next();
- if(entry instanceof PaletteContainer) {
- containers.add((PaletteContainer)entry);
- }
- }
- return containers;
- }
-
- /**
- * Retrieves the root element for the given container
- *
- * @param container
- * the container for which the root is searched
- * @return the root of the container
- */
- public static PaletteContainer getRoot(PaletteContainer container) {
- // if container has a parent, returns it.
- if(container.getParent() != null) {
- return getRoot(container.getParent());
- }
- // else, root element is the container itself.
- return container;
- }
-
- /**
- * Retrieves the root element for the given palette entry
- *
- * @param container
- * the container for which the root is searched
- * @return the root of the container
- */
- public static PaletteContainer getRoot(PaletteEntry entry) {
- return getRoot(entry.getParent());
- }
-
- /**
- * Default constructor. Should never be used, as method are static in this
- * class.
- */
- // @unused
- private PaletteUtil() {
-
- }
-
- /**
- * return tool entries for the given {@link PaletteContainer} and its
- * sub-containers
- *
- * @param container
- * the container that contains the ToolEntries
- * @return the list of tool entries or an empty list
- */
- public static List<ToolEntry> getAllToolEntries(PaletteContainer container) {
- final List<ToolEntry> entries = new ArrayList<ToolEntry>();
- Iterator<PaletteEntry> it = container.getChildren().iterator();
- while(it.hasNext()) {
- PaletteEntry entry = it.next();
- if(entry instanceof ToolEntry) {
- entries.add((ToolEntry)entry);
- }
- if(entry instanceof PaletteContainer) {
- entries.addAll(getAllToolEntries((PaletteContainer)entry));
- }
- }
- return entries;
- }
-
- /**
- * Looks for the memento with the correct id from the root momento
- *
- * @param rootMemento
- * the root memento from which the memento is searched
- * @param id
- * the id of the memento to search
- * @return the memento with the given ID or <code>null</code> if no memento
- * was found
- */
- // @unused
- public static IMemento getMemento(IMemento rootMemento, String id) {
- IMemento memento = null;
- memento = rootMemento.getChild(id);
- return memento;
- }
-
- /**
- * Return all entries from a palette
- *
- * @param paletteRoot
- * the root from which tools are retrieved
- * @return the list of entries
- */
- public static List<PaletteEntry> getAllEntries(PaletteContainer container) {
- List<PaletteEntry> elements = new ArrayList<PaletteEntry>();
- for(Object object : container.getChildren()) {
- if(object instanceof PaletteContainer) {
- elements.add((PaletteContainer)object);
- elements.addAll(getAllEntries((PaletteContainer)object));
- } else if(object instanceof ToolEntry) {
- elements.add((ToolEntry)object);
- }
- }
- return elements;
- }
-
- /**
- * Returns all available entries for the given editor ID
- *
- * @param editorID
- * the editor to be contributed
- * @param priority
- * the priority max for the entries
- * @return the set of available entries
- */
- public static Set<? extends PaletteEntry> getAvailableEntries(IEditorPart part, ProviderPriority priority) {
- Set<? extends PaletteEntry> entries = new HashSet<PaletteEntry>();
-
- // retrieve all provider for the given editor ID
- PaletteRoot root = new PaletteRoot();
- List<? extends PapyrusPaletteService.ProviderDescriptor> providers = (List<? extends ProviderDescriptor>)PapyrusPaletteService.getInstance().getProviders();
- ContributeToPaletteOperation operation = new ContributeToPaletteOperation(part, part.getEditorInput(), root, new HashMap<Object, Object>());
-
- // generate for each provider, according to priority
- @SuppressWarnings("unchecked")
- List<PapyrusPaletteService.ProviderDescriptor> providerList = (List<PapyrusPaletteService.ProviderDescriptor>)PapyrusPaletteService.getInstance().getProviders();
- for(PapyrusPaletteService.ProviderDescriptor descriptor : providerList) {
- int compare = descriptor.getPriority().compareTo(priority);
- if(compare < 0) {
- if(descriptor.providesWithVisibility(operation)) {
- ((IPaletteProvider)descriptor.getProvider()).contributeToPalette(part, part.getEditorInput(), root, new HashMap<Object, Object>());
- }
- }
- }
- return entries;
- }
-
- /**
- * Returns all available entries for the given editor ID
- *
- * @param editorID
- * the editor to be contributed
- * @param priority
- * the priority max for the entries
- * @return the set of available entries
- */
- public static Map<String, PaletteEntry> getAvailableEntriesSet(IEditorPart part, ProviderPriority priority) {
- Map<String, PaletteEntry> entries = new HashMap<String, PaletteEntry>();
-
- // retrieve all provider for the given editor ID
- PaletteRoot root = new PaletteRoot();
- List<? extends PapyrusPaletteService.ProviderDescriptor> providers = (List<? extends ProviderDescriptor>)PapyrusPaletteService.getInstance().getProviders();
- ContributeToPaletteOperation operation = new ContributeToPaletteOperation(part, part.getEditorInput(), root, entries);
-
- // generate for each provider, according to priority
- @SuppressWarnings("unchecked")
- List<PapyrusPaletteService.ProviderDescriptor> providerList = (List<PapyrusPaletteService.ProviderDescriptor>)PapyrusPaletteService.getInstance().getProviders();
- for(PapyrusPaletteService.ProviderDescriptor descriptor : providerList) {
- int compare = descriptor.getPriority().compareTo(priority);
- if(compare <= 0) {
- if(descriptor.providesWithVisibility(operation)) {
- ((IPaletteProvider)descriptor.getProvider()).contributeToPalette(part, part.getEditorInput(), root, entries);
- }
- }
- }
- return entries;
- }
-
- /**
- * Returns the list of stereotypes String from a serialize string form
- *
- * @param serializedForm
- * the serialized form of the list of stereotypes
- * @return the list of stereotypes String from a serialize string form
- */
- public static List<String> getStereotypeListFromString(String serializedForm) {
- StringTokenizer tokenizer = new StringTokenizer(serializedForm, ",");
- List<String> list = new ArrayList<String>();
- while(tokenizer.hasMoreElements()) {
- list.add(tokenizer.nextToken().trim());
- }
- return list;
- }
-
- /**
- * Returns the list of stereotypes String under a serialized form
- *
- * @param list
- * the list of stereotypes to serialize
- * @return the list of stereotypes String under a serialized form
- */
- public static String getSerializedStereotypeList(Collection<String> stereotypes) {
- return convertToCommaSeparatedRepresentation(stereotypes);
- }
-
- /**
- * Returns the name of the profile from the given stereotype qualified Name
- *
- * @param stereotypeName
- * the name of the stereotype to parse
- * @return the qualified name of the profile from the given stereotype
- * qualified Name
- */
- public static String findProfileNameFromStereotypeName(String stereotypeName) {
- return stereotypeName.substring(0, stereotypeName.lastIndexOf(NamedElement.SEPARATOR));
- }
-
- /**
- * Returns the list of profile Qualified Names String under a serialized
- * form
- *
- * @param list
- * the list of profiles to serialize
- * @return the list of profiles String under a serialized form
- */
- public static String getSerializedProfileList(Collection<String> profiles) {
- return convertToCommaSeparatedRepresentation(profiles);
- }
-
- public static String convertToCommaSeparatedRepresentation(Collection objects) {
- return convertToFlatRepresentation(objects, ",");
- }
-
- public static String convertToFlatRepresentation(Collection objects, String separator) {
- StringBuilder buffer = new StringBuilder();
- Iterator it = objects.iterator();
- while(it.hasNext()) {
- buffer.append(it.next());
- if(it.hasNext()) {
- buffer.append(separator);
- }
- }
- return buffer.toString();
- }
-
- /**
- * Returns the list of profiles String from a serialize string form
- *
- * @param serializedForm
- * the serialized form of the list of stereotypes
- * @return the list of profiles String from a serialize string form
- */
- public static Set<String> getProfileSetFromString(String serializedForm) {
- StringTokenizer tokenizer = new StringTokenizer(serializedForm, ",");
- Set<String> list = new HashSet<String>();
- while(tokenizer.hasMoreElements()) {
- list.add(tokenizer.nextToken());
- }
- return list;
- }
-
- /**
- * returns <code>true</code> if the descriptor have all necessary profiles
- *
- * @param part
- * the editor part for which the palette is shown
- * @param papyrusProviderDesc
- * the current provider descriptor to test
- * @return <code>true</code> if all required profile are present
- */
- public static boolean areRequiredProfileApplied(IEditorPart part, PapyrusPaletteService.ProviderDescriptor papyrusProviderDesc) {
- if(!(part instanceof DiagramEditorWithFlyOutPalette)) {
- PapyrusTrace.log(IStatus.WARNING, "trying to check a papyrus palette descriptor outside papyrus framework");
- return false;
- }
- if(papyrusProviderDesc instanceof PapyrusPaletteService.LocalProviderDescriptor) {
- IPaletteDescription description = ((PapyrusPaletteService.LocalProviderDescriptor)papyrusProviderDesc).getDescription();
- // checks the presence of required profile
- Diagram diagram = ((DiagramEditorWithFlyOutPalette)part).getDiagram();
- EObject element = diagram.getElement();
- if(element instanceof Element) {
- org.eclipse.uml2.uml.Package package_ = ((Element)element).getNearestPackage();
- List<Profile> appliedProfiles = package_.getAllAppliedProfiles();
- List<String> appliedProfilesNames = new ArrayList<String>();
- for(Profile profile : appliedProfiles) {
- appliedProfilesNames.add(profile.getQualifiedName());
- }
-
- // compare to the list of profiles used by the palette
- Map<String, String> properties = description.getProperties();
- if(description != null) {
- String requiredProfilesList = properties.get(IPapyrusPaletteConstant.PROFILE_LIST);
- if(requiredProfilesList != null) {
- // parse requiredProfile string (profile1QN, profile2QN,
- // etc.)
- Set<String> requiredProfiles = PaletteUtil.getProfileSetFromString(requiredProfilesList);
- for(String requiredProfileName : requiredProfiles) {
- if(!appliedProfilesNames.contains(requiredProfileName)) {
- return false;
- }
- }
- }
- }
- }
- } else {
- IProvider provider = papyrusProviderDesc.getProvider();
- if(provider instanceof IProfileDependantPaletteProvider) {
- Diagram diagram = ((DiagramEditorWithFlyOutPalette)part).getDiagram();
- EObject element = diagram.getElement();
- if(element instanceof Element) {
- org.eclipse.uml2.uml.Package package_ = ((Element)element).getNearestPackage();
- List<Profile> appliedProfiles = package_.getAllAppliedProfiles();
- List<String> appliedProfilesNames = new ArrayList<String>();
- for(Profile profile : appliedProfiles) {
- appliedProfilesNames.add(profile.getQualifiedName());
- }
- // not null also
- Collection<String> requiredProfiles = ((IProfileDependantPaletteProvider)provider).getRequiredProfiles();
- for(String requiredProfileName : requiredProfiles) {
- if(!appliedProfilesNames.contains(requiredProfileName)) {
- return false;
- }
- }
- }
- return true;
- }
- }
- // by default, returns true if the descriptor is not a local descriptor,
- // as they do not use
- // profile
- return true;
- }
-
- public static void initAspectActions(NodeList aspectActionNodes, List<IPostAction> postActions, List<IPreAction> preActions) {
- for(int i = 0; i < aspectActionNodes.getLength(); i++) {
- Node childNode = aspectActionNodes.item(i);
- String childName = childNode.getNodeName();
- if(IPapyrusPaletteConstant.POST_ACTION.equals(childName)) {
- // node is a post action => retrieve the id of the factory in charge of this configuration
- IAspectActionProvider provider = AspectToolService.getInstance().getProvider(AspectToolService.getProviderId(childNode));
- if(provider != null) {
- IAspectAction action = provider.createAction(childNode);
- if (action instanceof IPostAction) {
- postActions.add((IPostAction)action);
- }
- } else {
- Activator.log.error("impossible to find factory with id: " + AspectToolService.getProviderId(childNode), null);
- }
- } else if(IPapyrusPaletteConstant.PRE_ACTION.equals(childName)) {
- // node is a pre action => retrieve the id of the factory in charge of this configuration
- IAspectActionProvider provider = AspectToolService.getInstance().getProvider(AspectToolService.getProviderId(childNode));
- if(provider != null) {
- IAspectAction action = provider.createAction(childNode);
- if (action instanceof IPreAction) {
- preActions.add((IPreAction)action);
- }
- } else {
- Activator.log.error("impossible to find factory with id: " + AspectToolService.getProviderId(childNode), null);
- }
- }
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.Tool;
+import org.eclipse.gef.palette.PaletteContainer;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.palette.ToolEntry;
+import org.eclipse.gmf.runtime.common.core.service.IProvider;
+import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
+import org.eclipse.gmf.runtime.diagram.ui.internal.services.palette.ContributeToPaletteOperation;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette;
+import org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.SpecializationType;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.core.utils.PapyrusTrace;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.papyrus.uml.diagram.common.service.IProfileDependantPaletteProvider;
+import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService;
+import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.ProviderDescriptor;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.AspectToolService;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectAction;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IPostAction;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IPreAction;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IMemento;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Profile;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Utility class for palette.
+ */
+public class PaletteUtil {
+
+ /**
+ * Returns the parent container by its ID
+ *
+ * @param entry
+ * the palette container for which parent container is looked
+ * @param parentID
+ * the id of the parent container
+ * @return the parent
+ */
+ public static PaletteContainer getContainerByID(PaletteContainer container, String parentID) {
+ // check this element is the searched parent;
+ if(parentID.equals(container.getId())) {
+ return container;
+ }
+
+ // element is not the parent. Look its children
+ Iterator<PaletteContainer> it = getDirectChildContainers(container).iterator();
+ while(it.hasNext()) {
+ PaletteContainer tmp = getContainerByID(it.next(), parentID);
+ if(tmp != null) {
+ return tmp;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the type of metaclasses created by the toolentry
+ *
+ * @param entry
+ * the entry for which metaclass created is searched
+ * @return the type of metaclasses created by the toolentry or <code>null</code>.
+ */
+ public static EClass getToolMetaclass(ToolEntry entry) {
+ Tool tool = entry.createTool();
+ List<IElementType> types = null;
+ if(tool instanceof AspectUnspecifiedTypeCreationTool) {
+ types = ((AspectUnspecifiedTypeCreationTool)tool).getElementTypes();
+ } else if(tool instanceof AspectUnspecifiedTypeConnectionTool) {
+ types = ((AspectUnspecifiedTypeConnectionTool)tool).getElementTypes();
+ }
+ if(types != null && types.size() > 0) {
+ IElementType type = types.get(0);
+
+ if(type instanceof SpecializationType) {
+ type = ((SpecializationType)type).getSpecializedTypes()[0];
+ }
+ return type.getEClass();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the parent container by its ID
+ *
+ * @param entry
+ * the palette entry for which parent container is looked
+ * @param parentID
+ * the id of the parent container
+ * @return the parent
+ */
+ public static PaletteContainer getContainerByID(PaletteEntry entry, String parentID) {
+ // retrieve the root
+ PaletteContainer root = getRoot(entry);
+ return getContainerByID(root, parentID);
+ }
+
+ /**
+ * Return the child containers directly contained by the specified container
+ *
+ * @param container
+ * the container to look in.
+ * @return the list of directly contained elements
+ */
+ @SuppressWarnings("unchecked")
+ public static List<PaletteContainer> getDirectChildContainers(PaletteContainer container) {
+ List<PaletteContainer> containers = new ArrayList<PaletteContainer>();
+ Iterator<PaletteEntry> it = container.getChildren().iterator();
+ while(it.hasNext()) {
+ PaletteEntry entry = it.next();
+ if(entry instanceof PaletteContainer) {
+ containers.add((PaletteContainer)entry);
+ }
+ }
+ return containers;
+ }
+
+ /**
+ * Retrieves the root element for the given container
+ *
+ * @param container
+ * the container for which the root is searched
+ * @return the root of the container
+ */
+ public static PaletteContainer getRoot(PaletteContainer container) {
+ // if container has a parent, returns it.
+ if(container.getParent() != null) {
+ return getRoot(container.getParent());
+ }
+ // else, root element is the container itself.
+ return container;
+ }
+
+ /**
+ * Retrieves the root element for the given palette entry
+ *
+ * @param container
+ * the container for which the root is searched
+ * @return the root of the container
+ */
+ public static PaletteContainer getRoot(PaletteEntry entry) {
+ return getRoot(entry.getParent());
+ }
+
+ /**
+ * Default constructor. Should never be used, as method are static in this
+ * class.
+ */
+ // @unused
+ private PaletteUtil() {
+
+ }
+
+ /**
+ * return tool entries for the given {@link PaletteContainer} and its
+ * sub-containers
+ *
+ * @param container
+ * the container that contains the ToolEntries
+ * @return the list of tool entries or an empty list
+ */
+ public static List<ToolEntry> getAllToolEntries(PaletteContainer container) {
+ final List<ToolEntry> entries = new ArrayList<ToolEntry>();
+ Iterator<PaletteEntry> it = container.getChildren().iterator();
+ while(it.hasNext()) {
+ PaletteEntry entry = it.next();
+ if(entry instanceof ToolEntry) {
+ entries.add((ToolEntry)entry);
+ }
+ if(entry instanceof PaletteContainer) {
+ entries.addAll(getAllToolEntries((PaletteContainer)entry));
+ }
+ }
+ return entries;
+ }
+
+ /**
+ * Looks for the memento with the correct id from the root momento
+ *
+ * @param rootMemento
+ * the root memento from which the memento is searched
+ * @param id
+ * the id of the memento to search
+ * @return the memento with the given ID or <code>null</code> if no memento
+ * was found
+ */
+ // @unused
+ public static IMemento getMemento(IMemento rootMemento, String id) {
+ IMemento memento = null;
+ memento = rootMemento.getChild(id);
+ return memento;
+ }
+
+ /**
+ * Return all entries from a palette
+ *
+ * @param paletteRoot
+ * the root from which tools are retrieved
+ * @return the list of entries
+ */
+ public static List<PaletteEntry> getAllEntries(PaletteContainer container) {
+ List<PaletteEntry> elements = new ArrayList<PaletteEntry>();
+ for(Object object : container.getChildren()) {
+ if(object instanceof PaletteContainer) {
+ elements.add((PaletteContainer)object);
+ elements.addAll(getAllEntries((PaletteContainer)object));
+ } else if(object instanceof ToolEntry) {
+ elements.add((ToolEntry)object);
+ }
+ }
+ return elements;
+ }
+
+ /**
+ * Returns all available entries for the given editor ID
+ *
+ * @param editorID
+ * the editor to be contributed
+ * @param priority
+ * the priority max for the entries
+ * @return the set of available entries
+ */
+ public static Set<? extends PaletteEntry> getAvailableEntries(IEditorPart part, ProviderPriority priority) {
+ Set<? extends PaletteEntry> entries = new HashSet<PaletteEntry>();
+
+ // retrieve all provider for the given editor ID
+ PaletteRoot root = new PaletteRoot();
+ List<? extends PapyrusPaletteService.ProviderDescriptor> providers = (List<? extends ProviderDescriptor>)PapyrusPaletteService.getInstance().getProviders();
+ ContributeToPaletteOperation operation = new ContributeToPaletteOperation(part, part.getEditorInput(), root, new HashMap<Object, Object>());
+
+ // generate for each provider, according to priority
+ @SuppressWarnings("unchecked")
+ List<PapyrusPaletteService.ProviderDescriptor> providerList = (List<PapyrusPaletteService.ProviderDescriptor>)PapyrusPaletteService.getInstance().getProviders();
+ for(PapyrusPaletteService.ProviderDescriptor descriptor : providerList) {
+ int compare = descriptor.getPriority().compareTo(priority);
+ if(compare < 0) {
+ if(descriptor.providesWithVisibility(operation)) {
+ ((IPaletteProvider)descriptor.getProvider()).contributeToPalette(part, part.getEditorInput(), root, new HashMap<Object, Object>());
+ }
+ }
+ }
+ return entries;
+ }
+
+ /**
+ * Returns all available entries for the given editor ID
+ *
+ * @param editorID
+ * the editor to be contributed
+ * @param priority
+ * the priority max for the entries
+ * @return the set of available entries
+ */
+ public static Map<String, PaletteEntry> getAvailableEntriesSet(IEditorPart part, ProviderPriority priority) {
+ Map<String, PaletteEntry> entries = new HashMap<String, PaletteEntry>();
+
+ // retrieve all provider for the given editor ID
+ PaletteRoot root = new PaletteRoot();
+ List<? extends PapyrusPaletteService.ProviderDescriptor> providers = (List<? extends ProviderDescriptor>)PapyrusPaletteService.getInstance().getProviders();
+ ContributeToPaletteOperation operation = new ContributeToPaletteOperation(part, part.getEditorInput(), root, entries);
+
+ // generate for each provider, according to priority
+ @SuppressWarnings("unchecked")
+ List<PapyrusPaletteService.ProviderDescriptor> providerList = (List<PapyrusPaletteService.ProviderDescriptor>)PapyrusPaletteService.getInstance().getProviders();
+ for(PapyrusPaletteService.ProviderDescriptor descriptor : providerList) {
+ int compare = descriptor.getPriority().compareTo(priority);
+ if(compare <= 0) {
+ if(descriptor.providesWithVisibility(operation)) {
+ ((IPaletteProvider)descriptor.getProvider()).contributeToPalette(part, part.getEditorInput(), root, entries);
+ }
+ }
+ }
+ return entries;
+ }
+
+ /**
+ * Returns the list of stereotypes String from a serialize string form
+ *
+ * @param serializedForm
+ * the serialized form of the list of stereotypes
+ * @return the list of stereotypes String from a serialize string form
+ */
+ public static List<String> getStereotypeListFromString(String serializedForm) {
+ StringTokenizer tokenizer = new StringTokenizer(serializedForm, ",");
+ List<String> list = new ArrayList<String>();
+ while(tokenizer.hasMoreElements()) {
+ list.add(tokenizer.nextToken().trim());
+ }
+ return list;
+ }
+
+ /**
+ * Returns the list of stereotypes String under a serialized form
+ *
+ * @param list
+ * the list of stereotypes to serialize
+ * @return the list of stereotypes String under a serialized form
+ */
+ public static String getSerializedStereotypeList(Collection<String> stereotypes) {
+ return convertToCommaSeparatedRepresentation(stereotypes);
+ }
+
+ /**
+ * Returns the name of the profile from the given stereotype qualified Name
+ *
+ * @param stereotypeName
+ * the name of the stereotype to parse
+ * @return the qualified name of the profile from the given stereotype
+ * qualified Name
+ */
+ public static String findProfileNameFromStereotypeName(String stereotypeName) {
+ return stereotypeName.substring(0, stereotypeName.lastIndexOf(NamedElement.SEPARATOR));
+ }
+
+ /**
+ * Returns the list of profile Qualified Names String under a serialized
+ * form
+ *
+ * @param list
+ * the list of profiles to serialize
+ * @return the list of profiles String under a serialized form
+ */
+ public static String getSerializedProfileList(Collection<String> profiles) {
+ return convertToCommaSeparatedRepresentation(profiles);
+ }
+
+ public static String convertToCommaSeparatedRepresentation(Collection objects) {
+ return convertToFlatRepresentation(objects, ",");
+ }
+
+ public static String convertToFlatRepresentation(Collection objects, String separator) {
+ StringBuilder buffer = new StringBuilder();
+ Iterator it = objects.iterator();
+ while(it.hasNext()) {
+ buffer.append(it.next());
+ if(it.hasNext()) {
+ buffer.append(separator);
+ }
+ }
+ return buffer.toString();
+ }
+
+ /**
+ * Returns the list of profiles String from a serialize string form
+ *
+ * @param serializedForm
+ * the serialized form of the list of stereotypes
+ * @return the list of profiles String from a serialize string form
+ */
+ public static Set<String> getProfileSetFromString(String serializedForm) {
+ StringTokenizer tokenizer = new StringTokenizer(serializedForm, ",");
+ Set<String> list = new HashSet<String>();
+ while(tokenizer.hasMoreElements()) {
+ list.add(tokenizer.nextToken());
+ }
+ return list;
+ }
+
+ /**
+ * returns <code>true</code> if the descriptor have all necessary profiles
+ *
+ * @param part
+ * the editor part for which the palette is shown
+ * @param papyrusProviderDesc
+ * the current provider descriptor to test
+ * @return <code>true</code> if all required profile are present
+ */
+ public static boolean areRequiredProfileApplied(IEditorPart part, PapyrusPaletteService.ProviderDescriptor papyrusProviderDesc) {
+ if(!(part instanceof DiagramEditorWithFlyOutPalette)) {
+ PapyrusTrace.log(IStatus.WARNING, "trying to check a papyrus palette descriptor outside papyrus framework");
+ return false;
+ }
+ if(papyrusProviderDesc instanceof PapyrusPaletteService.LocalProviderDescriptor) {
+ IPaletteDescription description = ((PapyrusPaletteService.LocalProviderDescriptor)papyrusProviderDesc).getDescription();
+ // checks the presence of required profile
+ Diagram diagram = ((DiagramEditorWithFlyOutPalette)part).getDiagram();
+ EObject element = diagram.getElement();
+ if(element instanceof Element) {
+ org.eclipse.uml2.uml.Package package_ = ((Element)element).getNearestPackage();
+ List<Profile> appliedProfiles = package_.getAllAppliedProfiles();
+ List<String> appliedProfilesNames = new ArrayList<String>();
+ for(Profile profile : appliedProfiles) {
+ appliedProfilesNames.add(profile.getQualifiedName());
+ }
+
+ // compare to the list of profiles used by the palette
+ Map<String, String> properties = description.getProperties();
+ if(description != null) {
+ String requiredProfilesList = properties.get(IPapyrusPaletteConstant.PROFILE_LIST);
+ if(requiredProfilesList != null) {
+ // parse requiredProfile string (profile1QN, profile2QN,
+ // etc.)
+ Set<String> requiredProfiles = PaletteUtil.getProfileSetFromString(requiredProfilesList);
+ for(String requiredProfileName : requiredProfiles) {
+ if(!appliedProfilesNames.contains(requiredProfileName)) {
+ return false;
+ }
+ }
+ }
+ }
+ }
+ } else {
+ IProvider provider = papyrusProviderDesc.getProvider();
+ if(provider instanceof IProfileDependantPaletteProvider) {
+ Diagram diagram = ((DiagramEditorWithFlyOutPalette)part).getDiagram();
+ EObject element = diagram.getElement();
+ if(element instanceof Element) {
+ org.eclipse.uml2.uml.Package package_ = ((Element)element).getNearestPackage();
+ List<Profile> appliedProfiles = package_.getAllAppliedProfiles();
+ List<String> appliedProfilesNames = new ArrayList<String>();
+ for(Profile profile : appliedProfiles) {
+ appliedProfilesNames.add(profile.getQualifiedName());
+ }
+ // not null also
+ Collection<String> requiredProfiles = ((IProfileDependantPaletteProvider)provider).getRequiredProfiles();
+ for(String requiredProfileName : requiredProfiles) {
+ if(!appliedProfilesNames.contains(requiredProfileName)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ }
+ // by default, returns true if the descriptor is not a local descriptor,
+ // as they do not use
+ // profile
+ return true;
+ }
+
+ public static void initAspectActions(NodeList aspectActionNodes, List<IPostAction> postActions, List<IPreAction> preActions) {
+ for(int i = 0; i < aspectActionNodes.getLength(); i++) {
+ Node childNode = aspectActionNodes.item(i);
+ String childName = childNode.getNodeName();
+ if(IPapyrusPaletteConstant.POST_ACTION.equals(childName)) {
+ // node is a post action => retrieve the id of the factory in charge of this configuration
+ IAspectActionProvider provider = AspectToolService.getInstance().getProvider(AspectToolService.getProviderId(childNode));
+ if(provider != null) {
+ IAspectAction action = provider.createAction(childNode);
+ if (action instanceof IPostAction) {
+ postActions.add((IPostAction)action);
+ }
+ } else {
+ Activator.log.error("impossible to find factory with id: " + AspectToolService.getProviderId(childNode), null);
+ }
+ } else if(IPapyrusPaletteConstant.PRE_ACTION.equals(childName)) {
+ // node is a pre action => retrieve the id of the factory in charge of this configuration
+ IAspectActionProvider provider = AspectToolService.getInstance().getProvider(AspectToolService.getProviderId(childNode));
+ if(provider != null) {
+ IAspectAction action = provider.createAction(childNode);
+ if (action instanceof IPreAction) {
+ preActions.add((IPreAction)action);
+ }
+ } else {
+ Activator.log.error("impossible to find factory with id: " + AspectToolService.getProviderId(childNode), null);
+ }
+ }
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteContextMenuProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteContextMenuProvider.java
index f180e1caa20..a382e5286d6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteContextMenuProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteContextMenuProvider.java
@@ -1,49 +1,49 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import org.eclipse.gef.ui.actions.GEFActionConstants;
-import org.eclipse.gef.ui.palette.PaletteContextMenuProvider;
-import org.eclipse.gef.ui.palette.PaletteViewer;
-import org.eclipse.jface.action.IMenuManager;
-
-/**
- * Specific context menu provider for Papyrus diagrams
- */
-public class PapyrusPaletteContextMenuProvider extends PaletteContextMenuProvider {
-
- /**
- * Creates a new PaletteContextMenuProvider
- *
- * @param palette
- * the palette for which the context menu has to be buuild
- */
- public PapyrusPaletteContextMenuProvider(PaletteViewer palette) {
- super(palette);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void buildContextMenu(IMenuManager menu) {
- super.buildContextMenu(menu);
-
- // adds a new action with sub-menu to display which providers must be
- // displayed and which
- // ones should be hidden
- menu.appendToGroup(GEFActionConstants.GROUP_REST, new PaletteMenuAction(getPaletteViewer()));
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import org.eclipse.gef.ui.actions.GEFActionConstants;
+import org.eclipse.gef.ui.palette.PaletteContextMenuProvider;
+import org.eclipse.gef.ui.palette.PaletteViewer;
+import org.eclipse.jface.action.IMenuManager;
+
+/**
+ * Specific context menu provider for Papyrus diagrams
+ */
+public class PapyrusPaletteContextMenuProvider extends PaletteContextMenuProvider {
+
+ /**
+ * Creates a new PaletteContextMenuProvider
+ *
+ * @param palette
+ * the palette for which the context menu has to be buuild
+ */
+ public PapyrusPaletteContextMenuProvider(PaletteViewer palette) {
+ super(palette);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void buildContextMenu(IMenuManager menu) {
+ super.buildContextMenu(menu);
+
+ // adds a new action with sub-menu to display which providers must be
+ // displayed and which
+ // ones should be hidden
+ menu.appendToGroup(GEFActionConstants.GROUP_REST, new PaletteMenuAction(getPaletteViewer()));
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteCustomizer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteCustomizer.java
index 684cc0f5869..bbbbe933f73 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteCustomizer.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteCustomizer.java
@@ -1,399 +1,399 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.eclipse.gef.palette.PaletteContainer;
-import org.eclipse.gef.palette.PaletteDrawer;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.customize.DefaultEntryPage;
-import org.eclipse.gef.ui.palette.customize.DrawerEntryPage;
-import org.eclipse.gef.ui.palette.customize.EntryPage;
-import org.eclipse.gmf.runtime.gef.ui.palette.customize.IPaletteState;
-import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteCustomizerEx;
-import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteDrawerState;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
-
-/**
- * Customizer for the palette viewer
- */
-public class PapyrusPaletteCustomizer extends PaletteCustomizerEx {
-
- /** maps that stores the modification of parents */
- protected Map<PaletteEntry, PaletteContainer> changedParents = new HashMap<PaletteEntry, PaletteContainer>();
-
- /**
- * Creates a new PapyrusPaletteCustomizer.
- *
- * @param preferenceStore
- * the preference store associated to this palette customizer
- */
- public PapyrusPaletteCustomizer(IPreferenceStore preferenceStore) {
- super(preferenceStore);
- this.preferences = preferenceStore;
- }
-
- /**
- * Returns the change parents
- *
- * @return the change parents
- */
- public Map<PaletteEntry, PaletteContainer> getChangedParents() {
- return changedParents;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void applyCustomizationsToPalette(PaletteRoot paletteRoot) {
- XMLMemento rootMemento = getExistingCustomizations();
- if(rootMemento != null) {
- applyCustomizations(rootMemento, paletteRoot, rootMemento);
- }
-
- // must now clean the palette, as the element whose parent container is
- // changed is not
- // removed from its old container...
- // 1. ContainerA -< PaletteA, ContainerB
- // 2. apply customization => ContainerA -< PaletteA, ContainerB -<
- // PaletteA (setParent =
- // ContainerB)
- // 3. clean => remove PaletteA from ContainerA.
- // issue => cannot modify the list of children of containerA in
- // applyCustomization because
- // of the iterator system (concurrent modification)
- // so, clean palette using a specific method
- // 4. goal: ContainerA, ContainerB -< PaletteA
-
- // FIXME made by a new palette definition now
- // cleanPalette(paletteRoot);
- }
-
- /**
- * Cleans the given palette root from its entries
- *
- * @param paletteRoot
- */
- protected void cleanPalette(PaletteContainer paletteContainer) {
- // copy children list, then iterate, so the original children list can
- // be modified...
- List<PaletteEntry> children = new ArrayList<PaletteEntry>(paletteContainer.getChildren().size());
- for(Object o : paletteContainer.getChildren()) {
- children.add((PaletteEntry)o);
- }
-
- for(PaletteEntry entry : children) {
- // if parent is not the correct one, delete this child from the
- // children list
- if(entry.getParent() != paletteContainer) {
- paletteContainer.getChildren().remove(entry);
- }
- // call for sub-containers
- if(entry instanceof PaletteContainer) {
- cleanPalette((PaletteContainer)entry);
- }
- }
- }
-
- /**
- * Creation factory method for the <code>IPaletteState</code>. Clients may
- * override to provide custom <code>IPaletteStates</code>.
- *
- * @param entry
- * the palette entry
- * @return a new <code>IPaletteState</code> instance.
- */
- protected IPaletteState createPaletteState(PaletteEntry entry) {
- if(entry instanceof PaletteDrawer) {
- return new PaletteDrawerState((PaletteDrawer)entry);
- } else {
- // specific papyrus entry state. It manages at least the parent
- // customization
- return new PapyrusPaletteEntryState(entry);
- }
- }
-
- /**
- * id used in the workspace preference store for palette customizations
- */
- private static final String PALETTE_CUSTOMIZATIONS_ID = "org.eclipse.gmf.runtime.diagram.ui.paletteCustomizations"; //$NON-NLS-1$
-
- /**
- * Matches each palette entry with a palette state.
- */
- private HashMap<PaletteEntry, IPaletteState> paletteStates = new HashMap<PaletteEntry, IPaletteState>();
-
- /**
- * the preference store in which the palette customizations are to be saved
- * and retrieved from
- */
- private IPreferenceStore preferences;
-
- public EntryPage getPropertiesPage(PaletteEntry entry) {
- if(entry.getType().equals(PaletteDrawer.PALETTE_TYPE_DRAWER)) {
- return new PapyrusDrawerEntryPage();
- }
- return new PapyrusDefaultEntryPage();
- }
-
- /**
- * Stores the palette state for a given palette entry if the state has not
- * yet been stored.
- *
- * @param entry
- * the palette entry
- */
- public void storePaletteState(PaletteEntry entry) {
- if(paletteStates.get(entry) != null) {
- // the palette state has already been stored
- return;
- }
-
- IPaletteState paletteState = createPaletteState(entry);
- paletteState.storeState();
-
- paletteStates.put(entry, paletteState);
- }
-
- public void revertToSaved() {
- for(Iterator<Entry<PaletteEntry, IPaletteState>> iterator = paletteStates.entrySet().iterator(); iterator.hasNext();) {
- Entry<PaletteEntry, IPaletteState> entry = iterator.next();
- entry.getValue().rollback();
- }
- paletteStates.clear();
- }
-
- public void save() {
- if(paletteStates.isEmpty()) {
- return;
- }
-
- // If there are already existing palette customizations we will add to
- // them, otherwise, create a new XML memento which makes it easy to save
- // the customizations in a tree format.
- XMLMemento rootMemento = getExistingCustomizations();
- if(rootMemento == null) {
- rootMemento = XMLMemento.createWriteRoot(PALETTE_CUSTOMIZATIONS_ID);
- }
- for(Iterator<Entry<PaletteEntry, IPaletteState>> iterator = paletteStates.entrySet().iterator(); iterator.hasNext();) {
- Entry<PaletteEntry, IPaletteState> entry = iterator.next();
-
- IMemento memento = getMementoForEntry(rootMemento, entry.getKey());
- if(memento != null) {
- entry.getValue().storeChangesInMemento(memento);
- }
- }
-
- StringWriter writer = new StringWriter();
- try {
- rootMemento.save(writer);
-
- if(preferences != null) {
- preferences.setValue(PALETTE_CUSTOMIZATIONS_ID, writer.toString());
- }
- } catch (IOException e) {
- Activator.getDefault().logError("Error while saving preferences for palette", e);
- }
-
- paletteStates.clear();
- }
-
- /**
- * Given the rootMemento, gets the memento that already exists for the
- * palette entry or creates a new one in the rootMemento (and the necessary
- * palette container mementos) if one does not exist yet. The root memento's
- * tree structure matches that of the palette root. If a palette entry in
- * stack A, in drawer B is customized, the root memento will have a child
- * memento for drawer B which has a child memento for stack A which has a
- * child memento for the entry. The memento's use the palette entry's id.
- *
- * @param rootMemento
- * the root memento representing the palette root
- * @param paletteEntry
- * the palette entry for which a memento should be retrieved or
- * created
- * @return returns the memento that already exists for the palette entry or
- * creates a new one in the rootMemento if one does not exist yet or
- * null if the memento could not be created (most likely because the
- * palete id is not acceptable).
- */
- private IMemento getMementoForEntry(IMemento rootMemento, PaletteEntry paletteEntry) {
-
- ArrayList<String> idList = new ArrayList<String>();
- idList.add(paletteEntry.getId());
-
- // modification of GMF code to have the parent. takes the default parent
- // instead of the
- // actual one...
- PaletteContainer parent = changedParents.get(paletteEntry);
- if(parent == null) {
- parent = paletteEntry.getParent();
- }
- while(parent != null && !PaletteRoot.PALETTE_TYPE_ROOT.equals(parent.getType())) {
- idList.add(parent.getId());
- parent = parent.getParent();
- }
-
- // go through ids in reverse order and create the mementos as necessary
- IMemento containerMemento = rootMemento;
- for(int i = idList.size() - 1; i >= 0; i--) {
- String id = idList.get(i);
- IMemento memento = containerMemento.getChild(id);
- if(memento == null) {
- try {
- memento = containerMemento.createChild(id);
- } catch (Exception e) {
- Activator.getDefault().logError("Error while reading preferences for palette", e);
- return null;
- }
- }
- containerMemento = memento;
- }
-
- return containerMemento;
- }
-
- /**
- * Recursive helper method to apply the palette customizations in a memento
- * to a palette container.
- *
- * @param containerMemento
- * the mememto where the container's customizations are stored
- * @param paletteContainer
- * the palette container on which to apply the customizations
- */
- private void applyCustomizations(IMemento containerMemento, PaletteContainer paletteContainer, IMemento rootMemento) {
-
- for(Iterator iterator = paletteContainer.getChildren().iterator(); iterator.hasNext();) {
- PaletteEntry entry = (PaletteEntry)iterator.next();
- IMemento childMemento = containerMemento.getChild(entry.getId());
- if(childMemento != null) {
- // check that the memento does not change the parent of the
- // entry
- if(isChangingParent(entry, childMemento)) {
- changedParents.put(entry, entry.getParent());
- }
-
- IPaletteState state = createPaletteState(entry);
- state.applyChangesFromMemento(childMemento);
- if(entry instanceof PaletteContainer) {
- applyCustomizations(childMemento, (PaletteContainer)entry, rootMemento);
- }
- }
-
- }
- }
-
- protected boolean isChangingParent(PaletteEntry entry, IMemento childMemento) {
- String parentId = childMemento.getString(PapyrusPaletteEntryState.PARENT_ID_KEY);
- if(parentId == null) {
- return false;
- }
- return !(entry.getParent().getId().equals(parentId));
- }
-
- /**
- * Retrieves the root memento from the workspace preferences if there were
- * existing palette customizations.
- *
- * @return the root memento if there were existing customizations; null
- * otherwise
- */
- private XMLMemento getExistingCustomizations() {
- if(preferences != null) {
- String sValue = preferences.getString(PALETTE_CUSTOMIZATIONS_ID);
- if(sValue != null && !sValue.equals("")) { //$NON-NLS-1$
- try {
- XMLMemento rootMemento = XMLMemento.createReadRoot(new StringReader(sValue));
- return rootMemento;
- } catch (WorkbenchException e) {
- Activator.getDefault().logError("Error while reading preferences for palette", e);
- }
- }
- }
- return null;
- }
-
- /**
- * Customized so that the palette state can be saved before the change is
- * made to the palette model so that: <li>when the cancel button is pressed, the stored state can be restored</li> <li>when the save button is
- * pressed, the customizations made since the state was stored can be written to the workspace preferences</li>
- */
- private class PapyrusDefaultEntryPage extends DefaultEntryPage {
-
- protected void handleDescriptionChanged(String text) {
- storePaletteState(getEntry());
- super.handleDescriptionChanged(text);
- }
-
- protected void handleHiddenSelected(boolean isChecked) {
- storePaletteState(getEntry());
- super.handleHiddenSelected(isChecked);
- }
-
- protected void handleNameChanged(String text) {
- storePaletteState(getEntry());
- super.handleNameChanged(text);
- }
-
- }
-
- /**
- * Customized so that the palette state can be saved before the change is
- * made to the palette model so that: <li>when the cancel button is pressed, the stored state can be restored</li> <li>when the save button is
- * pressed, the customizations made since the state was stored can be written to the workspace preferences</li>
- */
- public class PapyrusDrawerEntryPage extends DrawerEntryPage {
-
- protected void handleOpenSelected(boolean selection) {
- storePaletteState(getEntry());
- super.handleOpenSelected(selection);
- }
-
- protected void handlePinSelected(boolean selection) {
- storePaletteState(getEntry());
- super.handlePinSelected(selection);
- }
-
- protected void handleDescriptionChanged(String text) {
- storePaletteState(getEntry());
- super.handleDescriptionChanged(text);
- }
-
- protected void handleHiddenSelected(boolean isChecked) {
- storePaletteState(getEntry());
- super.handleHiddenSelected(isChecked);
- }
-
- protected void handleNameChanged(String text) {
- storePaletteState(getEntry());
- super.handleNameChanged(text);
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.eclipse.gef.palette.PaletteContainer;
+import org.eclipse.gef.palette.PaletteDrawer;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.ui.palette.customize.DefaultEntryPage;
+import org.eclipse.gef.ui.palette.customize.DrawerEntryPage;
+import org.eclipse.gef.ui.palette.customize.EntryPage;
+import org.eclipse.gmf.runtime.gef.ui.palette.customize.IPaletteState;
+import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteCustomizerEx;
+import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteDrawerState;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
+
+/**
+ * Customizer for the palette viewer
+ */
+public class PapyrusPaletteCustomizer extends PaletteCustomizerEx {
+
+ /** maps that stores the modification of parents */
+ protected Map<PaletteEntry, PaletteContainer> changedParents = new HashMap<PaletteEntry, PaletteContainer>();
+
+ /**
+ * Creates a new PapyrusPaletteCustomizer.
+ *
+ * @param preferenceStore
+ * the preference store associated to this palette customizer
+ */
+ public PapyrusPaletteCustomizer(IPreferenceStore preferenceStore) {
+ super(preferenceStore);
+ this.preferences = preferenceStore;
+ }
+
+ /**
+ * Returns the change parents
+ *
+ * @return the change parents
+ */
+ public Map<PaletteEntry, PaletteContainer> getChangedParents() {
+ return changedParents;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void applyCustomizationsToPalette(PaletteRoot paletteRoot) {
+ XMLMemento rootMemento = getExistingCustomizations();
+ if(rootMemento != null) {
+ applyCustomizations(rootMemento, paletteRoot, rootMemento);
+ }
+
+ // must now clean the palette, as the element whose parent container is
+ // changed is not
+ // removed from its old container...
+ // 1. ContainerA -< PaletteA, ContainerB
+ // 2. apply customization => ContainerA -< PaletteA, ContainerB -<
+ // PaletteA (setParent =
+ // ContainerB)
+ // 3. clean => remove PaletteA from ContainerA.
+ // issue => cannot modify the list of children of containerA in
+ // applyCustomization because
+ // of the iterator system (concurrent modification)
+ // so, clean palette using a specific method
+ // 4. goal: ContainerA, ContainerB -< PaletteA
+
+ // FIXME made by a new palette definition now
+ // cleanPalette(paletteRoot);
+ }
+
+ /**
+ * Cleans the given palette root from its entries
+ *
+ * @param paletteRoot
+ */
+ protected void cleanPalette(PaletteContainer paletteContainer) {
+ // copy children list, then iterate, so the original children list can
+ // be modified...
+ List<PaletteEntry> children = new ArrayList<PaletteEntry>(paletteContainer.getChildren().size());
+ for(Object o : paletteContainer.getChildren()) {
+ children.add((PaletteEntry)o);
+ }
+
+ for(PaletteEntry entry : children) {
+ // if parent is not the correct one, delete this child from the
+ // children list
+ if(entry.getParent() != paletteContainer) {
+ paletteContainer.getChildren().remove(entry);
+ }
+ // call for sub-containers
+ if(entry instanceof PaletteContainer) {
+ cleanPalette((PaletteContainer)entry);
+ }
+ }
+ }
+
+ /**
+ * Creation factory method for the <code>IPaletteState</code>. Clients may
+ * override to provide custom <code>IPaletteStates</code>.
+ *
+ * @param entry
+ * the palette entry
+ * @return a new <code>IPaletteState</code> instance.
+ */
+ protected IPaletteState createPaletteState(PaletteEntry entry) {
+ if(entry instanceof PaletteDrawer) {
+ return new PaletteDrawerState((PaletteDrawer)entry);
+ } else {
+ // specific papyrus entry state. It manages at least the parent
+ // customization
+ return new PapyrusPaletteEntryState(entry);
+ }
+ }
+
+ /**
+ * id used in the workspace preference store for palette customizations
+ */
+ private static final String PALETTE_CUSTOMIZATIONS_ID = "org.eclipse.gmf.runtime.diagram.ui.paletteCustomizations"; //$NON-NLS-1$
+
+ /**
+ * Matches each palette entry with a palette state.
+ */
+ private HashMap<PaletteEntry, IPaletteState> paletteStates = new HashMap<PaletteEntry, IPaletteState>();
+
+ /**
+ * the preference store in which the palette customizations are to be saved
+ * and retrieved from
+ */
+ private IPreferenceStore preferences;
+
+ public EntryPage getPropertiesPage(PaletteEntry entry) {
+ if(entry.getType().equals(PaletteDrawer.PALETTE_TYPE_DRAWER)) {
+ return new PapyrusDrawerEntryPage();
+ }
+ return new PapyrusDefaultEntryPage();
+ }
+
+ /**
+ * Stores the palette state for a given palette entry if the state has not
+ * yet been stored.
+ *
+ * @param entry
+ * the palette entry
+ */
+ public void storePaletteState(PaletteEntry entry) {
+ if(paletteStates.get(entry) != null) {
+ // the palette state has already been stored
+ return;
+ }
+
+ IPaletteState paletteState = createPaletteState(entry);
+ paletteState.storeState();
+
+ paletteStates.put(entry, paletteState);
+ }
+
+ public void revertToSaved() {
+ for(Iterator<Entry<PaletteEntry, IPaletteState>> iterator = paletteStates.entrySet().iterator(); iterator.hasNext();) {
+ Entry<PaletteEntry, IPaletteState> entry = iterator.next();
+ entry.getValue().rollback();
+ }
+ paletteStates.clear();
+ }
+
+ public void save() {
+ if(paletteStates.isEmpty()) {
+ return;
+ }
+
+ // If there are already existing palette customizations we will add to
+ // them, otherwise, create a new XML memento which makes it easy to save
+ // the customizations in a tree format.
+ XMLMemento rootMemento = getExistingCustomizations();
+ if(rootMemento == null) {
+ rootMemento = XMLMemento.createWriteRoot(PALETTE_CUSTOMIZATIONS_ID);
+ }
+ for(Iterator<Entry<PaletteEntry, IPaletteState>> iterator = paletteStates.entrySet().iterator(); iterator.hasNext();) {
+ Entry<PaletteEntry, IPaletteState> entry = iterator.next();
+
+ IMemento memento = getMementoForEntry(rootMemento, entry.getKey());
+ if(memento != null) {
+ entry.getValue().storeChangesInMemento(memento);
+ }
+ }
+
+ StringWriter writer = new StringWriter();
+ try {
+ rootMemento.save(writer);
+
+ if(preferences != null) {
+ preferences.setValue(PALETTE_CUSTOMIZATIONS_ID, writer.toString());
+ }
+ } catch (IOException e) {
+ Activator.getDefault().logError("Error while saving preferences for palette", e);
+ }
+
+ paletteStates.clear();
+ }
+
+ /**
+ * Given the rootMemento, gets the memento that already exists for the
+ * palette entry or creates a new one in the rootMemento (and the necessary
+ * palette container mementos) if one does not exist yet. The root memento's
+ * tree structure matches that of the palette root. If a palette entry in
+ * stack A, in drawer B is customized, the root memento will have a child
+ * memento for drawer B which has a child memento for stack A which has a
+ * child memento for the entry. The memento's use the palette entry's id.
+ *
+ * @param rootMemento
+ * the root memento representing the palette root
+ * @param paletteEntry
+ * the palette entry for which a memento should be retrieved or
+ * created
+ * @return returns the memento that already exists for the palette entry or
+ * creates a new one in the rootMemento if one does not exist yet or
+ * null if the memento could not be created (most likely because the
+ * palete id is not acceptable).
+ */
+ private IMemento getMementoForEntry(IMemento rootMemento, PaletteEntry paletteEntry) {
+
+ ArrayList<String> idList = new ArrayList<String>();
+ idList.add(paletteEntry.getId());
+
+ // modification of GMF code to have the parent. takes the default parent
+ // instead of the
+ // actual one...
+ PaletteContainer parent = changedParents.get(paletteEntry);
+ if(parent == null) {
+ parent = paletteEntry.getParent();
+ }
+ while(parent != null && !PaletteRoot.PALETTE_TYPE_ROOT.equals(parent.getType())) {
+ idList.add(parent.getId());
+ parent = parent.getParent();
+ }
+
+ // go through ids in reverse order and create the mementos as necessary
+ IMemento containerMemento = rootMemento;
+ for(int i = idList.size() - 1; i >= 0; i--) {
+ String id = idList.get(i);
+ IMemento memento = containerMemento.getChild(id);
+ if(memento == null) {
+ try {
+ memento = containerMemento.createChild(id);
+ } catch (Exception e) {
+ Activator.getDefault().logError("Error while reading preferences for palette", e);
+ return null;
+ }
+ }
+ containerMemento = memento;
+ }
+
+ return containerMemento;
+ }
+
+ /**
+ * Recursive helper method to apply the palette customizations in a memento
+ * to a palette container.
+ *
+ * @param containerMemento
+ * the mememto where the container's customizations are stored
+ * @param paletteContainer
+ * the palette container on which to apply the customizations
+ */
+ private void applyCustomizations(IMemento containerMemento, PaletteContainer paletteContainer, IMemento rootMemento) {
+
+ for(Iterator iterator = paletteContainer.getChildren().iterator(); iterator.hasNext();) {
+ PaletteEntry entry = (PaletteEntry)iterator.next();
+ IMemento childMemento = containerMemento.getChild(entry.getId());
+ if(childMemento != null) {
+ // check that the memento does not change the parent of the
+ // entry
+ if(isChangingParent(entry, childMemento)) {
+ changedParents.put(entry, entry.getParent());
+ }
+
+ IPaletteState state = createPaletteState(entry);
+ state.applyChangesFromMemento(childMemento);
+ if(entry instanceof PaletteContainer) {
+ applyCustomizations(childMemento, (PaletteContainer)entry, rootMemento);
+ }
+ }
+
+ }
+ }
+
+ protected boolean isChangingParent(PaletteEntry entry, IMemento childMemento) {
+ String parentId = childMemento.getString(PapyrusPaletteEntryState.PARENT_ID_KEY);
+ if(parentId == null) {
+ return false;
+ }
+ return !(entry.getParent().getId().equals(parentId));
+ }
+
+ /**
+ * Retrieves the root memento from the workspace preferences if there were
+ * existing palette customizations.
+ *
+ * @return the root memento if there were existing customizations; null
+ * otherwise
+ */
+ private XMLMemento getExistingCustomizations() {
+ if(preferences != null) {
+ String sValue = preferences.getString(PALETTE_CUSTOMIZATIONS_ID);
+ if(sValue != null && !sValue.equals("")) { //$NON-NLS-1$
+ try {
+ XMLMemento rootMemento = XMLMemento.createReadRoot(new StringReader(sValue));
+ return rootMemento;
+ } catch (WorkbenchException e) {
+ Activator.getDefault().logError("Error while reading preferences for palette", e);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Customized so that the palette state can be saved before the change is
+ * made to the palette model so that: <li>when the cancel button is pressed, the stored state can be restored</li> <li>when the save button is
+ * pressed, the customizations made since the state was stored can be written to the workspace preferences</li>
+ */
+ private class PapyrusDefaultEntryPage extends DefaultEntryPage {
+
+ protected void handleDescriptionChanged(String text) {
+ storePaletteState(getEntry());
+ super.handleDescriptionChanged(text);
+ }
+
+ protected void handleHiddenSelected(boolean isChecked) {
+ storePaletteState(getEntry());
+ super.handleHiddenSelected(isChecked);
+ }
+
+ protected void handleNameChanged(String text) {
+ storePaletteState(getEntry());
+ super.handleNameChanged(text);
+ }
+
+ }
+
+ /**
+ * Customized so that the palette state can be saved before the change is
+ * made to the palette model so that: <li>when the cancel button is pressed, the stored state can be restored</li> <li>when the save button is
+ * pressed, the customizations made since the state was stored can be written to the workspace preferences</li>
+ */
+ public class PapyrusDrawerEntryPage extends DrawerEntryPage {
+
+ protected void handleOpenSelected(boolean selection) {
+ storePaletteState(getEntry());
+ super.handleOpenSelected(selection);
+ }
+
+ protected void handlePinSelected(boolean selection) {
+ storePaletteState(getEntry());
+ super.handlePinSelected(selection);
+ }
+
+ protected void handleDescriptionChanged(String text) {
+ storePaletteState(getEntry());
+ super.handleDescriptionChanged(text);
+ }
+
+ protected void handleHiddenSelected(boolean isChecked) {
+ storePaletteState(getEntry());
+ super.handleHiddenSelected(isChecked);
+ }
+
+ protected void handleNameChanged(String text) {
+ storePaletteState(getEntry());
+ super.handleNameChanged(text);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteDescription.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteDescription.java
index 6d8f9452cc3..d0f03e2c58f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteDescription.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteDescription.java
@@ -1,183 +1,183 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.ui.IMemento;
-
-/**
- * Class that defines a profile for a palette.
- */
-public class PapyrusPaletteDescription implements IPaletteDescription {
-
- /** name of the palette */
- private String name;
-
- /** id of the editor to contribute */
- private String contributionEditorID;
-
- /** contribution of this palette */
- private Object contributions;
-
- /** id of the palette */
- private String paletteID;
-
- /** priority of the palette */
- private ProviderPriority priority;
-
- /** properties of the palette */
- private Map<String, String> properties;
-
- /**
- * Creates a new PapyrusPaletteDescription.
- */
- public PapyrusPaletteDescription() {
- }
-
- /**
- * Create a new Palette description using a preference memento
- *
- * @param memento
- * the memento from which to read the description
- * @return the content of the palette
- */
- public static IPaletteDescription create(IMemento memento) {
- final PapyrusPaletteDescription description = new PapyrusPaletteDescription();
- description.setName(memento.getString(IPapyrusPaletteConstant.NAME));
- description.setPaletteID(memento.getString(IPapyrusPaletteConstant.ID));
- description.setContributionEditorID(memento.getString(IPapyrusPaletteConstant.EDITOR_ID));
- description.setContributions(memento.getString(IPapyrusPaletteConstant.PATH));
- description.setPriority(ProviderPriority.parse(memento.getString(IPapyrusPaletteConstant.PRIORITY)));
-
- // retrieve the map of properties
- IMemento propertiesMemento = memento.getChild(IPapyrusPaletteConstant.PALETTE_DESCRIPTION_PROPERTIES);
- Map<String, String> properties = new HashMap<String, String>();
- if(propertiesMemento != null) {
- // retrieve the child name/value tuple for each children
- for(String key : propertiesMemento.getAttributeKeys()) {
- properties.put(key, propertiesMemento.getString(key));
- }
- }
- description.setProperties(properties);
- // contributions: do not read the file before it is necessary...
- return description;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getContributionEditorID() {
- return contributionEditorID;
- }
-
- /**
- * {@inheritDoc}
- */
- public Object getContributions() {
- return contributions;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the name of the palette description
- *
- * @param name
- * the name to set
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Sets the id of the editor to contribute
- *
- * @param contributionEditorID
- * the contributionEditorID to set
- */
- public void setContributionEditorID(String contributionEditorID) {
- this.contributionEditorID = contributionEditorID;
- }
-
- /**
- * Sets the contributions of this palette
- *
- * @param contributions
- * the contributions to set
- */
- public void setContributions(Object contributions) {
- this.contributions = contributions;
- }
-
- /**
- * Sets the id of this palette
- *
- * @param paletteID
- * the paletteID to set
- */
- public void setPaletteID(String paletteID) {
- this.paletteID = paletteID;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getPaletteID() {
- return paletteID;
- }
-
- /**
- * {@inheritDoc}
- */
- public ProviderPriority getPriority() {
- return priority;
- }
-
- /**
- * Sets the priority for this palette
- *
- * @param priority
- * the priority to set
- */
- public void setPriority(ProviderPriority priority) {
- this.priority = priority;
- }
-
- /**
- * {@inheritDoc}
- */
- public Map<String, String> getProperties() {
- return properties;
- }
-
- /**
- * Sets the properties for this palette description
- *
- * @param properties
- * the properties to set
- */
- public void setProperties(Map<String, String> properties) {
- this.properties = properties;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.ui.IMemento;
+
+/**
+ * Class that defines a profile for a palette.
+ */
+public class PapyrusPaletteDescription implements IPaletteDescription {
+
+ /** name of the palette */
+ private String name;
+
+ /** id of the editor to contribute */
+ private String contributionEditorID;
+
+ /** contribution of this palette */
+ private Object contributions;
+
+ /** id of the palette */
+ private String paletteID;
+
+ /** priority of the palette */
+ private ProviderPriority priority;
+
+ /** properties of the palette */
+ private Map<String, String> properties;
+
+ /**
+ * Creates a new PapyrusPaletteDescription.
+ */
+ public PapyrusPaletteDescription() {
+ }
+
+ /**
+ * Create a new Palette description using a preference memento
+ *
+ * @param memento
+ * the memento from which to read the description
+ * @return the content of the palette
+ */
+ public static IPaletteDescription create(IMemento memento) {
+ final PapyrusPaletteDescription description = new PapyrusPaletteDescription();
+ description.setName(memento.getString(IPapyrusPaletteConstant.NAME));
+ description.setPaletteID(memento.getString(IPapyrusPaletteConstant.ID));
+ description.setContributionEditorID(memento.getString(IPapyrusPaletteConstant.EDITOR_ID));
+ description.setContributions(memento.getString(IPapyrusPaletteConstant.PATH));
+ description.setPriority(ProviderPriority.parse(memento.getString(IPapyrusPaletteConstant.PRIORITY)));
+
+ // retrieve the map of properties
+ IMemento propertiesMemento = memento.getChild(IPapyrusPaletteConstant.PALETTE_DESCRIPTION_PROPERTIES);
+ Map<String, String> properties = new HashMap<String, String>();
+ if(propertiesMemento != null) {
+ // retrieve the child name/value tuple for each children
+ for(String key : propertiesMemento.getAttributeKeys()) {
+ properties.put(key, propertiesMemento.getString(key));
+ }
+ }
+ description.setProperties(properties);
+ // contributions: do not read the file before it is necessary...
+ return description;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getContributionEditorID() {
+ return contributionEditorID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getContributions() {
+ return contributions;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the name of the palette description
+ *
+ * @param name
+ * the name to set
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Sets the id of the editor to contribute
+ *
+ * @param contributionEditorID
+ * the contributionEditorID to set
+ */
+ public void setContributionEditorID(String contributionEditorID) {
+ this.contributionEditorID = contributionEditorID;
+ }
+
+ /**
+ * Sets the contributions of this palette
+ *
+ * @param contributions
+ * the contributions to set
+ */
+ public void setContributions(Object contributions) {
+ this.contributions = contributions;
+ }
+
+ /**
+ * Sets the id of this palette
+ *
+ * @param paletteID
+ * the paletteID to set
+ */
+ public void setPaletteID(String paletteID) {
+ this.paletteID = paletteID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getPaletteID() {
+ return paletteID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ProviderPriority getPriority() {
+ return priority;
+ }
+
+ /**
+ * Sets the priority for this palette
+ *
+ * @param priority
+ * the priority to set
+ */
+ public void setPriority(ProviderPriority priority) {
+ this.priority = priority;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the properties for this palette description
+ *
+ * @param properties
+ * the properties to set
+ */
+ public void setProperties(Map<String, String> properties) {
+ this.properties = properties;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteEntryState.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteEntryState.java
index 73b45bf6012..ad1204a4403 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteEntryState.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteEntryState.java
@@ -1,92 +1,92 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import org.eclipse.gef.palette.PaletteContainer;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteEntryState;
-import org.eclipse.ui.IMemento;
-
-/**
- * Extended palette state, that also manages parent modification, etc.
- */
-public class PapyrusPaletteEntryState extends PaletteEntryState {
-
- /** key for the parent field */
- public static final String PARENT_ID_KEY = "parent";
-
- /** value of the parent ID field */
- protected String parentID;
-
- /**
- * Creates a new PapyrusPaletteEntryState.
- *
- * @param entry
- * the palette entry to manage
- */
- public PapyrusPaletteEntryState(PaletteEntry entry) {
- super(entry);
- }
-
- public void applyChangesFromMemento(IMemento entryMemento) {
- super.applyChangesFromMemento(entryMemento);
- PaletteEntry entry = getPaletteEntry();
-
- String sValue = entryMemento.getString(PARENT_ID_KEY);
- if(sValue != null) {
- if(!entry.getParent().getId().equals(sValue)) {
- // adds to the new container, but does nto remove from old one,
- // because of
- // iterator...
- PaletteContainer container = PaletteUtil.getContainerByID(entry, sValue);
- container.add(entry);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void rollback() {
- super.rollback();
- PaletteEntry entry = getPaletteEntry();
- entry.setParent(PaletteUtil.getContainerByID(entry, parentID));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void storeChangesInMemento(IMemento memento) {
- super.storeChangesInMemento(memento);
-
- PaletteEntry entry = getPaletteEntry();
-
- // stores the parent id name
- if(parentID != null && !parentID.equals(entry.getParent().getId()) || (parentID == null && entry.getParent() != null)) {
- memento.putString(PARENT_ID_KEY, entry.getParent().getId());
- }
-
- }
-
- /**
- * {@inheritDoc}
- */
- public void storeState() {
- super.storeState();
- PaletteEntry entry = getPaletteEntry();
- parentID = entry.getParent().getId();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import org.eclipse.gef.palette.PaletteContainer;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteEntryState;
+import org.eclipse.ui.IMemento;
+
+/**
+ * Extended palette state, that also manages parent modification, etc.
+ */
+public class PapyrusPaletteEntryState extends PaletteEntryState {
+
+ /** key for the parent field */
+ public static final String PARENT_ID_KEY = "parent";
+
+ /** value of the parent ID field */
+ protected String parentID;
+
+ /**
+ * Creates a new PapyrusPaletteEntryState.
+ *
+ * @param entry
+ * the palette entry to manage
+ */
+ public PapyrusPaletteEntryState(PaletteEntry entry) {
+ super(entry);
+ }
+
+ public void applyChangesFromMemento(IMemento entryMemento) {
+ super.applyChangesFromMemento(entryMemento);
+ PaletteEntry entry = getPaletteEntry();
+
+ String sValue = entryMemento.getString(PARENT_ID_KEY);
+ if(sValue != null) {
+ if(!entry.getParent().getId().equals(sValue)) {
+ // adds to the new container, but does nto remove from old one,
+ // because of
+ // iterator...
+ PaletteContainer container = PaletteUtil.getContainerByID(entry, sValue);
+ container.add(entry);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void rollback() {
+ super.rollback();
+ PaletteEntry entry = getPaletteEntry();
+ entry.setParent(PaletteUtil.getContainerByID(entry, parentID));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void storeChangesInMemento(IMemento memento) {
+ super.storeChangesInMemento(memento);
+
+ PaletteEntry entry = getPaletteEntry();
+
+ // stores the parent id name
+ if(parentID != null && !parentID.equals(entry.getParent().getId()) || (parentID == null && entry.getParent() != null)) {
+ memento.putString(PARENT_ID_KEY, entry.getParent().getId());
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void storeState() {
+ super.storeState();
+ PaletteEntry entry = getPaletteEntry();
+ parentID = entry.getParent().getId();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPalettePreferences.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPalettePreferences.java
index 11445bc7896..bef5e8e7dc4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPalettePreferences.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPalettePreferences.java
@@ -1,580 +1,580 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.papyrus.infra.core.utils.PapyrusTrace;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.ExtendedProviderDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.WorkbenchException;
-import org.eclipse.ui.XMLMemento;
-
-/**
- * Class that manages the preferences for the papyrus palette
- */
-public class PapyrusPalettePreferences implements IPapyrusPaletteConstant {
-
- /**
- * Returns local palettes description contained in the preference field.
- *
- * @return the list of local palette description
- */
- public static List<IPaletteDescription> getLocalPalettes() {
- ArrayList<IPaletteDescription> paletteDescriptions = new ArrayList<IPaletteDescription>();
-
- // retrieve the value of the preference field
- XMLMemento rootMemento = getExistingLocalPalettes();
-
- if(rootMemento == null) {
- return paletteDescriptions;
- }
-
- // retrieve all palette descriptions
- for(IMemento memento : rootMemento.getChildren(PALETTE)) {
- // there should be a factory here ?!
- IPaletteDescription description = PapyrusPaletteDescription.create(memento);
-
- paletteDescriptions.add(description);
- }
-
- return paletteDescriptions;
- }
-
- /**
- * Returns the preference store used to store palette preferences.
- *
- * @return the preference store of this plugin
- */
- protected static IPreferenceStore getPreferenceStore() {
- return Activator.getDefault().getPreferenceStore();
- }
-
- /**
- * Retrieves the root memento from the plugin preferences if there were
- * existing palette customizations.
- *
- * @return the root memento if there were existing customizations; null
- * otherwise
- */
- protected static XMLMemento getExistingCustomizations() {
- String sValue = getPreferenceStore().getString(PALETTE_CUSTOMIZATIONS_ID);
- try {
- if(sValue != null && !sValue.equals("")) { //$NON-NLS-1$
- XMLMemento rootMemento = XMLMemento.createReadRoot(new StringReader(sValue));
- return rootMemento;
- } else {
- return XMLMemento.createWriteRoot(PALETTE_CUSTOMIZATIONS_ID);
- }
- } catch (WorkbenchException e) {
- Activator.getDefault().logError("Impossible to read preferences", e);
- }
- return null;
- }
-
- /**
- * Retrieves the root memento from the plugin preferences if there were
- * existing local palette redefinitions.
- *
- * @return the root memento if there were existing customizations, a newly
- * created one otherwise (empty one)
- */
- protected static XMLMemento getLocalRedefinitions() {
- String sValue = getPreferenceStore().getString(PALETTE_REDEFINITIONS);
- try {
- if(sValue != null && !sValue.equals("")) { //$NON-NLS-1$
- XMLMemento rootMemento = XMLMemento.createReadRoot(new StringReader(sValue));
- return rootMemento;
- } else {
- return XMLMemento.createWriteRoot(PALETTE_REDEFINITIONS);
- }
- } catch (WorkbenchException e) {
- Activator.getDefault().logError("Impossible to read preferences for palette local redefinitions", e);
- }
- return null;
- }
-
- /**
- * Register a new local redefinition of a palette.
- *
- * @param paletteID
- * the id of the palette to register
- * @param path
- * the path to the configuration of the palette
- * @return the memento that has been registered
- */
- public static IMemento registerLocalRedefinition(String paletteID, String path) {
- XMLMemento rootMemento = getLocalRedefinitions();
-
- // try to find an existing local definition for this palette
- IMemento memento = getPaletteRedefinitionNode(paletteID);
-
- // if one exists, remove it from the preferences
- if(memento != null) {
- unregisterLocalRedefinition(paletteID);
- }
-
- // then register the new one
- IMemento newMemento = rootMemento.createChild(PALETTE_REDEFINITION);
- newMemento.putString(ID, paletteID);
- newMemento.putString(PATH, path);
-
- saveLocalRedefinitions(rootMemento);
-
- return newMemento;
- }
-
- /**
- * Unregister a specific local redefinition
- *
- * @param paletteID
- * the identifier of the palette to unregister
- */
- public static void unregisterLocalRedefinition(String paletteID) {
- XMLMemento rootMemento = getLocalRedefinitions();
- // no remove method...
- // so, creation of a new root memento, then, duplicate all entries
- // except the one to
- // delete...
- XMLMemento newRootMemento = XMLMemento.createWriteRoot(PALETTE_REDEFINITIONS);
- for(IMemento memento : rootMemento.getChildren(PALETTE_REDEFINITION)) {
- if(!memento.getString(ID).equals(paletteID)) {
- newRootMemento.putMemento(memento);
- }
- }
- // save new Memento
- saveLocalRedefinitions(newRootMemento);
-
- }
-
- /**
- * saves the given root memento with the given key in the preference area
- *
- * @param xmlMemento
- * the memento to save
- * @param key
- * the key for the preference store
- */
- private static void saveMemento(XMLMemento xmlMemento, String key) {
- // save memento
- StringWriter writer = new StringWriter();
- try {
- xmlMemento.save(writer);
-
- if(getPreferenceStore() != null) {
- getPreferenceStore().setValue(key, writer.toString());
- }
- } catch (IOException e) {
- Activator.getDefault().logError("input/ouput exception", e);
- }
- }
-
- /**
- * Saves the set of local redefinitions into the preference store
- *
- * @param rootMemento
- * the memento to save
- */
- public static void saveLocalRedefinitions(XMLMemento rootMemento) {
- saveMemento(rootMemento, PALETTE_REDEFINITIONS);
- }
-
- /**
- * Saves the palette customizations into the preferences
- *
- * @param rootMemento
- * the memento to save
- */
- public static void saveCustomizations(XMLMemento rootMemento) {
- saveMemento(rootMemento, PALETTE_CUSTOMIZATIONS_ID);
- }
-
- /**
- * Saves the list of local palettes into the preferences
- *
- * @param rootMemento
- * the memento to save
- */
- public static void saveLocalPalettes(XMLMemento rootMemento) {
- saveMemento(rootMemento, PALETTE_LOCAL_DEFINITIONS);
- }
-
- /**
- * Retrieves the memento for the current editor from the root memento
- *
- * @param rootMemento
- * the root memento from which the editor memento is retrieved
- * @param currentEditorClass
- * the current editor class name
- * @return the memento for the current editor from the root memento or <code>null</code>;
- */
- protected static IMemento getEditorMemento(XMLMemento rootMemento, String currentEditorClass) {
- IMemento[] editorsMementos = rootMemento.getChildren(EDITOR);
- for(IMemento editorMemento : editorsMementos) {
- String editorClass = editorMemento.getString(CLASS);
- if(currentEditorClass.equals(editorClass)) {
- return editorMemento;
- }
- }
-
- // create one if none was found
- IMemento memento = rootMemento.createChild(EDITOR);
- memento.putString(CLASS, currentEditorClass);
- return memento;
- }
-
- /**
- * Retrieves the memento corresponding to the list of hidden palettes for a
- * given editor part
- *
- * @param part
- * the editor for which preferences should be found
- * @return the memento corresponding to the hidden palettes list
- */
- public static IMemento getEditorHiddenPalettesMemento(IMemento editorMemento) {
- IMemento hiddenPaletteMemento = editorMemento.getChild(HIDDEN_PALETTES);
- if(hiddenPaletteMemento == null) {
- hiddenPaletteMemento = editorMemento.createChild(HIDDEN_PALETTES);
- }
- return hiddenPaletteMemento;
- }
-
- /**
- * Returns a String from concatened hidden palettes ids
- *
- * @param hiddenPalettesMemento
- * the memento for the hidden palettes
- * @return the string of ids, separated by a separator
- */
- // @unused
- public static String getHiddenPalettes(IMemento hiddenPalettesMemento) {
- return hiddenPalettesMemento.getString(ID);
- }
-
- /**
- * Returns the path for a given palette
- *
- * @param paletteID
- * the unique identifier of the palette to retrieve
- * @return the path to the configuration of the palette or <code>null</code> if no customization exists for this palette configuration
- */
- public static String getPaletteRedefinition(String paletteID) {
- if(paletteID == null) {
- Activator.log.debug("Trying to find preferences for a null palette identifier");
- }
- IMemento memento = getPaletteRedefinitionNode(paletteID);
- if(memento != null) {
- return memento.getString(PATH);
- }
- return null;
- }
-
- /**
- * Returns the memento associated to the palette, or <code>null</code> if
- * none exists
- *
- * @param paletteID
- * the identifier of the palette to find
- * @return the memento found or <code>null</code> if no customization exists
- * for this palette
- */
- private static IMemento getPaletteRedefinitionNode(String paletteID) {
- XMLMemento rootMemento = getLocalRedefinitions();
- IMemento[] redefinitions = rootMemento.getChildren(PALETTE_REDEFINITION);
- for(IMemento redefinitionMemento : redefinitions) {
- String paletteNodeID = redefinitionMemento.getString(ID);
- // check equals. Palette ID is not null, as checked at the begining
- // of the method.
- if(paletteID.equals(paletteNodeID)) {
- return redefinitionMemento;
- }
- }
- return null;
- }
-
- /**
- * Returns a list of hidden palettes ids
- *
- * @param hiddenPalettesMemento
- * the memento for the hidden palettes
- * @return the list of ids
- */
- public static List<String> getHiddenPalettesList(IMemento hiddenPalettesMemento) {
- String hiddenPalettes = hiddenPalettesMemento.getString(ID);
-
- ArrayList<String> ids = new ArrayList<String>();
- StringTokenizer tokenizer = new StringTokenizer((hiddenPalettes != null) ? hiddenPalettes : "", ";");
- while(tokenizer.hasMoreTokens()) {
- ids.add(tokenizer.nextToken());
- }
- return ids;
- }
-
- /**
- * Changes the palette visibility
- */
- public static void changePaletteVisibility(String providerID, IEditorPart editorClass, boolean visible) {
- changePaletteVisibility(providerID, getEditorClassName(editorClass), visible);
- }
-
- /**
- * Returns the name of the class of the editor
- *
- * @param editorClass
- * the editor for which the class name is searched
- * @return the class name
- */
- protected static String getEditorClassName(IEditorPart editorClass) {
- return editorClass.getClass().getName();
- }
-
- /**
- * Changes the palette visibility
- */
- public static void changePaletteVisibility(String providerID, String editorClass, boolean visible) {
- // retrieve preferences for the given editor
- XMLMemento rootMemento = getExistingCustomizations();
- IMemento editorMemento = getEditorMemento(rootMemento, editorClass);
- IMemento hiddenPalettesMemento = getEditorHiddenPalettesMemento(editorMemento);
- List<String> hiddenPalettes = getHiddenPalettesList(hiddenPalettesMemento);
-
- // in the list, remove or add the id of the provider descriptor
- if(hiddenPalettes.contains(providerID) && visible) {
- hiddenPalettes.remove(providerID);
- } else if(!hiddenPalettes.contains(providerID) && !visible) {
- hiddenPalettes.add(providerID);
- }
-
- // serialize the new list
- String newIDs = serializeHiddenPalettes(hiddenPalettes);
-
- // sets the new value for the memento
- hiddenPalettesMemento.putString(ID, newIDs);
-
- // saves the root memento
- saveCustomizations(rootMemento);
- }
-
- /**
- * Returns the list of identifiers that should not be shown for the palette.
- *
- * @param part
- * the editor for which the palette is shown
- * @return a list of identifiers of palettes that should not be shown.
- */
- public static List<String> getHiddenPalettes(IEditorPart part) {
- // retrieve preferences for the given editor
- XMLMemento rootMemento = getExistingCustomizations();
- IMemento editorMemento = getEditorMemento(rootMemento, part.getClass().getName());
- IMemento hiddenPalettesMemento = getEditorHiddenPalettesMemento(editorMemento);
- return getHiddenPalettesList(hiddenPalettesMemento);
- }
-
- /**
- * Serialize palettes value
- *
- * @param hiddenPalettes
- * the list to serialize
- * @return the new string
- */
- protected static String serializeHiddenPalettes(List<String> hiddenPalettes) {
- // builds the new id list
- return PaletteUtil.convertToFlatRepresentation(hiddenPalettes, ";");
- }
-
- /**
- * Retrieves the root memento from the plugin preferences if there were
- * existing local palettes.
- *
- * @return the root memento if there were existing customizations; null
- * otherwise
- */
- protected static XMLMemento getExistingLocalPalettes() {
- String sValue = getPreferenceStore().getString(PALETTE_LOCAL_DEFINITIONS);
- try {
- if(sValue != null && !sValue.equals("")) { //$NON-NLS-1$
-
- XMLMemento rootMemento = XMLMemento.createReadRoot(new StringReader(sValue));
- return rootMemento;
- } else {
- return XMLMemento.createWriteRoot(PALETTE_LOCAL_DEFINITIONS);
- }
- } catch (WorkbenchException e) {
- Activator.getDefault().logError("Impossible to read preferences", e);
- }
- return null;
- }
-
- /**
- * Adds or update local palette
- */
- public static void addLocalPalette(String paletteID, String paletteName, ProviderPriority priority, String editorID, Set<String> requiredProfiles) {
- // retrieves memento
- XMLMemento rootMemento = getExistingLocalPalettes();
-
- // search existing customization
- IMemento paletteMemento = searchPaletteMemento(rootMemento, paletteID);
- if(paletteMemento == null) {
- paletteMemento = createMemento(rootMemento, paletteID);
- }
-
- // update values in the memento
- paletteMemento.putString(NAME, paletteName);
- paletteMemento.putString(PRIORITY, priority.getName());
- paletteMemento.putString(EDITOR_ID, editorID);
- paletteMemento.putString(PATH, getPalettePathFromID(paletteID));
-
- // add properties if required
- IMemento propertiesMemento = paletteMemento.createChild(IPapyrusPaletteConstant.PALETTE_DESCRIPTION_PROPERTIES);
- propertiesMemento.putString(IPapyrusPaletteConstant.PROFILE_LIST, PaletteUtil.getSerializedProfileList(requiredProfiles));
-
- // saves the root memento
- saveLocalPalettes(rootMemento);
- }
-
- /**
- * Returns the provider priority for the palette provider with the given ID
- */
- public static ProviderPriority getPalettePriority(String paletteID) {
- // retrieves memento
- XMLMemento rootMemento = getExistingLocalPalettes();
-
- // search existing customization
- IMemento paletteMemento = searchPaletteMemento(rootMemento, paletteID);
- if(paletteMemento == null) {
- paletteMemento = createMemento(rootMemento, paletteID);
- }
-
- // update values in the memento
- String palettePriority = paletteMemento.getString(PRIORITY);
- return ProviderPriority.parse(palettePriority);
- }
-
- /**
- * Deletes a local palette definition
- *
- * @param id
- * the id of the palette to delete
- */
- public static void deleteLocalPalette(String id) {
- // retrieves memento
- XMLMemento rootMemento = getExistingLocalPalettes();
-
- // search existing customization
- IMemento paletteMemento = searchPaletteMemento(rootMemento, id);
-
- if(paletteMemento == null) {
- PapyrusTrace.log(IStatus.WARNING, "impossible to find the palette with id: " + id);
- return;
- }
-
- // no remove method...
- // so, creation of a new root memento, then, duplicate all entries
- // except the one to
- // delete...
-
- XMLMemento newRootMemento = XMLMemento.createWriteRoot(PALETTE_LOCAL_DEFINITIONS);
- for(IMemento memento : rootMemento.getChildren(PALETTE)) {
- if(!memento.getString(ID).equals(paletteMemento.getString(ID))) {
- IMemento newChild = newRootMemento.createChild(PALETTE);
- newChild.putMemento(memento);
- }
- }
- // save new Memento
- saveLocalPalettes(newRootMemento);
-
- }
-
- /**
- * Retrieves the name of the palette file, using the palette id
- *
- * @param paletteID
- * the id of the palette
- * @return the name of the file
- */
- public static String getPalettePathFromID(String paletteID) {
- return "Palette_" + paletteID + ".xml";
- }
-
- /**
- * Creates the palette memento for the given palette ID, in the given
- * memento
- *
- * @param rootMemento
- * the memento parent of the newly created memento
- * @param paletteID
- * the id of the palette to create
- * @return the newly created memento
- */
- protected static IMemento createMemento(XMLMemento rootMemento, String paletteID) {
- IMemento memento = rootMemento.createChild(PALETTE);
- memento.putString(ID, paletteID);
- return memento;
- }
-
- /**
- * search the palette memento for the given palette ID.
- *
- * @param rootMemento
- * the root memento to look in
- * @param paletteID
- * the palette ID to search
- * @return the palette memento or <code>null</code> if none was found.
- */
- protected static IMemento searchPaletteMemento(XMLMemento rootMemento, String paletteID) {
- for(IMemento memento : rootMemento.getChildren(PALETTE)) {
- String id = memento.getString(ID);
- if(paletteID.equals(id)) {
- return memento;
- }
- }
- // palette not found
- return null;
- }
-
- /**
- * Creates the palette redefinition for the given contribution
- *
- * @param descriptor
- * descriptor of the contribution to redefine
- */
- public static void createPaletteRedefinition(ExtendedProviderDescriptor descriptor) {
- // copy the file in the plugin state area
- String path = null;
-
- // retrieve the file in the descriptor
- path = descriptor.createLocalRedefinition();
-
- if(path == null) {
- Activator.log.error("There was an error during creation of the local file", null);
- return;
- }
-
- // finally, register the new redefinition
- registerLocalRedefinition(descriptor.getContributionID(), path);
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.papyrus.infra.core.utils.PapyrusTrace;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.papyrus.uml.diagram.common.service.PapyrusPaletteService.ExtendedProviderDescriptor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
+
+/**
+ * Class that manages the preferences for the papyrus palette
+ */
+public class PapyrusPalettePreferences implements IPapyrusPaletteConstant {
+
+ /**
+ * Returns local palettes description contained in the preference field.
+ *
+ * @return the list of local palette description
+ */
+ public static List<IPaletteDescription> getLocalPalettes() {
+ ArrayList<IPaletteDescription> paletteDescriptions = new ArrayList<IPaletteDescription>();
+
+ // retrieve the value of the preference field
+ XMLMemento rootMemento = getExistingLocalPalettes();
+
+ if(rootMemento == null) {
+ return paletteDescriptions;
+ }
+
+ // retrieve all palette descriptions
+ for(IMemento memento : rootMemento.getChildren(PALETTE)) {
+ // there should be a factory here ?!
+ IPaletteDescription description = PapyrusPaletteDescription.create(memento);
+
+ paletteDescriptions.add(description);
+ }
+
+ return paletteDescriptions;
+ }
+
+ /**
+ * Returns the preference store used to store palette preferences.
+ *
+ * @return the preference store of this plugin
+ */
+ protected static IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+
+ /**
+ * Retrieves the root memento from the plugin preferences if there were
+ * existing palette customizations.
+ *
+ * @return the root memento if there were existing customizations; null
+ * otherwise
+ */
+ protected static XMLMemento getExistingCustomizations() {
+ String sValue = getPreferenceStore().getString(PALETTE_CUSTOMIZATIONS_ID);
+ try {
+ if(sValue != null && !sValue.equals("")) { //$NON-NLS-1$
+ XMLMemento rootMemento = XMLMemento.createReadRoot(new StringReader(sValue));
+ return rootMemento;
+ } else {
+ return XMLMemento.createWriteRoot(PALETTE_CUSTOMIZATIONS_ID);
+ }
+ } catch (WorkbenchException e) {
+ Activator.getDefault().logError("Impossible to read preferences", e);
+ }
+ return null;
+ }
+
+ /**
+ * Retrieves the root memento from the plugin preferences if there were
+ * existing local palette redefinitions.
+ *
+ * @return the root memento if there were existing customizations, a newly
+ * created one otherwise (empty one)
+ */
+ protected static XMLMemento getLocalRedefinitions() {
+ String sValue = getPreferenceStore().getString(PALETTE_REDEFINITIONS);
+ try {
+ if(sValue != null && !sValue.equals("")) { //$NON-NLS-1$
+ XMLMemento rootMemento = XMLMemento.createReadRoot(new StringReader(sValue));
+ return rootMemento;
+ } else {
+ return XMLMemento.createWriteRoot(PALETTE_REDEFINITIONS);
+ }
+ } catch (WorkbenchException e) {
+ Activator.getDefault().logError("Impossible to read preferences for palette local redefinitions", e);
+ }
+ return null;
+ }
+
+ /**
+ * Register a new local redefinition of a palette.
+ *
+ * @param paletteID
+ * the id of the palette to register
+ * @param path
+ * the path to the configuration of the palette
+ * @return the memento that has been registered
+ */
+ public static IMemento registerLocalRedefinition(String paletteID, String path) {
+ XMLMemento rootMemento = getLocalRedefinitions();
+
+ // try to find an existing local definition for this palette
+ IMemento memento = getPaletteRedefinitionNode(paletteID);
+
+ // if one exists, remove it from the preferences
+ if(memento != null) {
+ unregisterLocalRedefinition(paletteID);
+ }
+
+ // then register the new one
+ IMemento newMemento = rootMemento.createChild(PALETTE_REDEFINITION);
+ newMemento.putString(ID, paletteID);
+ newMemento.putString(PATH, path);
+
+ saveLocalRedefinitions(rootMemento);
+
+ return newMemento;
+ }
+
+ /**
+ * Unregister a specific local redefinition
+ *
+ * @param paletteID
+ * the identifier of the palette to unregister
+ */
+ public static void unregisterLocalRedefinition(String paletteID) {
+ XMLMemento rootMemento = getLocalRedefinitions();
+ // no remove method...
+ // so, creation of a new root memento, then, duplicate all entries
+ // except the one to
+ // delete...
+ XMLMemento newRootMemento = XMLMemento.createWriteRoot(PALETTE_REDEFINITIONS);
+ for(IMemento memento : rootMemento.getChildren(PALETTE_REDEFINITION)) {
+ if(!memento.getString(ID).equals(paletteID)) {
+ newRootMemento.putMemento(memento);
+ }
+ }
+ // save new Memento
+ saveLocalRedefinitions(newRootMemento);
+
+ }
+
+ /**
+ * saves the given root memento with the given key in the preference area
+ *
+ * @param xmlMemento
+ * the memento to save
+ * @param key
+ * the key for the preference store
+ */
+ private static void saveMemento(XMLMemento xmlMemento, String key) {
+ // save memento
+ StringWriter writer = new StringWriter();
+ try {
+ xmlMemento.save(writer);
+
+ if(getPreferenceStore() != null) {
+ getPreferenceStore().setValue(key, writer.toString());
+ }
+ } catch (IOException e) {
+ Activator.getDefault().logError("input/ouput exception", e);
+ }
+ }
+
+ /**
+ * Saves the set of local redefinitions into the preference store
+ *
+ * @param rootMemento
+ * the memento to save
+ */
+ public static void saveLocalRedefinitions(XMLMemento rootMemento) {
+ saveMemento(rootMemento, PALETTE_REDEFINITIONS);
+ }
+
+ /**
+ * Saves the palette customizations into the preferences
+ *
+ * @param rootMemento
+ * the memento to save
+ */
+ public static void saveCustomizations(XMLMemento rootMemento) {
+ saveMemento(rootMemento, PALETTE_CUSTOMIZATIONS_ID);
+ }
+
+ /**
+ * Saves the list of local palettes into the preferences
+ *
+ * @param rootMemento
+ * the memento to save
+ */
+ public static void saveLocalPalettes(XMLMemento rootMemento) {
+ saveMemento(rootMemento, PALETTE_LOCAL_DEFINITIONS);
+ }
+
+ /**
+ * Retrieves the memento for the current editor from the root memento
+ *
+ * @param rootMemento
+ * the root memento from which the editor memento is retrieved
+ * @param currentEditorClass
+ * the current editor class name
+ * @return the memento for the current editor from the root memento or <code>null</code>;
+ */
+ protected static IMemento getEditorMemento(XMLMemento rootMemento, String currentEditorClass) {
+ IMemento[] editorsMementos = rootMemento.getChildren(EDITOR);
+ for(IMemento editorMemento : editorsMementos) {
+ String editorClass = editorMemento.getString(CLASS);
+ if(currentEditorClass.equals(editorClass)) {
+ return editorMemento;
+ }
+ }
+
+ // create one if none was found
+ IMemento memento = rootMemento.createChild(EDITOR);
+ memento.putString(CLASS, currentEditorClass);
+ return memento;
+ }
+
+ /**
+ * Retrieves the memento corresponding to the list of hidden palettes for a
+ * given editor part
+ *
+ * @param part
+ * the editor for which preferences should be found
+ * @return the memento corresponding to the hidden palettes list
+ */
+ public static IMemento getEditorHiddenPalettesMemento(IMemento editorMemento) {
+ IMemento hiddenPaletteMemento = editorMemento.getChild(HIDDEN_PALETTES);
+ if(hiddenPaletteMemento == null) {
+ hiddenPaletteMemento = editorMemento.createChild(HIDDEN_PALETTES);
+ }
+ return hiddenPaletteMemento;
+ }
+
+ /**
+ * Returns a String from concatened hidden palettes ids
+ *
+ * @param hiddenPalettesMemento
+ * the memento for the hidden palettes
+ * @return the string of ids, separated by a separator
+ */
+ // @unused
+ public static String getHiddenPalettes(IMemento hiddenPalettesMemento) {
+ return hiddenPalettesMemento.getString(ID);
+ }
+
+ /**
+ * Returns the path for a given palette
+ *
+ * @param paletteID
+ * the unique identifier of the palette to retrieve
+ * @return the path to the configuration of the palette or <code>null</code> if no customization exists for this palette configuration
+ */
+ public static String getPaletteRedefinition(String paletteID) {
+ if(paletteID == null) {
+ Activator.log.debug("Trying to find preferences for a null palette identifier");
+ }
+ IMemento memento = getPaletteRedefinitionNode(paletteID);
+ if(memento != null) {
+ return memento.getString(PATH);
+ }
+ return null;
+ }
+
+ /**
+ * Returns the memento associated to the palette, or <code>null</code> if
+ * none exists
+ *
+ * @param paletteID
+ * the identifier of the palette to find
+ * @return the memento found or <code>null</code> if no customization exists
+ * for this palette
+ */
+ private static IMemento getPaletteRedefinitionNode(String paletteID) {
+ XMLMemento rootMemento = getLocalRedefinitions();
+ IMemento[] redefinitions = rootMemento.getChildren(PALETTE_REDEFINITION);
+ for(IMemento redefinitionMemento : redefinitions) {
+ String paletteNodeID = redefinitionMemento.getString(ID);
+ // check equals. Palette ID is not null, as checked at the begining
+ // of the method.
+ if(paletteID.equals(paletteNodeID)) {
+ return redefinitionMemento;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns a list of hidden palettes ids
+ *
+ * @param hiddenPalettesMemento
+ * the memento for the hidden palettes
+ * @return the list of ids
+ */
+ public static List<String> getHiddenPalettesList(IMemento hiddenPalettesMemento) {
+ String hiddenPalettes = hiddenPalettesMemento.getString(ID);
+
+ ArrayList<String> ids = new ArrayList<String>();
+ StringTokenizer tokenizer = new StringTokenizer((hiddenPalettes != null) ? hiddenPalettes : "", ";");
+ while(tokenizer.hasMoreTokens()) {
+ ids.add(tokenizer.nextToken());
+ }
+ return ids;
+ }
+
+ /**
+ * Changes the palette visibility
+ */
+ public static void changePaletteVisibility(String providerID, IEditorPart editorClass, boolean visible) {
+ changePaletteVisibility(providerID, getEditorClassName(editorClass), visible);
+ }
+
+ /**
+ * Returns the name of the class of the editor
+ *
+ * @param editorClass
+ * the editor for which the class name is searched
+ * @return the class name
+ */
+ protected static String getEditorClassName(IEditorPart editorClass) {
+ return editorClass.getClass().getName();
+ }
+
+ /**
+ * Changes the palette visibility
+ */
+ public static void changePaletteVisibility(String providerID, String editorClass, boolean visible) {
+ // retrieve preferences for the given editor
+ XMLMemento rootMemento = getExistingCustomizations();
+ IMemento editorMemento = getEditorMemento(rootMemento, editorClass);
+ IMemento hiddenPalettesMemento = getEditorHiddenPalettesMemento(editorMemento);
+ List<String> hiddenPalettes = getHiddenPalettesList(hiddenPalettesMemento);
+
+ // in the list, remove or add the id of the provider descriptor
+ if(hiddenPalettes.contains(providerID) && visible) {
+ hiddenPalettes.remove(providerID);
+ } else if(!hiddenPalettes.contains(providerID) && !visible) {
+ hiddenPalettes.add(providerID);
+ }
+
+ // serialize the new list
+ String newIDs = serializeHiddenPalettes(hiddenPalettes);
+
+ // sets the new value for the memento
+ hiddenPalettesMemento.putString(ID, newIDs);
+
+ // saves the root memento
+ saveCustomizations(rootMemento);
+ }
+
+ /**
+ * Returns the list of identifiers that should not be shown for the palette.
+ *
+ * @param part
+ * the editor for which the palette is shown
+ * @return a list of identifiers of palettes that should not be shown.
+ */
+ public static List<String> getHiddenPalettes(IEditorPart part) {
+ // retrieve preferences for the given editor
+ XMLMemento rootMemento = getExistingCustomizations();
+ IMemento editorMemento = getEditorMemento(rootMemento, part.getClass().getName());
+ IMemento hiddenPalettesMemento = getEditorHiddenPalettesMemento(editorMemento);
+ return getHiddenPalettesList(hiddenPalettesMemento);
+ }
+
+ /**
+ * Serialize palettes value
+ *
+ * @param hiddenPalettes
+ * the list to serialize
+ * @return the new string
+ */
+ protected static String serializeHiddenPalettes(List<String> hiddenPalettes) {
+ // builds the new id list
+ return PaletteUtil.convertToFlatRepresentation(hiddenPalettes, ";");
+ }
+
+ /**
+ * Retrieves the root memento from the plugin preferences if there were
+ * existing local palettes.
+ *
+ * @return the root memento if there were existing customizations; null
+ * otherwise
+ */
+ protected static XMLMemento getExistingLocalPalettes() {
+ String sValue = getPreferenceStore().getString(PALETTE_LOCAL_DEFINITIONS);
+ try {
+ if(sValue != null && !sValue.equals("")) { //$NON-NLS-1$
+
+ XMLMemento rootMemento = XMLMemento.createReadRoot(new StringReader(sValue));
+ return rootMemento;
+ } else {
+ return XMLMemento.createWriteRoot(PALETTE_LOCAL_DEFINITIONS);
+ }
+ } catch (WorkbenchException e) {
+ Activator.getDefault().logError("Impossible to read preferences", e);
+ }
+ return null;
+ }
+
+ /**
+ * Adds or update local palette
+ */
+ public static void addLocalPalette(String paletteID, String paletteName, ProviderPriority priority, String editorID, Set<String> requiredProfiles) {
+ // retrieves memento
+ XMLMemento rootMemento = getExistingLocalPalettes();
+
+ // search existing customization
+ IMemento paletteMemento = searchPaletteMemento(rootMemento, paletteID);
+ if(paletteMemento == null) {
+ paletteMemento = createMemento(rootMemento, paletteID);
+ }
+
+ // update values in the memento
+ paletteMemento.putString(NAME, paletteName);
+ paletteMemento.putString(PRIORITY, priority.getName());
+ paletteMemento.putString(EDITOR_ID, editorID);
+ paletteMemento.putString(PATH, getPalettePathFromID(paletteID));
+
+ // add properties if required
+ IMemento propertiesMemento = paletteMemento.createChild(IPapyrusPaletteConstant.PALETTE_DESCRIPTION_PROPERTIES);
+ propertiesMemento.putString(IPapyrusPaletteConstant.PROFILE_LIST, PaletteUtil.getSerializedProfileList(requiredProfiles));
+
+ // saves the root memento
+ saveLocalPalettes(rootMemento);
+ }
+
+ /**
+ * Returns the provider priority for the palette provider with the given ID
+ */
+ public static ProviderPriority getPalettePriority(String paletteID) {
+ // retrieves memento
+ XMLMemento rootMemento = getExistingLocalPalettes();
+
+ // search existing customization
+ IMemento paletteMemento = searchPaletteMemento(rootMemento, paletteID);
+ if(paletteMemento == null) {
+ paletteMemento = createMemento(rootMemento, paletteID);
+ }
+
+ // update values in the memento
+ String palettePriority = paletteMemento.getString(PRIORITY);
+ return ProviderPriority.parse(palettePriority);
+ }
+
+ /**
+ * Deletes a local palette definition
+ *
+ * @param id
+ * the id of the palette to delete
+ */
+ public static void deleteLocalPalette(String id) {
+ // retrieves memento
+ XMLMemento rootMemento = getExistingLocalPalettes();
+
+ // search existing customization
+ IMemento paletteMemento = searchPaletteMemento(rootMemento, id);
+
+ if(paletteMemento == null) {
+ PapyrusTrace.log(IStatus.WARNING, "impossible to find the palette with id: " + id);
+ return;
+ }
+
+ // no remove method...
+ // so, creation of a new root memento, then, duplicate all entries
+ // except the one to
+ // delete...
+
+ XMLMemento newRootMemento = XMLMemento.createWriteRoot(PALETTE_LOCAL_DEFINITIONS);
+ for(IMemento memento : rootMemento.getChildren(PALETTE)) {
+ if(!memento.getString(ID).equals(paletteMemento.getString(ID))) {
+ IMemento newChild = newRootMemento.createChild(PALETTE);
+ newChild.putMemento(memento);
+ }
+ }
+ // save new Memento
+ saveLocalPalettes(newRootMemento);
+
+ }
+
+ /**
+ * Retrieves the name of the palette file, using the palette id
+ *
+ * @param paletteID
+ * the id of the palette
+ * @return the name of the file
+ */
+ public static String getPalettePathFromID(String paletteID) {
+ return "Palette_" + paletteID + ".xml";
+ }
+
+ /**
+ * Creates the palette memento for the given palette ID, in the given
+ * memento
+ *
+ * @param rootMemento
+ * the memento parent of the newly created memento
+ * @param paletteID
+ * the id of the palette to create
+ * @return the newly created memento
+ */
+ protected static IMemento createMemento(XMLMemento rootMemento, String paletteID) {
+ IMemento memento = rootMemento.createChild(PALETTE);
+ memento.putString(ID, paletteID);
+ return memento;
+ }
+
+ /**
+ * search the palette memento for the given palette ID.
+ *
+ * @param rootMemento
+ * the root memento to look in
+ * @param paletteID
+ * the palette ID to search
+ * @return the palette memento or <code>null</code> if none was found.
+ */
+ protected static IMemento searchPaletteMemento(XMLMemento rootMemento, String paletteID) {
+ for(IMemento memento : rootMemento.getChildren(PALETTE)) {
+ String id = memento.getString(ID);
+ if(paletteID.equals(id)) {
+ return memento;
+ }
+ }
+ // palette not found
+ return null;
+ }
+
+ /**
+ * Creates the palette redefinition for the given contribution
+ *
+ * @param descriptor
+ * descriptor of the contribution to redefine
+ */
+ public static void createPaletteRedefinition(ExtendedProviderDescriptor descriptor) {
+ // copy the file in the plugin state area
+ String path = null;
+
+ // retrieve the file in the descriptor
+ path = descriptor.createLocalRedefinition();
+
+ if(path == null) {
+ Activator.log.error("There was an error during creation of the local file", null);
+ return;
+ }
+
+ // finally, register the new redefinition
+ registerLocalRedefinition(descriptor.getContributionID(), path);
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteViewer.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteViewer.java
index e3d2976f911..9f10134e54c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteViewer.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/PapyrusPaletteViewer.java
@@ -1,73 +1,73 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import java.lang.reflect.Constructor;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.ui.palette.PaletteCustomizer;
-import org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog;
-import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteCustomizerDialogEx;
-import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteViewerEx;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Extended Palette Viewer, to have a new customize dialog
- */
-public class PapyrusPaletteViewer extends PaletteViewerEx {
-
- public static final String EXTENSION_ID = Activator.ID + ".paletteCustomization"; //$NON-NLS-1$
-
- public static final String CUSTOMIZER_ATTRIBUTE = "customizerDialog"; //$NON-NLS-1$
-
- /** cached dialog for the customization */
- private PaletteCustomizerDialog customizerDialog = null;
-
- /**
- * {@inheritDoc}
- */
- @Override
- public PaletteCustomizerDialog getCustomizerDialog() {
- if(customizerDialog == null) {
- IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
-
- //Load from extension point
- for(IConfigurationElement e : config) {
- String customizerClassName = e.getAttribute("customizerDialog"); //$NON-NLS-1$
- try {
- Class<? extends PaletteCustomizerDialog> advancedCustomizerDialogClass = Activator.getDefault().getBundle().loadClass(customizerClassName).asSubclass(PaletteCustomizerDialog.class);
- if(advancedCustomizerDialogClass != null) {
- Constructor<? extends PaletteCustomizerDialog> constructor = advancedCustomizerDialogClass.getConstructor(Shell.class, PaletteCustomizer.class, PaletteRoot.class);
- if(constructor != null) {
- customizerDialog = constructor.newInstance(getControl().getShell(), getCustomizer(), getPaletteRoot());
- break;
- }
- }
- } catch (Exception ex) {
- Activator.log.error(ex);
- continue;
- }
- }
-
- if(customizerDialog == null) {
- // be sure it is not null
- customizerDialog = new PaletteCustomizerDialogEx(getControl().getShell(), getCustomizer(), getPaletteRoot());
- }
- }
- return customizerDialog;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import java.lang.reflect.Constructor;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.ui.palette.PaletteCustomizer;
+import org.eclipse.gef.ui.palette.customize.PaletteCustomizerDialog;
+import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteCustomizerDialogEx;
+import org.eclipse.gmf.runtime.gef.ui.palette.customize.PaletteViewerEx;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Extended Palette Viewer, to have a new customize dialog
+ */
+public class PapyrusPaletteViewer extends PaletteViewerEx {
+
+ public static final String EXTENSION_ID = Activator.ID + ".paletteCustomization"; //$NON-NLS-1$
+
+ public static final String CUSTOMIZER_ATTRIBUTE = "customizerDialog"; //$NON-NLS-1$
+
+ /** cached dialog for the customization */
+ private PaletteCustomizerDialog customizerDialog = null;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public PaletteCustomizerDialog getCustomizerDialog() {
+ if(customizerDialog == null) {
+ IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
+
+ //Load from extension point
+ for(IConfigurationElement e : config) {
+ String customizerClassName = e.getAttribute("customizerDialog"); //$NON-NLS-1$
+ try {
+ Class<? extends PaletteCustomizerDialog> advancedCustomizerDialogClass = Activator.getDefault().getBundle().loadClass(customizerClassName).asSubclass(PaletteCustomizerDialog.class);
+ if(advancedCustomizerDialogClass != null) {
+ Constructor<? extends PaletteCustomizerDialog> constructor = advancedCustomizerDialogClass.getConstructor(Shell.class, PaletteCustomizer.class, PaletteRoot.class);
+ if(constructor != null) {
+ customizerDialog = constructor.newInstance(getControl().getShell(), getCustomizer(), getPaletteRoot());
+ break;
+ }
+ }
+ } catch (Exception ex) {
+ Activator.log.error(ex);
+ continue;
+ }
+ }
+
+ if(customizerDialog == null) {
+ // be sure it is not null
+ customizerDialog = new PaletteCustomizerDialogEx(getControl().getShell(), getCustomizer(), getPaletteRoot());
+ }
+ }
+ return customizerDialog;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UMLDiagramActionBarContributor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UMLDiagramActionBarContributor.java
index 09040b1b534..3367a09d662 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UMLDiagramActionBarContributor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UMLDiagramActionBarContributor.java
@@ -1,60 +1,60 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
-import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchPage;
-
-/**
- * @generated
- */
-public class UMLDiagramActionBarContributor extends DiagramActionBarContributor {
-
- /**
- * @generated
- */
- protected Class getEditorClass() {
- return DiagramDocumentEditor.class;
- }
-
- /**
- * @generated
- */
- protected String getEditorId() {
- return "org.eclipse.papyrus.UMLDiagramEditorID";
- }
-
- /**
- * @generated
- */
- public void init(IActionBars bars, IWorkbenchPage page) {
- super.init(bars, page);
- IMenuManager fileMenu = bars.getMenuManager();
-
- IContributionItem undoAction = bars.getMenuManager().findMenuUsingPath("undoGroup");
- if(undoAction != null) {
- fileMenu.remove(undoAction);
- }
- // print preview
- // IMenuManager fileMenu =
- // bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
- // assert fileMenu != null;
- //fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
+import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * @generated
+ */
+public class UMLDiagramActionBarContributor extends DiagramActionBarContributor {
+
+ /**
+ * @generated
+ */
+ protected Class getEditorClass() {
+ return DiagramDocumentEditor.class;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getEditorId() {
+ return "org.eclipse.papyrus.UMLDiagramEditorID";
+ }
+
+ /**
+ * @generated
+ */
+ public void init(IActionBars bars, IWorkbenchPage page) {
+ super.init(bars, page);
+ IMenuManager fileMenu = bars.getMenuManager();
+
+ IContributionItem undoAction = bars.getMenuManager().findMenuUsingPath("undoGroup");
+ if(undoAction != null) {
+ fileMenu.remove(undoAction);
+ }
+ // print preview
+ // IMenuManager fileMenu =
+ // bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
+ // assert fileMenu != null;
+ //fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java
index 25a437b7ca3..6eec1817b7b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/part/UmlGmfDiagramEditor.java
@@ -1,225 +1,225 @@
-/**
- *
- */
-package org.eclipse.papyrus.uml.diagram.common.part;
-
-import org.eclipse.core.commands.operations.IUndoContext;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.gef.KeyHandler;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveAndDirtyService;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.gmfdiag.common.SynchronizableGmfDiagramEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.contexts.IContextService;
-
-/**
- * Common ancestor of GMF based editors for UML. This class allows to declare
- * stuff commons to all this kind of editors.
- *
- * @author cedric dumoulin
- *
- */
-public class UmlGmfDiagramEditor extends SynchronizableGmfDiagramEditor {
-
- /**
- * The associated Diagram.
- */
- private Diagram diagram;
-
- /**
- * Object used to synchronize the name of the editor with the name of the
- * diagram.
- */
- private PartNameSynchronizer partNameSynchronizer;
-
- /**
- * service registry of the backbone
- */
- private ServicesRegistry servicesRegistry;
-
- /**
- * Constructor.
- *
- * @param servicesRegistry
- * @param diagram
- * @throws ServiceException
- */
- public UmlGmfDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
- super(true);
- this.diagram = diagram;
- this.servicesRegistry = servicesRegistry;
- // Install synchronizer
- partNameSynchronizer = new PartNameSynchronizer(diagram);
-
- // Register this part to the ISaveAndDirtyService.
- // This will allows to be notified of saveAs events, and the isDirty
- // flag will be taken into
- // account.
- ISaveAndDirtyService saveAndDirtyService = servicesRegistry.getService(ISaveAndDirtyService.class);
- saveAndDirtyService.registerIsaveablePart(this);
-
- // TODO: unregister when editor is disposed !
- }
-
- /**
- * Dispose services used in this part.
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#dispose()
- *
- */
- @Override
- public void dispose() {
- this.setUndoContext(new IUndoContext() {
-
- public String getLabel() {
- return "Disposed undo context";
- }
-
- public boolean matches(IUndoContext context) {
- return false;
- }
-
- }); //Avoid disposing the shared UndoContext when this nestedEditor is dispose
- //Super.dispose() will try to dispose the IUndoContext
-
- super.dispose();
-
- ISaveAndDirtyService saveAndDirtyService;
- try {
- saveAndDirtyService = servicesRegistry.getService(ISaveAndDirtyService.class);
- saveAndDirtyService.removeIsaveablePart(this);
-
- } catch (ServiceException e) {
- // the service can't be found. Maybe it is already disposed.
- // Do nothing
- }
-
- partNameSynchronizer = null;
- diagram = null;
- servicesRegistry = null;
- }
-
- @Override
- protected void stopListening() {
- super.stopListening();
- }
-
- /**
- *
- * @return the backbone service registry. it cannot return null.
- */
- public ServicesRegistry getServicesRegistry() {
- return servicesRegistry;
- }
-
- /**
- * Set the associated Diagram.
- */
- public void setDiagram(Diagram diagram) {
- this.diagram = diagram;
- partNameSynchronizer.setDiagram(diagram);
- }
-
- /**
- * Get the associated Diagram
- */
- @Override
- public Diagram getDiagram() {
- return diagram;
- }
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#getKeyHandler()
- *
- * @return
- */
- @Override
- protected KeyHandler getKeyHandler() {
- // we remove all keybinding provided by GMF
- KeyHandler keyHandler = new KeyHandler();
- return keyHandler;
- }
-
- /**
- * A class taking in charge the synchronization of the partName and the
- * diagram name. When diagram name change, the other is automatically
- * updated.
- *
- * @author cedric dumoulin
- *
- */
- public class PartNameSynchronizer {
-
- Diagram diagram;
-
- /**
- * Listener on diagram name change.
- */
- private Adapter diagramNameListener = new Adapter() {
-
- public void notifyChanged(Notification notification) {
- if(notification.getFeatureID(Diagram.class) == NotationPackage.DIAGRAM__NAME && notification.getNotifier() == diagram) {
- setPartName(diagram.getName());
- }
-
- }
-
- public Notifier getTarget() {
- return null;
- }
-
- public void setTarget(Notifier newTarget) {
- }
-
- public boolean isAdapterForType(Object type) {
- return false;
- }
-
- };
-
- /**
- *
- * Constructor.
- *
- * @param diagram
- */
- PartNameSynchronizer(Diagram diagram) {
- setDiagram(diagram);
- }
-
- /**
- * Change the associated diagram.
- *
- * @param diagram
- */
- public void setDiagram(Diagram diagram) {
- // Remove from old diagram, if any
- if(this.diagram != null) {
- diagram.eAdapters().remove(diagramNameListener);
- }
-
- // Set new Diagram
- this.diagram = diagram;
- // Set editor name
- setPartName(diagram.getName());
- // Listen to name change
- diagram.eAdapters().add(diagramNameListener);
- }
- }
-
- @Override
- public void createPartControl(Composite parent) {
- IContextService contextService = (IContextService)getSite().getService(IContextService.class);
- //FIXME : before Eclipse Juno, this line was not necessary
- //see bug 367816 and bug 382218
- contextService.activateContext("org.eclipse.gmf.runtime.diagram.ui.diagramContext"); //$NON-NLS-1$
- super.createPartControl(parent);
-
- }
-}
+/**
+ *
+ */
+package org.eclipse.papyrus.uml.diagram.common.part;
+
+import org.eclipse.core.commands.operations.IUndoContext;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.gef.KeyHandler;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.papyrus.infra.core.lifecycleevents.ISaveAndDirtyService;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.gmfdiag.common.SynchronizableGmfDiagramEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.contexts.IContextService;
+
+/**
+ * Common ancestor of GMF based editors for UML. This class allows to declare
+ * stuff commons to all this kind of editors.
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class UmlGmfDiagramEditor extends SynchronizableGmfDiagramEditor {
+
+ /**
+ * The associated Diagram.
+ */
+ private Diagram diagram;
+
+ /**
+ * Object used to synchronize the name of the editor with the name of the
+ * diagram.
+ */
+ private PartNameSynchronizer partNameSynchronizer;
+
+ /**
+ * service registry of the backbone
+ */
+ private ServicesRegistry servicesRegistry;
+
+ /**
+ * Constructor.
+ *
+ * @param servicesRegistry
+ * @param diagram
+ * @throws ServiceException
+ */
+ public UmlGmfDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
+ super(true);
+ this.diagram = diagram;
+ this.servicesRegistry = servicesRegistry;
+ // Install synchronizer
+ partNameSynchronizer = new PartNameSynchronizer(diagram);
+
+ // Register this part to the ISaveAndDirtyService.
+ // This will allows to be notified of saveAs events, and the isDirty
+ // flag will be taken into
+ // account.
+ ISaveAndDirtyService saveAndDirtyService = servicesRegistry.getService(ISaveAndDirtyService.class);
+ saveAndDirtyService.registerIsaveablePart(this);
+
+ // TODO: unregister when editor is disposed !
+ }
+
+ /**
+ * Dispose services used in this part.
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor#dispose()
+ *
+ */
+ @Override
+ public void dispose() {
+ this.setUndoContext(new IUndoContext() {
+
+ public String getLabel() {
+ return "Disposed undo context";
+ }
+
+ public boolean matches(IUndoContext context) {
+ return false;
+ }
+
+ }); //Avoid disposing the shared UndoContext when this nestedEditor is dispose
+ //Super.dispose() will try to dispose the IUndoContext
+
+ super.dispose();
+
+ ISaveAndDirtyService saveAndDirtyService;
+ try {
+ saveAndDirtyService = servicesRegistry.getService(ISaveAndDirtyService.class);
+ saveAndDirtyService.removeIsaveablePart(this);
+
+ } catch (ServiceException e) {
+ // the service can't be found. Maybe it is already disposed.
+ // Do nothing
+ }
+
+ partNameSynchronizer = null;
+ diagram = null;
+ servicesRegistry = null;
+ }
+
+ @Override
+ protected void stopListening() {
+ super.stopListening();
+ }
+
+ /**
+ *
+ * @return the backbone service registry. it cannot return null.
+ */
+ public ServicesRegistry getServicesRegistry() {
+ return servicesRegistry;
+ }
+
+ /**
+ * Set the associated Diagram.
+ */
+ public void setDiagram(Diagram diagram) {
+ this.diagram = diagram;
+ partNameSynchronizer.setDiagram(diagram);
+ }
+
+ /**
+ * Get the associated Diagram
+ */
+ @Override
+ public Diagram getDiagram() {
+ return diagram;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor#getKeyHandler()
+ *
+ * @return
+ */
+ @Override
+ protected KeyHandler getKeyHandler() {
+ // we remove all keybinding provided by GMF
+ KeyHandler keyHandler = new KeyHandler();
+ return keyHandler;
+ }
+
+ /**
+ * A class taking in charge the synchronization of the partName and the
+ * diagram name. When diagram name change, the other is automatically
+ * updated.
+ *
+ * @author cedric dumoulin
+ *
+ */
+ public class PartNameSynchronizer {
+
+ Diagram diagram;
+
+ /**
+ * Listener on diagram name change.
+ */
+ private Adapter diagramNameListener = new Adapter() {
+
+ public void notifyChanged(Notification notification) {
+ if(notification.getFeatureID(Diagram.class) == NotationPackage.DIAGRAM__NAME && notification.getNotifier() == diagram) {
+ setPartName(diagram.getName());
+ }
+
+ }
+
+ public Notifier getTarget() {
+ return null;
+ }
+
+ public void setTarget(Notifier newTarget) {
+ }
+
+ public boolean isAdapterForType(Object type) {
+ return false;
+ }
+
+ };
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param diagram
+ */
+ PartNameSynchronizer(Diagram diagram) {
+ setDiagram(diagram);
+ }
+
+ /**
+ * Change the associated diagram.
+ *
+ * @param diagram
+ */
+ public void setDiagram(Diagram diagram) {
+ // Remove from old diagram, if any
+ if(this.diagram != null) {
+ diagram.eAdapters().remove(diagramNameListener);
+ }
+
+ // Set new Diagram
+ this.diagram = diagram;
+ // Set editor name
+ setPartName(diagram.getName());
+ // Listen to name change
+ diagram.eAdapters().add(diagramNameListener);
+ }
+ }
+
+ @Override
+ public void createPartControl(Composite parent) {
+ IContextService contextService = (IContextService)getSite().getService(IContextService.class);
+ //FIXME : before Eclipse Juno, this line was not necessary
+ //see bug 367816 and bug 382218
+ contextService.activateContext("org.eclipse.gmf.runtime.diagram.ui.diagramContext"); //$NON-NLS-1$
+ super.createPartControl(parent);
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/ProfileApplicationPreferencePage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/ProfileApplicationPreferencePage.java
index 4aac7612d04..60460adc25d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/ProfileApplicationPreferencePage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/preferences/ProfileApplicationPreferencePage.java
@@ -1,57 +1,57 @@
-/*******************************************************************************
- * Copyright (c) 2006 CEA List.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA List - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.preferences;
-
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.RadioGroupFieldEditor;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * Defines the profile application preference page.
- *
- * @author Gilles Cannenterre
- * @since 27 oct. 06
- */
-// @unused
-public class ProfileApplicationPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
-
- /**
- * The Constructor.
- */
- // @unused
- public ProfileApplicationPreferencePage() {
- super(GRID);
- setPreferenceStore(Activator.getDefault().getPreferenceStore());
- setDescription("Profile Application Preferences");
- }
-
- /**
- * Creates the field editors.
- */
- @Override
- public void createFieldEditors() {
-
- addField(new RadioGroupFieldEditor(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE, "Stereotype Name Display Preferences :", 1, new String[][]{ { "UML Compatibility (force lower case for first letter - default)", UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM }, { "User Controlled (let name as entered by user)", UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED } }, getFieldEditorParent()));
- }
-
- /**
- * Init.
- *
- * @param workbench
- * the workbench
- */
- public void init(IWorkbench workbench) {
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 CEA List.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA List - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.preferences;
+
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.RadioGroupFieldEditor;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+/**
+ * Defines the profile application preference page.
+ *
+ * @author Gilles Cannenterre
+ * @since 27 oct. 06
+ */
+// @unused
+public class ProfileApplicationPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ /**
+ * The Constructor.
+ */
+ // @unused
+ public ProfileApplicationPreferencePage() {
+ super(GRID);
+ setPreferenceStore(Activator.getDefault().getPreferenceStore());
+ setDescription("Profile Application Preferences");
+ }
+
+ /**
+ * Creates the field editors.
+ */
+ @Override
+ public void createFieldEditors() {
+
+ addField(new RadioGroupFieldEditor(UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_APPEARANCE, "Stereotype Name Display Preferences :", 1, new String[][]{ { "UML Compatibility (force lower case for first letter - default)", UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_UML_CONFORM }, { "User Controlled (let name as entered by user)", UMLVisualInformationPapyrusConstant.P_STEREOTYPE_NAME_DISPLAY_USER_CONTROLLED } }, getFieldEditorParent()));
+ }
+
+ /**
+ * Init.
+ *
+ * @param workbench
+ * the workbench
+ */
+ public void init(IWorkbench workbench) {
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/AbstractActionStateSourceProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/AbstractActionStateSourceProvider.java
index 36203caf2a2..7d88bf02ced 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/AbstractActionStateSourceProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/AbstractActionStateSourceProvider.java
@@ -1,278 +1,278 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.providers;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.AbstractSourceProvider;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IPartService;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.ISelectionService;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This abstract class is used to provide the state of the actions. It's used to
- * refresh the status of these actions in the menu. (in toolbar and popup, it's
- * not needed)
- *
- * To get the status, we listen the selection service AND the part service! The
- * part service is used to know if the selection is in the Model Explorer or
- * not! When the selection is not in the model explorer, the handlers listening
- * the variable need to be disabled
- */
-public abstract class AbstractActionStateSourceProvider extends AbstractSourceProvider {
-
- /**
- * The enabled state value.
- */
- public static final String ENABLED = "enabled"; //$NON-NLS-
-
- /**
- * The disabled state value.
- */
- public static final String DISABLED = "disabled"; //$NON-NLS-1$
-
- /**
- * Map used to register the state of the actions
- */
- protected HashMap<String, String> currentState;
-
- /**
- * The selection service
- */
- private static ISelectionService selectionService;
-
- /**
- * the listener for the part service
- */
- private static IPartService partService;
-
- /**
- * The listener for the selection service
- */
- private ISelectionListener listener; // we can't set the listener as a
- // static field -> doesn't work
-
- /**
- * The listener for the part service
- */
- private IPartListener partListener; // we can't set the listener as a static
- // field -> doesn't work
-
- /**
- * The activated part
- */
- private static IWorkbenchPart workbenchPart = null;
-
- /**
- *
- * Constructor.
- *
- */
- public AbstractActionStateSourceProvider() {
- currentState = new HashMap<String, String>();
- listener = new SelectionListener();
- partListener = new PartListener();
- }
-
- /**
- *
- * @see org.eclipse.ui.ISourceProvider#dispose()
- *
- */
- public void dispose() {
- if(selectionService != null) {
- selectionService.removeSelectionListener(listener);
- }
- if(partService != null) {
- partService.removePartListener(partListener);
- }
- }
-
- /**
- *
- * @see org.eclipse.ui.ISourceProvider#getCurrentState()
- *
- * @return
- */
- public Map<String, String> getCurrentState() {
- addSelectionListener();
- addPartListener();
- return currentState;
- }
-
- /**
- *
- * @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
- *
- * @return
- */
-
- public abstract String[] getProvidedSourceNames();
-
- // public String[] getProvidedSourceNames() {
- // return new String[]{};
- // }
-
- /**
- * Adds a listener on the selection service if the field {@link #selectionService} is <code>null</code>
- */
- protected void addSelectionListener() {
- if(selectionService == null) {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- // selectionService =
- // (ISelectionService)workbench.getService(ISelectionService.class);
- IWorkbenchWindow activeWorkbench = workbench.getActiveWorkbenchWindow();
- if(activeWorkbench != null) {
- selectionService = activeWorkbench.getSelectionService();
- if(selectionService != null) {
- selectionService.addSelectionListener(listener);
- }
- }
- }
- });
- }
- }
-
- /**
- * Adds a listener on the part service
- */
- protected void addPartListener() {
- if(partService == null) {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- IWorkbench workbench = PlatformUI.getWorkbench();
- // partService =
- // (IPartService)workbench.getService(IPartService.class);
- IWorkbenchWindow activeWorkbench = workbench.getActiveWorkbenchWindow();
- if(activeWorkbench != null) {
- partService = activeWorkbench.getPartService();
- if(partService != null) {
- partService.addPartListener(partListener);
- }
- }
- }
- });
- }
- }
-
- /**
- * Test if the current ActivePart is the Model Explorer
- *
- * @return <code>true</code> if the current activePart is the Model Explorer <code>false</code> if not
- */
- protected boolean isSelectionInDiagram() {
- return (workbenchPart instanceof IMultiDiagramEditor);
- }
-
- /**
- *
- * The class {@link PartListener}
- *
- *
- */
- public class PartListener implements IPartListener {
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partOpened(IWorkbenchPart part) {
- // TODO Auto-generated method stub
- }
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partDeactivated(IWorkbenchPart part) {
- // TODO Auto-generated method stub
- }
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partClosed(IWorkbenchPart part) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- *
- * @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
- *
- * @param part
- */
- public void partActivated(IWorkbenchPart part) {
- workbenchPart = part;
- refreshActions();
- }
-
- }
-
- /**
- *
- * This class provides the listener for the selection service
- *
- */
- protected class SelectionListener implements ISelectionListener {
-
- /**
- *
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
- *
- * @param part
- * @param selection
- */
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- workbenchPart = part;
- refreshActions();
- }
- }
-
- /**
- * This method refresh the status of the variables listened by the actions
- */
- protected abstract void refreshActions();
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.AbstractSourceProvider;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPartService;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This abstract class is used to provide the state of the actions. It's used to
+ * refresh the status of these actions in the menu. (in toolbar and popup, it's
+ * not needed)
+ *
+ * To get the status, we listen the selection service AND the part service! The
+ * part service is used to know if the selection is in the Model Explorer or
+ * not! When the selection is not in the model explorer, the handlers listening
+ * the variable need to be disabled
+ */
+public abstract class AbstractActionStateSourceProvider extends AbstractSourceProvider {
+
+ /**
+ * The enabled state value.
+ */
+ public static final String ENABLED = "enabled"; //$NON-NLS-
+
+ /**
+ * The disabled state value.
+ */
+ public static final String DISABLED = "disabled"; //$NON-NLS-1$
+
+ /**
+ * Map used to register the state of the actions
+ */
+ protected HashMap<String, String> currentState;
+
+ /**
+ * The selection service
+ */
+ private static ISelectionService selectionService;
+
+ /**
+ * the listener for the part service
+ */
+ private static IPartService partService;
+
+ /**
+ * The listener for the selection service
+ */
+ private ISelectionListener listener; // we can't set the listener as a
+ // static field -> doesn't work
+
+ /**
+ * The listener for the part service
+ */
+ private IPartListener partListener; // we can't set the listener as a static
+ // field -> doesn't work
+
+ /**
+ * The activated part
+ */
+ private static IWorkbenchPart workbenchPart = null;
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public AbstractActionStateSourceProvider() {
+ currentState = new HashMap<String, String>();
+ listener = new SelectionListener();
+ partListener = new PartListener();
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.ISourceProvider#dispose()
+ *
+ */
+ public void dispose() {
+ if(selectionService != null) {
+ selectionService.removeSelectionListener(listener);
+ }
+ if(partService != null) {
+ partService.removePartListener(partListener);
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.ISourceProvider#getCurrentState()
+ *
+ * @return
+ */
+ public Map<String, String> getCurrentState() {
+ addSelectionListener();
+ addPartListener();
+ return currentState;
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
+ *
+ * @return
+ */
+
+ public abstract String[] getProvidedSourceNames();
+
+ // public String[] getProvidedSourceNames() {
+ // return new String[]{};
+ // }
+
+ /**
+ * Adds a listener on the selection service if the field {@link #selectionService} is <code>null</code>
+ */
+ protected void addSelectionListener() {
+ if(selectionService == null) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ // selectionService =
+ // (ISelectionService)workbench.getService(ISelectionService.class);
+ IWorkbenchWindow activeWorkbench = workbench.getActiveWorkbenchWindow();
+ if(activeWorkbench != null) {
+ selectionService = activeWorkbench.getSelectionService();
+ if(selectionService != null) {
+ selectionService.addSelectionListener(listener);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * Adds a listener on the part service
+ */
+ protected void addPartListener() {
+ if(partService == null) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ // partService =
+ // (IPartService)workbench.getService(IPartService.class);
+ IWorkbenchWindow activeWorkbench = workbench.getActiveWorkbenchWindow();
+ if(activeWorkbench != null) {
+ partService = activeWorkbench.getPartService();
+ if(partService != null) {
+ partService.addPartListener(partListener);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * Test if the current ActivePart is the Model Explorer
+ *
+ * @return <code>true</code> if the current activePart is the Model Explorer <code>false</code> if not
+ */
+ protected boolean isSelectionInDiagram() {
+ return (workbenchPart instanceof IMultiDiagramEditor);
+ }
+
+ /**
+ *
+ * The class {@link PartListener}
+ *
+ *
+ */
+ public class PartListener implements IPartListener {
+
+ /**
+ *
+ * @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
+ *
+ * @param part
+ */
+ public void partOpened(IWorkbenchPart part) {
+ // TODO Auto-generated method stub
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
+ *
+ * @param part
+ */
+ public void partDeactivated(IWorkbenchPart part) {
+ // TODO Auto-generated method stub
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
+ *
+ * @param part
+ */
+ public void partClosed(IWorkbenchPart part) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
+ *
+ * @param part
+ */
+ public void partBroughtToTop(IWorkbenchPart part) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
+ *
+ * @param part
+ */
+ public void partActivated(IWorkbenchPart part) {
+ workbenchPart = part;
+ refreshActions();
+ }
+
+ }
+
+ /**
+ *
+ * This class provides the listener for the selection service
+ *
+ */
+ protected class SelectionListener implements ISelectionListener {
+
+ /**
+ *
+ * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ *
+ * @param part
+ * @param selection
+ */
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ workbenchPart = part;
+ refreshActions();
+ }
+ }
+
+ /**
+ * This method refresh the status of the variables listened by the actions
+ */
+ protected abstract void refreshActions();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java
index 0ab489e4092..1f4c0bb78aa 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/ActionStateSourceProvider.java
@@ -1,112 +1,112 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.providers;
-
-import org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromDiagramCommandHandler;
-import org.eclipse.papyrus.uml.diagram.common.handlers.RenamedElementHandler;
-import org.eclipse.ui.ISources;
-
-/**
- * This class provides the state of the actions. It's used to refresh the status
- * of these actions in the menu. (in toolbar and popup, it's not needed)
- *
- * To get the status, we listen the selection service AND the part service! The
- * part service is used to know if the selection is in the Model Explorer or
- * not! When the selection is not in the model explorer, the handlers listening
- * the variable need to be disabled
- */
-public class ActionStateSourceProvider extends AbstractActionStateSourceProvider {
-
- /**
- * The name of the variables to check.
- */
- public static final String DELETE_IN_DIAGRAM = "deleteInDiagram"; //$NON-NLS-1$
-
- public static final String RENAME_NAMED_ELEMENT = "renameNamedElement";//$NON-NLS-1$
-
- /**
- *
- * Constructor.
- *
- */
- public ActionStateSourceProvider() {
- super();
- currentState.put(DELETE_IN_DIAGRAM, DISABLED);
- currentState.put(RENAME_NAMED_ELEMENT, DISABLED);
- }
-
- /**
- *
- * @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
- *
- * @return
- */
- @Override
- public String[] getProvidedSourceNames() {
- return new String[]{ DELETE_IN_DIAGRAM, RENAME_NAMED_ELEMENT };
- }
-
- /**
- * Refresh the state of the Delete Action
- */
- protected void refreshDeleteAction() {
- String oldState = currentState.get(DELETE_IN_DIAGRAM);
- String newState = (testDeleteFromDiagram() ? ENABLED : DISABLED);
-
- if(oldState != newState) {
- currentState.put(DELETE_IN_DIAGRAM, newState);
- fireSourceChanged(ISources.WORKBENCH, currentState);
- }
- }
-
- /**
- * Tests if the action DeleteFromDiagram (now called Delete Selected Element
- * can be executed
- *
- * @return <code>true</code> if the action DeleteFromDiagram (now called
- * Delete Selected Element can be executed <code>false</code> if not
- */
- protected boolean testDeleteFromDiagram() {
- DeleteFromDiagramCommandHandler handler = new DeleteFromDiagramCommandHandler();
- return isSelectionInDiagram() && handler.isEnabled();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.providers.AbstractActionStateSourceProvider#refreshActions()
- *
- */
- @Override
- protected void refreshActions() {
- refreshDeleteAction();
- refreshRenamedNamedElement();
- }
-
- /**
- * Refresh the status of the handlers which listen {@link #RENAME_NAMED_ELEMENT}
- */
- protected void refreshRenamedNamedElement() {
- RenamedElementHandler handler = new RenamedElementHandler();
- boolean newValue = handler.isEnabled();
-
- String oldState = currentState.get(RENAME_NAMED_ELEMENT);
- String newState = (newValue ? ENABLED : DISABLED);
-
- if(oldState != newState) {
- currentState.put(RENAME_NAMED_ELEMENT, newState);
- fireSourceChanged(ISources.WORKBENCH, currentState);
- }
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import org.eclipse.papyrus.uml.diagram.common.handlers.DeleteFromDiagramCommandHandler;
+import org.eclipse.papyrus.uml.diagram.common.handlers.RenamedElementHandler;
+import org.eclipse.ui.ISources;
+
+/**
+ * This class provides the state of the actions. It's used to refresh the status
+ * of these actions in the menu. (in toolbar and popup, it's not needed)
+ *
+ * To get the status, we listen the selection service AND the part service! The
+ * part service is used to know if the selection is in the Model Explorer or
+ * not! When the selection is not in the model explorer, the handlers listening
+ * the variable need to be disabled
+ */
+public class ActionStateSourceProvider extends AbstractActionStateSourceProvider {
+
+ /**
+ * The name of the variables to check.
+ */
+ public static final String DELETE_IN_DIAGRAM = "deleteInDiagram"; //$NON-NLS-1$
+
+ public static final String RENAME_NAMED_ELEMENT = "renameNamedElement";//$NON-NLS-1$
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public ActionStateSourceProvider() {
+ super();
+ currentState.put(DELETE_IN_DIAGRAM, DISABLED);
+ currentState.put(RENAME_NAMED_ELEMENT, DISABLED);
+ }
+
+ /**
+ *
+ * @see org.eclipse.ui.ISourceProvider#getProvidedSourceNames()
+ *
+ * @return
+ */
+ @Override
+ public String[] getProvidedSourceNames() {
+ return new String[]{ DELETE_IN_DIAGRAM, RENAME_NAMED_ELEMENT };
+ }
+
+ /**
+ * Refresh the state of the Delete Action
+ */
+ protected void refreshDeleteAction() {
+ String oldState = currentState.get(DELETE_IN_DIAGRAM);
+ String newState = (testDeleteFromDiagram() ? ENABLED : DISABLED);
+
+ if(oldState != newState) {
+ currentState.put(DELETE_IN_DIAGRAM, newState);
+ fireSourceChanged(ISources.WORKBENCH, currentState);
+ }
+ }
+
+ /**
+ * Tests if the action DeleteFromDiagram (now called Delete Selected Element
+ * can be executed
+ *
+ * @return <code>true</code> if the action DeleteFromDiagram (now called
+ * Delete Selected Element can be executed <code>false</code> if not
+ */
+ protected boolean testDeleteFromDiagram() {
+ DeleteFromDiagramCommandHandler handler = new DeleteFromDiagramCommandHandler();
+ return isSelectionInDiagram() && handler.isEnabled();
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.providers.AbstractActionStateSourceProvider#refreshActions()
+ *
+ */
+ @Override
+ protected void refreshActions() {
+ refreshDeleteAction();
+ refreshRenamedNamedElement();
+ }
+
+ /**
+ * Refresh the status of the handlers which listen {@link #RENAME_NAMED_ELEMENT}
+ */
+ protected void refreshRenamedNamedElement() {
+ RenamedElementHandler handler = new RenamedElementHandler();
+ boolean newValue = handler.isEnabled();
+
+ String oldState = currentState.get(RENAME_NAMED_ELEMENT);
+ String newState = (newValue ? ENABLED : DISABLED);
+
+ if(oldState != newState) {
+ currentState.put(RENAME_NAMED_ELEMENT, newState);
+ fireSourceChanged(ISources.WORKBENCH, currentState);
+ }
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java
index baeee9e2601..998ef1f4d21 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/CommentEditPolicyProvider.java
@@ -1,60 +1,60 @@
-/*****************************************************************************
- * Copyright (c) 2013 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Camille Letavernier (camille.letavernier@cea.fr) - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.providers;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.AbstractNameReferencesListenerEditPolicy;
-import org.eclipse.papyrus.uml.diagram.common.editpolicies.CommentReferencesListenerEditPolicy;
-import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
-import org.eclipse.uml2.uml.Comment;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * An edit policy provider to install
- *
- * @author Camille Letavernier
- *
- */
-public class CommentEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider {
-
- public boolean provides(IOperation operation) {
- CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
- Element element = UMLUtil.resolveUMLElement(epOperation.getEditPart());
- if(!(element instanceof Comment)) {
- return false;
- }
- try {
- ServicesRegistry registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(element);
- if(registry == null) {
- return false;
- }
- } catch (Exception ex) {
- return false;
- }
-
- return !(epOperation.getEditPart() instanceof IPrimaryEditPart);
- }
-
- public void createEditPolicies(EditPart editPart) {
- editPart.installEditPolicy(AbstractNameReferencesListenerEditPolicy.NAME_REFERENCES_LISTENER_ID, new CommentReferencesListenerEditPolicy());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2013 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (camille.letavernier@cea.fr) - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IPrimaryEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.CreateEditPoliciesOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpolicy.IEditPolicyProvider;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.emf.utils.ServiceUtilsForEObject;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.AbstractNameReferencesListenerEditPolicy;
+import org.eclipse.papyrus.uml.diagram.common.editpolicies.CommentReferencesListenerEditPolicy;
+import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
+import org.eclipse.uml2.uml.Comment;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * An edit policy provider to install
+ *
+ * @author Camille Letavernier
+ *
+ */
+public class CommentEditPolicyProvider extends AbstractProvider implements IEditPolicyProvider {
+
+ public boolean provides(IOperation operation) {
+ CreateEditPoliciesOperation epOperation = (CreateEditPoliciesOperation)operation;
+ Element element = UMLUtil.resolveUMLElement(epOperation.getEditPart());
+ if(!(element instanceof Comment)) {
+ return false;
+ }
+ try {
+ ServicesRegistry registry = ServiceUtilsForEObject.getInstance().getServiceRegistry(element);
+ if(registry == null) {
+ return false;
+ }
+ } catch (Exception ex) {
+ return false;
+ }
+
+ return !(epOperation.getEditPart() instanceof IPrimaryEditPart);
+ }
+
+ public void createEditPolicies(EditPart editPart) {
+ editPart.installEditPolicy(AbstractNameReferencesListenerEditPolicy.NAME_REFERENCES_LISTENER_ID, new CommentReferencesListenerEditPolicy());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java
index 9620010c009..560118a864c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/DiagramDecorationAdapter.java
@@ -1,430 +1,430 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Amine EL KOUHEN (CEA LIST/LIFL) - Amine.Elkouhen@cea.fr
- * Ansgar Radermacher (CEA LIST) - ansgar.radermacher@cea.fr
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.providers;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PrecisionRectangle;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.handles.HandleBounds;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.Decoration;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.services.decoration.util.Decoration.PreferedPosition;
-import org.eclipse.papyrus.infra.services.decoration.util.IPapyrusDecoration;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.graphics.Image;
-
-
-/**
- * The Class DiagramDecorationAdapter.
- */
-public class DiagramDecorationAdapter {
-
- /** The decorator target. */
- protected IDecoratorTarget decoratorTarget;
-
- /** The decoration. */
- protected List<IDecoration> decorations;
-
- /**
- * Instantiates a new diagram decoration adapter.
- *
- * @param decoratorTarget
- * the decorator target
- */
- public DiagramDecorationAdapter(IDecoratorTarget decoratorTarget) {
- this.decoratorTarget = decoratorTarget;
- }
-
- /**
- * Gets the decorator target.
- *
- * @return the decorator target
- */
- public IDecoratorTarget getDecoratorTarget() {
- return this.decoratorTarget;
- }
-
- /**
- * Removes the decoration.
- */
- public void removeDecorations() {
- if((decoratorTarget == null) || (decorations == null)) {
- return;
- }
- for(IDecoration decoration : decorations) {
- removeDecoration(decoration);
- }
-
- }
-
- /**
- * Sets the decorator target.
- *
- * @param decoratorTarget
- * the new decorator target
- */
- public void setDecoratorTarget(IDecoratorTarget decoratorTarget) {
- this.decoratorTarget = decoratorTarget;
- }
-
- /**
- * Gets the tool tip.
- *
- * @param message
- * the message
- * @return the tool tip
- */
- final public Label getToolTip(String message) {
- return new Label(message);
- }
-
- /**
- * Sets the decorations for a node.
- *
- * @param pDecoration
- * A set of Papyrus decorations
- * @param margin
- * the margin from the right corner
- * @param isVolatile
- * the is volatile
- * @return the set of JFace decorations
- */
- final public List<IDecoration> setDecorationsNode(List<IPapyrusDecoration> pDecorations, int margin, boolean isVolatile) {
-
- decorations = new BasicEList<IDecoration>();
- for(IPapyrusDecoration pDecoration : pDecorations) {
- Image image = addDecorationNode(pDecoration, margin, isVolatile);
- if(image != null) {
- margin += image.getBounds().width;
- }
- }
- // this.pDecorations = pDecorations;
-
- return decorations;
- }
-
- /**
- * Sets the decorations on an edge.
- *
- * @param pDecoration
- * A set of Papyrus decorations
- * @param percentageFromSource
- * the distance in percent from source node. 50 indicates in the middle
- * between source and target
- * @param isVolatile
- * the is volatile
- * @return the set of JFace decorations
- */
- final public List<IDecoration> setDecorationsEdge(List<IPapyrusDecoration> pDecorations, int percentageFromSource, boolean isVolatile) {
-
- final int distBetweenIconsPercent = 20;
- final int percentageMin = 10;
- final int percentageMax = 90;
-
- decorations = new BasicEList<IDecoration>();
- if(pDecorations.size() > 1) {
- percentageFromSource -= distBetweenIconsPercent / 2 * (pDecorations.size() - 1);
- }
- if(percentageFromSource < percentageMin) {
- percentageFromSource = percentageMin;
- }
- for(IPapyrusDecoration pDecoration : pDecorations) {
- addDecoration(pDecoration, percentageFromSource, 0, isVolatile);
- percentageFromSource += distBetweenIconsPercent;
- if(percentageFromSource > percentageMax) {
- percentageFromSource = percentageMax;
- }
- }
- // this.pDecorations = pDecorations;
-
- return decorations;
- }
-
- /**
- * Add a decoration to a node. This function can also be used to add decorations incrementally (see bug 400593)
- *
- * @param pDecoration
- * the Papyrus decoration
- * @param margin
- * The margin from the right corner. If -1, the proper position left of other icons is calculated
- * @param isVolatile
- * whether volatile (typically true)
- * @return
- */
- final public Image addDecorationNode(IPapyrusDecoration pDecoration, int margin, boolean isVolatile) {
-
- if(margin == -1) {
- margin = 0;
- // calc distance from right margin, if not given.
- for(IDecoration decoration : decorations) {
- if(decoration instanceof Decoration) {
- margin += ((Decoration)decoration).getBounds().width;
- }
- }
- }
- return addDecoration(pDecoration, 0, margin, true);
- }
-
- final public Image addDecoration(IPapyrusDecoration pDecoration, int percentageFromSource, int margin, boolean isVolatile) {
- // use image registry, see bug 401056
- Image image = Activator.getPluginIconImage(Activator.ID, pDecoration.getDecorationImageForGE());
- IDecoration decoration = createDecorationImage(decoratorTarget, image, percentageFromSource, margin, isVolatile);
- if(decoration != null) {
- decorations.add(decoration);
- String message = pDecoration.getMessage();
- Label toolTip = getToolTip(message);
- if(decoration instanceof Decoration) {
- ((Decoration)decoration).setToolTip(toolTip);
- }
- return image;
- }
- else {
- return null;
- }
- }
-
-
- /**
- * Removes a decoration.
- *
- * @param decoratorTarget
- * the decorator target
- * @param Decoration
- * the decoration
- */
- final public void removeDecoration(IDecoration decoration) {
- if((decoration == null) || (decoratorTarget == null)) {
- return;
- }
-
- if(decoration instanceof IFigure) {
- IFigure parent = ((IFigure)decoration).getParent();
- if(parent != null) {
- parent.remove((IFigure)decoration);
- }
- }
- // decorations.remove(decoration);
- GraphicalEditPart ownerEditPart = (GraphicalEditPart)decoratorTarget.getAdapter(GraphicalEditPart.class);
- if(ownerEditPart.getViewer() != null) {
- ownerEditPart.getViewer().getVisualPartMap().remove(decoration);
- }
- }
-
- /**
- * Create a decoration based on an image
- *
- * @param decoratorTarget
- * the decorator target
- * @param image
- * the image
- * @param position
- * the position
- * @param percentageFromSource
- * the percentage from source, only evaluated for edge decorations
- * @param margin
- * the margin in pixels from the target position.
- * @See org.eclipse.gmf.runtime.diagram.ui.services.decorator.addShapeDecoration:
- * The margin is the space, in himetric units, between the
- * shape's edge and the decoration. A positive margin will place
- * the figure outside the shape, a negative margin will place the
- * decoration inside the shape.
- * @param isVolatile
- * the is volatile
- * @return the decoration
- */
- final public IDecoration createDecorationImage(IDecoratorTarget decoratorTarget, Image image, int percentageFromSource, int margin, boolean isVolatile) {
- final View view = (View)decoratorTarget.getAdapter(View.class);
- org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration decoration = null;
- if(view == null || view.eResource() == null || image == null) {
- return decoration;
- }
- EditPart editPart = (EditPart)decoratorTarget.getAdapter(EditPart.class);
- if(editPart == null || editPart.getViewer() == null) {
- return decoration;
- }
- if(editPart instanceof GraphicalEditPart) {
- GraphicalEditPart gEditPart = (GraphicalEditPart)editPart;
- if(view instanceof Edge) {
- decoration = decoratorTarget.addConnectionDecoration(image, percentageFromSource, isVolatile);
- } else {
- IFigure parentFig = gEditPart.getFigure();
- if(parentFig instanceof HandleBounds) {
- // only support figures with handle bounds
- Locator locator = new MultiIconTopRightLocator(parentFig, margin);
-
- // Direction NORTH_EAST will be ignored, since we impose "our" locator below
- decoration = decoratorTarget.addShapeDecoration(image, IDecoratorTarget.Direction.NORTH_EAST, margin, isVolatile);
- if(decoration instanceof Decoration) {
- ((Decoration)decoration).setLocator(locator);
- }
- }
- }
-
- }
- return decoration;
- }
-
- /**
- * Create a decoration based on a figure
- *
- * @param decoratorTarget
- * the decorator target
- * @param figure
- * the figure
- * @param position
- * the position
- * @param percentageFromSource
- * the percentage from source
- * @param margin
- * the margin
- * @param isVolatile
- * the is volatile
- * @return the decoration
- */
- final public IDecoration createDecorationFigure(IDecoratorTarget decoratorTarget, IFigure figure, int percentageFromSource, int margin, boolean isVolatile) {
-
- final View view = (View)decoratorTarget.getAdapter(View.class);
- org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration decoration = null;
- if(view == null || view.eResource() == null || figure == null) {
- return decoration;
- }
- EditPart editPart = (EditPart)decoratorTarget.getAdapter(EditPart.class);
- if(editPart == null || editPart.getViewer() == null) {
- return decoration;
- }
- if(editPart instanceof GraphicalEditPart) {
- if(view instanceof Edge) {
- decoration = decoratorTarget.addConnectionDecoration(figure, percentageFromSource, isVolatile);
- } else {
- IFigure parentFig = ((GraphicalEditPart)editPart).getFigure();
- margin = MapModeUtil.getMapMode(parentFig).DPtoLP(margin);
-
- // Locator locator = new MultiIconTopRightLocator(parentFig, margin);
-
- // decoration = decoratorTarget.addDecoration(figure, locator, isVolatile);
- decoration = decoratorTarget.addShapeDecoration(figure, IDecoratorTarget.Direction.NORTH_EAST, margin, isVolatile);
- }
-
- }
- return decoration;
- }
-
- /**
- * A locator that places elements to the upper right corner with a "margin" distance to the left.
- *
- * @See org.eclipse.gmf.runtime.gef.ui.internal.figures.RelativetoBorderLocator
- * @author ansgar
- *
- */
- public class MultiIconTopRightLocator implements Locator {
-
- public MultiIconTopRightLocator(IFigure parentFig, int rightMargin) {
- this.reference = parentFig;
- if(rightMargin < 0) {
- // avoid negative right margin. This could imply that the decorator enlarges the reference figure
- // which in turn might re-position the decorator to the right and thus causing an enlargement in
- // an endless loop
- rightMargin = 0;
- }
- this.rightMargin = rightMargin;
- }
-
- public void relocate(IFigure target) {
- Rectangle bounds;
- if(reference instanceof HandleBounds) {
- bounds = new PrecisionRectangle(((HandleBounds)reference).getHandleBounds());
- }
- else {
- bounds = new PrecisionRectangle(reference.getBounds());
- // authorized rectangle without handle bounds is smaller: if the icon would be exactly on one of the corners,
- // it would trigger an enlargement of the figure, followed by a reposition, i.e. an endless loop.
- bounds.x++;
- bounds.y++;
- bounds.width -= 2;
- bounds.height -= 2;
- }
-
- reference.translateToAbsolute(bounds);
- target.translateToRelative(bounds);
-
- Point pTR = bounds.getTopRight();
- Point pTL = bounds.getTopLeft();
- Point pDecoration = new Point(pTR);
-
- int decorationX = pTR.x - target.getSize().width - rightMargin;
- if(decorationX > pTL.x) {
- // only set position, if it is inside the figure, i.e. bigger than left margin
- pDecoration.setX(decorationX);
- }
- else {
- pDecoration.setX(pTL.x);
- }
- target.setLocation(pDecoration);
- }
-
- protected IFigure reference;
-
- protected int rightMargin;
- };
-
-
- /**
- * Gets the direction.
- *
- * @param position
- * the position
- * @return the direction
- */
- @Deprecated
- private Direction getDirection(PreferedPosition position) {
-
- switch(position) {
-
- case NORTH_WEST:
- return IDecoratorTarget.Direction.NORTH_WEST;
- case NORTH:
- return IDecoratorTarget.Direction.NORTH;
- case NORTH_EAST:
- return IDecoratorTarget.Direction.NORTH_EAST;
- case EAST:
- return IDecoratorTarget.Direction.EAST;
- case SOUTH_EAST:
- return IDecoratorTarget.Direction.SOUTH_EAST;
- case SOUTH:
- return IDecoratorTarget.Direction.SOUTH;
- case SOUTH_WEST:
- return IDecoratorTarget.Direction.SOUTH_WEST;
- case WEST:
- return IDecoratorTarget.Direction.WEST;
- case CENTER:
- return IDecoratorTarget.Direction.CENTER;
- default:
- return IDecoratorTarget.Direction.NORTH_EAST;
-
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Amine EL KOUHEN (CEA LIST/LIFL) - Amine.Elkouhen@cea.fr
+ * Ansgar Radermacher (CEA LIST) - ansgar.radermacher@cea.fr
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import java.util.List;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.Locator;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.handles.HandleBounds;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.Decoration;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.services.decoration.util.Decoration.PreferedPosition;
+import org.eclipse.papyrus.infra.services.decoration.util.IPapyrusDecoration;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.graphics.Image;
+
+
+/**
+ * The Class DiagramDecorationAdapter.
+ */
+public class DiagramDecorationAdapter {
+
+ /** The decorator target. */
+ protected IDecoratorTarget decoratorTarget;
+
+ /** The decoration. */
+ protected List<IDecoration> decorations;
+
+ /**
+ * Instantiates a new diagram decoration adapter.
+ *
+ * @param decoratorTarget
+ * the decorator target
+ */
+ public DiagramDecorationAdapter(IDecoratorTarget decoratorTarget) {
+ this.decoratorTarget = decoratorTarget;
+ }
+
+ /**
+ * Gets the decorator target.
+ *
+ * @return the decorator target
+ */
+ public IDecoratorTarget getDecoratorTarget() {
+ return this.decoratorTarget;
+ }
+
+ /**
+ * Removes the decoration.
+ */
+ public void removeDecorations() {
+ if((decoratorTarget == null) || (decorations == null)) {
+ return;
+ }
+ for(IDecoration decoration : decorations) {
+ removeDecoration(decoration);
+ }
+
+ }
+
+ /**
+ * Sets the decorator target.
+ *
+ * @param decoratorTarget
+ * the new decorator target
+ */
+ public void setDecoratorTarget(IDecoratorTarget decoratorTarget) {
+ this.decoratorTarget = decoratorTarget;
+ }
+
+ /**
+ * Gets the tool tip.
+ *
+ * @param message
+ * the message
+ * @return the tool tip
+ */
+ final public Label getToolTip(String message) {
+ return new Label(message);
+ }
+
+ /**
+ * Sets the decorations for a node.
+ *
+ * @param pDecoration
+ * A set of Papyrus decorations
+ * @param margin
+ * the margin from the right corner
+ * @param isVolatile
+ * the is volatile
+ * @return the set of JFace decorations
+ */
+ final public List<IDecoration> setDecorationsNode(List<IPapyrusDecoration> pDecorations, int margin, boolean isVolatile) {
+
+ decorations = new BasicEList<IDecoration>();
+ for(IPapyrusDecoration pDecoration : pDecorations) {
+ Image image = addDecorationNode(pDecoration, margin, isVolatile);
+ if(image != null) {
+ margin += image.getBounds().width;
+ }
+ }
+ // this.pDecorations = pDecorations;
+
+ return decorations;
+ }
+
+ /**
+ * Sets the decorations on an edge.
+ *
+ * @param pDecoration
+ * A set of Papyrus decorations
+ * @param percentageFromSource
+ * the distance in percent from source node. 50 indicates in the middle
+ * between source and target
+ * @param isVolatile
+ * the is volatile
+ * @return the set of JFace decorations
+ */
+ final public List<IDecoration> setDecorationsEdge(List<IPapyrusDecoration> pDecorations, int percentageFromSource, boolean isVolatile) {
+
+ final int distBetweenIconsPercent = 20;
+ final int percentageMin = 10;
+ final int percentageMax = 90;
+
+ decorations = new BasicEList<IDecoration>();
+ if(pDecorations.size() > 1) {
+ percentageFromSource -= distBetweenIconsPercent / 2 * (pDecorations.size() - 1);
+ }
+ if(percentageFromSource < percentageMin) {
+ percentageFromSource = percentageMin;
+ }
+ for(IPapyrusDecoration pDecoration : pDecorations) {
+ addDecoration(pDecoration, percentageFromSource, 0, isVolatile);
+ percentageFromSource += distBetweenIconsPercent;
+ if(percentageFromSource > percentageMax) {
+ percentageFromSource = percentageMax;
+ }
+ }
+ // this.pDecorations = pDecorations;
+
+ return decorations;
+ }
+
+ /**
+ * Add a decoration to a node. This function can also be used to add decorations incrementally (see bug 400593)
+ *
+ * @param pDecoration
+ * the Papyrus decoration
+ * @param margin
+ * The margin from the right corner. If -1, the proper position left of other icons is calculated
+ * @param isVolatile
+ * whether volatile (typically true)
+ * @return
+ */
+ final public Image addDecorationNode(IPapyrusDecoration pDecoration, int margin, boolean isVolatile) {
+
+ if(margin == -1) {
+ margin = 0;
+ // calc distance from right margin, if not given.
+ for(IDecoration decoration : decorations) {
+ if(decoration instanceof Decoration) {
+ margin += ((Decoration)decoration).getBounds().width;
+ }
+ }
+ }
+ return addDecoration(pDecoration, 0, margin, true);
+ }
+
+ final public Image addDecoration(IPapyrusDecoration pDecoration, int percentageFromSource, int margin, boolean isVolatile) {
+ // use image registry, see bug 401056
+ Image image = Activator.getPluginIconImage(Activator.ID, pDecoration.getDecorationImageForGE());
+ IDecoration decoration = createDecorationImage(decoratorTarget, image, percentageFromSource, margin, isVolatile);
+ if(decoration != null) {
+ decorations.add(decoration);
+ String message = pDecoration.getMessage();
+ Label toolTip = getToolTip(message);
+ if(decoration instanceof Decoration) {
+ ((Decoration)decoration).setToolTip(toolTip);
+ }
+ return image;
+ }
+ else {
+ return null;
+ }
+ }
+
+
+ /**
+ * Removes a decoration.
+ *
+ * @param decoratorTarget
+ * the decorator target
+ * @param Decoration
+ * the decoration
+ */
+ final public void removeDecoration(IDecoration decoration) {
+ if((decoration == null) || (decoratorTarget == null)) {
+ return;
+ }
+
+ if(decoration instanceof IFigure) {
+ IFigure parent = ((IFigure)decoration).getParent();
+ if(parent != null) {
+ parent.remove((IFigure)decoration);
+ }
+ }
+ // decorations.remove(decoration);
+ GraphicalEditPart ownerEditPart = (GraphicalEditPart)decoratorTarget.getAdapter(GraphicalEditPart.class);
+ if(ownerEditPart.getViewer() != null) {
+ ownerEditPart.getViewer().getVisualPartMap().remove(decoration);
+ }
+ }
+
+ /**
+ * Create a decoration based on an image
+ *
+ * @param decoratorTarget
+ * the decorator target
+ * @param image
+ * the image
+ * @param position
+ * the position
+ * @param percentageFromSource
+ * the percentage from source, only evaluated for edge decorations
+ * @param margin
+ * the margin in pixels from the target position.
+ * @See org.eclipse.gmf.runtime.diagram.ui.services.decorator.addShapeDecoration:
+ * The margin is the space, in himetric units, between the
+ * shape's edge and the decoration. A positive margin will place
+ * the figure outside the shape, a negative margin will place the
+ * decoration inside the shape.
+ * @param isVolatile
+ * the is volatile
+ * @return the decoration
+ */
+ final public IDecoration createDecorationImage(IDecoratorTarget decoratorTarget, Image image, int percentageFromSource, int margin, boolean isVolatile) {
+ final View view = (View)decoratorTarget.getAdapter(View.class);
+ org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration decoration = null;
+ if(view == null || view.eResource() == null || image == null) {
+ return decoration;
+ }
+ EditPart editPart = (EditPart)decoratorTarget.getAdapter(EditPart.class);
+ if(editPart == null || editPart.getViewer() == null) {
+ return decoration;
+ }
+ if(editPart instanceof GraphicalEditPart) {
+ GraphicalEditPart gEditPart = (GraphicalEditPart)editPart;
+ if(view instanceof Edge) {
+ decoration = decoratorTarget.addConnectionDecoration(image, percentageFromSource, isVolatile);
+ } else {
+ IFigure parentFig = gEditPart.getFigure();
+ if(parentFig instanceof HandleBounds) {
+ // only support figures with handle bounds
+ Locator locator = new MultiIconTopRightLocator(parentFig, margin);
+
+ // Direction NORTH_EAST will be ignored, since we impose "our" locator below
+ decoration = decoratorTarget.addShapeDecoration(image, IDecoratorTarget.Direction.NORTH_EAST, margin, isVolatile);
+ if(decoration instanceof Decoration) {
+ ((Decoration)decoration).setLocator(locator);
+ }
+ }
+ }
+
+ }
+ return decoration;
+ }
+
+ /**
+ * Create a decoration based on a figure
+ *
+ * @param decoratorTarget
+ * the decorator target
+ * @param figure
+ * the figure
+ * @param position
+ * the position
+ * @param percentageFromSource
+ * the percentage from source
+ * @param margin
+ * the margin
+ * @param isVolatile
+ * the is volatile
+ * @return the decoration
+ */
+ final public IDecoration createDecorationFigure(IDecoratorTarget decoratorTarget, IFigure figure, int percentageFromSource, int margin, boolean isVolatile) {
+
+ final View view = (View)decoratorTarget.getAdapter(View.class);
+ org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration decoration = null;
+ if(view == null || view.eResource() == null || figure == null) {
+ return decoration;
+ }
+ EditPart editPart = (EditPart)decoratorTarget.getAdapter(EditPart.class);
+ if(editPart == null || editPart.getViewer() == null) {
+ return decoration;
+ }
+ if(editPart instanceof GraphicalEditPart) {
+ if(view instanceof Edge) {
+ decoration = decoratorTarget.addConnectionDecoration(figure, percentageFromSource, isVolatile);
+ } else {
+ IFigure parentFig = ((GraphicalEditPart)editPart).getFigure();
+ margin = MapModeUtil.getMapMode(parentFig).DPtoLP(margin);
+
+ // Locator locator = new MultiIconTopRightLocator(parentFig, margin);
+
+ // decoration = decoratorTarget.addDecoration(figure, locator, isVolatile);
+ decoration = decoratorTarget.addShapeDecoration(figure, IDecoratorTarget.Direction.NORTH_EAST, margin, isVolatile);
+ }
+
+ }
+ return decoration;
+ }
+
+ /**
+ * A locator that places elements to the upper right corner with a "margin" distance to the left.
+ *
+ * @See org.eclipse.gmf.runtime.gef.ui.internal.figures.RelativetoBorderLocator
+ * @author ansgar
+ *
+ */
+ public class MultiIconTopRightLocator implements Locator {
+
+ public MultiIconTopRightLocator(IFigure parentFig, int rightMargin) {
+ this.reference = parentFig;
+ if(rightMargin < 0) {
+ // avoid negative right margin. This could imply that the decorator enlarges the reference figure
+ // which in turn might re-position the decorator to the right and thus causing an enlargement in
+ // an endless loop
+ rightMargin = 0;
+ }
+ this.rightMargin = rightMargin;
+ }
+
+ public void relocate(IFigure target) {
+ Rectangle bounds;
+ if(reference instanceof HandleBounds) {
+ bounds = new PrecisionRectangle(((HandleBounds)reference).getHandleBounds());
+ }
+ else {
+ bounds = new PrecisionRectangle(reference.getBounds());
+ // authorized rectangle without handle bounds is smaller: if the icon would be exactly on one of the corners,
+ // it would trigger an enlargement of the figure, followed by a reposition, i.e. an endless loop.
+ bounds.x++;
+ bounds.y++;
+ bounds.width -= 2;
+ bounds.height -= 2;
+ }
+
+ reference.translateToAbsolute(bounds);
+ target.translateToRelative(bounds);
+
+ Point pTR = bounds.getTopRight();
+ Point pTL = bounds.getTopLeft();
+ Point pDecoration = new Point(pTR);
+
+ int decorationX = pTR.x - target.getSize().width - rightMargin;
+ if(decorationX > pTL.x) {
+ // only set position, if it is inside the figure, i.e. bigger than left margin
+ pDecoration.setX(decorationX);
+ }
+ else {
+ pDecoration.setX(pTL.x);
+ }
+ target.setLocation(pDecoration);
+ }
+
+ protected IFigure reference;
+
+ protected int rightMargin;
+ };
+
+
+ /**
+ * Gets the direction.
+ *
+ * @param position
+ * the position
+ * @return the direction
+ */
+ @Deprecated
+ private Direction getDirection(PreferedPosition position) {
+
+ switch(position) {
+
+ case NORTH_WEST:
+ return IDecoratorTarget.Direction.NORTH_WEST;
+ case NORTH:
+ return IDecoratorTarget.Direction.NORTH;
+ case NORTH_EAST:
+ return IDecoratorTarget.Direction.NORTH_EAST;
+ case EAST:
+ return IDecoratorTarget.Direction.EAST;
+ case SOUTH_EAST:
+ return IDecoratorTarget.Direction.SOUTH_EAST;
+ case SOUTH:
+ return IDecoratorTarget.Direction.SOUTH;
+ case SOUTH_WEST:
+ return IDecoratorTarget.Direction.SOUTH_WEST;
+ case WEST:
+ return IDecoratorTarget.Direction.WEST;
+ case CENTER:
+ return IDecoratorTarget.Direction.CENTER;
+ default:
+ return IDecoratorTarget.Direction.NORTH_EAST;
+
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusDiagramGlobalActionHandler.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusDiagramGlobalActionHandler.java
index 3c65f248913..f7544436747 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusDiagramGlobalActionHandler.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusDiagramGlobalActionHandler.java
@@ -1,307 +1,307 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.providers;
-
-import java.awt.Toolkit;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.edit.command.CopyToClipboardCommand;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.RequestConstants;
-import org.eclipse.gef.RootEditPart;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.requests.GroupRequest;
-import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.action.global.GlobalActionId;
-import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionContext;
-import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
-import org.eclipse.gmf.runtime.diagram.ui.render.clipboard.AWTClipboardHelper;
-import org.eclipse.gmf.runtime.diagram.ui.render.internal.providers.ImageSupportGlobalActionHandler;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.ui.properties.actions.PropertyPageViewAction;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
-import org.eclipse.papyrus.uml.diagram.common.helper.CleanDiagramHelper;
-import org.eclipse.papyrus.uml.pastemanager.service.PasteCommandService;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * this class has in charge to launch command for cut copy paste (graphically)
- * it is also used to launch the copy into bmp like as writer software
- *
- */
-@SuppressWarnings("restriction")
-public class PapyrusDiagramGlobalActionHandler extends ImageSupportGlobalActionHandler {
-
- @Override
- public boolean canHandle(IGlobalActionContext cntxt) {
- /* Check if the active part is a IDiagramWorkbenchPart */
- IWorkbenchPart part = cntxt.getActivePart();
- part = (IWorkbenchPart)part.getAdapter(IDiagramWorkbenchPart.class);
- if(!(part instanceof IDiagramWorkbenchPart)) {
- return false;
- }
-
- /* Check if the selection is a structured selection */
- if(!(cntxt.getSelection() instanceof IStructuredSelection)) {
- return false;
- }
-
- /* Check the action id */
- String actionId = cntxt.getActionId();
- if(actionId.equals(GlobalActionId.COPY)) {
- return canCopy(cntxt);
- } else if(actionId.equals(GlobalActionId.CUT)) {
- return canCut(cntxt);
- } else if(actionId.equals(GlobalActionId.PASTE)) {
- return canPaste(cntxt);
- }
- return false;
- }
-
- protected boolean canPaste(IGlobalActionContext cntxt) {
- /* Get the selected edit parts */
- Object[] objectsArray = ((IStructuredSelection)cntxt.getSelection()).toArray();
-
- if(objectsArray.length > 0 && objectsArray[0] instanceof GraphicalEditPart) {
- ICommand pastecommand = PasteCommandService.getInstance().getPasteViewCommand(((GraphicalEditPart)objectsArray[0]), Toolkit.getDefaultToolkit().getSystemClipboard(), ((GraphicalEditPart)objectsArray[0]).getEditingDomain().getClipboard());
- return pastecommand.canExecute();
- }
-
- if(!AWTClipboardHelper.getInstance().isImageCopySupported()) {
- return super.canPaste(cntxt);
- }
-
- /* Check if the clipboard has data for the drawing surface */
- return AWTClipboardHelper.getInstance().hasCustomData();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandler
- * #getCommand(org.eclipse.gmf.runtime.common.ui.services.action.
- * global.IGlobalActionContext)
- */
- public ICommand getCommand(IGlobalActionContext cntxt) {
- /* Check if the active part is a IDiagramWorkbenchPart */
- IWorkbenchPart part = cntxt.getActivePart();
- part = (IWorkbenchPart)part.getAdapter(IDiagramWorkbenchPart.class);
- if(!(part instanceof IDiagramWorkbenchPart)) {
- return null;
- }
-
- /* Get the model operation context */
- IDiagramWorkbenchPart diagramPart = (IDiagramWorkbenchPart)part;
-
- /* Create a command */
- ICommand command = null;
-
- /* Check the action id */
- String actionId = cntxt.getActionId();
- if(actionId.equals(GlobalActionId.DELETE)) {
- CompoundCommand deleteCC = getDeleteCommand(diagramPart, cntxt);
- /* Set the command */
- if(deleteCC != null && deleteCC.canExecute())
- command = new CommandProxy(deleteCC);
- } else if(actionId.equals(GlobalActionId.COPY)) {
- command = getCopyCommand(cntxt, diagramPart, false);
- } else if(actionId.equals(GlobalActionId.CUT)) {
- command = getCutCommand(cntxt, diagramPart);
- } else if(actionId.equals(GlobalActionId.PASTE)) {
-
- /* Get the selected edit parts */
- Object[] objectsArray = ((IStructuredSelection)cntxt.getSelection()).toArray();
-
- if(objectsArray.length > 0 && objectsArray[0] instanceof GraphicalEditPart) {
-
- ICommand pastecommand = PasteCommandService.getInstance().getPasteViewCommand(((GraphicalEditPart)objectsArray[0]), Toolkit.getDefaultToolkit().getSystemClipboard(), ((GraphicalEditPart)objectsArray[0]).getEditingDomain().getClipboard());
-
- if(pastecommand.canExecute()) {
- ((GraphicalEditPart)objectsArray[0]).getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(pastecommand));
- RootEditPart topEditPart = ((GraphicalEditPart)objectsArray[0]).getRoot();
- if(topEditPart.getChildren().get(0) instanceof DiagramEditPart) {
- CleanDiagramHelper.getInstance().run((DiagramEditPart)topEditPart.getChildren().get(0));
- }
-
- }
- return null;
- }
-
- } else if(actionId.equals(GlobalActionId.SAVE)) {
- part.getSite().getPage().saveEditor((IEditorPart)diagramPart, false);
- } else if(actionId.equals(GlobalActionId.PROPERTIES)) {
- new PropertyPageViewAction().run();
- }
-
- return command;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler#getCopyCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionContext,
- * org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart, boolean) this class also copy in the clipboard of the editing domain
- * selected elements
- *
- */
-
- @Override
- protected ICommand getCopyCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart, boolean isUndoable) {
- /* Get the selected edit parts */
- Object[] objectsArray = ((IStructuredSelection)cntxt.getSelection()).toArray();
- CompositeCommand compositeCommand = new CompositeCommand(GlobalActionId.COPY);
- if(objectsArray.length > 0 && objectsArray[0] instanceof GraphicalEditPart) {
- // ((GraphicalEditPart)objectsArray[0]).getEditingDomain().setClipboard(((IStructuredSelection)
- // cntxt.getSelection()).toList());
- compositeCommand.add(new EMFtoGMFCommandWrapper(CopyToClipboardCommand.create(((GraphicalEditPart)objectsArray[0]).getEditingDomain(), getNotation(((IStructuredSelection)cntxt.getSelection()).toList()))));
- }
- if(objectsArray.length > 0 && objectsArray[0] instanceof ConnectionEditPart) {
- // ((GraphicalEditPart)objectsArray[0]).getEditingDomain().setClipboard(((IStructuredSelection)
- // cntxt.getSelection()).toList());
- compositeCommand.add(new EMFtoGMFCommandWrapper(CopyToClipboardCommand.create(((ConnectionEditPart)objectsArray[0]).getEditingDomain(), getNotation(((IStructuredSelection)cntxt.getSelection()).toList()))));
- }
- compositeCommand.add(super.getCopyCommand(cntxt, diagramPart, isUndoable));
- return compositeCommand;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler#getCutCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionContext,
- * org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart)
- *
- * @param cntxt
- * @param diagramPart
- * @return
- */
-
- @Override
- protected ICommand getCutCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart) {
- Object[] objectsArray = ((IStructuredSelection)cntxt.getSelection()).toArray();
- CompositeCommand compositeCommand = new CompositeCommand(GlobalActionId.CUT);
- if(objectsArray.length > 0 && objectsArray[0] instanceof GraphicalEditPart) {
- // ((GraphicalEditPart)objectsArray[0]).getEditingDomain().setClipboard(((IStructuredSelection)
- // cntxt.getSelection()).toList());
- compositeCommand.add(new EMFtoGMFCommandWrapper(CopyToClipboardCommand.create(((GraphicalEditPart)objectsArray[0]).getEditingDomain(), getNotation(((IStructuredSelection)cntxt.getSelection()).toList()))));
-
- }
- if(objectsArray.length > 0 && objectsArray[0] instanceof ConnectionEditPart) {
- // ((GraphicalEditPart)objectsArray[0]).getEditingDomain().setClipboard(((IStructuredSelection)
- // cntxt.getSelection()).toList());
- compositeCommand.add(new EMFtoGMFCommandWrapper(CopyToClipboardCommand.create(((ConnectionEditPart)objectsArray[0]).getEditingDomain(), getNotation(((IStructuredSelection)cntxt.getSelection()).toList()))));
- }
- ICommand cutCommand = super.getCutCommand(cntxt, diagramPart);
- if(cutCommand != null) {
- compositeCommand.add(cutCommand);
- }
- return compositeCommand;
- }
-
- /**
- * Returns appropriate delete command for this context.
- *
- * @param part
- * the workbench part
- * @param cntxt
- * the <code>IGlobalActionContext</code> holding the necessary
- * information needed by this action handler
- * @return CompoundCommand command
- */
- private CompoundCommand getDeleteCommand(IDiagramWorkbenchPart part, IGlobalActionContext cntxt) {
- /* Create the delete request */
- GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE);
-
- CompoundCommand deleteCC = new CompoundCommand(cntxt.getLabel());
-
- TransactionalEditingDomain editingDomain = getEditingDomain(part);
-
- if(editingDomain == null) {
- return deleteCC;
- }
-
- CompositeTransactionalCommand compositeCommand = new CompositeTransactionalCommand(editingDomain, cntxt.getLabel());
- /* Get the selected edit parts */
- Object[] objects = ((IStructuredSelection)cntxt.getSelection()).toArray();
- for(int i = 0; i < objects.length; i++) {
- /* Get the next part */
- EditPart editPart = (EditPart)objects[i];
-
- /* Send the request to the edit part */
- org.eclipse.gef.commands.Command command = editPart.getCommand(deleteReq);
- if(command != null)
- compositeCommand.compose(new CommandProxy(command));
- // deleteCC.add(editPart.getCommand(deleteReq));
- }
- if(!compositeCommand.isEmpty()) {
- deleteCC.add(new ICommandProxy(compositeCommand));
- }
-
- return deleteCC;
- }
-
- /**
- * Gets the transactional editing domain associated with the workbench <code>part</code>.
- *
- * @param part
- * the diagram workbench part
- * @return the editing domain, or <code>null</code> if there is none.
- */
- private TransactionalEditingDomain getEditingDomain(IDiagramWorkbenchPart part) {
-
- TransactionalEditingDomain result = null;
-
- IEditingDomainProvider provider = (IEditingDomainProvider)part.getAdapter(IEditingDomainProvider.class);
-
- if(provider != null) {
- EditingDomain domain = provider.getEditingDomain();
-
- if(domain != null && domain instanceof TransactionalEditingDomain) {
- result = (TransactionalEditingDomain)domain;
- }
- }
-
- return result;
- }
-
- /**
- * get the list of notation element from the a list of editpart
- *
- * @param editPartList
- * the list of editpart
- * @return the list of notation element
- */
- @SuppressWarnings({ "rawtypes", "unchecked" })
- protected List getNotation(List editPartList) {
- ArrayList notationList = new ArrayList();
- Iterator iterator = editPartList.iterator();
- while(iterator.hasNext()) {
- Object object = (Object)iterator.next();
- if(object instanceof EditPart) {
- notationList.add(((EditPart)object).getModel());
- }
- }
- return notationList;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.Tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import java.awt.Toolkit;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.edit.command.CopyToClipboardCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.RootEditPart;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.action.global.GlobalActionId;
+import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionContext;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+import org.eclipse.gmf.runtime.diagram.ui.render.clipboard.AWTClipboardHelper;
+import org.eclipse.gmf.runtime.diagram.ui.render.internal.providers.ImageSupportGlobalActionHandler;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.ui.properties.actions.PropertyPageViewAction;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.uml.diagram.common.helper.CleanDiagramHelper;
+import org.eclipse.papyrus.uml.pastemanager.service.PasteCommandService;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * this class has in charge to launch command for cut copy paste (graphically)
+ * it is also used to launch the copy into bmp like as writer software
+ *
+ */
+@SuppressWarnings("restriction")
+public class PapyrusDiagramGlobalActionHandler extends ImageSupportGlobalActionHandler {
+
+ @Override
+ public boolean canHandle(IGlobalActionContext cntxt) {
+ /* Check if the active part is a IDiagramWorkbenchPart */
+ IWorkbenchPart part = cntxt.getActivePart();
+ part = (IWorkbenchPart)part.getAdapter(IDiagramWorkbenchPart.class);
+ if(!(part instanceof IDiagramWorkbenchPart)) {
+ return false;
+ }
+
+ /* Check if the selection is a structured selection */
+ if(!(cntxt.getSelection() instanceof IStructuredSelection)) {
+ return false;
+ }
+
+ /* Check the action id */
+ String actionId = cntxt.getActionId();
+ if(actionId.equals(GlobalActionId.COPY)) {
+ return canCopy(cntxt);
+ } else if(actionId.equals(GlobalActionId.CUT)) {
+ return canCut(cntxt);
+ } else if(actionId.equals(GlobalActionId.PASTE)) {
+ return canPaste(cntxt);
+ }
+ return false;
+ }
+
+ protected boolean canPaste(IGlobalActionContext cntxt) {
+ /* Get the selected edit parts */
+ Object[] objectsArray = ((IStructuredSelection)cntxt.getSelection()).toArray();
+
+ if(objectsArray.length > 0 && objectsArray[0] instanceof GraphicalEditPart) {
+ ICommand pastecommand = PasteCommandService.getInstance().getPasteViewCommand(((GraphicalEditPart)objectsArray[0]), Toolkit.getDefaultToolkit().getSystemClipboard(), ((GraphicalEditPart)objectsArray[0]).getEditingDomain().getClipboard());
+ return pastecommand.canExecute();
+ }
+
+ if(!AWTClipboardHelper.getInstance().isImageCopySupported()) {
+ return super.canPaste(cntxt);
+ }
+
+ /* Check if the clipboard has data for the drawing surface */
+ return AWTClipboardHelper.getInstance().hasCustomData();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandler
+ * #getCommand(org.eclipse.gmf.runtime.common.ui.services.action.
+ * global.IGlobalActionContext)
+ */
+ public ICommand getCommand(IGlobalActionContext cntxt) {
+ /* Check if the active part is a IDiagramWorkbenchPart */
+ IWorkbenchPart part = cntxt.getActivePart();
+ part = (IWorkbenchPart)part.getAdapter(IDiagramWorkbenchPart.class);
+ if(!(part instanceof IDiagramWorkbenchPart)) {
+ return null;
+ }
+
+ /* Get the model operation context */
+ IDiagramWorkbenchPart diagramPart = (IDiagramWorkbenchPart)part;
+
+ /* Create a command */
+ ICommand command = null;
+
+ /* Check the action id */
+ String actionId = cntxt.getActionId();
+ if(actionId.equals(GlobalActionId.DELETE)) {
+ CompoundCommand deleteCC = getDeleteCommand(diagramPart, cntxt);
+ /* Set the command */
+ if(deleteCC != null && deleteCC.canExecute())
+ command = new CommandProxy(deleteCC);
+ } else if(actionId.equals(GlobalActionId.COPY)) {
+ command = getCopyCommand(cntxt, diagramPart, false);
+ } else if(actionId.equals(GlobalActionId.CUT)) {
+ command = getCutCommand(cntxt, diagramPart);
+ } else if(actionId.equals(GlobalActionId.PASTE)) {
+
+ /* Get the selected edit parts */
+ Object[] objectsArray = ((IStructuredSelection)cntxt.getSelection()).toArray();
+
+ if(objectsArray.length > 0 && objectsArray[0] instanceof GraphicalEditPart) {
+
+ ICommand pastecommand = PasteCommandService.getInstance().getPasteViewCommand(((GraphicalEditPart)objectsArray[0]), Toolkit.getDefaultToolkit().getSystemClipboard(), ((GraphicalEditPart)objectsArray[0]).getEditingDomain().getClipboard());
+
+ if(pastecommand.canExecute()) {
+ ((GraphicalEditPart)objectsArray[0]).getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(pastecommand));
+ RootEditPart topEditPart = ((GraphicalEditPart)objectsArray[0]).getRoot();
+ if(topEditPart.getChildren().get(0) instanceof DiagramEditPart) {
+ CleanDiagramHelper.getInstance().run((DiagramEditPart)topEditPart.getChildren().get(0));
+ }
+
+ }
+ return null;
+ }
+
+ } else if(actionId.equals(GlobalActionId.SAVE)) {
+ part.getSite().getPage().saveEditor((IEditorPart)diagramPart, false);
+ } else if(actionId.equals(GlobalActionId.PROPERTIES)) {
+ new PropertyPageViewAction().run();
+ }
+
+ return command;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler#getCopyCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionContext,
+ * org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart, boolean) this class also copy in the clipboard of the editing domain
+ * selected elements
+ *
+ */
+
+ @Override
+ protected ICommand getCopyCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart, boolean isUndoable) {
+ /* Get the selected edit parts */
+ Object[] objectsArray = ((IStructuredSelection)cntxt.getSelection()).toArray();
+ CompositeCommand compositeCommand = new CompositeCommand(GlobalActionId.COPY);
+ if(objectsArray.length > 0 && objectsArray[0] instanceof GraphicalEditPart) {
+ // ((GraphicalEditPart)objectsArray[0]).getEditingDomain().setClipboard(((IStructuredSelection)
+ // cntxt.getSelection()).toList());
+ compositeCommand.add(new EMFtoGMFCommandWrapper(CopyToClipboardCommand.create(((GraphicalEditPart)objectsArray[0]).getEditingDomain(), getNotation(((IStructuredSelection)cntxt.getSelection()).toList()))));
+ }
+ if(objectsArray.length > 0 && objectsArray[0] instanceof ConnectionEditPart) {
+ // ((GraphicalEditPart)objectsArray[0]).getEditingDomain().setClipboard(((IStructuredSelection)
+ // cntxt.getSelection()).toList());
+ compositeCommand.add(new EMFtoGMFCommandWrapper(CopyToClipboardCommand.create(((ConnectionEditPart)objectsArray[0]).getEditingDomain(), getNotation(((IStructuredSelection)cntxt.getSelection()).toList()))));
+ }
+ compositeCommand.add(super.getCopyCommand(cntxt, diagramPart, isUndoable));
+ return compositeCommand;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler#getCutCommand(org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionContext,
+ * org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart)
+ *
+ * @param cntxt
+ * @param diagramPart
+ * @return
+ */
+
+ @Override
+ protected ICommand getCutCommand(IGlobalActionContext cntxt, IDiagramWorkbenchPart diagramPart) {
+ Object[] objectsArray = ((IStructuredSelection)cntxt.getSelection()).toArray();
+ CompositeCommand compositeCommand = new CompositeCommand(GlobalActionId.CUT);
+ if(objectsArray.length > 0 && objectsArray[0] instanceof GraphicalEditPart) {
+ // ((GraphicalEditPart)objectsArray[0]).getEditingDomain().setClipboard(((IStructuredSelection)
+ // cntxt.getSelection()).toList());
+ compositeCommand.add(new EMFtoGMFCommandWrapper(CopyToClipboardCommand.create(((GraphicalEditPart)objectsArray[0]).getEditingDomain(), getNotation(((IStructuredSelection)cntxt.getSelection()).toList()))));
+
+ }
+ if(objectsArray.length > 0 && objectsArray[0] instanceof ConnectionEditPart) {
+ // ((GraphicalEditPart)objectsArray[0]).getEditingDomain().setClipboard(((IStructuredSelection)
+ // cntxt.getSelection()).toList());
+ compositeCommand.add(new EMFtoGMFCommandWrapper(CopyToClipboardCommand.create(((ConnectionEditPart)objectsArray[0]).getEditingDomain(), getNotation(((IStructuredSelection)cntxt.getSelection()).toList()))));
+ }
+ ICommand cutCommand = super.getCutCommand(cntxt, diagramPart);
+ if(cutCommand != null) {
+ compositeCommand.add(cutCommand);
+ }
+ return compositeCommand;
+ }
+
+ /**
+ * Returns appropriate delete command for this context.
+ *
+ * @param part
+ * the workbench part
+ * @param cntxt
+ * the <code>IGlobalActionContext</code> holding the necessary
+ * information needed by this action handler
+ * @return CompoundCommand command
+ */
+ private CompoundCommand getDeleteCommand(IDiagramWorkbenchPart part, IGlobalActionContext cntxt) {
+ /* Create the delete request */
+ GroupRequest deleteReq = new GroupRequest(RequestConstants.REQ_DELETE);
+
+ CompoundCommand deleteCC = new CompoundCommand(cntxt.getLabel());
+
+ TransactionalEditingDomain editingDomain = getEditingDomain(part);
+
+ if(editingDomain == null) {
+ return deleteCC;
+ }
+
+ CompositeTransactionalCommand compositeCommand = new CompositeTransactionalCommand(editingDomain, cntxt.getLabel());
+ /* Get the selected edit parts */
+ Object[] objects = ((IStructuredSelection)cntxt.getSelection()).toArray();
+ for(int i = 0; i < objects.length; i++) {
+ /* Get the next part */
+ EditPart editPart = (EditPart)objects[i];
+
+ /* Send the request to the edit part */
+ org.eclipse.gef.commands.Command command = editPart.getCommand(deleteReq);
+ if(command != null)
+ compositeCommand.compose(new CommandProxy(command));
+ // deleteCC.add(editPart.getCommand(deleteReq));
+ }
+ if(!compositeCommand.isEmpty()) {
+ deleteCC.add(new ICommandProxy(compositeCommand));
+ }
+
+ return deleteCC;
+ }
+
+ /**
+ * Gets the transactional editing domain associated with the workbench <code>part</code>.
+ *
+ * @param part
+ * the diagram workbench part
+ * @return the editing domain, or <code>null</code> if there is none.
+ */
+ private TransactionalEditingDomain getEditingDomain(IDiagramWorkbenchPart part) {
+
+ TransactionalEditingDomain result = null;
+
+ IEditingDomainProvider provider = (IEditingDomainProvider)part.getAdapter(IEditingDomainProvider.class);
+
+ if(provider != null) {
+ EditingDomain domain = provider.getEditingDomain();
+
+ if(domain != null && domain instanceof TransactionalEditingDomain) {
+ result = (TransactionalEditingDomain)domain;
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * get the list of notation element from the a list of editpart
+ *
+ * @param editPartList
+ * the list of editpart
+ * @return the list of notation element
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ protected List getNotation(List editPartList) {
+ ArrayList notationList = new ArrayList();
+ Iterator iterator = editPartList.iterator();
+ while(iterator.hasNext()) {
+ Object object = (Object)iterator.next();
+ if(object instanceof EditPart) {
+ notationList.add(((EditPart)object).getModel());
+ }
+ }
+ return notationList;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusGlobalActionHandlerProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusGlobalActionHandlerProvider.java
index c0d4f12fbbf..6a1619aa048 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusGlobalActionHandlerProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/PapyrusGlobalActionHandlerProvider.java
@@ -1,120 +1,120 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.providers;
-
-import java.util.Hashtable;
-
-import org.eclipse.gmf.runtime.common.ui.services.action.global.AbstractGlobalActionHandlerProvider;
-import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandler;
-import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandlerContext;
-import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * this is the provider is charge to give the handler in order to have the
- * functionnality cut copy paste
- *
- */
-public class PapyrusGlobalActionHandlerProvider extends AbstractGlobalActionHandlerProvider {
-
- /**
- * List that contains all the IGlobalActionHandlers mapped to the
- * IWorkbenchParts
- */
- @SuppressWarnings("rawtypes")
- private Hashtable handlerList = new Hashtable();
-
- /**
- * Constructor for DiagramGlobalActionHandlerProvider.
- */
- public PapyrusGlobalActionHandlerProvider() {
- super();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gmf.runtime.common.ui.services.action.global.
- * IGlobalActionHandlerProvider
- * #getGlobalActionHandler(org.eclipse.gmf.runtime.common
- * .ui.services.action.global.IGlobalActionHandlerContext)
- */
- @SuppressWarnings("unchecked")
- public IGlobalActionHandler getGlobalActionHandler(final IGlobalActionHandlerContext context) {
- /* create the handler */
- if(!getHandlerList().containsKey(context.getActivePart())) {
- getHandlerList().put(context.getActivePart(), new PapyrusDiagramGlobalActionHandler());
- /*
- * register as a part listener so that the cache can be cleared when
- * the part is disposed
- */
- context.getActivePart().getSite().getPage().addPartListener(new IPartListener() {
-
- private IWorkbenchPart localPart = context.getActivePart();
-
- /**
- * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- // NULL implementation
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- // NULL implementation
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
- /* remove the cache associated with the part */
- if(part != null && part == localPart && getHandlerList().containsKey(part)) {
- getHandlerList().remove(part);
- localPart.getSite().getPage().removePartListener(this);
- localPart = null;
- }
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- // NULL implementation
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- // NULL implementation
- }
- });
- }
- return (DiagramGlobalActionHandler)getHandlerList().get(context.getActivePart());
- }
-
- /**
- * Returns the handlerList.
- *
- * @return Hashtable
- */
- @SuppressWarnings("rawtypes")
- private Hashtable getHandlerList() {
- return handlerList;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import java.util.Hashtable;
+
+import org.eclipse.gmf.runtime.common.ui.services.action.global.AbstractGlobalActionHandlerProvider;
+import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandler;
+import org.eclipse.gmf.runtime.common.ui.services.action.global.IGlobalActionHandlerContext;
+import org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandler;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * this is the provider is charge to give the handler in order to have the
+ * functionnality cut copy paste
+ *
+ */
+public class PapyrusGlobalActionHandlerProvider extends AbstractGlobalActionHandlerProvider {
+
+ /**
+ * List that contains all the IGlobalActionHandlers mapped to the
+ * IWorkbenchParts
+ */
+ @SuppressWarnings("rawtypes")
+ private Hashtable handlerList = new Hashtable();
+
+ /**
+ * Constructor for DiagramGlobalActionHandlerProvider.
+ */
+ public PapyrusGlobalActionHandlerProvider() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.common.ui.services.action.global.
+ * IGlobalActionHandlerProvider
+ * #getGlobalActionHandler(org.eclipse.gmf.runtime.common
+ * .ui.services.action.global.IGlobalActionHandlerContext)
+ */
+ @SuppressWarnings("unchecked")
+ public IGlobalActionHandler getGlobalActionHandler(final IGlobalActionHandlerContext context) {
+ /* create the handler */
+ if(!getHandlerList().containsKey(context.getActivePart())) {
+ getHandlerList().put(context.getActivePart(), new PapyrusDiagramGlobalActionHandler());
+ /*
+ * register as a part listener so that the cache can be cleared when
+ * the part is disposed
+ */
+ context.getActivePart().getSite().getPage().addPartListener(new IPartListener() {
+
+ private IWorkbenchPart localPart = context.getActivePart();
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partActivated(IWorkbenchPart)
+ */
+ public void partActivated(IWorkbenchPart part) {
+ // NULL implementation
+ }
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partBroughtToTop(IWorkbenchPart)
+ */
+ public void partBroughtToTop(IWorkbenchPart part) {
+ // NULL implementation
+ }
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partClosed(IWorkbenchPart)
+ */
+ public void partClosed(IWorkbenchPart part) {
+ /* remove the cache associated with the part */
+ if(part != null && part == localPart && getHandlerList().containsKey(part)) {
+ getHandlerList().remove(part);
+ localPart.getSite().getPage().removePartListener(this);
+ localPart = null;
+ }
+ }
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partDeactivated(IWorkbenchPart)
+ */
+ public void partDeactivated(IWorkbenchPart part) {
+ // NULL implementation
+ }
+
+ /**
+ * @see org.eclipse.ui.IPartListener#partOpened(IWorkbenchPart)
+ */
+ public void partOpened(IWorkbenchPart part) {
+ // NULL implementation
+ }
+ });
+ }
+ return (DiagramGlobalActionHandler)getHandlerList().get(context.getActivePart());
+ }
+
+ /**
+ * Returns the handlerList.
+ *
+ * @return Hashtable
+ */
+ @SuppressWarnings("rawtypes")
+ private Hashtable getHandlerList() {
+ return handlerList;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UIAdapterImpl.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UIAdapterImpl.java
index 8edfdebb166..675910c4d07 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UIAdapterImpl.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UIAdapterImpl.java
@@ -1,63 +1,63 @@
-/*******************************************************************************
- * Copyright (c) 2005 AIRBUS FRANCE.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * David Sciamma (Anyware Technologies),
- * Nicolas Lalevee (Anyware Technologies),
- * Jacques Lescot (Anyware Technologies) - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.providers;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * This EMF listener receives an event and then handles this event in the UI
- * thread
- *
- * @author <a href="david.sciamma@anyware-tech.com">David Sciamma</a>
- */
-public abstract class UIAdapterImpl extends AdapterImpl {
-
- /**
- * Call the handlePropertyChanged method in the UI thread
- *
- * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- public final void notifyChanged(Notification msg) {
- if(Display.getCurrent() != Display.getDefault()) {
- syncNotifyChanged(msg);
- } else {
- safeNotifyChanged(msg);
- }
- }
-
- /**
- * Handles the event notification in the UI thread
- *
- * @param msg
- * the event notification
- */
- private void syncNotifyChanged(final Notification msg) {
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- safeNotifyChanged(msg);
- }
- });
- }
-
- /**
- * This method is called when an event occured on the model objects.<br>
- * This method is always called in the Ui thread
- *
- * @param msg
- * the event notification
- */
- protected abstract void safeNotifyChanged(Notification msg);
-}
+/*******************************************************************************
+ * Copyright (c) 2005 AIRBUS FRANCE.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * David Sciamma (Anyware Technologies),
+ * Nicolas Lalevee (Anyware Technologies),
+ * Jacques Lescot (Anyware Technologies) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * This EMF listener receives an event and then handles this event in the UI
+ * thread
+ *
+ * @author <a href="david.sciamma@anyware-tech.com">David Sciamma</a>
+ */
+public abstract class UIAdapterImpl extends AdapterImpl {
+
+ /**
+ * Call the handlePropertyChanged method in the UI thread
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+ public final void notifyChanged(Notification msg) {
+ if(Display.getCurrent() != Display.getDefault()) {
+ syncNotifyChanged(msg);
+ } else {
+ safeNotifyChanged(msg);
+ }
+ }
+
+ /**
+ * Handles the event notification in the UI thread
+ *
+ * @param msg
+ * the event notification
+ */
+ private void syncNotifyChanged(final Notification msg) {
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ safeNotifyChanged(msg);
+ }
+ });
+ }
+
+ /**
+ * This method is called when an event occured on the model objects.<br>
+ * This method is always called in the Ui thread
+ *
+ * @param msg
+ * the event notification
+ */
+ protected abstract void safeNotifyChanged(Notification msg);
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UMLComposedAdapterFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UMLComposedAdapterFactory.java
index e13ca179038..1fd62f160ee 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UMLComposedAdapterFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/providers/UMLComposedAdapterFactory.java
@@ -1,25 +1,25 @@
-/*******************************************************************************
- * Copyright (c) 2010 Atos Origin.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.providers;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-import org.eclipse.uml2.uml.edit.providers.UMLResourceItemProviderAdapterFactory;
-
-public class UMLComposedAdapterFactory extends ComposedAdapterFactory {
-
- private static final AdapterFactory[] factories = { new UMLResourceItemProviderAdapterFactory(), new UMLItemProviderAdapterFactory() };
-
- public UMLComposedAdapterFactory() {
- super(factories);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2010 Atos Origin.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.providers;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
+import org.eclipse.uml2.uml.edit.providers.UMLResourceItemProviderAdapterFactory;
+
+public class UMLComposedAdapterFactory extends ComposedAdapterFactory {
+
+ private static final AdapterFactory[] factories = { new UMLResourceItemProviderAdapterFactory(), new UMLItemProviderAdapterFactory() };
+
+ public UMLComposedAdapterFactory() {
+ super(factories);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AbstractXMLDefinitionPaletteFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AbstractXMLDefinitionPaletteFactory.java
index aec3ef5a29d..9b0e4e7daa9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AbstractXMLDefinitionPaletteFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AbstractXMLDefinitionPaletteFactory.java
@@ -1,71 +1,71 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import org.w3c.dom.Node;
-
-/**
- * Basic factory to create elements from the xml definition of the palette
- */
-public abstract class AbstractXMLDefinitionPaletteFactory {
-
- /**
- * action when visiting a content node
- *
- * @param node
- * the node to visit
- */
- public abstract void traverseContentNode(Node node);
-
- /**
- * action when visiting a drawer node
- *
- * @param node
- * the node to visit
- */
- public abstract void traverseDrawerNode(Node node);
-
- /**
- * action when visiting a drawer node
- *
- * @param node
- * the node to visit
- */
- public abstract void traverseToolEntryNode(Node node);
-
- /**
- * action when visiting a drawer node
- *
- * @param node
- * the node to visit
- */
- public abstract void traverseStackNode(Node node);
-
- /**
- * action when visiting a drawer node
- *
- * @param node
- * the node to visit
- */
- public abstract void traverseSeparatorNode(Node node);
-
- /**
- * action when visiting a aspect tool node
- *
- * @param node
- * the node to visit
- */
- public abstract void traverseAspectToolEntryNode(Node node);
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import org.w3c.dom.Node;
+
+/**
+ * Basic factory to create elements from the xml definition of the palette
+ */
+public abstract class AbstractXMLDefinitionPaletteFactory {
+
+ /**
+ * action when visiting a content node
+ *
+ * @param node
+ * the node to visit
+ */
+ public abstract void traverseContentNode(Node node);
+
+ /**
+ * action when visiting a drawer node
+ *
+ * @param node
+ * the node to visit
+ */
+ public abstract void traverseDrawerNode(Node node);
+
+ /**
+ * action when visiting a drawer node
+ *
+ * @param node
+ * the node to visit
+ */
+ public abstract void traverseToolEntryNode(Node node);
+
+ /**
+ * action when visiting a drawer node
+ *
+ * @param node
+ * the node to visit
+ */
+ public abstract void traverseStackNode(Node node);
+
+ /**
+ * action when visiting a drawer node
+ *
+ * @param node
+ * the node to visit
+ */
+ public abstract void traverseSeparatorNode(Node node);
+
+ /**
+ * action when visiting a aspect tool node
+ *
+ * @param node
+ * the node to visit
+ */
+ public abstract void traverseAspectToolEntryNode(Node node);
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ApplyStereotypeRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ApplyStereotypeRequest.java
index d01f2721940..a491207753a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ApplyStereotypeRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ApplyStereotypeRequest.java
@@ -1,92 +1,92 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.uml2.uml.Element;
-
-/**
- * Request to apply stereotype on elements
- */
-public class ApplyStereotypeRequest extends CreateRequest {
-
- /** type of the Apply stereotype request */
- public static String APPLY_STEREOTYPE_REQUEST = "applyStereotype";
-
- /** stereotypes to apply */
- final protected List<String> stereotypes;
-
- protected IAdaptable viewAdapter;
-
- protected Element element;
-
- protected boolean renameWithFirstStereotype;
-
-
- /**
- * Creates a new ApplyStereotypeRequest
- *
- * @param objects
- * the list of stereotypes to apply, identified by their
- * qualified names
- */
- public ApplyStereotypeRequest(IAdaptable viewAdapter, List<String> stereotypes, boolean renameWithFirstStereotype) {
- super();
- this.stereotypes = stereotypes;
- this.viewAdapter = viewAdapter;
- this.renameWithFirstStereotype = renameWithFirstStereotype;
- // initialize the type of this request
- setType(APPLY_STEREOTYPE_REQUEST);
- }
-
- public ApplyStereotypeRequest(Element element, List<String> stereotypes) {
- this.stereotypes = stereotypes;
- this.element = element;
- // initialize the type of this request
- setType(APPLY_STEREOTYPE_REQUEST);
- }
-
- /**
- * Returns the list of stereotypes to apply, identified by their qualified
- * names
- *
- * @return the list of stereotypes to apply, identified by their qualified
- * names, or an empty list
- */
- public List<String> getStereotypesToApply() {
- return stereotypes;
- }
-
- public boolean renameWithFirstStereotype() {
- return renameWithFirstStereotype;
- }
-
- public void setElement(Element elem) {
- this.element = elem;
- }
-
- public Element getElement() {
- if (element == null && viewAdapter != null) {
- View view = (View)viewAdapter.getAdapter(View.class);
- if (view != null && view.getElement() instanceof Element) {
- element = (Element)view.getElement();
- }
- }
- return element;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.uml2.uml.Element;
+
+/**
+ * Request to apply stereotype on elements
+ */
+public class ApplyStereotypeRequest extends CreateRequest {
+
+ /** type of the Apply stereotype request */
+ public static String APPLY_STEREOTYPE_REQUEST = "applyStereotype";
+
+ /** stereotypes to apply */
+ final protected List<String> stereotypes;
+
+ protected IAdaptable viewAdapter;
+
+ protected Element element;
+
+ protected boolean renameWithFirstStereotype;
+
+
+ /**
+ * Creates a new ApplyStereotypeRequest
+ *
+ * @param objects
+ * the list of stereotypes to apply, identified by their
+ * qualified names
+ */
+ public ApplyStereotypeRequest(IAdaptable viewAdapter, List<String> stereotypes, boolean renameWithFirstStereotype) {
+ super();
+ this.stereotypes = stereotypes;
+ this.viewAdapter = viewAdapter;
+ this.renameWithFirstStereotype = renameWithFirstStereotype;
+ // initialize the type of this request
+ setType(APPLY_STEREOTYPE_REQUEST);
+ }
+
+ public ApplyStereotypeRequest(Element element, List<String> stereotypes) {
+ this.stereotypes = stereotypes;
+ this.element = element;
+ // initialize the type of this request
+ setType(APPLY_STEREOTYPE_REQUEST);
+ }
+
+ /**
+ * Returns the list of stereotypes to apply, identified by their qualified
+ * names
+ *
+ * @return the list of stereotypes to apply, identified by their qualified
+ * names, or an empty list
+ */
+ public List<String> getStereotypesToApply() {
+ return stereotypes;
+ }
+
+ public boolean renameWithFirstStereotype() {
+ return renameWithFirstStereotype;
+ }
+
+ public void setElement(Element elem) {
+ this.element = elem;
+ }
+
+ public Element getElement() {
+ if (element == null && viewAdapter != null) {
+ View view = (View)viewAdapter.getAdapter(View.class);
+ if (view != null && view.getElement() instanceof Element) {
+ element = (Element)view.getElement();
+ }
+ }
+ return element;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectCreationEntry.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectCreationEntry.java
index 42bb2276d2a..8b85b73d38c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectCreationEntry.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectCreationEntry.java
@@ -1,165 +1,165 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.gef.Tool;
-import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-
-/**
- * Entry that uses the functionality of another entry, but adds some actions to
- * it
- */
-public class AspectCreationEntry extends CombinedTemplateCreationEntry implements Cloneable {
-
- /** overriden palette entry */
- protected CombinedTemplateCreationEntry entry;
-
- /** Tool object for this entry */
- protected Tool tool;
-
- /** properties for the tool */
- protected Map<?, ?> properties;
-
- /** specific icon path */
- private String iconPath;
-
- /** saves the image descriptor used by this entry */
- private ImageDescriptor descriptor;
-
- private final static String URL_IMAGE_DESCRIPTOR_BEGIN = "URLImageDescriptor(";
-
- /**
- * Creates a new AspectCreationEntry
- *
- * @param name
- * @param desc
- * @param id
- * @param descriptor
- * @param entry
- * @param properties
- */
- public AspectCreationEntry(String name, String desc, String id, ImageDescriptor descriptor, CombinedTemplateCreationEntry entry, Map<?, ?> properties) {
- super(name, desc, null, descriptor, descriptor);
- setId(id);
- // computes the icon path
- // due to visibility problems on URL image descriptor, use the
- // toString() method...
- computeIconPathFromImageDescriptor(descriptor);
- this.entry = entry;
- this.properties = properties;
- this.descriptor = descriptor;
- }
-
- /**
- * Computes the icon path for the URL image descriptor
- */
- protected void computeIconPathFromImageDescriptor(ImageDescriptor desc) {
- String value = desc.toString();
- if(value.startsWith("URLImageDescriptor(")) {
- String url = value.substring(URL_IMAGE_DESCRIPTOR_BEGIN.length(), value.length() - 1);
- setIconPath(url);
- }
- }
-
- /**
- * Creates a new AspectCreationEntry
- *
- * @param name
- * @param desc
- * @param id
- * @param iconPath
- * @param entry
- * @param properties
- */
- public AspectCreationEntry(String name, String desc, String id, String iconPath, CombinedTemplateCreationEntry entry, Map<?, ?> properties) {
- super(name, desc, null, Activator.getImageDescriptor(iconPath), Activator.getImageDescriptor(iconPath));
- setId(id);
- this.setIconPath(iconPath);
- this.entry = entry;
- this.properties = properties;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Tool createTool() {
- if(tool == null) {
- tool = entry.createTool();
- tool.setProperties(properties);
- }
- return tool;
- }
-
- /**
- * Returns the specific properties for aspect actions
- *
- * @param key
- * the key of the properties
- * @return the specific properties for aspect actions
- */
- public Object getAspectProperties(String key) {
- return properties.get(key);
- }
-
- /**
- * Returns the referenced entry
- *
- * @return the referenced entry
- */
- public CombinedTemplateCreationEntry getReferencedEntry() {
- return entry;
- }
-
- /**
- * Returns the list of stereotypes to apply post creation
- *
- * @return the list of stereotypes to apply post creation
- */
- @SuppressWarnings("unchecked")
- public List<String> getStereotypeList() {
- return (List<String>)properties.get(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY_KEY);
- }
-
- /**
- * @param path
- * the iconPath to set
- */
- public void setIconPath(String path) {
- iconPath = path;
- }
-
- /**
- * @return the iconPath
- */
- public String getIconPath() {
- return iconPath;
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public AspectCreationEntry clone() {
- if(getIconPath() != null) {
- return new AspectCreationEntry(this.getLabel(), this.getDescription(), entry.getId() + "_" + System.currentTimeMillis(), this.getIconPath(), this.entry, this.properties);
- }
- return new AspectCreationEntry(this.getLabel(), this.getDescription(), entry.getId() + "_" + System.currentTimeMillis(), this.descriptor, this.entry, this.properties);
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.gef.Tool;
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+
+/**
+ * Entry that uses the functionality of another entry, but adds some actions to
+ * it
+ */
+public class AspectCreationEntry extends CombinedTemplateCreationEntry implements Cloneable {
+
+ /** overriden palette entry */
+ protected CombinedTemplateCreationEntry entry;
+
+ /** Tool object for this entry */
+ protected Tool tool;
+
+ /** properties for the tool */
+ protected Map<?, ?> properties;
+
+ /** specific icon path */
+ private String iconPath;
+
+ /** saves the image descriptor used by this entry */
+ private ImageDescriptor descriptor;
+
+ private final static String URL_IMAGE_DESCRIPTOR_BEGIN = "URLImageDescriptor(";
+
+ /**
+ * Creates a new AspectCreationEntry
+ *
+ * @param name
+ * @param desc
+ * @param id
+ * @param descriptor
+ * @param entry
+ * @param properties
+ */
+ public AspectCreationEntry(String name, String desc, String id, ImageDescriptor descriptor, CombinedTemplateCreationEntry entry, Map<?, ?> properties) {
+ super(name, desc, null, descriptor, descriptor);
+ setId(id);
+ // computes the icon path
+ // due to visibility problems on URL image descriptor, use the
+ // toString() method...
+ computeIconPathFromImageDescriptor(descriptor);
+ this.entry = entry;
+ this.properties = properties;
+ this.descriptor = descriptor;
+ }
+
+ /**
+ * Computes the icon path for the URL image descriptor
+ */
+ protected void computeIconPathFromImageDescriptor(ImageDescriptor desc) {
+ String value = desc.toString();
+ if(value.startsWith("URLImageDescriptor(")) {
+ String url = value.substring(URL_IMAGE_DESCRIPTOR_BEGIN.length(), value.length() - 1);
+ setIconPath(url);
+ }
+ }
+
+ /**
+ * Creates a new AspectCreationEntry
+ *
+ * @param name
+ * @param desc
+ * @param id
+ * @param iconPath
+ * @param entry
+ * @param properties
+ */
+ public AspectCreationEntry(String name, String desc, String id, String iconPath, CombinedTemplateCreationEntry entry, Map<?, ?> properties) {
+ super(name, desc, null, Activator.getImageDescriptor(iconPath), Activator.getImageDescriptor(iconPath));
+ setId(id);
+ this.setIconPath(iconPath);
+ this.entry = entry;
+ this.properties = properties;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Tool createTool() {
+ if(tool == null) {
+ tool = entry.createTool();
+ tool.setProperties(properties);
+ }
+ return tool;
+ }
+
+ /**
+ * Returns the specific properties for aspect actions
+ *
+ * @param key
+ * the key of the properties
+ * @return the specific properties for aspect actions
+ */
+ public Object getAspectProperties(String key) {
+ return properties.get(key);
+ }
+
+ /**
+ * Returns the referenced entry
+ *
+ * @return the referenced entry
+ */
+ public CombinedTemplateCreationEntry getReferencedEntry() {
+ return entry;
+ }
+
+ /**
+ * Returns the list of stereotypes to apply post creation
+ *
+ * @return the list of stereotypes to apply post creation
+ */
+ @SuppressWarnings("unchecked")
+ public List<String> getStereotypeList() {
+ return (List<String>)properties.get(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY_KEY);
+ }
+
+ /**
+ * @param path
+ * the iconPath to set
+ */
+ public void setIconPath(String path) {
+ iconPath = path;
+ }
+
+ /**
+ * @return the iconPath
+ */
+ public String getIconPath() {
+ return iconPath;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public AspectCreationEntry clone() {
+ if(getIconPath() != null) {
+ return new AspectCreationEntry(this.getLabel(), this.getDescription(), entry.getId() + "_" + System.currentTimeMillis(), this.getIconPath(), this.entry, this.properties);
+ }
+ return new AspectCreationEntry(this.getLabel(), this.getDescription(), entry.getId() + "_" + System.currentTimeMillis(), this.descriptor, this.entry, this.properties);
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
index 2cead5f2024..560ee110beb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeConnectionTool.java
@@ -1,755 +1,755 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Vincent Lorenzo (CEA LIST)
- * Mathieu Velten (Atos) mathieu.velten@atos.net - use commands instead of running code in post commit
- * Philippe ROLAND (Atos) philippe.roland@atos.net - Implemented PreActions
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.CompoundCommand;
-import org.eclipse.gef.requests.CreateConnectionRequest;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredCreateConnectionViewCommand;
-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.parts.DiagramCommandStack;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedAdapter;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
-import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool;
-import org.eclipse.gmf.runtime.diagram.ui.util.INotationType;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-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.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.preferences.ConnectionToolPreferences;
-import org.eclipse.papyrus.uml.diagram.common.layout.LayoutUtils;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IPostAction;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IPreAction;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Connection tool that adds stereotype application after creation actions.
- */
-public class AspectUnspecifiedTypeConnectionTool extends UnspecifiedTypeConnectionTool {
-
- private static final int STATE_CONNECTION_WAITING_END = STATE_CONNECTION_STARTED + 1;
-
- /**
- * List of element types of which one will be created (of type <code>IElementType</code>).
- */
- // protected List elementTypes;
-
- /** post action list */
- protected List<IPostAction> postActions = new ArrayList<IPostAction>();
-
- /** preaction list */
- protected List<IPreAction> preActions = new ArrayList<IPreAction>();
-
- /** List of elements to create */
- private final List<IElementType> elementTypes;
-
- /**
- * Creates an AspectUnspecifiedTypeCreationTool
- *
- * @param elementTypes
- * List of element types of which one will be created (of type <code>IElementType</code>).
- */
- public AspectUnspecifiedTypeConnectionTool(List<IElementType> elementTypes) {
- super(elementTypes);
- this.elementTypes = elementTypes;
- }
-
- /**
- * @return the elementDescriptors
- */
- public List<IElementType> getElementTypes() {
- return elementTypes;
- }
-
- protected boolean handleButtonUpOneClick(int button) {
- return super.handleButtonUp(button);
- }
-
- protected boolean handleButtonUpTwoClicks(int button) {
- setCtrlKeyDown(getCurrentInput().isControlKeyDown());
-
- if(isInState(STATE_CONNECTION_STARTED)) {
- setState(STATE_CONNECTION_WAITING_END);
- return false;
- } else if(isInState(STATE_CONNECTION_WAITING_END)) {
- handleCreateConnection();
- }
-
- setState(STATE_TERMINAL);
-
- if(isInState(STATE_TERMINAL | STATE_INVALID)) {
- handleFinished();
- }
-
- return true;
- }
-
- /**
- * @see org.eclipse.gef.tools.AbstractTool#handleButtonUp(int)
- */
- @Override
- protected boolean handleButtonUp(int button) {
- if(ConnectionToolPreferences.instance.isInSingleClickMode()) {
- return handleButtonUpOneClick(button);
- } else {
- return handleButtonUpTwoClicks(button);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void createConnection() {
- List<?> selectedEditParts = getCurrentViewer().getSelectedEditParts();
- List<EObject> eobjects = new ArrayList<EObject>();
- List<NotificationListener> listeners = new ArrayList<NotificationListener>();
- DiagramEventBroker eventBroker = null;
- final EditPartViewer viewer = getCurrentViewer();
- // only attempt to create connection if there are two shapes selected
- if(!selectedEditParts.isEmpty()) {
- IGraphicalEditPart targetEditPart = (IGraphicalEditPart)selectedEditParts.get(selectedEditParts.size() - 1);
-
- // allow add the listener only one time the target
- boolean done = false;
- for(int i = 0; i < selectedEditParts.size(); i++) {
- IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)selectedEditParts.get(i);
- if(i != 0) {
- if(sourceEditPart == targetEditPart) {
- break;
- }
- }
-
- CreateConnectionRequest connectionRequest = createTargetRequest();
- // get the anchors locations
- Point[] newLocation = LayoutUtils.getLinkAnchor(sourceEditPart, targetEditPart);
- connectionRequest.setTargetEditPart(sourceEditPart);
- connectionRequest.setType(RequestConstants.REQ_CONNECTION_START);
- connectionRequest.setLocation(newLocation[0]);
-
- // only if the connection is supported will we get a non null
- // command from the sourceEditPart
-
- if(sourceEditPart.getCommand(connectionRequest) != null) {
-
- connectionRequest.setSourceEditPart(sourceEditPart);
- connectionRequest.setTargetEditPart(targetEditPart);
- connectionRequest.setType(RequestConstants.REQ_CONNECTION_END);
-
- connectionRequest.setLocation(newLocation[1]);
-
- setTargetRequest(connectionRequest);
-
- // inits the listener
- View eObject = (View)targetEditPart.getAdapter(View.class);
-
- NotificationListener listener = null;
- boolean requiresPostCommitRun = requiresPostCommitRun();
-
- // adds the listener
- if(requiresPostCommitRun) {
- // register a listener to have information about element
- // creation
- // retrieves editing domain
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eObject);
- eventBroker = DiagramEventBroker.getInstance(domain);
-
- listener = new NotificationListener() {
-
- public void notifyChanged(Notification notification) {
- Object newValue = notification.getNewValue();
-
- Map<?, ?> map = viewer.getEditPartRegistry();
- EditPart editPart = (EditPart)map.get(newValue);
- for(IPostAction action : postActions) {
- action.runInPostCommit(editPart);
- }
- }
- };
-
- // we need to add only one time the listener of the
- // target (eobject)
- if(!done && eventBroker != null) {
- listeners.add(listener);
- eobjects.add(eObject);
- eventBroker.addNotificationListener(eObject, listener);
- done = true;
- }
- }
-
- Command command = targetEditPart.getCommand(connectionRequest);
-
- if(command != null) {
- Command completeCommand = getCompleteCommand(command);
-
- setCurrentCommand(completeCommand);
-
- executeCurrentCommand();
- }
-
- if(requiresPostCommitRun) {
- if(eventBroker != null) {
- for(int ii = 0; ii < eobjects.size(); ii++) {
- eventBroker.removeNotificationListener(eobjects.get(ii), listeners.get(ii));
- }
- }
- }
-
- selectAddedObject(viewer, DiagramCommandStack.getReturnValues(command));
-
- }
- }
-
- setAvoidDeactivation(false);
- eraseSourceFeedback();
- deactivate();
-
- }
- }
-
- protected Command getCompleteCommand(Command createConnectionCommand) {
- CompoundCommand compositeCmd = new CompoundCommand("Create Link");
-// CompositeTransactionalCommand compositeCmd = new CompositeTransactionalCommand(editingDomain, "Create Link");
-
- for(IPreAction preAction : preActions) {
- if(getTargetRequest() instanceof CreateConnectionRequest) {
- Object sourceModel = ((CreateConnectionRequest)getTargetRequest()).getSourceEditPart().getModel();
- Object targetModel = ((CreateConnectionRequest)getTargetRequest()).getTargetEditPart().getModel();
- if(sourceModel instanceof View && targetModel instanceof View) {
- ICommand cmd = preAction.getConnectionPreCommand((View)sourceModel, (View)targetModel);
- if(cmd != null) {
- compositeCmd.add(new ICommandProxy(cmd));
- }
- }
- }
- }
-
- compositeCmd.add(createConnectionCommand);
-
- if(getTargetRequest() instanceof CreateRequest) {
- CreateUnspecifiedAdapter viewAdapter = new CreateUnspecifiedAdapter();
- viewAdapter.add((CreateRequest)getTargetRequest());
-
- for(IPostAction action : postActions) {
- ICommand cmd = action.getPostCommand(viewAdapter);
- if(cmd != null) {
- compositeCmd.add(new ICommandProxy(cmd));
- }
- }
- }
-
- return compositeCmd;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean handleCreateConnection() {
- // When a connection is to be created, a dialog box may appear which
- // will cause this tool to be deactivated and the feedback to be
- // erased. This behavior is overridden by setting the avoid
- // deactivation flag.
- setAvoidDeactivation(true);
-
- if(getTargetEditPart() == null) {
- return false;
- }
-
- // inits the listener
- View eObject = (View)getTargetEditPart().getAdapter(View.class);
- DiagramEventBroker eventBroker = null;
- NotificationListener listener = null;
- boolean requiresPostCommitRun = true;
- final EditPartViewer currentViewer = getCurrentViewer();
-
- // adds the listener
- if(requiresPostCommitRun) {
- // register a listener to have information about element creation
- // retrieves editing domain
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eObject);
- eventBroker = DiagramEventBroker.getInstance(domain);
-
- listener = new NotificationListener() {
-
- public void notifyChanged(Notification notification) {
- Object newValue = notification.getNewValue();
- if (currentViewer != null) {
- EditPart editPart = (EditPart)currentViewer.getEditPartRegistry().get(newValue);
- for(IPostAction action : postActions) {
- action.runInPostCommit(editPart);
- }
- }
- }
- };
-
- if(eventBroker != null) {
- eventBroker.addNotificationListener(eObject, listener);
- }
- }
-
- Command endCommand = getCommand();
-
- if(endCommand != null) {
- Command completeCommand = getCompleteCommand(endCommand);
-
- setCurrentCommand(completeCommand);
-
- executeCurrentCommand();
- }
-
- if(requiresPostCommitRun && eventBroker != null) {
- eventBroker.removeNotificationListener(eObject, listener);
- }
-
- selectAddedObject(currentViewer, DiagramCommandStack.getReturnValues(endCommand));
-
- setAvoidDeactivation(false);
- eraseSourceFeedback();
- deactivate();
-
- return true;
- }
-
- /**
- * checks if this tool needs a post commit run
- *
- * @return <code>true</code> if post actions need a post commit run
- */
- protected boolean requiresPostCommitRun() {
- for(IPostAction action : postActions) {
- if(action.needsPostCommitRun()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void applyProperty(Object key, Object value) {
- if(IPapyrusPaletteConstant.ASPECT_ACTION_KEY.equals(key)) {
- // initialize the pre and post actions
- // the value should be a NodeList
- if(value instanceof NodeList) {
- PaletteUtil.initAspectActions((NodeList)value, postActions, preActions);
- }
- } else {
- super.applyProperty(key, value);
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected CreateConnectionRequest createTargetRequest() {
- return new CreateAspectUnspecifiedTypeConnectionRequest(getElementTypes(), false, getPreferencesHint());
- }
-
- /**
- * Copy of the class {@link CreateUnspecifiedTypeConnectionRequest} to use
- * the Papyrus request factory instead of the gmf one.
- */
- public class CreateAspectUnspecifiedTypeConnectionRequest extends CreateUnspecifiedTypeConnectionRequest {
-
- /**
- * List of relationship types of which one will be created (of type <code>IElementType</code>).
- */
- // private List relationshipTypes;
-
- /**
- * A map containing the <code>CreateConnectionRequest</code> for each
- * element type.
- */
- private Map<IElementType, CreateConnectionRequest> requests = new HashMap<IElementType, CreateConnectionRequest>();
-
- /** The result to be returned from which the new views can be retrieved. */
- private List newObjectList = new ArrayList();
-
- /**
- * A flag to indicate if the Modeling Assistant Service should be used
- * to find the types when the other end of the connection is known.
- */
- private boolean useModelingAssistantService;
-
- /**
- * A flag to indicate if this request is to create a connection from
- * target to source.
- */
- private boolean directionReversed = false;
-
- /**
- * The hint used to find the appropriate preference store from which
- * general diagramming preference values for properties of shapes,
- * connections, and diagrams can be retrieved. This hint is mapped to a
- * preference store in the {@link DiagramPreferencesRegistry}.
- */
- private PreferencesHint preferencesHint;
-
- /**
- * Creates a new <code>CreateUnspecifiedTypeConnectionRequest</code>.
- *
- * @param relationshipTypes
- * List of relationship types of which one will be created
- * (of type <code>IElementType</code>).
- * @param useModelingAssistantService
- * True if the Modeling Assistant Service should be used to
- * find the types when the other end of the connection is
- * known.
- * @param preferencesHint
- * The preference hint that is to be used to find the
- * appropriate preference store from which to retrieve
- * diagram preference values. The preference hint is mapped
- * to a preference store in the preference registry <@link
- * DiagramPreferencesRegistry>.
- */
- public CreateAspectUnspecifiedTypeConnectionRequest(List<IElementType> relationshipTypes, boolean useModelingAssistantService, PreferencesHint preferencesHint) {
- super(relationshipTypes, useModelingAssistantService, preferencesHint);
- this.useModelingAssistantService = useModelingAssistantService;
- this.preferencesHint = preferencesHint;
- createRequests();
- }
-
- /**
- * See bug 288695
- *
- * if there is only one {@link CreateRequest}, returns this {@link CreateRequest#getNewObject()},
- * else, returns a list containing a single {@link IAdaptable} that delegates to the {@link CreateRequest#getNewObject()} after the command is
- * executed.
- * It is safe to use the return {@link IAdaptable} in a {@link DeferredCreateConnectionViewCommand}.
- */
- @Override
- public Object getNewObject() {
- if(newObjectList.isEmpty()) {
- if(requests.size() == 1) {
- Object createRequest = requests.values().iterator().next();
- if(createRequest instanceof CreateRequest) {
- newObjectList.add(((CreateRequest)createRequest).getNewObject());
- }
- } else if(requests.size() > 1) {
- /* See bug 288695 */
- CreateUnspecifiedAdapter adapter = new CreateUnspecifiedAdapter();
- for(Object request : requests.values()) {
- if(request instanceof CreateRequest) {
- adapter.add((CreateRequest)request);
- }
- }
- List<IAdaptable> newObjects = new ArrayList<IAdaptable>();
- newObjects.add(adapter);
- return newObjects;
- }
- }
- return newObjectList;
- }
-
- /**
- * Creates a <code>CreateConnectionRequest</code> for each relationship
- * type and adds it to the map of requests.
- */
- protected void createRequests() {
- for(IElementType elementType : (List<IElementType>)getElementTypes()) {
- CreateConnectionRequest request = PapyrusCreateViewRequestFactory.getCreateConnectionRequest(elementType, getPreferencesHint());
- request.setType(getType());
- requests.put(elementType, request);
- }
- }
-
- /**
- * Returns the <code>CreateRequest</code> for the relationship type
- * passed in.
- *
- * @param relationshipType
- * @return the <code>CreateRequest</code>
- */
- @Override
- public CreateRequest getRequestForType(IElementType relationshipType) {
- if(requests != null) {
- return requests.get(relationshipType);
- }
- return null;
- }
-
- @Override
- public void addRequest(IElementType relationshipType, Request request) {
- if(requests != null && request instanceof CreateConnectionRequest) {
- requests.put(relationshipType, (CreateConnectionRequest)request);
- }
- }
-
- /**
- * Returns a list of all the requests.
- *
- * @return the requests
- */
- @Override
- public List getAllRequests() {
- if(requests != null) {
- return new ArrayList(requests.values());
- }
- return Collections.EMPTY_LIST;
- }
-
- // /**
- // * Returns the list of element types.
- // *
- // * @return Returns the list of element types.
- // */
- // public List getElementTypes() {
- // return relationshipTypes;
- // }
-
- /**
- * @see org.eclipse.gef.requests.CreateConnectionRequest#setSourceEditPart(org.eclipse.gef.EditPart)
- */
- @Override
- public void setSourceEditPart(EditPart part) {
- if(requests != null) {
- for(CreateConnectionRequest request : requests.values()) {
- request.setSourceEditPart(part);
- }
- }
- super.setSourceEditPart(part);
- }
-
- /**
- * @see org.eclipse.gef.requests.TargetRequest#setTargetEditPart(org.eclipse.gef.EditPart)
- */
- @Override
- public void setTargetEditPart(EditPart part) {
- if(requests != null) {
- for(CreateConnectionRequest request : requests.values()) {
- request.setTargetEditPart(part);
- }
- }
- super.setTargetEditPart(part);
- }
-
- /**
- * @see org.eclipse.gef.requests.CreateRequest#setLocation(org.eclipse.draw2d.geometry.Point)
- */
- @Override
- public void setLocation(Point location) {
- if(requests != null) {
- for(CreateConnectionRequest request : requests.values()) {
- request.setLocation(location);
- }
- }
- super.setLocation(location);
- }
-
- /**
- * @see org.eclipse.gef.Request#setType(java.lang.Object)
- */
- @Override
- public void setType(Object type) {
- if(REQ_CONNECTION_END.equals(getType()) && REQ_CONNECTION_START.equals(type)) {
-
- //Bug 386011: [Class Diagrams] Incomplete associations get left on diagram
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=386011
-
- //This case is specific to the two-clicks association mode
- //When we draw an association to nothing, and discard the popup menu proposing to
- //create a new Element as the target of the Association, the target request is changed
- //from type "connection_end" to "connection_start", which prevents cleaning the feedback
-
- //We should clean the feedback before changing the type (Because eraseSourceFeedback
- //tests the type of the request, and expects "connection_end")
- AspectUnspecifiedTypeConnectionTool.this.setAvoidDeactivation(false);
- AspectUnspecifiedTypeConnectionTool.this.eraseSourceFeedback();
- AspectUnspecifiedTypeConnectionTool.this.deactivate();
- AspectUnspecifiedTypeConnectionTool.this.handleFinished();
- }
-
- if(requests != null) {
- for(CreateConnectionRequest request : requests.values()) {
- request.setType(type);
- }
- }
- super.setType(type);
- }
-
- /**
- * Returns true if this request is to create a connection from target to
- * source.
- *
- * @return Returns the directionReversed.
- */
- @Override
- public boolean isDirectionReversed() {
- return directionReversed;
- }
-
- /**
- * Sets the directionReversed flag.
- *
- * @param directionReversed
- * The directionReversed to set.
- */
- @Override
- public void setDirectionReversed(boolean directionReversed) {
- this.directionReversed = directionReversed;
- }
-
- /**
- * Should the Modeling Assistant Service be used?
- *
- * @return Returns true if the Modeling Assistant Service should be used
- * to find the types when the other end of the connection is
- * known.
- */
- @Override
- public boolean useModelingAssistantService() {
- return useModelingAssistantService;
- }
-
- /**
- * Gets the preferences hint that is to be used to find the appropriate
- * preference store from which to retrieve diagram preference values.
- * The preference hint is mapped to a preference store in the preference
- * registry <@link DiagramPreferencesRegistry>.
- *
- * @return the preferences hint
- */
- @Override
- protected PreferencesHint getPreferencesHint() {
- return preferencesHint;
- }
- }
-
- public static class PapyrusCreateViewRequestFactory {
-
- /**
- * Creates a new <code>CreateViewRequest</code> or <code>CreateViewAndElementRequest</code> based on the <code>IElementType</code> passed in.
- *
- * @param type
- * the <code>IElementType</code>
- * @param preferencesHint
- * The preference hint that is to be used to find the
- * appropriate preference store from which to retrieve
- * diagram preference values. The preference hint is mapped
- * to a preference store in the preference registry <@link
- * DiagramPreferencesRegistry>.
- * @return the new request
- */
- public static CreateViewRequest getCreateShapeRequest(IElementType type, PreferencesHint preferencesHint) {
- if(type instanceof INotationType) {
- ViewDescriptor viewDescriptor = new ViewDescriptor(null, Node.class, ((INotationType)type).getSemanticHint(), preferencesHint);
- return new CreateViewRequest(viewDescriptor);
- } else if(type instanceof IHintedType) {
- ViewAndElementDescriptor viewDescriptor = new ViewAndElementDescriptor(new CreateElementRequestAdapter(new CreateElementRequest(type)), Node.class, ((IHintedType)type).getSemanticHint(), preferencesHint);
- return new CreateViewAndElementRequest(viewDescriptor);
- } else {
- return new CreateViewAndElementRequest(type, preferencesHint);
- }
- }
-
- /**
- * Creates a new <code>CreateConnectionViewRequest</code> or <code>CreateConnectionViewAndElementRequest</code> based on the
- * <code>IElementType</code> passed in.
- *
- * @param type
- * the <code>IElementType</code>
- * @param preferencesHint
- * The preference hint that is to be used to find the
- * appropriate preference store from which to retrieve
- * diagram preference values. The preference hint is mapped
- * to a preference store in the preference registry <@link
- * DiagramPreferencesRegistry>.
- * @return the new request
- */
- public static CreateConnectionViewRequest getCreateConnectionRequest(IElementType type, PreferencesHint preferencesHint) {
- if(type instanceof INotationType) {
- // Pass in the type as the element adapter so that it can be
- // retrieved in the cases where a popup menu is to appear with a
- // list of types.
- ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(type, ((IHintedType)type).getSemanticHint(), preferencesHint);
- return new CreateConnectionViewRequest(viewDescriptor);
- } else if(type instanceof IHintedType) {
- return new CreateConnectionViewAndElementRequest(type, ((IHintedType)type).getSemanticHint(), preferencesHint);
- } else {
- return new CreateConnectionViewAndElementRequest(type, preferencesHint);
- }
- }
-
- /**
- * Creates a new <code>CreateConnectionViewRequest</code> or <code>CreateConnectionViewAndElementRequest</code> based on the
- * <code>IElementType</code> passed in.
- *
- * @param type
- * the <code>IElementType</code>
- * @param graphicalHint
- * graphical hint for the view to create
- * @param preferencesHint
- * The preference hint that is to be used to find the
- * appropriate preference store from which to retrieve
- * diagram preference values. The preference hint is mapped
- * to a preference store in the preference registry <@link
- * DiagramPreferencesRegistry>.
- * @return the new request
- */
- public static CreateConnectionViewRequest getCreateConnectionRequest(IElementType type, String graphicalHint, PreferencesHint preferencesHint) {
- if(type instanceof INotationType) {
- // Pass in the type as the element adapter so that it can be
- // retrieved in the cases where a popup menu is to appear with a
- // list of types.
- ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(type, graphicalHint, preferencesHint);
- return new CreateConnectionViewRequest(viewDescriptor);
- } else if(type instanceof IHintedType) {
- // force the graphical hint instead of the hint of the hinted
- // element
- return new CreateConnectionViewAndElementRequest(type, graphicalHint, preferencesHint);
- } else {
- return new CreateConnectionViewAndElementRequest(type, preferencesHint);
- }
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * Vincent Lorenzo (CEA LIST)
+ * Mathieu Velten (Atos) mathieu.velten@atos.net - use commands instead of running code in post commit
+ * Philippe ROLAND (Atos) philippe.roland@atos.net - Implemented PreActions
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.requests.CreateConnectionRequest;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredCreateConnectionViewCommand;
+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.parts.DiagramCommandStack;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewRequest.ConnectionViewDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedAdapter;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeConnectionRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool;
+import org.eclipse.gmf.runtime.diagram.ui.util.INotationType;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+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.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.preferences.ConnectionToolPreferences;
+import org.eclipse.papyrus.uml.diagram.common.layout.LayoutUtils;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IPostAction;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IPreAction;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Connection tool that adds stereotype application after creation actions.
+ */
+public class AspectUnspecifiedTypeConnectionTool extends UnspecifiedTypeConnectionTool {
+
+ private static final int STATE_CONNECTION_WAITING_END = STATE_CONNECTION_STARTED + 1;
+
+ /**
+ * List of element types of which one will be created (of type <code>IElementType</code>).
+ */
+ // protected List elementTypes;
+
+ /** post action list */
+ protected List<IPostAction> postActions = new ArrayList<IPostAction>();
+
+ /** preaction list */
+ protected List<IPreAction> preActions = new ArrayList<IPreAction>();
+
+ /** List of elements to create */
+ private final List<IElementType> elementTypes;
+
+ /**
+ * Creates an AspectUnspecifiedTypeCreationTool
+ *
+ * @param elementTypes
+ * List of element types of which one will be created (of type <code>IElementType</code>).
+ */
+ public AspectUnspecifiedTypeConnectionTool(List<IElementType> elementTypes) {
+ super(elementTypes);
+ this.elementTypes = elementTypes;
+ }
+
+ /**
+ * @return the elementDescriptors
+ */
+ public List<IElementType> getElementTypes() {
+ return elementTypes;
+ }
+
+ protected boolean handleButtonUpOneClick(int button) {
+ return super.handleButtonUp(button);
+ }
+
+ protected boolean handleButtonUpTwoClicks(int button) {
+ setCtrlKeyDown(getCurrentInput().isControlKeyDown());
+
+ if(isInState(STATE_CONNECTION_STARTED)) {
+ setState(STATE_CONNECTION_WAITING_END);
+ return false;
+ } else if(isInState(STATE_CONNECTION_WAITING_END)) {
+ handleCreateConnection();
+ }
+
+ setState(STATE_TERMINAL);
+
+ if(isInState(STATE_TERMINAL | STATE_INVALID)) {
+ handleFinished();
+ }
+
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.gef.tools.AbstractTool#handleButtonUp(int)
+ */
+ @Override
+ protected boolean handleButtonUp(int button) {
+ if(ConnectionToolPreferences.instance.isInSingleClickMode()) {
+ return handleButtonUpOneClick(button);
+ } else {
+ return handleButtonUpTwoClicks(button);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void createConnection() {
+ List<?> selectedEditParts = getCurrentViewer().getSelectedEditParts();
+ List<EObject> eobjects = new ArrayList<EObject>();
+ List<NotificationListener> listeners = new ArrayList<NotificationListener>();
+ DiagramEventBroker eventBroker = null;
+ final EditPartViewer viewer = getCurrentViewer();
+ // only attempt to create connection if there are two shapes selected
+ if(!selectedEditParts.isEmpty()) {
+ IGraphicalEditPart targetEditPart = (IGraphicalEditPart)selectedEditParts.get(selectedEditParts.size() - 1);
+
+ // allow add the listener only one time the target
+ boolean done = false;
+ for(int i = 0; i < selectedEditParts.size(); i++) {
+ IGraphicalEditPart sourceEditPart = (IGraphicalEditPart)selectedEditParts.get(i);
+ if(i != 0) {
+ if(sourceEditPart == targetEditPart) {
+ break;
+ }
+ }
+
+ CreateConnectionRequest connectionRequest = createTargetRequest();
+ // get the anchors locations
+ Point[] newLocation = LayoutUtils.getLinkAnchor(sourceEditPart, targetEditPart);
+ connectionRequest.setTargetEditPart(sourceEditPart);
+ connectionRequest.setType(RequestConstants.REQ_CONNECTION_START);
+ connectionRequest.setLocation(newLocation[0]);
+
+ // only if the connection is supported will we get a non null
+ // command from the sourceEditPart
+
+ if(sourceEditPart.getCommand(connectionRequest) != null) {
+
+ connectionRequest.setSourceEditPart(sourceEditPart);
+ connectionRequest.setTargetEditPart(targetEditPart);
+ connectionRequest.setType(RequestConstants.REQ_CONNECTION_END);
+
+ connectionRequest.setLocation(newLocation[1]);
+
+ setTargetRequest(connectionRequest);
+
+ // inits the listener
+ View eObject = (View)targetEditPart.getAdapter(View.class);
+
+ NotificationListener listener = null;
+ boolean requiresPostCommitRun = requiresPostCommitRun();
+
+ // adds the listener
+ if(requiresPostCommitRun) {
+ // register a listener to have information about element
+ // creation
+ // retrieves editing domain
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eObject);
+ eventBroker = DiagramEventBroker.getInstance(domain);
+
+ listener = new NotificationListener() {
+
+ public void notifyChanged(Notification notification) {
+ Object newValue = notification.getNewValue();
+
+ Map<?, ?> map = viewer.getEditPartRegistry();
+ EditPart editPart = (EditPart)map.get(newValue);
+ for(IPostAction action : postActions) {
+ action.runInPostCommit(editPart);
+ }
+ }
+ };
+
+ // we need to add only one time the listener of the
+ // target (eobject)
+ if(!done && eventBroker != null) {
+ listeners.add(listener);
+ eobjects.add(eObject);
+ eventBroker.addNotificationListener(eObject, listener);
+ done = true;
+ }
+ }
+
+ Command command = targetEditPart.getCommand(connectionRequest);
+
+ if(command != null) {
+ Command completeCommand = getCompleteCommand(command);
+
+ setCurrentCommand(completeCommand);
+
+ executeCurrentCommand();
+ }
+
+ if(requiresPostCommitRun) {
+ if(eventBroker != null) {
+ for(int ii = 0; ii < eobjects.size(); ii++) {
+ eventBroker.removeNotificationListener(eobjects.get(ii), listeners.get(ii));
+ }
+ }
+ }
+
+ selectAddedObject(viewer, DiagramCommandStack.getReturnValues(command));
+
+ }
+ }
+
+ setAvoidDeactivation(false);
+ eraseSourceFeedback();
+ deactivate();
+
+ }
+ }
+
+ protected Command getCompleteCommand(Command createConnectionCommand) {
+ CompoundCommand compositeCmd = new CompoundCommand("Create Link");
+// CompositeTransactionalCommand compositeCmd = new CompositeTransactionalCommand(editingDomain, "Create Link");
+
+ for(IPreAction preAction : preActions) {
+ if(getTargetRequest() instanceof CreateConnectionRequest) {
+ Object sourceModel = ((CreateConnectionRequest)getTargetRequest()).getSourceEditPart().getModel();
+ Object targetModel = ((CreateConnectionRequest)getTargetRequest()).getTargetEditPart().getModel();
+ if(sourceModel instanceof View && targetModel instanceof View) {
+ ICommand cmd = preAction.getConnectionPreCommand((View)sourceModel, (View)targetModel);
+ if(cmd != null) {
+ compositeCmd.add(new ICommandProxy(cmd));
+ }
+ }
+ }
+ }
+
+ compositeCmd.add(createConnectionCommand);
+
+ if(getTargetRequest() instanceof CreateRequest) {
+ CreateUnspecifiedAdapter viewAdapter = new CreateUnspecifiedAdapter();
+ viewAdapter.add((CreateRequest)getTargetRequest());
+
+ for(IPostAction action : postActions) {
+ ICommand cmd = action.getPostCommand(viewAdapter);
+ if(cmd != null) {
+ compositeCmd.add(new ICommandProxy(cmd));
+ }
+ }
+ }
+
+ return compositeCmd;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected boolean handleCreateConnection() {
+ // When a connection is to be created, a dialog box may appear which
+ // will cause this tool to be deactivated and the feedback to be
+ // erased. This behavior is overridden by setting the avoid
+ // deactivation flag.
+ setAvoidDeactivation(true);
+
+ if(getTargetEditPart() == null) {
+ return false;
+ }
+
+ // inits the listener
+ View eObject = (View)getTargetEditPart().getAdapter(View.class);
+ DiagramEventBroker eventBroker = null;
+ NotificationListener listener = null;
+ boolean requiresPostCommitRun = true;
+ final EditPartViewer currentViewer = getCurrentViewer();
+
+ // adds the listener
+ if(requiresPostCommitRun) {
+ // register a listener to have information about element creation
+ // retrieves editing domain
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eObject);
+ eventBroker = DiagramEventBroker.getInstance(domain);
+
+ listener = new NotificationListener() {
+
+ public void notifyChanged(Notification notification) {
+ Object newValue = notification.getNewValue();
+ if (currentViewer != null) {
+ EditPart editPart = (EditPart)currentViewer.getEditPartRegistry().get(newValue);
+ for(IPostAction action : postActions) {
+ action.runInPostCommit(editPart);
+ }
+ }
+ }
+ };
+
+ if(eventBroker != null) {
+ eventBroker.addNotificationListener(eObject, listener);
+ }
+ }
+
+ Command endCommand = getCommand();
+
+ if(endCommand != null) {
+ Command completeCommand = getCompleteCommand(endCommand);
+
+ setCurrentCommand(completeCommand);
+
+ executeCurrentCommand();
+ }
+
+ if(requiresPostCommitRun && eventBroker != null) {
+ eventBroker.removeNotificationListener(eObject, listener);
+ }
+
+ selectAddedObject(currentViewer, DiagramCommandStack.getReturnValues(endCommand));
+
+ setAvoidDeactivation(false);
+ eraseSourceFeedback();
+ deactivate();
+
+ return true;
+ }
+
+ /**
+ * checks if this tool needs a post commit run
+ *
+ * @return <code>true</code> if post actions need a post commit run
+ */
+ protected boolean requiresPostCommitRun() {
+ for(IPostAction action : postActions) {
+ if(action.needsPostCommitRun()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void applyProperty(Object key, Object value) {
+ if(IPapyrusPaletteConstant.ASPECT_ACTION_KEY.equals(key)) {
+ // initialize the pre and post actions
+ // the value should be a NodeList
+ if(value instanceof NodeList) {
+ PaletteUtil.initAspectActions((NodeList)value, postActions, preActions);
+ }
+ } else {
+ super.applyProperty(key, value);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected CreateConnectionRequest createTargetRequest() {
+ return new CreateAspectUnspecifiedTypeConnectionRequest(getElementTypes(), false, getPreferencesHint());
+ }
+
+ /**
+ * Copy of the class {@link CreateUnspecifiedTypeConnectionRequest} to use
+ * the Papyrus request factory instead of the gmf one.
+ */
+ public class CreateAspectUnspecifiedTypeConnectionRequest extends CreateUnspecifiedTypeConnectionRequest {
+
+ /**
+ * List of relationship types of which one will be created (of type <code>IElementType</code>).
+ */
+ // private List relationshipTypes;
+
+ /**
+ * A map containing the <code>CreateConnectionRequest</code> for each
+ * element type.
+ */
+ private Map<IElementType, CreateConnectionRequest> requests = new HashMap<IElementType, CreateConnectionRequest>();
+
+ /** The result to be returned from which the new views can be retrieved. */
+ private List newObjectList = new ArrayList();
+
+ /**
+ * A flag to indicate if the Modeling Assistant Service should be used
+ * to find the types when the other end of the connection is known.
+ */
+ private boolean useModelingAssistantService;
+
+ /**
+ * A flag to indicate if this request is to create a connection from
+ * target to source.
+ */
+ private boolean directionReversed = false;
+
+ /**
+ * The hint used to find the appropriate preference store from which
+ * general diagramming preference values for properties of shapes,
+ * connections, and diagrams can be retrieved. This hint is mapped to a
+ * preference store in the {@link DiagramPreferencesRegistry}.
+ */
+ private PreferencesHint preferencesHint;
+
+ /**
+ * Creates a new <code>CreateUnspecifiedTypeConnectionRequest</code>.
+ *
+ * @param relationshipTypes
+ * List of relationship types of which one will be created
+ * (of type <code>IElementType</code>).
+ * @param useModelingAssistantService
+ * True if the Modeling Assistant Service should be used to
+ * find the types when the other end of the connection is
+ * known.
+ * @param preferencesHint
+ * The preference hint that is to be used to find the
+ * appropriate preference store from which to retrieve
+ * diagram preference values. The preference hint is mapped
+ * to a preference store in the preference registry <@link
+ * DiagramPreferencesRegistry>.
+ */
+ public CreateAspectUnspecifiedTypeConnectionRequest(List<IElementType> relationshipTypes, boolean useModelingAssistantService, PreferencesHint preferencesHint) {
+ super(relationshipTypes, useModelingAssistantService, preferencesHint);
+ this.useModelingAssistantService = useModelingAssistantService;
+ this.preferencesHint = preferencesHint;
+ createRequests();
+ }
+
+ /**
+ * See bug 288695
+ *
+ * if there is only one {@link CreateRequest}, returns this {@link CreateRequest#getNewObject()},
+ * else, returns a list containing a single {@link IAdaptable} that delegates to the {@link CreateRequest#getNewObject()} after the command is
+ * executed.
+ * It is safe to use the return {@link IAdaptable} in a {@link DeferredCreateConnectionViewCommand}.
+ */
+ @Override
+ public Object getNewObject() {
+ if(newObjectList.isEmpty()) {
+ if(requests.size() == 1) {
+ Object createRequest = requests.values().iterator().next();
+ if(createRequest instanceof CreateRequest) {
+ newObjectList.add(((CreateRequest)createRequest).getNewObject());
+ }
+ } else if(requests.size() > 1) {
+ /* See bug 288695 */
+ CreateUnspecifiedAdapter adapter = new CreateUnspecifiedAdapter();
+ for(Object request : requests.values()) {
+ if(request instanceof CreateRequest) {
+ adapter.add((CreateRequest)request);
+ }
+ }
+ List<IAdaptable> newObjects = new ArrayList<IAdaptable>();
+ newObjects.add(adapter);
+ return newObjects;
+ }
+ }
+ return newObjectList;
+ }
+
+ /**
+ * Creates a <code>CreateConnectionRequest</code> for each relationship
+ * type and adds it to the map of requests.
+ */
+ protected void createRequests() {
+ for(IElementType elementType : (List<IElementType>)getElementTypes()) {
+ CreateConnectionRequest request = PapyrusCreateViewRequestFactory.getCreateConnectionRequest(elementType, getPreferencesHint());
+ request.setType(getType());
+ requests.put(elementType, request);
+ }
+ }
+
+ /**
+ * Returns the <code>CreateRequest</code> for the relationship type
+ * passed in.
+ *
+ * @param relationshipType
+ * @return the <code>CreateRequest</code>
+ */
+ @Override
+ public CreateRequest getRequestForType(IElementType relationshipType) {
+ if(requests != null) {
+ return requests.get(relationshipType);
+ }
+ return null;
+ }
+
+ @Override
+ public void addRequest(IElementType relationshipType, Request request) {
+ if(requests != null && request instanceof CreateConnectionRequest) {
+ requests.put(relationshipType, (CreateConnectionRequest)request);
+ }
+ }
+
+ /**
+ * Returns a list of all the requests.
+ *
+ * @return the requests
+ */
+ @Override
+ public List getAllRequests() {
+ if(requests != null) {
+ return new ArrayList(requests.values());
+ }
+ return Collections.EMPTY_LIST;
+ }
+
+ // /**
+ // * Returns the list of element types.
+ // *
+ // * @return Returns the list of element types.
+ // */
+ // public List getElementTypes() {
+ // return relationshipTypes;
+ // }
+
+ /**
+ * @see org.eclipse.gef.requests.CreateConnectionRequest#setSourceEditPart(org.eclipse.gef.EditPart)
+ */
+ @Override
+ public void setSourceEditPart(EditPart part) {
+ if(requests != null) {
+ for(CreateConnectionRequest request : requests.values()) {
+ request.setSourceEditPart(part);
+ }
+ }
+ super.setSourceEditPart(part);
+ }
+
+ /**
+ * @see org.eclipse.gef.requests.TargetRequest#setTargetEditPart(org.eclipse.gef.EditPart)
+ */
+ @Override
+ public void setTargetEditPart(EditPart part) {
+ if(requests != null) {
+ for(CreateConnectionRequest request : requests.values()) {
+ request.setTargetEditPart(part);
+ }
+ }
+ super.setTargetEditPart(part);
+ }
+
+ /**
+ * @see org.eclipse.gef.requests.CreateRequest#setLocation(org.eclipse.draw2d.geometry.Point)
+ */
+ @Override
+ public void setLocation(Point location) {
+ if(requests != null) {
+ for(CreateConnectionRequest request : requests.values()) {
+ request.setLocation(location);
+ }
+ }
+ super.setLocation(location);
+ }
+
+ /**
+ * @see org.eclipse.gef.Request#setType(java.lang.Object)
+ */
+ @Override
+ public void setType(Object type) {
+ if(REQ_CONNECTION_END.equals(getType()) && REQ_CONNECTION_START.equals(type)) {
+
+ //Bug 386011: [Class Diagrams] Incomplete associations get left on diagram
+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=386011
+
+ //This case is specific to the two-clicks association mode
+ //When we draw an association to nothing, and discard the popup menu proposing to
+ //create a new Element as the target of the Association, the target request is changed
+ //from type "connection_end" to "connection_start", which prevents cleaning the feedback
+
+ //We should clean the feedback before changing the type (Because eraseSourceFeedback
+ //tests the type of the request, and expects "connection_end")
+ AspectUnspecifiedTypeConnectionTool.this.setAvoidDeactivation(false);
+ AspectUnspecifiedTypeConnectionTool.this.eraseSourceFeedback();
+ AspectUnspecifiedTypeConnectionTool.this.deactivate();
+ AspectUnspecifiedTypeConnectionTool.this.handleFinished();
+ }
+
+ if(requests != null) {
+ for(CreateConnectionRequest request : requests.values()) {
+ request.setType(type);
+ }
+ }
+ super.setType(type);
+ }
+
+ /**
+ * Returns true if this request is to create a connection from target to
+ * source.
+ *
+ * @return Returns the directionReversed.
+ */
+ @Override
+ public boolean isDirectionReversed() {
+ return directionReversed;
+ }
+
+ /**
+ * Sets the directionReversed flag.
+ *
+ * @param directionReversed
+ * The directionReversed to set.
+ */
+ @Override
+ public void setDirectionReversed(boolean directionReversed) {
+ this.directionReversed = directionReversed;
+ }
+
+ /**
+ * Should the Modeling Assistant Service be used?
+ *
+ * @return Returns true if the Modeling Assistant Service should be used
+ * to find the types when the other end of the connection is
+ * known.
+ */
+ @Override
+ public boolean useModelingAssistantService() {
+ return useModelingAssistantService;
+ }
+
+ /**
+ * Gets the preferences hint that is to be used to find the appropriate
+ * preference store from which to retrieve diagram preference values.
+ * The preference hint is mapped to a preference store in the preference
+ * registry <@link DiagramPreferencesRegistry>.
+ *
+ * @return the preferences hint
+ */
+ @Override
+ protected PreferencesHint getPreferencesHint() {
+ return preferencesHint;
+ }
+ }
+
+ public static class PapyrusCreateViewRequestFactory {
+
+ /**
+ * Creates a new <code>CreateViewRequest</code> or <code>CreateViewAndElementRequest</code> based on the <code>IElementType</code> passed in.
+ *
+ * @param type
+ * the <code>IElementType</code>
+ * @param preferencesHint
+ * The preference hint that is to be used to find the
+ * appropriate preference store from which to retrieve
+ * diagram preference values. The preference hint is mapped
+ * to a preference store in the preference registry <@link
+ * DiagramPreferencesRegistry>.
+ * @return the new request
+ */
+ public static CreateViewRequest getCreateShapeRequest(IElementType type, PreferencesHint preferencesHint) {
+ if(type instanceof INotationType) {
+ ViewDescriptor viewDescriptor = new ViewDescriptor(null, Node.class, ((INotationType)type).getSemanticHint(), preferencesHint);
+ return new CreateViewRequest(viewDescriptor);
+ } else if(type instanceof IHintedType) {
+ ViewAndElementDescriptor viewDescriptor = new ViewAndElementDescriptor(new CreateElementRequestAdapter(new CreateElementRequest(type)), Node.class, ((IHintedType)type).getSemanticHint(), preferencesHint);
+ return new CreateViewAndElementRequest(viewDescriptor);
+ } else {
+ return new CreateViewAndElementRequest(type, preferencesHint);
+ }
+ }
+
+ /**
+ * Creates a new <code>CreateConnectionViewRequest</code> or <code>CreateConnectionViewAndElementRequest</code> based on the
+ * <code>IElementType</code> passed in.
+ *
+ * @param type
+ * the <code>IElementType</code>
+ * @param preferencesHint
+ * The preference hint that is to be used to find the
+ * appropriate preference store from which to retrieve
+ * diagram preference values. The preference hint is mapped
+ * to a preference store in the preference registry <@link
+ * DiagramPreferencesRegistry>.
+ * @return the new request
+ */
+ public static CreateConnectionViewRequest getCreateConnectionRequest(IElementType type, PreferencesHint preferencesHint) {
+ if(type instanceof INotationType) {
+ // Pass in the type as the element adapter so that it can be
+ // retrieved in the cases where a popup menu is to appear with a
+ // list of types.
+ ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(type, ((IHintedType)type).getSemanticHint(), preferencesHint);
+ return new CreateConnectionViewRequest(viewDescriptor);
+ } else if(type instanceof IHintedType) {
+ return new CreateConnectionViewAndElementRequest(type, ((IHintedType)type).getSemanticHint(), preferencesHint);
+ } else {
+ return new CreateConnectionViewAndElementRequest(type, preferencesHint);
+ }
+ }
+
+ /**
+ * Creates a new <code>CreateConnectionViewRequest</code> or <code>CreateConnectionViewAndElementRequest</code> based on the
+ * <code>IElementType</code> passed in.
+ *
+ * @param type
+ * the <code>IElementType</code>
+ * @param graphicalHint
+ * graphical hint for the view to create
+ * @param preferencesHint
+ * The preference hint that is to be used to find the
+ * appropriate preference store from which to retrieve
+ * diagram preference values. The preference hint is mapped
+ * to a preference store in the preference registry <@link
+ * DiagramPreferencesRegistry>.
+ * @return the new request
+ */
+ public static CreateConnectionViewRequest getCreateConnectionRequest(IElementType type, String graphicalHint, PreferencesHint preferencesHint) {
+ if(type instanceof INotationType) {
+ // Pass in the type as the element adapter so that it can be
+ // retrieved in the cases where a popup menu is to appear with a
+ // list of types.
+ ConnectionViewDescriptor viewDescriptor = new ConnectionViewDescriptor(type, graphicalHint, preferencesHint);
+ return new CreateConnectionViewRequest(viewDescriptor);
+ } else if(type instanceof IHintedType) {
+ // force the graphical hint instead of the hint of the hinted
+ // element
+ return new CreateConnectionViewAndElementRequest(type, graphicalHint, preferencesHint);
+ } else {
+ return new CreateConnectionViewAndElementRequest(type, preferencesHint);
+ }
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeCreationTool.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeCreationTool.java
index 05079493f39..30bd63f14d0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeCreationTool.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/AspectUnspecifiedTypeCreationTool.java
@@ -1,286 +1,286 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Mathieu Velten (Atos) mathieu.velten@atos.net - use commands instead of running code in post commit
- * Philippe ROLAND (Atos) philippe.roland@atos.net - Implemented PreActions
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartViewer;
-import org.eclipse.gef.Request;
-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.core.edithelpers.CreateElementRequestAdapter;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedAdapter;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool;
-import org.eclipse.gmf.runtime.diagram.ui.util.INotationType;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-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.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectAction;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IPostAction;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IPreAction;
-import org.w3c.dom.NodeList;
-
-/**
- * Creation tool that adds stereotype application after creation actions.
- */
-public class AspectUnspecifiedTypeCreationTool extends UnspecifiedTypeCreationTool {
-
- /**
- * List of element types of which one will be created (of type <code>IElementType</code>).
- */
- protected List<IElementType> elementTypes;
-
- /** post action list */
- protected List<IPostAction> postActions = new ArrayList<IPostAction>();
-
- /** preaction list */
- protected List<IPreAction> preActions = new ArrayList<IPreAction>();
-
- private static String ID_ASPECT_ACTION = "palette_aspect_actions" ;
-
- /**
- * Creates an AspectUnspecifiedTypeCreationTool
- *
- * @param elementTypes
- * List of element types of which one will be created (of type <code>IElementType</code>).
- */
- public AspectUnspecifiedTypeCreationTool(List<IElementType> elementTypes) {
- super(elementTypes);
- this.elementTypes = elementTypes;
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void performCreation(int button) {
- antiScroll = true;
- boolean requiresPostCommitRun = requiresPostCommitRun();
- // EObject to listen
- View eObject = (View)getTargetEditPart().getAdapter(View.class);
- DiagramEventBroker eventBroker = null;
- NotificationListener listener = null;
- final EditPartViewer currentViewer = getCurrentViewer();
-
- if(requiresPostCommitRun) {
- // register a listener to have information about element creation
- // retrieves editing domain
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eObject);
- eventBroker = DiagramEventBroker.getInstance(domain);
-
- listener = new NotificationListener() {
-
- public void notifyChanged(Notification notification) {
- Object newValue = notification.getNewValue();
- if(currentViewer != null) {
- EditPart editPart = (EditPart)currentViewer.getEditPartRegistry().get(newValue);
-
- for(IPostAction action : postActions) {
- action.runInPostCommit(editPart);
- }
- }
- }
- };
-
- if(eventBroker != null) {
- eventBroker.addNotificationListener(eObject, listener);
- }
- }
-
- Command command = getCurrentCommand();
-
- if(command != null) {
- Command completeCommand = getCompleteCommand(command);
-
- setCurrentCommand(completeCommand);
-
- executeCurrentCommand();
- }
-
- if(requiresPostCommitRun && eventBroker != null) {
- eventBroker.removeNotificationListener(eObject, listener);
- }
-
- selectAddedObject(currentViewer, DiagramCommandStack.getReturnValues(command));
-
- antiScroll = false;
- }
-
- protected Command getCompleteCommand(Command createCommand) {
- CompoundCommand compositeCmd = new CompoundCommand("Create Element");
-
- for(IPreAction preAction : preActions) {
- Object context = getTargetEditPart().getModel();
- if(context instanceof View) {
- ICommand cmd = preAction.getNodePreCommand((View)context);
- if(cmd != null) {
- compositeCmd.add(new ICommandProxy(cmd));
- }
- }
- }
-
- compositeCmd.add(createCommand);
-
- CreateUnspecifiedAdapter viewAdapter = new CreateUnspecifiedAdapter();
- viewAdapter.add(getCreateRequest());
-
- for(IPostAction action : postActions) {
- ICommand cmd = action.getPostCommand(viewAdapter);
- if(cmd != null) {
- compositeCmd.add(new ICommandProxy(cmd));
- }
- }
-
- return compositeCmd;
- }
-
- /**
- * checks if this tool needs a post commit run
- *
- * @return <code>true</code> if post actions need a post commit run
- */
- protected boolean requiresPostCommitRun() {
- for(IPostAction action : postActions) {
- if(action.needsPostCommitRun()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void applyProperty(Object key, Object value) {
- if(IPapyrusPaletteConstant.ASPECT_ACTION_KEY.equals(key)) {
- // initialize the pre and post actions
- // the value should be a NodeList
- if(value instanceof NodeList) {
- PaletteUtil.initAspectActions((NodeList)value, postActions, preActions);
- }
- } else {
- super.applyProperty(key, value);
- }
- }
-
- /**
- * Returns the list of element types
- *
- * @return the list of element types
- */
- public List<IElementType> getElementTypes() {
- return elementTypes;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Request createTargetRequest() {
- CreateAspectUnspecifiedTypeRequest request = new CreateAspectUnspecifiedTypeRequest(getElementTypes(), getPreferencesHint());
- request.getExtendedData().put(ID_ASPECT_ACTION, postActions);
- return request ;
- }
-
- @SuppressWarnings("unchecked")
- public static List<IAspectAction> getAspectActions(Request request)
- {
- return (List<IAspectAction>) (request == null ? Collections.emptyList() : getAspectActions(request.getExtendedData()));
- }
-
- @SuppressWarnings("unchecked")
- public static List<IAspectAction> getAspectActions(Map map)
- {
- return (List<IAspectAction>) (map == null ? Collections.emptyList() : map.get(ID_ASPECT_ACTION));
- }
-
- public class CreateAspectUnspecifiedTypeRequest extends CreateUnspecifiedTypeRequest {
-
- /**
- * Constructor.
- *
- * @param elementTypes
- * @param preferencesHint
- */
- public CreateAspectUnspecifiedTypeRequest(List<IElementType> elementTypes, PreferencesHint preferencesHint) {
- super(elementTypes, preferencesHint);
- }
-
- /**
- * Creates a <code>CreateViewRequest</code> or <code>CreateViewAndElementRequest</code> for each creation hint and
- * adds it to the map of requests.
- */
- @Override
- protected void createRequests() {
- for(IElementType elementType : (List<IElementType>)getElementTypes()) {
- Request request = null;
- if(elementType instanceof INotationType) {
- ViewDescriptor viewDescriptor = new ViewDescriptor(null, Node.class, ((INotationType)elementType).getSemanticHint(), getPreferencesHint());
- request = new CreateViewRequest(viewDescriptor);
- } else if(elementType instanceof IHintedType) {
- ViewAndElementDescriptor viewDescriptor = new ViewAndElementDescriptor(new CreateElementRequestAdapter(new CreateElementRequest(elementType)), Node.class, getGraphicalHint((IHintedType)elementType), getPreferencesHint());
- request = new CreateViewAndElementRequest(viewDescriptor);
- request.setExtendedData(getExtendedData());
- } else {
- ViewAndElementDescriptor viewDescriptor = new ViewAndElementDescriptor(new CreateElementRequestAdapter(new CreateElementRequest(elementType)), Node.class, getPreferencesHint());
- request = new CreateViewAndElementRequest(viewDescriptor);
- request.setExtendedData(getExtendedData());
- }
-
- request.setType(getType());
- requests.put(elementType, request);
- }
- }
-
- /**
- * Returns the semantic hint for the given type. In case of extended
- * type, it returns the hint of the super type
- *
- * @param elementType
- * the hinted element type from which hint is retrieved
- * @return
- */
- protected String getGraphicalHint(IHintedType elementType) {
- String hint = elementType.getSemanticHint();
- return hint;
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * Mathieu Velten (Atos) mathieu.velten@atos.net - use commands instead of running code in post commit
+ * Philippe ROLAND (Atos) philippe.roland@atos.net - Implemented PreActions
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
+import org.eclipse.gef.Request;
+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.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedAdapter;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest.ViewAndElementDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool;
+import org.eclipse.gmf.runtime.diagram.ui.util.INotationType;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+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.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectAction;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IPostAction;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IPreAction;
+import org.w3c.dom.NodeList;
+
+/**
+ * Creation tool that adds stereotype application after creation actions.
+ */
+public class AspectUnspecifiedTypeCreationTool extends UnspecifiedTypeCreationTool {
+
+ /**
+ * List of element types of which one will be created (of type <code>IElementType</code>).
+ */
+ protected List<IElementType> elementTypes;
+
+ /** post action list */
+ protected List<IPostAction> postActions = new ArrayList<IPostAction>();
+
+ /** preaction list */
+ protected List<IPreAction> preActions = new ArrayList<IPreAction>();
+
+ private static String ID_ASPECT_ACTION = "palette_aspect_actions" ;
+
+ /**
+ * Creates an AspectUnspecifiedTypeCreationTool
+ *
+ * @param elementTypes
+ * List of element types of which one will be created (of type <code>IElementType</code>).
+ */
+ public AspectUnspecifiedTypeCreationTool(List<IElementType> elementTypes) {
+ super(elementTypes);
+ this.elementTypes = elementTypes;
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void performCreation(int button) {
+ antiScroll = true;
+ boolean requiresPostCommitRun = requiresPostCommitRun();
+ // EObject to listen
+ View eObject = (View)getTargetEditPart().getAdapter(View.class);
+ DiagramEventBroker eventBroker = null;
+ NotificationListener listener = null;
+ final EditPartViewer currentViewer = getCurrentViewer();
+
+ if(requiresPostCommitRun) {
+ // register a listener to have information about element creation
+ // retrieves editing domain
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(eObject);
+ eventBroker = DiagramEventBroker.getInstance(domain);
+
+ listener = new NotificationListener() {
+
+ public void notifyChanged(Notification notification) {
+ Object newValue = notification.getNewValue();
+ if(currentViewer != null) {
+ EditPart editPart = (EditPart)currentViewer.getEditPartRegistry().get(newValue);
+
+ for(IPostAction action : postActions) {
+ action.runInPostCommit(editPart);
+ }
+ }
+ }
+ };
+
+ if(eventBroker != null) {
+ eventBroker.addNotificationListener(eObject, listener);
+ }
+ }
+
+ Command command = getCurrentCommand();
+
+ if(command != null) {
+ Command completeCommand = getCompleteCommand(command);
+
+ setCurrentCommand(completeCommand);
+
+ executeCurrentCommand();
+ }
+
+ if(requiresPostCommitRun && eventBroker != null) {
+ eventBroker.removeNotificationListener(eObject, listener);
+ }
+
+ selectAddedObject(currentViewer, DiagramCommandStack.getReturnValues(command));
+
+ antiScroll = false;
+ }
+
+ protected Command getCompleteCommand(Command createCommand) {
+ CompoundCommand compositeCmd = new CompoundCommand("Create Element");
+
+ for(IPreAction preAction : preActions) {
+ Object context = getTargetEditPart().getModel();
+ if(context instanceof View) {
+ ICommand cmd = preAction.getNodePreCommand((View)context);
+ if(cmd != null) {
+ compositeCmd.add(new ICommandProxy(cmd));
+ }
+ }
+ }
+
+ compositeCmd.add(createCommand);
+
+ CreateUnspecifiedAdapter viewAdapter = new CreateUnspecifiedAdapter();
+ viewAdapter.add(getCreateRequest());
+
+ for(IPostAction action : postActions) {
+ ICommand cmd = action.getPostCommand(viewAdapter);
+ if(cmd != null) {
+ compositeCmd.add(new ICommandProxy(cmd));
+ }
+ }
+
+ return compositeCmd;
+ }
+
+ /**
+ * checks if this tool needs a post commit run
+ *
+ * @return <code>true</code> if post actions need a post commit run
+ */
+ protected boolean requiresPostCommitRun() {
+ for(IPostAction action : postActions) {
+ if(action.needsPostCommitRun()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void applyProperty(Object key, Object value) {
+ if(IPapyrusPaletteConstant.ASPECT_ACTION_KEY.equals(key)) {
+ // initialize the pre and post actions
+ // the value should be a NodeList
+ if(value instanceof NodeList) {
+ PaletteUtil.initAspectActions((NodeList)value, postActions, preActions);
+ }
+ } else {
+ super.applyProperty(key, value);
+ }
+ }
+
+ /**
+ * Returns the list of element types
+ *
+ * @return the list of element types
+ */
+ public List<IElementType> getElementTypes() {
+ return elementTypes;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Request createTargetRequest() {
+ CreateAspectUnspecifiedTypeRequest request = new CreateAspectUnspecifiedTypeRequest(getElementTypes(), getPreferencesHint());
+ request.getExtendedData().put(ID_ASPECT_ACTION, postActions);
+ return request ;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static List<IAspectAction> getAspectActions(Request request)
+ {
+ return (List<IAspectAction>) (request == null ? Collections.emptyList() : getAspectActions(request.getExtendedData()));
+ }
+
+ @SuppressWarnings("unchecked")
+ public static List<IAspectAction> getAspectActions(Map map)
+ {
+ return (List<IAspectAction>) (map == null ? Collections.emptyList() : map.get(ID_ASPECT_ACTION));
+ }
+
+ public class CreateAspectUnspecifiedTypeRequest extends CreateUnspecifiedTypeRequest {
+
+ /**
+ * Constructor.
+ *
+ * @param elementTypes
+ * @param preferencesHint
+ */
+ public CreateAspectUnspecifiedTypeRequest(List<IElementType> elementTypes, PreferencesHint preferencesHint) {
+ super(elementTypes, preferencesHint);
+ }
+
+ /**
+ * Creates a <code>CreateViewRequest</code> or <code>CreateViewAndElementRequest</code> for each creation hint and
+ * adds it to the map of requests.
+ */
+ @Override
+ protected void createRequests() {
+ for(IElementType elementType : (List<IElementType>)getElementTypes()) {
+ Request request = null;
+ if(elementType instanceof INotationType) {
+ ViewDescriptor viewDescriptor = new ViewDescriptor(null, Node.class, ((INotationType)elementType).getSemanticHint(), getPreferencesHint());
+ request = new CreateViewRequest(viewDescriptor);
+ } else if(elementType instanceof IHintedType) {
+ ViewAndElementDescriptor viewDescriptor = new ViewAndElementDescriptor(new CreateElementRequestAdapter(new CreateElementRequest(elementType)), Node.class, getGraphicalHint((IHintedType)elementType), getPreferencesHint());
+ request = new CreateViewAndElementRequest(viewDescriptor);
+ request.setExtendedData(getExtendedData());
+ } else {
+ ViewAndElementDescriptor viewDescriptor = new ViewAndElementDescriptor(new CreateElementRequestAdapter(new CreateElementRequest(elementType)), Node.class, getPreferencesHint());
+ request = new CreateViewAndElementRequest(viewDescriptor);
+ request.setExtendedData(getExtendedData());
+ }
+
+ request.setType(getType());
+ requests.put(elementType, request);
+ }
+ }
+
+ /**
+ * Returns the semantic hint for the given type. In case of extended
+ * type, it returns the hint of the super type
+ *
+ * @param elementType
+ * the hinted element type from which hint is retrieved
+ * @return
+ */
+ protected String getGraphicalHint(IHintedType elementType) {
+ String hint = elementType.getSemanticHint();
+ return hint;
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ExtendedPaletteProviderConfiguration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ExtendedPaletteProviderConfiguration.java
index 0d1ebc39b94..9d506d7b6b0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ExtendedPaletteProviderConfiguration.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/ExtendedPaletteProviderConfiguration.java
@@ -1,86 +1,86 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-
-/**
- * A provider configuration for the PapyrusPaletteService.
- */
-public class ExtendedPaletteProviderConfiguration extends XMLPaletteProviderConfiguration {
-
- /** name of this contribution */
- private final String bundleID;
-
- /** ID of this palette contribution */
- private final String path;
-
- /**
- * Creates a new <code>ProviderContributionDescriptor</code> instance given
- * a provider configuration element
- *
- * @param configElement
- * The provider XML configuration element
- */
- protected ExtendedPaletteProviderConfiguration(IConfigurationElement configElement) {
- super(configElement);
- bundleID = configElement.getContributor().getName();
- path = configElement.getAttribute(IPapyrusPaletteConstant.PATH);
-
- // check that the two variables are not null
- if(bundleID == null) {
- Activator.log.error("Impossible to find the bundle unique identifier for element: " + configElement, null);
- }
-
- if(path == null) {
- Activator.log.error("Impossible to find thepath to configuration file for element: " + configElement, null);
- }
- }
-
- /**
- * Builds a new provider contribution descriptor by parsing its
- * configuration element
- *
- * @param configElement
- * A provider configuration element
- * @return A provider XML contribution descriptor
- */
- public static ExtendedPaletteProviderConfiguration parse(IConfigurationElement configElement) {
- Assert.isNotNull(configElement, "null provider configuration element"); //$NON-NLS-1$
- return new ExtendedPaletteProviderConfiguration(configElement);
- }
-
- /**
- * Returns the unique identifier of the bundle that contains the
- * configuration file
- *
- * @return the unique identifier of the bundle that contains the
- * configuration file
- */
- public String getBundleID() {
- return bundleID;
- }
-
- /**
- * Returns the path to the file in the bundle
- *
- * @return the path to the file in the bundle
- */
- public String getPath() {
- return path;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+
+/**
+ * A provider configuration for the PapyrusPaletteService.
+ */
+public class ExtendedPaletteProviderConfiguration extends XMLPaletteProviderConfiguration {
+
+ /** name of this contribution */
+ private final String bundleID;
+
+ /** ID of this palette contribution */
+ private final String path;
+
+ /**
+ * Creates a new <code>ProviderContributionDescriptor</code> instance given
+ * a provider configuration element
+ *
+ * @param configElement
+ * The provider XML configuration element
+ */
+ protected ExtendedPaletteProviderConfiguration(IConfigurationElement configElement) {
+ super(configElement);
+ bundleID = configElement.getContributor().getName();
+ path = configElement.getAttribute(IPapyrusPaletteConstant.PATH);
+
+ // check that the two variables are not null
+ if(bundleID == null) {
+ Activator.log.error("Impossible to find the bundle unique identifier for element: " + configElement, null);
+ }
+
+ if(path == null) {
+ Activator.log.error("Impossible to find thepath to configuration file for element: " + configElement, null);
+ }
+ }
+
+ /**
+ * Builds a new provider contribution descriptor by parsing its
+ * configuration element
+ *
+ * @param configElement
+ * A provider configuration element
+ * @return A provider XML contribution descriptor
+ */
+ public static ExtendedPaletteProviderConfiguration parse(IConfigurationElement configElement) {
+ Assert.isNotNull(configElement, "null provider configuration element"); //$NON-NLS-1$
+ return new ExtendedPaletteProviderConfiguration(configElement);
+ }
+
+ /**
+ * Returns the unique identifier of the bundle that contains the
+ * configuration file
+ *
+ * @return the unique identifier of the bundle that contains the
+ * configuration file
+ */
+ public String getBundleID() {
+ return bundleID;
+ }
+
+ /**
+ * Returns the path to the file in the bundle
+ *
+ * @return the path to the file in the bundle
+ */
+ public String getPath() {
+ return path;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IPapyrusPaletteConstant.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IPapyrusPaletteConstant.java
index 8d0fd598fa6..8b7100feef0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IPapyrusPaletteConstant.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IPapyrusPaletteConstant.java
@@ -1,131 +1,131 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-
-/**
- * Constant for the papyrus palette extension point
- */
-public interface IPapyrusPaletteConstant {
-
- /** Papyrus palette definition extension point name */
- public final String PALETTE_DEFINITION = "paletteDefinition"; //$NON-NLS-1$
-
- /** Papyrus palette definition full extension point identifier */
- public final String PALETTE_DEFINITION_FULL_ID = Activator.ID + "." + PALETTE_DEFINITION; //$NON-NLS-1$ //$NON-NLS-2$
-
- /** name for the field giving the path to the XML file */
- public final String CONTENT = "content"; //$NON-NLS-1$
-
- /** name for the field giving the path to the XML file */
- public final String PATH = "path"; //$NON-NLS-1$
-
- /** name of the properties node */
- public final String PALETTE_DESCRIPTION_PROPERTIES = "properties";
-
- /** name of the drawer node */
- public final String DRAWER = "drawer";
-
- /** name of the stack node */
- public final String STACK = "stack";
-
- /** name of the tool node */
- public final String TOOL = "tool";
-
- /** name of the tool node */
- public final String ASPECT_TOOL = "aspectTool";
-
- /** name of the separator node */
- public final String SEPARATOR = "separator";
-
- /** name of the ID attribute */
- public final String ID = "id";
-
- /** name of the preAction attribute */
- public final String PRE_ACTION = "preAction";
-
- /** name of the editor attribute */
- public final String EDITOR = "editor";
-
- /** name of the name attribute */
- public final String NAME = "name";
-
- /** name of the editor id attribute */
- public final String EDITOR_ID = "editorID";
-
- /** name of the priority attribute */
- public final String PRIORITY = "priority";
-
- /** name of the description attribute */
- public final String DESCRIPTION = "description";
-
- /** id for the preference store for palette customizations */
- public final String PALETTE_CUSTOMIZATIONS_ID = "paletteCustomization";
-
- /** id for the preference store for palette redefinitions */
- public final String PALETTE_REDEFINITIONS = "paletteRedefinitions";
-
- /** id for the node: palette redefinition */
- public final String PALETTE_REDEFINITION = "paletteRedefinition";
-
- /** id for the preference store for local palette definitions */
- public final String PALETTE_LOCAL_DEFINITIONS = "localPaletteDefinition";
-
- /** id for the preference definitions */
- public final String HIDDEN_PALETTES = "hiddenPalettes";
-
- /** id for the palette attribute */
- public final String PALETTE = "palette";
-
- /** id for the class attribute */
- public final String CLASS = "class";
-
- /** id for the icon path attribute */
- public final String ICON_PATH = "iconpath";
-
- /** id for the referenced tool in aspect tools */
- public final String REF_TOOL_ID = "refToolId";
-
- /** id for the post action node in aspect tool definition */
- public final String POST_ACTION = "postAction";
-
- /** id for the attribute stereotypes to apply qualified name */
- public final String STEREOTYPES_TO_APPLY = "stereotypesToApply";
-
- /** key for the properties tool */
- public final String STEREOTYPES_TO_APPLY_KEY = "StereotypesToApply";
-
- /** key for the profile list attribute */
- public final String PROFILE_LIST = "requiredProfiles";
-
- /** key for the properties Tool */
- public final String ASPECT_ACTION_KEY = "aspectActions";
-
- /** name of the value attribute */
- public final String VALUE = "value";
-
- /** name of the feature node for features defined statically */
- public final String FEATURE_NODE_NAME = "feature";
-
- /** name of the attribute or node for display kind */
- public final String DISPLAY_KIND = "displayKind";
-
- /** name of the attribute or node for display place */
- public final String DISPLAY_PLACE = "displayPlace";
-
- /** name of the feature node for features defined at runtime */
- public final String RUNTIME_FEATURE_NODE_NAME = "runtimeFeature";
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+
+/**
+ * Constant for the papyrus palette extension point
+ */
+public interface IPapyrusPaletteConstant {
+
+ /** Papyrus palette definition extension point name */
+ public final String PALETTE_DEFINITION = "paletteDefinition"; //$NON-NLS-1$
+
+ /** Papyrus palette definition full extension point identifier */
+ public final String PALETTE_DEFINITION_FULL_ID = Activator.ID + "." + PALETTE_DEFINITION; //$NON-NLS-1$ //$NON-NLS-2$
+
+ /** name for the field giving the path to the XML file */
+ public final String CONTENT = "content"; //$NON-NLS-1$
+
+ /** name for the field giving the path to the XML file */
+ public final String PATH = "path"; //$NON-NLS-1$
+
+ /** name of the properties node */
+ public final String PALETTE_DESCRIPTION_PROPERTIES = "properties";
+
+ /** name of the drawer node */
+ public final String DRAWER = "drawer";
+
+ /** name of the stack node */
+ public final String STACK = "stack";
+
+ /** name of the tool node */
+ public final String TOOL = "tool";
+
+ /** name of the tool node */
+ public final String ASPECT_TOOL = "aspectTool";
+
+ /** name of the separator node */
+ public final String SEPARATOR = "separator";
+
+ /** name of the ID attribute */
+ public final String ID = "id";
+
+ /** name of the preAction attribute */
+ public final String PRE_ACTION = "preAction";
+
+ /** name of the editor attribute */
+ public final String EDITOR = "editor";
+
+ /** name of the name attribute */
+ public final String NAME = "name";
+
+ /** name of the editor id attribute */
+ public final String EDITOR_ID = "editorID";
+
+ /** name of the priority attribute */
+ public final String PRIORITY = "priority";
+
+ /** name of the description attribute */
+ public final String DESCRIPTION = "description";
+
+ /** id for the preference store for palette customizations */
+ public final String PALETTE_CUSTOMIZATIONS_ID = "paletteCustomization";
+
+ /** id for the preference store for palette redefinitions */
+ public final String PALETTE_REDEFINITIONS = "paletteRedefinitions";
+
+ /** id for the node: palette redefinition */
+ public final String PALETTE_REDEFINITION = "paletteRedefinition";
+
+ /** id for the preference store for local palette definitions */
+ public final String PALETTE_LOCAL_DEFINITIONS = "localPaletteDefinition";
+
+ /** id for the preference definitions */
+ public final String HIDDEN_PALETTES = "hiddenPalettes";
+
+ /** id for the palette attribute */
+ public final String PALETTE = "palette";
+
+ /** id for the class attribute */
+ public final String CLASS = "class";
+
+ /** id for the icon path attribute */
+ public final String ICON_PATH = "iconpath";
+
+ /** id for the referenced tool in aspect tools */
+ public final String REF_TOOL_ID = "refToolId";
+
+ /** id for the post action node in aspect tool definition */
+ public final String POST_ACTION = "postAction";
+
+ /** id for the attribute stereotypes to apply qualified name */
+ public final String STEREOTYPES_TO_APPLY = "stereotypesToApply";
+
+ /** key for the properties tool */
+ public final String STEREOTYPES_TO_APPLY_KEY = "StereotypesToApply";
+
+ /** key for the profile list attribute */
+ public final String PROFILE_LIST = "requiredProfiles";
+
+ /** key for the properties Tool */
+ public final String ASPECT_ACTION_KEY = "aspectActions";
+
+ /** name of the value attribute */
+ public final String VALUE = "value";
+
+ /** name of the feature node for features defined statically */
+ public final String FEATURE_NODE_NAME = "feature";
+
+ /** name of the attribute or node for display kind */
+ public final String DISPLAY_KIND = "displayKind";
+
+ /** name of the attribute or node for display place */
+ public final String DISPLAY_PLACE = "displayPlace";
+
+ /** name of the feature node for features defined at runtime */
+ public final String RUNTIME_FEATURE_NODE_NAME = "runtimeFeature";
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IProfileDependantPaletteProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IProfileDependantPaletteProvider.java
index 3b70fc45a3d..40d1f3bfdc6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IProfileDependantPaletteProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/IProfileDependantPaletteProvider.java
@@ -1,31 +1,31 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.util.Collection;
-
-import org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider;
-
-/**
- * Interface implemented by all palette providers that requires some profiles
- * applied to be shown
- */
-public interface IProfileDependantPaletteProvider extends IPaletteProvider {
-
- /**
- * Returns the list of required profiles for the palette to be shown
- *
- * @return the list of required profiles for the palette to be shown
- */
- public Collection<String> getRequiredProfiles();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.util.Collection;
+
+import org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider;
+
+/**
+ * Interface implemented by all palette providers that requires some profiles
+ * applied to be shown
+ */
+public interface IProfileDependantPaletteProvider extends IPaletteProvider {
+
+ /**
+ * Returns the list of required profiles for the palette to be shown
+ *
+ * @return the list of required profiles for the palette to be shown
+ */
+ public Collection<String> getRequiredProfiles();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecorator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecorator.java
index bc3f401076a..abf19823ad5 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecorator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecorator.java
@@ -1,471 +1,471 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.ImageFigure;
-import org.eclipse.draw2d.Locator;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
-import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
-import org.eclipse.gmf.runtime.notation.DecorationNode;
-import org.eclipse.gmf.runtime.notation.DescriptionStyle;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.layout.OverlayLocator;
-import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Operation;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- *
- * The decorator to represent inherited element This decorator adds a small
- * image ( the generalization icon) next to the UML Element which are inherited.
- * 3 positions are defined for the decoration :
- * <ul>
- * <li>if the UML Element is represented like an affixed child node : in {@link PositionConstants#NORTH_WEST} or {@link PositionConstants#SOUTH_EAST}
- * following its position/parent and margin =1</li>
- * <li>else if the element is in a compartment list : {@link PositionConstants#EAST} and margin =-1</li>
- * <li>else {@link PositionConstants#SOUTH_EAST} and margin = -1</li>
- * </ul>
- */
-public class InheritedDecorator implements IDecorator {
-
- /** the object to be decorated */
- private IDecoratorTarget decoratorTarget;
-
- /** the decoration being displayed */
- private IDecoration decoration;
-
- /** the plugin where owning the icons for the UML Element */
- public static final String pluginID = "org.eclipse.papyrus.uml.diagram.common"; //$NON-NLS-1$
-
- /** the image path */
- public static final String imagePath = "/icons/hyperlink_13x13.gif"; //$NON-NLS-1$
-
- /** the image used added to represent an inherited element */
- private static final Image ICON_HYPERLINK = Activator.getPluginIconImage(pluginID, imagePath);
-
- /**
- * Creates a new <code>AbstractDecorator</code> for the decorator target
- * passed in.
- *
- * @param decoratorTarget
- * the object to be decorated
- */
- public InheritedDecorator(IDecoratorTarget decoratorTarget) {
- this.decoratorTarget = decoratorTarget;
- }
-
- /**
- * Gets the object to be decorated.
- *
- * @return Returns the object to be decorated
- */
- protected IDecoratorTarget getDecoratorTarget() {
- return decoratorTarget;
- }
-
- /**
- * @return Returns the decoration.
- */
- public IDecoration getDecoration() {
- return decoration;
- }
-
- /**
- * @param decoration
- * The decoration to set.
- */
- public void setDecoration(IDecoration decoration) {
- this.decoration = decoration;
- }
-
- /**
- * Removes the decoration if it exists and sets it to null.
- */
- protected void removeDecoration() {
- if(decoration != null) {
- decoratorTarget.removeDecoration(decoration);
- decoration = null;
- }
- }
-
- /**
- * getDecoratorTargetClassifier Utility method to determine if the
- * decoratorTarget is a supported type for this decorator and return the
- * associated Classifier element.
- *
- * @param decoratorTarget
- * IDecoratorTarget to check and return valid Classifier target.
- * @return node Node if IDecoratorTarget can be supported, null otherwise.
- */
- static public Node getDecoratorTargetNode(IDecoratorTarget decoratorTarget) {
- DescriptionStyle descStyle = null;
- View node = (View)decoratorTarget.getAdapter(View.class);
- if(node != null && !(node instanceof Diagram)) {
- descStyle = (DescriptionStyle)node.getStyle(NotationPackage.eINSTANCE.getDescriptionStyle());
-
- if(descStyle != null) {
- return (Node)node;
- }
- }
- return null;
-
- }
-
- /**
- * Creates the appropriate review decoration if all the criteria is
- * satisfied by the view passed in.
- */
-
- public void refresh() {
- removeDecoration();
-
- Node node = getDecoratorTargetNode(getDecoratorTarget());
- IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
-
- if(node != null) {
- DescriptionStyle descStyle = getDescriptionStyle(node);
-
- if(descStyle != null) {
- if(isInherited(node)) {
- // if(Util.isAffixedChildNode(gep)) {
-
- // setDecoration(getDecoratorTarget().addDecoration(figure,
- // locator, false));
- // } else {
- // setDecoration(getDecoratorTarget().addShapeDecoration(figure,
- // getDirection(node), -1, false));
- // }
-
- if(gep != null && gep.getRoot() != null) {// if the gep has
- // no parent, we
- // can't test if
- // the container
- // is a
- // compartment
- // list
- // (because, we
- // call the
- // method
- // DiagramEditPartsUtil.getEditPartFromView((View)container,
- // gep);
- IFigure figure = getFigure(ICON_HYPERLINK);
- if(isInCompartmentList(node) && !Util.isAffixedChildNode(gep)) {
- setDecoration(getDecoratorTarget().addShapeDecoration(figure, getDirection(node), -1, false));
- } else {
- Locator locator = new OverlayLocator(gep.getFigure(), getDirection(node));
- setDecoration(getDecoratorTarget().addDecoration(figure, locator, false));
- }
- }
-
- }
- }
- }
- }
-
- /**
- * Returns a figure corresponding to this image
- *
- * @param image
- * a image
- * @return a figure corresponding to this image
- */
- public IFigure getFigure(Image image) {
- IMapMode mm = MapModeUtil.getMapMode(((IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class)).getFigure());
- ImageFigure fig = new ImageFigure();
- fig.setImage(image);
- fig.setSize(mm.DPtoLP(image.getBounds().width), mm.DPtoLP(image.getBounds().height));
- return fig;
- }
-
- /**
- * Returns the direction to set the decorator for the node
- *
- * @param node
- * the node
- * @return the direction to set the decorator for the node direction can be
- * :
- * <ul>
- * <li> {@link PositionConstants#NORTH_WEST} or {@link PositionConstants#SOUTH_EAST}</li> if the node is an Affixed Child Node
- * <li>{@link PositionConstants#EAST}</li> if the node is in a compartment list
- * <li>{@link PositionConstants#SOUTH_EAST}</li> in other cases
- * </ul>
- */
- protected Direction getDirection(Node node) {
- IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
- assert gep != null;
- // test if its an affixed ChildNode
- // if(Util.isAffixedChildNode(gep)) {
- //
- // IBorderItemLocator loc =
- // ((BorderNamedElementEditPart)gep).getBorderItemLocator();
- // int location = loc.getCurrentSideOfParent();
- // if(PositionConstants.NONE == location) { //sometimes
- // getBorderItemLocator doesn't work correctly!
- // location = PositionConstants.NORTH_WEST;
- // }
- // switch(location) {
- // case PositionConstants.NORTH:
- // case PositionConstants.NORTH_WEST:
- // case PositionConstants.WEST:
- // case PositionConstants.SOUTH_WEST:
- // // return IDecoratorTarget.Direction.NORTH_WEST;
- // default:
- // return IDecoratorTarget.Direction.SOUTH_EAST;
- // }
- // }
- if(gep.getParent() != null) {
- if(isInCompartmentList(node) && !Util.isAffixedChildNode(gep)) {
- return IDecoratorTarget.Direction.EAST;
- }
- }
- return IDecoratorTarget.Direction.SOUTH_WEST;
- }
-
- /**
- * Tests if the compartment is a compartment list
- *
- * @param node
- * the node on which we want add an Overlay
- * @return <code>true</code> if the compartment is managed by an {@link XYLayoutEditPolicy}
- */
- protected boolean isInCompartmentList(Node node) {
- IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
- if(gep != null && gep.getRoot() != null) {
- EObject container = node.eContainer();
- if(container instanceof View) {
- EditPart EP = DiagramEditPartsUtil.getEditPartFromView((View)container, gep);
- EditPolicy editPolicy = EP.getEditPolicy(EditPolicy.LAYOUT_ROLE);
- if(!(editPolicy instanceof XYLayoutEditPolicy)) {// we are in a
- // compartment
- // list
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Tests if the node is an inherited element
- *
- * @param node
- * a node
- * @return <code>true</code> if the node is an inherited element <code>false</code> if not
- */
- protected boolean isInherited(Node node) {
- EObject element = node.getElement();
- if(element instanceof Element) {
- EObject container = node.eContainer();
- EObject graphicalParent = null;
- if(container instanceof DecorationNode) {
- graphicalParent = ((DecorationNode)container).getElement();
- } else if(container instanceof View) {
- graphicalParent = ((View)container).getElement();
- }
- if(graphicalParent instanceof Property || graphicalParent instanceof Classifier) {
- Classifier classifier = null;
- if(graphicalParent instanceof Property) {
- Type type = ((Property)graphicalParent).getType();
- if(type instanceof Classifier) {
- classifier = (Classifier)type;
- }
- } else {
- classifier = (Classifier)graphicalParent;
- }
- if(classifier != null) {
- EList<NamedElement> inheritedMembers = classifier.getInheritedMembers();
- return inheritedMembers.contains(element);
- }
- }
- }
- return false;
- }
-
- /**
- * getDescriptionStyle Accessor to retrieve the description style from a
- * Node.
- *
- * @param node
- * Node to retrieve the description style from.
- * @return DescriptionStyle style object
- */
- protected DescriptionStyle getDescriptionStyle(Node node) {
- return (DescriptionStyle)node.getStyle(NotationPackage.eINSTANCE.getDescriptionStyle());
- }
-
- /**
- * A listener used to listen the change of location and type (for Property)
- */
- private NotificationListener notificationListener = new NotificationListener() {
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
- *
- * @param notification
- */
- public void notifyChanged(Notification notification) {
-
- if(notification.getEventType() == Notification.REMOVE) {
- if(notification.getNotifier() instanceof Classifier) {
- IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
- assert gep != null;
- // we remove the listener on the container (because it's
- // changing
- DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener((EObject)notification.getNotifier(), notificationListener);
- }
- }
- // we update the listeners It's useful when an Element with overlay
- // changes of parent
- deactivate();
- activate();
- refresh();
- }
-
- };
-
- /**
- * Adds listeners on
- * <ul>
- * <li>Affixed Child Node</li>
- * <li>graphical parent, when its a {@link Property} (we add the listener on its Type)</li>
- * </ul>
- */
- public void activate() {
-
- IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
- assert gep != null;
- View view = ((View)gep.getModel());
-
- if(view instanceof Node) {
- // the location of the decorator can change if it's an Affixed Child
- // Node
- if(isInherited((Node)view) && Util.isAffixedChildNode(gep)) {
- DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(gep.getNotationView(), notificationListener);
- }
- }
-
- // if the graphical parent is a Property, we add a listener on the type
- // of the property, to refresh the decoration
- EObject parent = view.eContainer();
- if(parent instanceof DecorationNode) {
- parent = parent.eContainer();
- }
- if(parent instanceof View) {
- EObject el = ((View)parent).getElement();
- if(el instanceof Property) {
- DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(el, UMLPackage.eINSTANCE.getTypedElement_Type(), notificationListener);
- }
- }
-
- /*
- * We listen the changes on the UML parent, in order to know if the
- * element is changing of parent Adding a listener using the following
- * EReference doesn't work UMLPackage.eINSTANCE.getElement_Owner();
- * UMLPackage.eINSTANCE.getProperty_Class();
- * UMLPackage.eINSTANCE.getNamedElement_Namespace(); that's why we
- * listen the parent
- */
- if(view.getElement() instanceof Element) {
- Element semanticElement = (Element)view.getElement();
-
- /*
- * We need add a listener only if the element is an element which
- * can be inherited, like Property, Operation, Signal, Classifier...
- */
- if(semanticElement != null && canBeInherited(semanticElement)) {
- // we listen if the container of the element changes!
- if(semanticElement.eContainer() != null) {
- DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(semanticElement.eContainer(), notificationListener);
- }
- }
- }
- }
-
- /**
- * Tests if the element can be inherited
- *
- * @param semanticElement
- * the element to test
- * @return <code>true</code> if the element can be inherited
- */
- protected boolean canBeInherited(Element semanticElement) {
- /*
- * maybe we could replace these tests by RedefinableElement? or not?
- */
-
- if(semanticElement instanceof Classifier) {
- return true;
- } else if(semanticElement instanceof Property) {
- return true;
- } else if(semanticElement instanceof Operation) {
- return true;
- }
- return false;
- }
-
- /**
- * Removes the listeners and the decorations
- */
- public void deactivate() {
- removeDecoration();
-
- IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
- assert gep != null;
- DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(gep.getNotationView(), notificationListener);
- View view = ((View)gep.getModel());
-
- EObject parent = view.eContainer();
- if(parent instanceof View) {
- EObject el = ((View)parent).getElement();
- if(el instanceof Property) {
- DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(el, UMLPackage.eINSTANCE.getTypedElement_Type(), notificationListener);
- }
- }
-
- if(view.getElement() instanceof Element) {
- Element semanticElement = (Element)view.getElement();
- if(semanticElement != null) {
- if(semanticElement.eContainer() != null) {
- DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(semanticElement.eContainer(), notificationListener);
- }
- }
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.ImageFigure;
+import org.eclipse.draw2d.Locator;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
+import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEditPolicy;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode;
+import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil;
+import org.eclipse.gmf.runtime.notation.DecorationNode;
+import org.eclipse.gmf.runtime.notation.DescriptionStyle;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.layout.OverlayLocator;
+import org.eclipse.papyrus.uml.diagram.common.util.DiagramEditPartsUtil;
+import org.eclipse.papyrus.uml.diagram.common.util.Util;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ *
+ * The decorator to represent inherited element This decorator adds a small
+ * image ( the generalization icon) next to the UML Element which are inherited.
+ * 3 positions are defined for the decoration :
+ * <ul>
+ * <li>if the UML Element is represented like an affixed child node : in {@link PositionConstants#NORTH_WEST} or {@link PositionConstants#SOUTH_EAST}
+ * following its position/parent and margin =1</li>
+ * <li>else if the element is in a compartment list : {@link PositionConstants#EAST} and margin =-1</li>
+ * <li>else {@link PositionConstants#SOUTH_EAST} and margin = -1</li>
+ * </ul>
+ */
+public class InheritedDecorator implements IDecorator {
+
+ /** the object to be decorated */
+ private IDecoratorTarget decoratorTarget;
+
+ /** the decoration being displayed */
+ private IDecoration decoration;
+
+ /** the plugin where owning the icons for the UML Element */
+ public static final String pluginID = "org.eclipse.papyrus.uml.diagram.common"; //$NON-NLS-1$
+
+ /** the image path */
+ public static final String imagePath = "/icons/hyperlink_13x13.gif"; //$NON-NLS-1$
+
+ /** the image used added to represent an inherited element */
+ private static final Image ICON_HYPERLINK = Activator.getPluginIconImage(pluginID, imagePath);
+
+ /**
+ * Creates a new <code>AbstractDecorator</code> for the decorator target
+ * passed in.
+ *
+ * @param decoratorTarget
+ * the object to be decorated
+ */
+ public InheritedDecorator(IDecoratorTarget decoratorTarget) {
+ this.decoratorTarget = decoratorTarget;
+ }
+
+ /**
+ * Gets the object to be decorated.
+ *
+ * @return Returns the object to be decorated
+ */
+ protected IDecoratorTarget getDecoratorTarget() {
+ return decoratorTarget;
+ }
+
+ /**
+ * @return Returns the decoration.
+ */
+ public IDecoration getDecoration() {
+ return decoration;
+ }
+
+ /**
+ * @param decoration
+ * The decoration to set.
+ */
+ public void setDecoration(IDecoration decoration) {
+ this.decoration = decoration;
+ }
+
+ /**
+ * Removes the decoration if it exists and sets it to null.
+ */
+ protected void removeDecoration() {
+ if(decoration != null) {
+ decoratorTarget.removeDecoration(decoration);
+ decoration = null;
+ }
+ }
+
+ /**
+ * getDecoratorTargetClassifier Utility method to determine if the
+ * decoratorTarget is a supported type for this decorator and return the
+ * associated Classifier element.
+ *
+ * @param decoratorTarget
+ * IDecoratorTarget to check and return valid Classifier target.
+ * @return node Node if IDecoratorTarget can be supported, null otherwise.
+ */
+ static public Node getDecoratorTargetNode(IDecoratorTarget decoratorTarget) {
+ DescriptionStyle descStyle = null;
+ View node = (View)decoratorTarget.getAdapter(View.class);
+ if(node != null && !(node instanceof Diagram)) {
+ descStyle = (DescriptionStyle)node.getStyle(NotationPackage.eINSTANCE.getDescriptionStyle());
+
+ if(descStyle != null) {
+ return (Node)node;
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * Creates the appropriate review decoration if all the criteria is
+ * satisfied by the view passed in.
+ */
+
+ public void refresh() {
+ removeDecoration();
+
+ Node node = getDecoratorTargetNode(getDecoratorTarget());
+ IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
+
+ if(node != null) {
+ DescriptionStyle descStyle = getDescriptionStyle(node);
+
+ if(descStyle != null) {
+ if(isInherited(node)) {
+ // if(Util.isAffixedChildNode(gep)) {
+
+ // setDecoration(getDecoratorTarget().addDecoration(figure,
+ // locator, false));
+ // } else {
+ // setDecoration(getDecoratorTarget().addShapeDecoration(figure,
+ // getDirection(node), -1, false));
+ // }
+
+ if(gep != null && gep.getRoot() != null) {// if the gep has
+ // no parent, we
+ // can't test if
+ // the container
+ // is a
+ // compartment
+ // list
+ // (because, we
+ // call the
+ // method
+ // DiagramEditPartsUtil.getEditPartFromView((View)container,
+ // gep);
+ IFigure figure = getFigure(ICON_HYPERLINK);
+ if(isInCompartmentList(node) && !Util.isAffixedChildNode(gep)) {
+ setDecoration(getDecoratorTarget().addShapeDecoration(figure, getDirection(node), -1, false));
+ } else {
+ Locator locator = new OverlayLocator(gep.getFigure(), getDirection(node));
+ setDecoration(getDecoratorTarget().addDecoration(figure, locator, false));
+ }
+ }
+
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns a figure corresponding to this image
+ *
+ * @param image
+ * a image
+ * @return a figure corresponding to this image
+ */
+ public IFigure getFigure(Image image) {
+ IMapMode mm = MapModeUtil.getMapMode(((IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class)).getFigure());
+ ImageFigure fig = new ImageFigure();
+ fig.setImage(image);
+ fig.setSize(mm.DPtoLP(image.getBounds().width), mm.DPtoLP(image.getBounds().height));
+ return fig;
+ }
+
+ /**
+ * Returns the direction to set the decorator for the node
+ *
+ * @param node
+ * the node
+ * @return the direction to set the decorator for the node direction can be
+ * :
+ * <ul>
+ * <li> {@link PositionConstants#NORTH_WEST} or {@link PositionConstants#SOUTH_EAST}</li> if the node is an Affixed Child Node
+ * <li>{@link PositionConstants#EAST}</li> if the node is in a compartment list
+ * <li>{@link PositionConstants#SOUTH_EAST}</li> in other cases
+ * </ul>
+ */
+ protected Direction getDirection(Node node) {
+ IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
+ assert gep != null;
+ // test if its an affixed ChildNode
+ // if(Util.isAffixedChildNode(gep)) {
+ //
+ // IBorderItemLocator loc =
+ // ((BorderNamedElementEditPart)gep).getBorderItemLocator();
+ // int location = loc.getCurrentSideOfParent();
+ // if(PositionConstants.NONE == location) { //sometimes
+ // getBorderItemLocator doesn't work correctly!
+ // location = PositionConstants.NORTH_WEST;
+ // }
+ // switch(location) {
+ // case PositionConstants.NORTH:
+ // case PositionConstants.NORTH_WEST:
+ // case PositionConstants.WEST:
+ // case PositionConstants.SOUTH_WEST:
+ // // return IDecoratorTarget.Direction.NORTH_WEST;
+ // default:
+ // return IDecoratorTarget.Direction.SOUTH_EAST;
+ // }
+ // }
+ if(gep.getParent() != null) {
+ if(isInCompartmentList(node) && !Util.isAffixedChildNode(gep)) {
+ return IDecoratorTarget.Direction.EAST;
+ }
+ }
+ return IDecoratorTarget.Direction.SOUTH_WEST;
+ }
+
+ /**
+ * Tests if the compartment is a compartment list
+ *
+ * @param node
+ * the node on which we want add an Overlay
+ * @return <code>true</code> if the compartment is managed by an {@link XYLayoutEditPolicy}
+ */
+ protected boolean isInCompartmentList(Node node) {
+ IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
+ if(gep != null && gep.getRoot() != null) {
+ EObject container = node.eContainer();
+ if(container instanceof View) {
+ EditPart EP = DiagramEditPartsUtil.getEditPartFromView((View)container, gep);
+ EditPolicy editPolicy = EP.getEditPolicy(EditPolicy.LAYOUT_ROLE);
+ if(!(editPolicy instanceof XYLayoutEditPolicy)) {// we are in a
+ // compartment
+ // list
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Tests if the node is an inherited element
+ *
+ * @param node
+ * a node
+ * @return <code>true</code> if the node is an inherited element <code>false</code> if not
+ */
+ protected boolean isInherited(Node node) {
+ EObject element = node.getElement();
+ if(element instanceof Element) {
+ EObject container = node.eContainer();
+ EObject graphicalParent = null;
+ if(container instanceof DecorationNode) {
+ graphicalParent = ((DecorationNode)container).getElement();
+ } else if(container instanceof View) {
+ graphicalParent = ((View)container).getElement();
+ }
+ if(graphicalParent instanceof Property || graphicalParent instanceof Classifier) {
+ Classifier classifier = null;
+ if(graphicalParent instanceof Property) {
+ Type type = ((Property)graphicalParent).getType();
+ if(type instanceof Classifier) {
+ classifier = (Classifier)type;
+ }
+ } else {
+ classifier = (Classifier)graphicalParent;
+ }
+ if(classifier != null) {
+ EList<NamedElement> inheritedMembers = classifier.getInheritedMembers();
+ return inheritedMembers.contains(element);
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * getDescriptionStyle Accessor to retrieve the description style from a
+ * Node.
+ *
+ * @param node
+ * Node to retrieve the description style from.
+ * @return DescriptionStyle style object
+ */
+ protected DescriptionStyle getDescriptionStyle(Node node) {
+ return (DescriptionStyle)node.getStyle(NotationPackage.eINSTANCE.getDescriptionStyle());
+ }
+
+ /**
+ * A listener used to listen the change of location and type (for Property)
+ */
+ private NotificationListener notificationListener = new NotificationListener() {
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param notification
+ */
+ public void notifyChanged(Notification notification) {
+
+ if(notification.getEventType() == Notification.REMOVE) {
+ if(notification.getNotifier() instanceof Classifier) {
+ IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
+ assert gep != null;
+ // we remove the listener on the container (because it's
+ // changing
+ DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener((EObject)notification.getNotifier(), notificationListener);
+ }
+ }
+ // we update the listeners It's useful when an Element with overlay
+ // changes of parent
+ deactivate();
+ activate();
+ refresh();
+ }
+
+ };
+
+ /**
+ * Adds listeners on
+ * <ul>
+ * <li>Affixed Child Node</li>
+ * <li>graphical parent, when its a {@link Property} (we add the listener on its Type)</li>
+ * </ul>
+ */
+ public void activate() {
+
+ IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
+ assert gep != null;
+ View view = ((View)gep.getModel());
+
+ if(view instanceof Node) {
+ // the location of the decorator can change if it's an Affixed Child
+ // Node
+ if(isInherited((Node)view) && Util.isAffixedChildNode(gep)) {
+ DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(gep.getNotationView(), notificationListener);
+ }
+ }
+
+ // if the graphical parent is a Property, we add a listener on the type
+ // of the property, to refresh the decoration
+ EObject parent = view.eContainer();
+ if(parent instanceof DecorationNode) {
+ parent = parent.eContainer();
+ }
+ if(parent instanceof View) {
+ EObject el = ((View)parent).getElement();
+ if(el instanceof Property) {
+ DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(el, UMLPackage.eINSTANCE.getTypedElement_Type(), notificationListener);
+ }
+ }
+
+ /*
+ * We listen the changes on the UML parent, in order to know if the
+ * element is changing of parent Adding a listener using the following
+ * EReference doesn't work UMLPackage.eINSTANCE.getElement_Owner();
+ * UMLPackage.eINSTANCE.getProperty_Class();
+ * UMLPackage.eINSTANCE.getNamedElement_Namespace(); that's why we
+ * listen the parent
+ */
+ if(view.getElement() instanceof Element) {
+ Element semanticElement = (Element)view.getElement();
+
+ /*
+ * We need add a listener only if the element is an element which
+ * can be inherited, like Property, Operation, Signal, Classifier...
+ */
+ if(semanticElement != null && canBeInherited(semanticElement)) {
+ // we listen if the container of the element changes!
+ if(semanticElement.eContainer() != null) {
+ DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(semanticElement.eContainer(), notificationListener);
+ }
+ }
+ }
+ }
+
+ /**
+ * Tests if the element can be inherited
+ *
+ * @param semanticElement
+ * the element to test
+ * @return <code>true</code> if the element can be inherited
+ */
+ protected boolean canBeInherited(Element semanticElement) {
+ /*
+ * maybe we could replace these tests by RedefinableElement? or not?
+ */
+
+ if(semanticElement instanceof Classifier) {
+ return true;
+ } else if(semanticElement instanceof Property) {
+ return true;
+ } else if(semanticElement instanceof Operation) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Removes the listeners and the decorations
+ */
+ public void deactivate() {
+ removeDecoration();
+
+ IGraphicalEditPart gep = (IGraphicalEditPart)getDecoratorTarget().getAdapter(IGraphicalEditPart.class);
+ assert gep != null;
+ DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(gep.getNotationView(), notificationListener);
+ View view = ((View)gep.getModel());
+
+ EObject parent = view.eContainer();
+ if(parent instanceof View) {
+ EObject el = ((View)parent).getElement();
+ if(el instanceof Property) {
+ DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(el, UMLPackage.eINSTANCE.getTypedElement_Type(), notificationListener);
+ }
+ }
+
+ if(view.getElement() instanceof Element) {
+ Element semanticElement = (Element)view.getElement();
+ if(semanticElement != null) {
+ if(semanticElement.eContainer() != null) {
+ DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(semanticElement.eContainer(), notificationListener);
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecoratorProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecoratorProvider.java
index 2f9ac493d32..b32623585bb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecoratorProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/InheritedDecoratorProvider.java
@@ -1,65 +1,65 @@
-/*****************************************************************************
- * Copyright (c) 2009-2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.notation.Node;
-
-/**
- *
- * Provide the decorator for the Inheritance
- *
- */
-public class InheritedDecoratorProvider extends AbstractProvider implements IDecoratorProvider {
-
- /** The key used for the mood decoration */
- public static final String GENERALIZATION = "Generalization"; //$NON-NLS-1$
-
- /**
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider#createDecorators(org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget)
- *
- * @param decoratorTarget
- */
- public void createDecorators(IDecoratorTarget decoratorTarget) {
- Node node = InheritedDecorator.getDecoratorTargetNode(decoratorTarget);
- if(node != null) {
- decoratorTarget.installDecorator(GENERALIZATION, new InheritedDecorator(decoratorTarget));
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gmf.runtime.common.core.internal.service.IProvider#provides
- * (org.eclipse.gmf.runtime.common.core.service.IOperation)
- */
- public boolean provides(IOperation operation) {
- Assert.isNotNull(operation);
-
- if(!(operation instanceof CreateDecoratorsOperation)) {
- return false;
- }
-
- IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation)operation).getDecoratorTarget();
- return InheritedDecorator.getDecoratorTargetNode(decoratorTarget) != null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider;
+import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
+import org.eclipse.gmf.runtime.notation.Node;
+
+/**
+ *
+ * Provide the decorator for the Inheritance
+ *
+ */
+public class InheritedDecoratorProvider extends AbstractProvider implements IDecoratorProvider {
+
+ /** The key used for the mood decoration */
+ public static final String GENERALIZATION = "Generalization"; //$NON-NLS-1$
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider#createDecorators(org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget)
+ *
+ * @param decoratorTarget
+ */
+ public void createDecorators(IDecoratorTarget decoratorTarget) {
+ Node node = InheritedDecorator.getDecoratorTargetNode(decoratorTarget);
+ if(node != null) {
+ decoratorTarget.installDecorator(GENERALIZATION, new InheritedDecorator(decoratorTarget));
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.common.core.internal.service.IProvider#provides
+ * (org.eclipse.gmf.runtime.common.core.service.IOperation)
+ */
+ public boolean provides(IOperation operation) {
+ Assert.isNotNull(operation);
+
+ if(!(operation instanceof CreateDecoratorsOperation)) {
+ return false;
+ }
+
+ IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation)operation).getDecoratorTarget();
+ return InheritedDecorator.getDecoratorTargetNode(decoratorTarget) != null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java
index b36bca9ab1f..4a5af50263f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/LocalPaletteProvider.java
@@ -1,172 +1,172 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.part.IPaletteDescription;
-import org.eclipse.ui.IEditorPart;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * Provider for Palette that uses a XML file for palette definition.
- */
-public class LocalPaletteProvider extends AbstractProvider implements IPaletteProvider, IPapyrusPaletteConstant {
-
- /**
- * The list of palette provider XML contributions
- */
- protected NodeList contributions = null;
-
- /** parser used for the xml file */
- protected XMLDefinitionPaletteParser parser;
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- public void contributeToPalette(IEditorPart editor, Object content, PaletteRoot root, Map predefinedEntries) {
- parser = new XMLDefinitionPaletteParser(new XMLDefinitionPaletteFactory(root, predefinedEntries));
- for(int i = 0; i < contributions.getLength(); i++) {
- Node node = contributions.item(i);
- if(PALETTE_DEFINITION.equals(node.getNodeName())) {
- parser.parsePaletteDefinition(node);
- }
- }
- }
-
- /**
- * Adds the configuration elements to the list of palette provider XML
- * contributions
- *
- * @param configElement
- * the configuration element from which information are retrieved
- */
- public void setContributions(IConfigurationElement configElement) {
- // tries to read the XML configuration file
- readXMLDocument(configElement.getAttribute(PATH));
- }
-
- /**
- * locally defines palette
- *
- * @param description
- * the description of the palette to build
- */
- public void setContributions(IPaletteDescription description) {
- readXMLDocument(description.getContributions());
- }
-
- /**
- * Reads the XML configuration for the specified element
- *
- * @param contribution
- * the path for the xml file
- */
- protected void readXMLDocument(Object contribution) {
- if(contribution instanceof String) {
- readXMLDocument((String)contribution);
- }
- }
-
- /**
- * Reads the XML configuration for the specified element
- *
- * @param iConfigurationElement
- * the path for the xml file
- */
- protected void readXMLDocument(String path) {
- DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- try {
- DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
-
- InputStream inputStream = getXmlFile(path);
- // the file should never be null in this implementation, but
- // sub-classes could return null
- if(inputStream == null) {
- throw new IOException("Impossible to load file: " + path);
- } else {
- Document document = documentBuilder.parse(inputStream);
- contributions = document.getChildNodes();
- }
- } catch (ParserConfigurationException e) {
- Activator.log.error(e);
- contributions = new EmptyNodeList();
- } catch (IOException e) {
- Activator.log.error(e);
- contributions = new EmptyNodeList();
- } catch (SAXException e) {
- Activator.log.error(e);
- contributions = new EmptyNodeList();
- }
- }
-
- /**
- * Returns the file using the specified path in the plugin state location
- *
- * @param path
- * the path to the file
- * @return the file using the specified path in the plugin state location,
- * even if it does not exists. In the latter case, the method {@link File#exists()} returns <code>false</code>.
- */
- public InputStream getXmlFile(String path) throws IOException {
- return new FileInputStream(Activator.getDefault().getStateLocation().append(path).toFile());
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean provides(IOperation operation) {
- return false;
- }
-
- /**
- * empty node list implementation
- */
- public class EmptyNodeList implements NodeList {
-
- /**
- * {@inheritDoc}
- */
- public int getLength() {
- return 0;
- }
-
- /**
- * {@inheritDoc}
- */
- public Node item(int index) {
- return null;
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.diagram.ui.services.palette.IPaletteProvider;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.part.IPaletteDescription;
+import org.eclipse.ui.IEditorPart;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * Provider for Palette that uses a XML file for palette definition.
+ */
+public class LocalPaletteProvider extends AbstractProvider implements IPaletteProvider, IPapyrusPaletteConstant {
+
+ /**
+ * The list of palette provider XML contributions
+ */
+ protected NodeList contributions = null;
+
+ /** parser used for the xml file */
+ protected XMLDefinitionPaletteParser parser;
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public void contributeToPalette(IEditorPart editor, Object content, PaletteRoot root, Map predefinedEntries) {
+ parser = new XMLDefinitionPaletteParser(new XMLDefinitionPaletteFactory(root, predefinedEntries));
+ for(int i = 0; i < contributions.getLength(); i++) {
+ Node node = contributions.item(i);
+ if(PALETTE_DEFINITION.equals(node.getNodeName())) {
+ parser.parsePaletteDefinition(node);
+ }
+ }
+ }
+
+ /**
+ * Adds the configuration elements to the list of palette provider XML
+ * contributions
+ *
+ * @param configElement
+ * the configuration element from which information are retrieved
+ */
+ public void setContributions(IConfigurationElement configElement) {
+ // tries to read the XML configuration file
+ readXMLDocument(configElement.getAttribute(PATH));
+ }
+
+ /**
+ * locally defines palette
+ *
+ * @param description
+ * the description of the palette to build
+ */
+ public void setContributions(IPaletteDescription description) {
+ readXMLDocument(description.getContributions());
+ }
+
+ /**
+ * Reads the XML configuration for the specified element
+ *
+ * @param contribution
+ * the path for the xml file
+ */
+ protected void readXMLDocument(Object contribution) {
+ if(contribution instanceof String) {
+ readXMLDocument((String)contribution);
+ }
+ }
+
+ /**
+ * Reads the XML configuration for the specified element
+ *
+ * @param iConfigurationElement
+ * the path for the xml file
+ */
+ protected void readXMLDocument(String path) {
+ DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+ documentBuilderFactory.setNamespaceAware(true);
+ try {
+ DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+
+ InputStream inputStream = getXmlFile(path);
+ // the file should never be null in this implementation, but
+ // sub-classes could return null
+ if(inputStream == null) {
+ throw new IOException("Impossible to load file: " + path);
+ } else {
+ Document document = documentBuilder.parse(inputStream);
+ contributions = document.getChildNodes();
+ }
+ } catch (ParserConfigurationException e) {
+ Activator.log.error(e);
+ contributions = new EmptyNodeList();
+ } catch (IOException e) {
+ Activator.log.error(e);
+ contributions = new EmptyNodeList();
+ } catch (SAXException e) {
+ Activator.log.error(e);
+ contributions = new EmptyNodeList();
+ }
+ }
+
+ /**
+ * Returns the file using the specified path in the plugin state location
+ *
+ * @param path
+ * the path to the file
+ * @return the file using the specified path in the plugin state location,
+ * even if it does not exists. In the latter case, the method {@link File#exists()} returns <code>false</code>.
+ */
+ public InputStream getXmlFile(String path) throws IOException {
+ return new FileInputStream(Activator.getDefault().getStateLocation().append(path).toFile());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean provides(IOperation operation) {
+ return false;
+ }
+
+ /**
+ * empty node list implementation
+ */
+ public class EmptyNodeList implements NodeList {
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getLength() {
+ return 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Node item(int index) {
+ return null;
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PaletteProfileApplicationListener.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PaletteProfileApplicationListener.java
index 4d07822ab35..c4dd85525a2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PaletteProfileApplicationListener.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PaletteProfileApplicationListener.java
@@ -1,52 +1,52 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent;
-import org.eclipse.papyrus.commands.Activator;
-import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
-import org.eclipse.uml2.uml.ProfileApplication;
-
-/**
- * Listener for the palette Service that updates palette contribution in case of
- * profile application/unapplication
- */
-public class PaletteProfileApplicationListener implements IPapyrusListener {
-
- /**
- * Creates a new PaletteProfileApplicationListener.
- */
- public PaletteProfileApplicationListener() {
- }
-
- /**
- * {@inheritDoc}
- */
- public void notifyChanged(Notification notification) {
- // check notification is relevant for us
- // notifier shoud be instance of profileApplication. In this case,
- // reload the palette
- if(notification.getNotifier() instanceof ProfileApplication) {
- if(Notification.SET == notification.getEventType()) {
- try {
- PapyrusPaletteService.getInstance().providerChanged(new ProviderChangeEvent(PapyrusPaletteService.getInstance()));
- } catch (Exception ex) {
- //Bug 407849: If a listener throws an exception, the operation is rolled back. In this case, we simply want to update the palettes and exceptions should only be logged
- Activator.log.error(ex);
- }
- }
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.gmf.runtime.common.core.service.ProviderChangeEvent;
+import org.eclipse.papyrus.commands.Activator;
+import org.eclipse.papyrus.infra.core.listenerservice.IPapyrusListener;
+import org.eclipse.uml2.uml.ProfileApplication;
+
+/**
+ * Listener for the palette Service that updates palette contribution in case of
+ * profile application/unapplication
+ */
+public class PaletteProfileApplicationListener implements IPapyrusListener {
+
+ /**
+ * Creates a new PaletteProfileApplicationListener.
+ */
+ public PaletteProfileApplicationListener() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void notifyChanged(Notification notification) {
+ // check notification is relevant for us
+ // notifier shoud be instance of profileApplication. In this case,
+ // reload the palette
+ if(notification.getNotifier() instanceof ProfileApplication) {
+ if(Notification.SET == notification.getEventType()) {
+ try {
+ PapyrusPaletteService.getInstance().providerChanged(new ProviderChangeEvent(PapyrusPaletteService.getInstance()));
+ } catch (Exception ex) {
+ //Bug 407849: If a listener throws an exception, the operation is rolled back. In this case, we simply want to update the palettes and exceptions should only be logged
+ Activator.log.error(ex);
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java
index d508baea45b..7887e80c16e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/PluginPaletteProvider.java
@@ -1,124 +1,124 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.osgi.framework.Bundle;
-import org.w3c.dom.Node;
-
-/**
- * Provider extending the {@link LocalPaletteProvider} to reference xml-defined
- * palettes into plugins, using the papyrus palette extension point
- */
-public class PluginPaletteProvider extends LocalPaletteProvider implements IProfileDependantPaletteProvider {
-
- /** id of the contributor */
- private String providerID;
-
- /** cached list of required profiles for this palette to be shown */
- protected Collection<String> requiredProfiles;
-
- /**
- * Return the provider ID that declares this provider
- *
- * @return the id of the plugin that realizes this contribution to the
- * palette
- */
- protected String getProviderID() {
- return providerID;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public InputStream getXmlFile(String path) throws IOException {
- // try to read it in a plugin...
- Bundle bundle = Platform.getBundle(getProviderID());
- if(bundle != null) {
- URL urlFile = bundle.getEntry(path);
- urlFile = FileLocator.resolve(urlFile);
- urlFile = FileLocator.toFileURL(urlFile);
- if("file".equals(urlFile.getProtocol())) { //$NON-NLS-1$
- return new FileInputStream(urlFile.getFile());
- } else if("jar".equals(urlFile.getProtocol())) { //$NON-NLS-1$
- String filePath = urlFile.getPath();
- if(filePath.startsWith("file:")) {
- // strip off the file: and the !/
- int jarPathEndIndex = filePath.indexOf("!/");
- if(jarPathEndIndex < 0) {
- Activator.log.error("Impossible to find the jar path end", null);
- return null;
- }
- String jarPath = filePath.substring("file:".length(), jarPathEndIndex);
- ZipFile zipFile = new ZipFile(jarPath);
- filePath = filePath.substring(jarPathEndIndex + 2, filePath.length());
- ZipEntry entry = zipFile.getEntry(filePath);
- return zipFile.getInputStream(entry);
- // return new File(filePath);
- }
- }
- }
- return null;
- }
-
- /**
- * Adds the configuration elements to the list of palette provider XML
- * contributions
- *
- * @param configElement
- * the configuration element from which information are retrieved
- */
- public void setContributions(IConfigurationElement configElement) {
- providerID = configElement.getContributor().getName();
- readXMLDocument(configElement.getAttribute(PATH));
- }
-
- /**
- * {@inheritDoc}
- */
- public Collection<String> getRequiredProfiles() {
- if(requiredProfiles == null) {
- requiredProfiles = new HashSet<String>();
-
- try {
- // parse the content of the file to discover the required
- // profiles
- // using safe computation
- XMLDefinitionPaletteParser profileParser = new XMLDefinitionPaletteParser(new XMLRequiredProfileFactory(requiredProfiles));
- for(int i = 0; i < contributions.getLength(); i++) {
- Node node = contributions.item(i);
- if(PALETTE_DEFINITION.equals(node.getNodeName())) {
- profileParser.parsePaletteDefinition(node);
- }
- }
- } catch (Throwable e) {
- Activator.log.error(e);
- }
- }
- return requiredProfiles;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.osgi.framework.Bundle;
+import org.w3c.dom.Node;
+
+/**
+ * Provider extending the {@link LocalPaletteProvider} to reference xml-defined
+ * palettes into plugins, using the papyrus palette extension point
+ */
+public class PluginPaletteProvider extends LocalPaletteProvider implements IProfileDependantPaletteProvider {
+
+ /** id of the contributor */
+ private String providerID;
+
+ /** cached list of required profiles for this palette to be shown */
+ protected Collection<String> requiredProfiles;
+
+ /**
+ * Return the provider ID that declares this provider
+ *
+ * @return the id of the plugin that realizes this contribution to the
+ * palette
+ */
+ protected String getProviderID() {
+ return providerID;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public InputStream getXmlFile(String path) throws IOException {
+ // try to read it in a plugin...
+ Bundle bundle = Platform.getBundle(getProviderID());
+ if(bundle != null) {
+ URL urlFile = bundle.getEntry(path);
+ urlFile = FileLocator.resolve(urlFile);
+ urlFile = FileLocator.toFileURL(urlFile);
+ if("file".equals(urlFile.getProtocol())) { //$NON-NLS-1$
+ return new FileInputStream(urlFile.getFile());
+ } else if("jar".equals(urlFile.getProtocol())) { //$NON-NLS-1$
+ String filePath = urlFile.getPath();
+ if(filePath.startsWith("file:")) {
+ // strip off the file: and the !/
+ int jarPathEndIndex = filePath.indexOf("!/");
+ if(jarPathEndIndex < 0) {
+ Activator.log.error("Impossible to find the jar path end", null);
+ return null;
+ }
+ String jarPath = filePath.substring("file:".length(), jarPathEndIndex);
+ ZipFile zipFile = new ZipFile(jarPath);
+ filePath = filePath.substring(jarPathEndIndex + 2, filePath.length());
+ ZipEntry entry = zipFile.getEntry(filePath);
+ return zipFile.getInputStream(entry);
+ // return new File(filePath);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Adds the configuration elements to the list of palette provider XML
+ * contributions
+ *
+ * @param configElement
+ * the configuration element from which information are retrieved
+ */
+ public void setContributions(IConfigurationElement configElement) {
+ providerID = configElement.getContributor().getName();
+ readXMLDocument(configElement.getAttribute(PATH));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Collection<String> getRequiredProfiles() {
+ if(requiredProfiles == null) {
+ requiredProfiles = new HashSet<String>();
+
+ try {
+ // parse the content of the file to discover the required
+ // profiles
+ // using safe computation
+ XMLDefinitionPaletteParser profileParser = new XMLDefinitionPaletteParser(new XMLRequiredProfileFactory(requiredProfiles));
+ for(int i = 0; i < contributions.getLength(); i++) {
+ Node node = contributions.item(i);
+ if(PALETTE_DEFINITION.equals(node.getNodeName())) {
+ profileParser.parsePaletteDefinition(node);
+ }
+ }
+ } catch (Throwable e) {
+ Activator.log.error(e);
+ }
+ }
+ return requiredProfiles;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteFactory.java
index 6b1eed0fbf1..01aa3267423 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteFactory.java
@@ -1,302 +1,302 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
-import org.eclipse.gef.palette.PaletteContainer;
-import org.eclipse.gef.palette.PaletteDrawer;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.palette.PaletteSeparator;
-import org.eclipse.gef.palette.PaletteStack;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.w3c.dom.Node;
-
-/**
- * Standard implementation of the palette factory. This one should be use to
- * provide palette content
- */
-public class XMLDefinitionPaletteFactory extends AbstractXMLDefinitionPaletteFactory implements IPapyrusPaletteConstant {
-
- /** palette root for the palette to be built */
- protected PaletteRoot root;
-
- /** map of predefined entries */
- protected Map<String, PaletteEntry> predefinedEntries;
-
- /**
- * Creates a new XMLDefinitionPaletteFactory
- *
- * @param root
- * the palette root to fill
- * @param predefinedEntries
- * existing predefined entries
- */
- public XMLDefinitionPaletteFactory(PaletteRoot root, Map<String, PaletteEntry> predefinedEntries) {
- this.root = root;
- this.predefinedEntries = predefinedEntries;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseContentNode(Node node) {
- // nothing to do here
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseDrawerNode(Node node) {
- String id = node.getAttributes().getNamedItem(ID).getNodeValue();
- PaletteEntry entry = predefinedEntries.get(id);
- if(entry == null) {
- String name = node.getAttributes().getNamedItem(NAME).getNodeValue();
- String iconPath = node.getAttributes().getNamedItem(ICON_PATH).getNodeValue();
- entry = new PaletteDrawer(name);
- entry.setId(id);
- entry.setDescription("Drawer " + name);
- if(iconPath != null && !iconPath.equals("")) {
- entry.setSmallIcon(Activator.getImageDescriptor(iconPath));
- entry.setLargeIcon(Activator.getImageDescriptor(iconPath));
- }
- predefinedEntries.put(id, entry);
- }
- appendPaletteEntry(root, predefinedEntries, computePath(node), entry);
- }
-
- /**
- * returns the path for the given
- *
- * @param node
- * the node for which the path is computed
- * @return the path to this element
- */
- protected String computePath(Node node) {
- String path = "/";
- Node parentNode = node;
- while(parentNode.getParentNode() != null && !parentNode.getParentNode().getNodeName().equals(CONTENT)) {
- parentNode = parentNode.getParentNode();
- path = "/" + parentNode.getAttributes().getNamedItem(ID).getNodeValue() + path;
- }
- return path;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseSeparatorNode(Node node) {
- String id = node.getAttributes().getNamedItem(ID).getNodeValue();
- PaletteEntry entry = predefinedEntries.get(id);
- if(entry == null) {
- entry = new PaletteSeparator(id);
- predefinedEntries.put(id, entry);
- }
- appendPaletteEntry(root, predefinedEntries, computePath(node), entry);
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseStackNode(Node node) {
- String id = node.getAttributes().getNamedItem(ID).getNodeValue();
- PaletteEntry entry = predefinedEntries.get(id);
- if(entry == null) {
- // everything can be null for the constructor
- entry = new PaletteStack(null, null, null);
- entry.setId(id);
- predefinedEntries.put(id, entry);
- }
- appendPaletteEntry(root, predefinedEntries, computePath(node), entry);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseToolEntryNode(Node node) {
- String id = node.getAttributes().getNamedItem(ID).getNodeValue();
- PaletteEntry entry = predefinedEntries.get(id);
- appendPaletteEntry(root, predefinedEntries, computePath(node), entry);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseAspectToolEntryNode(Node node) {
- final String id = node.getAttributes().getNamedItem(ID).getNodeValue();
- final String refToolID = node.getAttributes().getNamedItem(REF_TOOL_ID).getNodeValue();
-
- Node nameNode = node.getAttributes().getNamedItem(NAME);
- Node descNode = node.getAttributes().getNamedItem(DESCRIPTION);
- Node iconPathNode = node.getAttributes().getNamedItem(ICON_PATH);
-
- final Map<Object, Object> properties = new HashMap<Object, Object>();
- if(node.getChildNodes().getLength() > 0) {
- properties.put(ASPECT_ACTION_KEY, node.getChildNodes());
- }
-
- final CombinedTemplateCreationEntry entry = (CombinedTemplateCreationEntry)predefinedEntries.get(refToolID);
- if(entry == null) {
- Activator.log.error("could not find entry " + refToolID, null);
- return;
- }
-
- ImageDescriptor iconDesc = null;
- String name = null;
- String desc = null;
-
- if(iconPathNode != null) {
- iconDesc = Activator.getImageDescriptor(iconPathNode.getNodeValue());
- } else {
- iconDesc = entry.getSmallIcon();
- }
- if(nameNode != null) {
- name = nameNode.getNodeValue();
- } else {
- name = entry.getLabel();
- }
- if(descNode != null) {
- desc = descNode.getNodeValue();
- } else {
- desc = entry.getDescription();
- }
-
- CombinedTemplateCreationEntry realEntry = new AspectCreationEntry(name, desc, id, iconDesc, entry, properties);
-
- predefinedEntries.put(id, realEntry);
- appendPaletteEntry(root, predefinedEntries, computePath(node), realEntry);
- }
-
- /**
- * Appends the given palette entry to the appropriate location in either a
- * predefined palette entry or the palette root.
- *
- * @param root
- * @param predefinedEntries
- * map of predefined palette entries where the key is the palette
- * entry id and the value is the palette entry
- * @param path
- * @param paletteEntry
- */
- private static void appendPaletteEntry(PaletteRoot root, Map predefinedEntries, String path, PaletteEntry paletteEntry) {
- PaletteEntry fEntry = findPaletteEntry(root, path);
- if(fEntry == null) {
- fEntry = findPredefinedEntry(predefinedEntries, path);
- }
- if(fEntry == null) {
- Activator.log.error("Invalid palette entry path: " + path, null);
- } else if(fEntry instanceof PaletteContainer) {
- // remove if it already exists
- if(!((PaletteContainer)fEntry).getChildren().contains(paletteEntry)) {
- ((PaletteContainer)fEntry).add(paletteEntry);
- }
- } else if(fEntry instanceof PaletteSeparator) {
- appendTo((PaletteSeparator)fEntry, paletteEntry);
- } else
- fEntry.getParent().add(fEntry.getParent().getChildren().indexOf(fEntry) + 1, paletteEntry);
- }
-
- /**
- * Finds a palette container starting from the given root and using the
- * given path
- *
- * @param root
- * @param aPath
- * @return the container or <code>null</code> if not found
- */
- private static PaletteEntry findPaletteEntry(PaletteEntry root, String aPath) {
- StringTokenizer tokens = new StringTokenizer(aPath, "/"); //$NON-NLS-1$
- while(tokens.hasMoreElements()) {
- if(root instanceof PaletteContainer)
- root = findChildPaletteEntry((PaletteContainer)root, tokens.nextToken());
- else
- return null;
- }
- return root;
- }
-
- /**
- * Finds a palette entry starting from the given container and using the
- * given path
- *
- * @param root
- * @param path
- * @return the entry or <code>null</code> if not found
- */
- private static PaletteEntry findChildPaletteEntry(PaletteContainer container, String childId) {
- Iterator entries = container.getChildren().iterator();
- while(entries.hasNext()) {
- PaletteEntry entry = (PaletteEntry)entries.next();
- if(entry.getId().equals(childId))
- return entry;
- }
- return null;
- }
-
- /**
- * Searches the predefined entries for a palette entry given the full path
- * as it was predefined.
- *
- * @param predefinedEntries
- * map of predefined palette entries where the key is the palette
- * entry id and the value is the palette entry
- * @param path
- * the path to the palette entry starting as it was predefined
- * @return the palette entry if one exists; null otherwise.
- */
- private static PaletteEntry findPredefinedEntry(Map predefinedEntries, String path) {
- StringTokenizer tokens = new StringTokenizer(path, "/"); //$NON-NLS-1$
-
- PaletteEntry root = (PaletteEntry)predefinedEntries.get(tokens.nextToken());
-
- while(tokens.hasMoreElements()) {
- if(root instanceof PaletteContainer)
- root = findChildPaletteEntry((PaletteContainer)root, tokens.nextToken());
- else
- return null;
- }
- return root;
- }
-
- /**
- * Appends the given entry to the end of the group of the given separator.
- *
- * @param separator
- * @param entry
- */
- private static void appendTo(PaletteSeparator separator, PaletteEntry entry) {
- List children = separator.getParent().getChildren();
- int index = children.indexOf(separator);
- for(index++; index < children.size(); index++) {
- if(children.get(index) instanceof PaletteSeparator)
- break;
- }
- separator.getParent().add(index, entry);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
+import org.eclipse.gef.palette.PaletteContainer;
+import org.eclipse.gef.palette.PaletteDrawer;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gef.palette.PaletteSeparator;
+import org.eclipse.gef.palette.PaletteStack;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.w3c.dom.Node;
+
+/**
+ * Standard implementation of the palette factory. This one should be use to
+ * provide palette content
+ */
+public class XMLDefinitionPaletteFactory extends AbstractXMLDefinitionPaletteFactory implements IPapyrusPaletteConstant {
+
+ /** palette root for the palette to be built */
+ protected PaletteRoot root;
+
+ /** map of predefined entries */
+ protected Map<String, PaletteEntry> predefinedEntries;
+
+ /**
+ * Creates a new XMLDefinitionPaletteFactory
+ *
+ * @param root
+ * the palette root to fill
+ * @param predefinedEntries
+ * existing predefined entries
+ */
+ public XMLDefinitionPaletteFactory(PaletteRoot root, Map<String, PaletteEntry> predefinedEntries) {
+ this.root = root;
+ this.predefinedEntries = predefinedEntries;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseContentNode(Node node) {
+ // nothing to do here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseDrawerNode(Node node) {
+ String id = node.getAttributes().getNamedItem(ID).getNodeValue();
+ PaletteEntry entry = predefinedEntries.get(id);
+ if(entry == null) {
+ String name = node.getAttributes().getNamedItem(NAME).getNodeValue();
+ String iconPath = node.getAttributes().getNamedItem(ICON_PATH).getNodeValue();
+ entry = new PaletteDrawer(name);
+ entry.setId(id);
+ entry.setDescription("Drawer " + name);
+ if(iconPath != null && !iconPath.equals("")) {
+ entry.setSmallIcon(Activator.getImageDescriptor(iconPath));
+ entry.setLargeIcon(Activator.getImageDescriptor(iconPath));
+ }
+ predefinedEntries.put(id, entry);
+ }
+ appendPaletteEntry(root, predefinedEntries, computePath(node), entry);
+ }
+
+ /**
+ * returns the path for the given
+ *
+ * @param node
+ * the node for which the path is computed
+ * @return the path to this element
+ */
+ protected String computePath(Node node) {
+ String path = "/";
+ Node parentNode = node;
+ while(parentNode.getParentNode() != null && !parentNode.getParentNode().getNodeName().equals(CONTENT)) {
+ parentNode = parentNode.getParentNode();
+ path = "/" + parentNode.getAttributes().getNamedItem(ID).getNodeValue() + path;
+ }
+ return path;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseSeparatorNode(Node node) {
+ String id = node.getAttributes().getNamedItem(ID).getNodeValue();
+ PaletteEntry entry = predefinedEntries.get(id);
+ if(entry == null) {
+ entry = new PaletteSeparator(id);
+ predefinedEntries.put(id, entry);
+ }
+ appendPaletteEntry(root, predefinedEntries, computePath(node), entry);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseStackNode(Node node) {
+ String id = node.getAttributes().getNamedItem(ID).getNodeValue();
+ PaletteEntry entry = predefinedEntries.get(id);
+ if(entry == null) {
+ // everything can be null for the constructor
+ entry = new PaletteStack(null, null, null);
+ entry.setId(id);
+ predefinedEntries.put(id, entry);
+ }
+ appendPaletteEntry(root, predefinedEntries, computePath(node), entry);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseToolEntryNode(Node node) {
+ String id = node.getAttributes().getNamedItem(ID).getNodeValue();
+ PaletteEntry entry = predefinedEntries.get(id);
+ appendPaletteEntry(root, predefinedEntries, computePath(node), entry);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseAspectToolEntryNode(Node node) {
+ final String id = node.getAttributes().getNamedItem(ID).getNodeValue();
+ final String refToolID = node.getAttributes().getNamedItem(REF_TOOL_ID).getNodeValue();
+
+ Node nameNode = node.getAttributes().getNamedItem(NAME);
+ Node descNode = node.getAttributes().getNamedItem(DESCRIPTION);
+ Node iconPathNode = node.getAttributes().getNamedItem(ICON_PATH);
+
+ final Map<Object, Object> properties = new HashMap<Object, Object>();
+ if(node.getChildNodes().getLength() > 0) {
+ properties.put(ASPECT_ACTION_KEY, node.getChildNodes());
+ }
+
+ final CombinedTemplateCreationEntry entry = (CombinedTemplateCreationEntry)predefinedEntries.get(refToolID);
+ if(entry == null) {
+ Activator.log.error("could not find entry " + refToolID, null);
+ return;
+ }
+
+ ImageDescriptor iconDesc = null;
+ String name = null;
+ String desc = null;
+
+ if(iconPathNode != null) {
+ iconDesc = Activator.getImageDescriptor(iconPathNode.getNodeValue());
+ } else {
+ iconDesc = entry.getSmallIcon();
+ }
+ if(nameNode != null) {
+ name = nameNode.getNodeValue();
+ } else {
+ name = entry.getLabel();
+ }
+ if(descNode != null) {
+ desc = descNode.getNodeValue();
+ } else {
+ desc = entry.getDescription();
+ }
+
+ CombinedTemplateCreationEntry realEntry = new AspectCreationEntry(name, desc, id, iconDesc, entry, properties);
+
+ predefinedEntries.put(id, realEntry);
+ appendPaletteEntry(root, predefinedEntries, computePath(node), realEntry);
+ }
+
+ /**
+ * Appends the given palette entry to the appropriate location in either a
+ * predefined palette entry or the palette root.
+ *
+ * @param root
+ * @param predefinedEntries
+ * map of predefined palette entries where the key is the palette
+ * entry id and the value is the palette entry
+ * @param path
+ * @param paletteEntry
+ */
+ private static void appendPaletteEntry(PaletteRoot root, Map predefinedEntries, String path, PaletteEntry paletteEntry) {
+ PaletteEntry fEntry = findPaletteEntry(root, path);
+ if(fEntry == null) {
+ fEntry = findPredefinedEntry(predefinedEntries, path);
+ }
+ if(fEntry == null) {
+ Activator.log.error("Invalid palette entry path: " + path, null);
+ } else if(fEntry instanceof PaletteContainer) {
+ // remove if it already exists
+ if(!((PaletteContainer)fEntry).getChildren().contains(paletteEntry)) {
+ ((PaletteContainer)fEntry).add(paletteEntry);
+ }
+ } else if(fEntry instanceof PaletteSeparator) {
+ appendTo((PaletteSeparator)fEntry, paletteEntry);
+ } else
+ fEntry.getParent().add(fEntry.getParent().getChildren().indexOf(fEntry) + 1, paletteEntry);
+ }
+
+ /**
+ * Finds a palette container starting from the given root and using the
+ * given path
+ *
+ * @param root
+ * @param aPath
+ * @return the container or <code>null</code> if not found
+ */
+ private static PaletteEntry findPaletteEntry(PaletteEntry root, String aPath) {
+ StringTokenizer tokens = new StringTokenizer(aPath, "/"); //$NON-NLS-1$
+ while(tokens.hasMoreElements()) {
+ if(root instanceof PaletteContainer)
+ root = findChildPaletteEntry((PaletteContainer)root, tokens.nextToken());
+ else
+ return null;
+ }
+ return root;
+ }
+
+ /**
+ * Finds a palette entry starting from the given container and using the
+ * given path
+ *
+ * @param root
+ * @param path
+ * @return the entry or <code>null</code> if not found
+ */
+ private static PaletteEntry findChildPaletteEntry(PaletteContainer container, String childId) {
+ Iterator entries = container.getChildren().iterator();
+ while(entries.hasNext()) {
+ PaletteEntry entry = (PaletteEntry)entries.next();
+ if(entry.getId().equals(childId))
+ return entry;
+ }
+ return null;
+ }
+
+ /**
+ * Searches the predefined entries for a palette entry given the full path
+ * as it was predefined.
+ *
+ * @param predefinedEntries
+ * map of predefined palette entries where the key is the palette
+ * entry id and the value is the palette entry
+ * @param path
+ * the path to the palette entry starting as it was predefined
+ * @return the palette entry if one exists; null otherwise.
+ */
+ private static PaletteEntry findPredefinedEntry(Map predefinedEntries, String path) {
+ StringTokenizer tokens = new StringTokenizer(path, "/"); //$NON-NLS-1$
+
+ PaletteEntry root = (PaletteEntry)predefinedEntries.get(tokens.nextToken());
+
+ while(tokens.hasMoreElements()) {
+ if(root instanceof PaletteContainer)
+ root = findChildPaletteEntry((PaletteContainer)root, tokens.nextToken());
+ else
+ return null;
+ }
+ return root;
+ }
+
+ /**
+ * Appends the given entry to the end of the group of the given separator.
+ *
+ * @param separator
+ * @param entry
+ */
+ private static void appendTo(PaletteSeparator separator, PaletteEntry entry) {
+ List children = separator.getParent().getChildren();
+ int index = children.indexOf(separator);
+ for(index++; index < children.size(); index++) {
+ if(children.get(index) instanceof PaletteSeparator)
+ break;
+ }
+ separator.getParent().add(index, entry);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteParser.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteParser.java
index fd4d0d13fb8..3719c37bdda 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteParser.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLDefinitionPaletteParser.java
@@ -1,149 +1,149 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Parser for the local definition of palettes.
- */
-public class XMLDefinitionPaletteParser implements IPapyrusPaletteConstant {
-
- /** factory used to create elements from the parsed xml file */
- final protected AbstractXMLDefinitionPaletteFactory factory;
-
- /**
- * Create a new XMLDefinitionPaletteParser
- *
- * @param factory
- * the factory used to create elements from the parsing of the
- * xml file
- */
- public XMLDefinitionPaletteParser(AbstractXMLDefinitionPaletteFactory factory) {
- this.factory = factory;
- }
-
- /**
- * Parse the given node, assuming its type is a palette definition
- *
- * @param node
- * the node to parse
- */
- public void parsePaletteDefinition(Node paletteDefinitionNode) {
- NodeList nodes = paletteDefinitionNode.getChildNodes();
- for(int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
- if(CONTENT.equals(node.getNodeName())) {
- factory.traverseContentNode(node);
- parsePaletteContent(node);
- }
- }
- }
-
- /**
- * Parse the given node, assuming its type is a palette content
- *
- * @param node
- * the node to parse
- * @param root
- * the palette root to fill
- */
- public void parsePaletteContent(Node paletteContentNode) {
- NodeList nodes = paletteContentNode.getChildNodes();
- for(int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
- String name = node.getNodeName();
- if(DRAWER.equals(name)) {
- parserDrawerNode(node);
- } else if(STACK.equals(name)) {
- parserStackNode(node);
- } else if(SEPARATOR.equals(name)) {
- parseSeparatorNode(node);
- } else if(TOOL.equals(name)) {
- parseToolNode(node);
- } else if(ASPECT_TOOL.equals(name)) {
- parseAspectToolNode(node);
- }
-
- }
- }
-
- /**
- * Parse the given aspect node, assuming its type is a palette aspect tool
- *
- * @param node
- * the node to parse
- */
- public void parseAspectToolNode(Node node) {
- factory.traverseAspectToolEntryNode(node);
- }
-
- /**
- * Parse the given node, assuming its type is a palette drawer
- *
- * @param node
- * the node to parse
- */
- public void parserDrawerNode(Node node) {
- factory.traverseDrawerNode(node);
- if(node.getChildNodes().getLength() > 0) {
- parsePaletteContent(node);
- }
- // return entry;
- }
-
- /**
- * Parse the given node, assuming its type is a stack
- *
- * @param node
- * the node to parse
- */
- public void parserStackNode(Node node) {
- factory.traverseStackNode(node);
-
- if(node.getChildNodes().getLength() > 0) {
- parsePaletteContent(node);
- }
- }
-
- /**
- * Parse the given node, assuming its type is a node
- *
- * @param node
- * the node to parse
- */
- public void parseToolNode(Node node) {
- factory.traverseToolEntryNode(node);
-
- if(node.getChildNodes().getLength() > 0) {
- parsePaletteContent(node);
- }
- }
-
- /**
- * Parse the given node, assuming its type is a separator
- *
- * @param node
- * the node to parse
- */
- public void parseSeparatorNode(Node node) {
- factory.traverseSeparatorNode(node);
-
- if(node.getChildNodes().getLength() > 0) {
- parsePaletteContent(node);
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Parser for the local definition of palettes.
+ */
+public class XMLDefinitionPaletteParser implements IPapyrusPaletteConstant {
+
+ /** factory used to create elements from the parsed xml file */
+ final protected AbstractXMLDefinitionPaletteFactory factory;
+
+ /**
+ * Create a new XMLDefinitionPaletteParser
+ *
+ * @param factory
+ * the factory used to create elements from the parsing of the
+ * xml file
+ */
+ public XMLDefinitionPaletteParser(AbstractXMLDefinitionPaletteFactory factory) {
+ this.factory = factory;
+ }
+
+ /**
+ * Parse the given node, assuming its type is a palette definition
+ *
+ * @param node
+ * the node to parse
+ */
+ public void parsePaletteDefinition(Node paletteDefinitionNode) {
+ NodeList nodes = paletteDefinitionNode.getChildNodes();
+ for(int i = 0; i < nodes.getLength(); i++) {
+ Node node = nodes.item(i);
+ if(CONTENT.equals(node.getNodeName())) {
+ factory.traverseContentNode(node);
+ parsePaletteContent(node);
+ }
+ }
+ }
+
+ /**
+ * Parse the given node, assuming its type is a palette content
+ *
+ * @param node
+ * the node to parse
+ * @param root
+ * the palette root to fill
+ */
+ public void parsePaletteContent(Node paletteContentNode) {
+ NodeList nodes = paletteContentNode.getChildNodes();
+ for(int i = 0; i < nodes.getLength(); i++) {
+ Node node = nodes.item(i);
+ String name = node.getNodeName();
+ if(DRAWER.equals(name)) {
+ parserDrawerNode(node);
+ } else if(STACK.equals(name)) {
+ parserStackNode(node);
+ } else if(SEPARATOR.equals(name)) {
+ parseSeparatorNode(node);
+ } else if(TOOL.equals(name)) {
+ parseToolNode(node);
+ } else if(ASPECT_TOOL.equals(name)) {
+ parseAspectToolNode(node);
+ }
+
+ }
+ }
+
+ /**
+ * Parse the given aspect node, assuming its type is a palette aspect tool
+ *
+ * @param node
+ * the node to parse
+ */
+ public void parseAspectToolNode(Node node) {
+ factory.traverseAspectToolEntryNode(node);
+ }
+
+ /**
+ * Parse the given node, assuming its type is a palette drawer
+ *
+ * @param node
+ * the node to parse
+ */
+ public void parserDrawerNode(Node node) {
+ factory.traverseDrawerNode(node);
+ if(node.getChildNodes().getLength() > 0) {
+ parsePaletteContent(node);
+ }
+ // return entry;
+ }
+
+ /**
+ * Parse the given node, assuming its type is a stack
+ *
+ * @param node
+ * the node to parse
+ */
+ public void parserStackNode(Node node) {
+ factory.traverseStackNode(node);
+
+ if(node.getChildNodes().getLength() > 0) {
+ parsePaletteContent(node);
+ }
+ }
+
+ /**
+ * Parse the given node, assuming its type is a node
+ *
+ * @param node
+ * the node to parse
+ */
+ public void parseToolNode(Node node) {
+ factory.traverseToolEntryNode(node);
+
+ if(node.getChildNodes().getLength() > 0) {
+ parsePaletteContent(node);
+ }
+ }
+
+ /**
+ * Parse the given node, assuming its type is a separator
+ *
+ * @param node
+ * the node to parse
+ */
+ public void parseSeparatorNode(Node node) {
+ factory.traverseSeparatorNode(node);
+
+ if(node.getChildNodes().getLength() > 0) {
+ parsePaletteContent(node);
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLPaletteProviderConfiguration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLPaletteProviderConfiguration.java
index fa95b4a2336..caedb378ddf 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLPaletteProviderConfiguration.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLPaletteProviderConfiguration.java
@@ -1,220 +1,220 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration;
-import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * A provider configuration for the PapyrusPaletteService.
- */
-public class XMLPaletteProviderConfiguration extends AbstractProviderConfiguration {
-
- /** the target editor */
- private EditorDescriptor editor;
-
- /** name of this contribution */
- private String name;
-
- /** ID of this palette contribution */
- private String id;
-
- /** priority of the provider */
- private ProviderPriority priority = ProviderPriority.LOWEST;
-
- /**
- * boolean set to true if the {@link XMLPaletteProviderConfiguration} creates new entries or uses predefined ones.
- */
- protected boolean displayEntries = false;
-
- /**
- * Creates a new <code>ProviderContributionDescriptor</code> instance given
- * a provider configuration element
- *
- * @param configElement
- * The provider XML configuration element
- */
- protected XMLPaletteProviderConfiguration(IConfigurationElement configElement) {
- IConfigurationElement configChildren[];
-
- // read the editor object if any
- configChildren = configElement.getChildren(IPapyrusPaletteConstant.EDITOR);
- if(configChildren.length > 0) {
- editor = new EditorDescriptor(configChildren[0]);
- }
-
- name = configElement.getDeclaringExtension().getLabel();
- if(name == null || name.equals("")) {
- name = configElement.getDeclaringExtension().getContributor().getName();
- }
-
- if(name == null || name.equals("")) {
- name = "<Unnamed>";
- } else if(name.equals("%ext.presentationPaletteProvider")) {
- name = "Presentation Palette";
- } else if(name.equals("org.eclipse.gmf.runtime.diagram.ui.geoshapes")) {
- name = "Geoshapes";
- }
-
- id = configElement.getDeclaringExtension().getUniqueIdentifier();
- if(id == null || id.equals("")) {
- id = configElement.getDeclaringExtension().getContributor().getName();
- }
-
- configChildren = configElement.getChildren(IPapyrusPaletteConstant.PRIORITY);
- // sometimes, there is a confusion between priority and Priority...
- if(configChildren.length > 0) {
- configChildren = configElement.getChildren("Priority");
- }
- if(configChildren.length > 0) {
- priority = ProviderPriority.parse(configChildren[0].getAttribute(NAME));
- }
- }
-
- /**
- * Returns the name for this configuration
- *
- * @return the name for this configuration or <code>null</code>.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Get the target Editor
- * @return
- */
- public EditorDescriptor getEditor() {
- return editor;
- }
-
- /**
- * Returns the ID for this configuration
- *
- * @return the ID for this configuration or <code>null</code>.
- */
- /**
- * Returns the name for this configuration
- *
- * @return the name for this configuration or <code>null</code>.
- */
- public String getID() {
- return id;
- }
-
- /**
- * Builds a new provider contribution descriptor by parsing its
- * configuration element
- *
- * @param configElement
- * A provider configuration element
- * @return A provider XML contribution descriptor
- */
- public static XMLPaletteProviderConfiguration parse(IConfigurationElement configElement) {
- Assert.isNotNull(configElement, "null provider configuration element"); //$NON-NLS-1$
- return new XMLPaletteProviderConfiguration(configElement);
- }
-
- /**
- * Determines if the provider understands the given context
- *
- * @param targetEditor
- * The target editor
- * @param targetContent
- * The target editor's content
- * @return boolean <code>true</code> if it supports; <code>false</code> otherwise
- */
- public boolean supports(IEditorPart targetEditor, Object targetContent) {
- if(editor != null && !editor.sameAs(targetEditor))
- return false;
- return true;
- }
-
- /**
- * An descriptor for an editor in XML by a contribution item provider.
- */
- protected static class EditorDescriptor extends ObjectDescriptor {
-
- /** the target id */
- private final String targetId;
-
- /**
- * Initializes a new editor descriptor by reading the configuration
- * element
- *
- * @param configElement
- * The contribution configuration element
- */
- public EditorDescriptor(IConfigurationElement configElement) {
- super(configElement);
- targetId = configElement.getAttribute(ID);
- }
-
- /**
- * Get the id of the target editor
- * @return
- */
- public String getTargetId() {
- return targetId;
- }
-
- /**
- * Determines whether this contribution is applicable to the given
- * editor
- *
- * @param editor
- * The target editor
- * @return <code>true</code> if applicable <code>false</code> if not
- */
- public boolean sameAs(Object object) {
- if(!(object instanceof DiagramEditorWithFlyOutPalette)) {
- return false;
- }
-
- // will never work, ID of the site is the multi diagram editor...
- if(targetId != null) {
- if(!targetId.equals(((DiagramEditorWithFlyOutPalette)object).getContributorId())) {
- return false;
- }
- }
- return super.sameAs(object);
- }
- }
-
- /**
- * Returns <code>true</code> if this configuration provides only
- * predefinition of entries and neither use predefined entries nor creates
- * new entries.
- *
- * @return <code>true</code> if this configuration provides only
- * predefinition of entries and neither use predefined entries nor
- * creates new entries.
- */
- public boolean hasOnlyEntriesDefinition() {
- return !displayEntries;
- }
-
- /**
- * returns the priority for this configuration
- *
- * @return the priority for this configuration
- */
- public ProviderPriority getPriority() {
- return priority;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration;
+import org.eclipse.gmf.runtime.common.core.service.ProviderPriority;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * A provider configuration for the PapyrusPaletteService.
+ */
+public class XMLPaletteProviderConfiguration extends AbstractProviderConfiguration {
+
+ /** the target editor */
+ private EditorDescriptor editor;
+
+ /** name of this contribution */
+ private String name;
+
+ /** ID of this palette contribution */
+ private String id;
+
+ /** priority of the provider */
+ private ProviderPriority priority = ProviderPriority.LOWEST;
+
+ /**
+ * boolean set to true if the {@link XMLPaletteProviderConfiguration} creates new entries or uses predefined ones.
+ */
+ protected boolean displayEntries = false;
+
+ /**
+ * Creates a new <code>ProviderContributionDescriptor</code> instance given
+ * a provider configuration element
+ *
+ * @param configElement
+ * The provider XML configuration element
+ */
+ protected XMLPaletteProviderConfiguration(IConfigurationElement configElement) {
+ IConfigurationElement configChildren[];
+
+ // read the editor object if any
+ configChildren = configElement.getChildren(IPapyrusPaletteConstant.EDITOR);
+ if(configChildren.length > 0) {
+ editor = new EditorDescriptor(configChildren[0]);
+ }
+
+ name = configElement.getDeclaringExtension().getLabel();
+ if(name == null || name.equals("")) {
+ name = configElement.getDeclaringExtension().getContributor().getName();
+ }
+
+ if(name == null || name.equals("")) {
+ name = "<Unnamed>";
+ } else if(name.equals("%ext.presentationPaletteProvider")) {
+ name = "Presentation Palette";
+ } else if(name.equals("org.eclipse.gmf.runtime.diagram.ui.geoshapes")) {
+ name = "Geoshapes";
+ }
+
+ id = configElement.getDeclaringExtension().getUniqueIdentifier();
+ if(id == null || id.equals("")) {
+ id = configElement.getDeclaringExtension().getContributor().getName();
+ }
+
+ configChildren = configElement.getChildren(IPapyrusPaletteConstant.PRIORITY);
+ // sometimes, there is a confusion between priority and Priority...
+ if(configChildren.length > 0) {
+ configChildren = configElement.getChildren("Priority");
+ }
+ if(configChildren.length > 0) {
+ priority = ProviderPriority.parse(configChildren[0].getAttribute(NAME));
+ }
+ }
+
+ /**
+ * Returns the name for this configuration
+ *
+ * @return the name for this configuration or <code>null</code>.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get the target Editor
+ * @return
+ */
+ public EditorDescriptor getEditor() {
+ return editor;
+ }
+
+ /**
+ * Returns the ID for this configuration
+ *
+ * @return the ID for this configuration or <code>null</code>.
+ */
+ /**
+ * Returns the name for this configuration
+ *
+ * @return the name for this configuration or <code>null</code>.
+ */
+ public String getID() {
+ return id;
+ }
+
+ /**
+ * Builds a new provider contribution descriptor by parsing its
+ * configuration element
+ *
+ * @param configElement
+ * A provider configuration element
+ * @return A provider XML contribution descriptor
+ */
+ public static XMLPaletteProviderConfiguration parse(IConfigurationElement configElement) {
+ Assert.isNotNull(configElement, "null provider configuration element"); //$NON-NLS-1$
+ return new XMLPaletteProviderConfiguration(configElement);
+ }
+
+ /**
+ * Determines if the provider understands the given context
+ *
+ * @param targetEditor
+ * The target editor
+ * @param targetContent
+ * The target editor's content
+ * @return boolean <code>true</code> if it supports; <code>false</code> otherwise
+ */
+ public boolean supports(IEditorPart targetEditor, Object targetContent) {
+ if(editor != null && !editor.sameAs(targetEditor))
+ return false;
+ return true;
+ }
+
+ /**
+ * An descriptor for an editor in XML by a contribution item provider.
+ */
+ protected static class EditorDescriptor extends ObjectDescriptor {
+
+ /** the target id */
+ private final String targetId;
+
+ /**
+ * Initializes a new editor descriptor by reading the configuration
+ * element
+ *
+ * @param configElement
+ * The contribution configuration element
+ */
+ public EditorDescriptor(IConfigurationElement configElement) {
+ super(configElement);
+ targetId = configElement.getAttribute(ID);
+ }
+
+ /**
+ * Get the id of the target editor
+ * @return
+ */
+ public String getTargetId() {
+ return targetId;
+ }
+
+ /**
+ * Determines whether this contribution is applicable to the given
+ * editor
+ *
+ * @param editor
+ * The target editor
+ * @return <code>true</code> if applicable <code>false</code> if not
+ */
+ public boolean sameAs(Object object) {
+ if(!(object instanceof DiagramEditorWithFlyOutPalette)) {
+ return false;
+ }
+
+ // will never work, ID of the site is the multi diagram editor...
+ if(targetId != null) {
+ if(!targetId.equals(((DiagramEditorWithFlyOutPalette)object).getContributorId())) {
+ return false;
+ }
+ }
+ return super.sameAs(object);
+ }
+ }
+
+ /**
+ * Returns <code>true</code> if this configuration provides only
+ * predefinition of entries and neither use predefined entries nor creates
+ * new entries.
+ *
+ * @return <code>true</code> if this configuration provides only
+ * predefinition of entries and neither use predefined entries nor
+ * creates new entries.
+ */
+ public boolean hasOnlyEntriesDefinition() {
+ return !displayEntries;
+ }
+
+ /**
+ * returns the priority for this configuration
+ *
+ * @return the priority for this configuration
+ */
+ public ProviderPriority getPriority() {
+ return priority;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLRequiredProfileFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLRequiredProfileFactory.java
index 14e044ea7bc..4e0940c594f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLRequiredProfileFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/XMLRequiredProfileFactory.java
@@ -1,114 +1,114 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.AspectToolService;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectAction;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider;
-import org.eclipse.papyrus.uml.diagram.common.service.palette.StereotypePostAction;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Factory that collects all required profiles for the given palette
- */
-public class XMLRequiredProfileFactory extends AbstractXMLDefinitionPaletteFactory implements IPapyrusPaletteConstant {
-
- final protected Collection<String> requiredProfiles;
-
- /**
- * Creates a new XMLRequiredProfileFactory.
- *
- * @param requiredProfiles
- * list of required profiles to complete
- */
- public XMLRequiredProfileFactory(Collection<String> requiredProfiles) {
- this.requiredProfiles = requiredProfiles;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseContentNode(Node node) {
- // nothing specific here
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseDrawerNode(Node node) {
- // nothing specific here
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseToolEntryNode(Node node) {
- // nothing specific here
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseStackNode(Node node) {
- // nothing specific here
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseSeparatorNode(Node node) {
- // nothing specific here
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void traverseAspectToolEntryNode(Node node) {
- if(node.getChildNodes().getLength() > 0) {
- NodeList children = node.getChildNodes();
- for(int i = 0; i < children.getLength(); i++) {
- Node childNode = children.item(i);
- String childName = childNode.getNodeName();
- if(IPapyrusPaletteConstant.POST_ACTION.equals(childName)) {
- // node is a post action => retrieve the id of the provider
- // in charge of this configuration
- IAspectActionProvider provider = AspectToolService.getInstance().getProvider(AspectToolService.getProviderId(childNode));
- if(provider != null) {
- IAspectAction action = provider.createAction(childNode);
- if(action instanceof StereotypePostAction) {
- List<String> stereotypesToApply = ((StereotypePostAction)action).getStereotypesToApply();
- for(String stereotypeQN : stereotypesToApply) {
- String profileName = PaletteUtil.findProfileNameFromStereotypeName(stereotypeQN);
- requiredProfiles.add(profileName);
- }
- }
- } else {
- Activator.log.error("impossible to find factory with id: " + AspectToolService.getProviderId(childNode), null);
- }
- }
- }
- }
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.AspectToolService;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectAction;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider;
+import org.eclipse.papyrus.uml.diagram.common.service.palette.StereotypePostAction;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Factory that collects all required profiles for the given palette
+ */
+public class XMLRequiredProfileFactory extends AbstractXMLDefinitionPaletteFactory implements IPapyrusPaletteConstant {
+
+ final protected Collection<String> requiredProfiles;
+
+ /**
+ * Creates a new XMLRequiredProfileFactory.
+ *
+ * @param requiredProfiles
+ * list of required profiles to complete
+ */
+ public XMLRequiredProfileFactory(Collection<String> requiredProfiles) {
+ this.requiredProfiles = requiredProfiles;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseContentNode(Node node) {
+ // nothing specific here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseDrawerNode(Node node) {
+ // nothing specific here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseToolEntryNode(Node node) {
+ // nothing specific here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseStackNode(Node node) {
+ // nothing specific here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseSeparatorNode(Node node) {
+ // nothing specific here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void traverseAspectToolEntryNode(Node node) {
+ if(node.getChildNodes().getLength() > 0) {
+ NodeList children = node.getChildNodes();
+ for(int i = 0; i < children.getLength(); i++) {
+ Node childNode = children.item(i);
+ String childName = childNode.getNodeName();
+ if(IPapyrusPaletteConstant.POST_ACTION.equals(childName)) {
+ // node is a post action => retrieve the id of the provider
+ // in charge of this configuration
+ IAspectActionProvider provider = AspectToolService.getInstance().getProvider(AspectToolService.getProviderId(childNode));
+ if(provider != null) {
+ IAspectAction action = provider.createAction(childNode);
+ if(action instanceof StereotypePostAction) {
+ List<String> stereotypesToApply = ((StereotypePostAction)action).getStereotypesToApply();
+ for(String stereotypeQN : stereotypesToApply) {
+ String profileName = PaletteUtil.findProfileNameFromStereotypeName(stereotypeQN);
+ requiredProfiles.add(profileName);
+ }
+ }
+ } else {
+ Activator.log.error("impossible to find factory with id: " + AspectToolService.getProviderId(childNode), null);
+ }
+ }
+ }
+ }
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractAspectActionProvider.java
index 7dc67f1ea6d..f8f6c182c47 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractAspectActionProvider.java
@@ -1,91 +1,91 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Abstract class for the aspect action providers
- */
-public abstract class AbstractAspectActionProvider extends AbstractProvider implements IAspectActionProvider {
-
- /** field for name */
- protected static final String NAME = "name";
-
- /** field for icon path */
- protected static final String ICON = "icon";
-
- /** field for identifier */
- protected static final String ID = "id";
-
- /** field for description */
- protected static final String DESCRIPTION = "description";
-
- /** field for Activator ID */
- protected String bundleId ;
-
- /** name for the factory */
- protected String name;
-
- /** identifier for the factory */
- protected String id;
-
- /** description of the factory */
- protected String description;
-
- /** icon of the factory */
- protected String iconPath;
-
- /**
- * @{inheritDoc
- */
- public boolean provides(IOperation operation) {
- return (operation instanceof GetAllAspectToolProvidersOperation || operation instanceof GetAspectToolProviderOperation);
- }
-
- /**
- * @{inheritDoc
- */
- public String getFactoryId() {
- return id;
- }
-
- /**
- * @{inheritDoc
- */
- public Image getImage() {
- return Activator.getPluginIconImage(bundleId, iconPath);
- }
-
- /**
- * @{inheritDoc
- */
- public String getName() {
- return name;
- }
-
- /**
- * @{inheritDoc
- */
- public void setConfiguration(IConfigurationElement configElement) {
- // retrieve name
- name = configElement.getAttribute(NAME);
- id = configElement.getAttribute(ID);
- iconPath = configElement.getAttribute(ICON);
- description = configElement.getAttribute(DESCRIPTION);
- bundleId = configElement.getContributor().getName();
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Abstract class for the aspect action providers
+ */
+public abstract class AbstractAspectActionProvider extends AbstractProvider implements IAspectActionProvider {
+
+ /** field for name */
+ protected static final String NAME = "name";
+
+ /** field for icon path */
+ protected static final String ICON = "icon";
+
+ /** field for identifier */
+ protected static final String ID = "id";
+
+ /** field for description */
+ protected static final String DESCRIPTION = "description";
+
+ /** field for Activator ID */
+ protected String bundleId ;
+
+ /** name for the factory */
+ protected String name;
+
+ /** identifier for the factory */
+ protected String id;
+
+ /** description of the factory */
+ protected String description;
+
+ /** icon of the factory */
+ protected String iconPath;
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean provides(IOperation operation) {
+ return (operation instanceof GetAllAspectToolProvidersOperation || operation instanceof GetAspectToolProviderOperation);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getFactoryId() {
+ return id;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Image getImage() {
+ return Activator.getPluginIconImage(bundleId, iconPath);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void setConfiguration(IConfigurationElement configElement) {
+ // retrieve name
+ name = configElement.getAttribute(NAME);
+ id = configElement.getAttribute(ID);
+ iconPath = configElement.getAttribute(ICON);
+ description = configElement.getAttribute(DESCRIPTION);
+ bundleId = configElement.getContributor().getName();
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractPreConditionAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractPreConditionAction.java
index aae6bdb1233..95b6895be74 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractPreConditionAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AbstractPreConditionAction.java
@@ -1,169 +1,169 @@
-/*****************************************************************************
- * Copyright (c) 2012 Atos
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Philippe ROLAND (Atos) philippe.roland@atos.net - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
-import org.w3c.dom.Node;
-
-/**
- * Abstract aspect action class for preconditions
- *
- * @author proland
- */
-public abstract class AbstractPreConditionAction implements IPreAction {
-
- /** factory used to create this action */
- protected IAspectActionProvider factory;
-
- /**
- * @{inheritDoc
- */
- public void init(Node configurationNode, IAspectActionProvider factory) {
- this.factory = factory;
- }
-
- /**
- * @{inheritDoc
- */
- public Image getImage() {
- return factory.getImage();
- }
-
- /**
- * @{inheritDoc
- */
- public String getLabel() {
- return factory.getName();
- }
-
- /**
- * @{inheritDoc
- */
- public String getFactoryId() {
- return factory.getFactoryId();
- }
-
- public IStatus checkPostCondition() {
- //Do nothing
- return null;
- }
-
- public IStatus checkPreCondition() {
- //Do nothing; this is already covered by the command itself,
- //which can return an Unexecutable command
- return null;
- }
-
- public ICommand getConnectionPreCommand(View sourceView, View targetView) {
- List<IStatus> preConditionStatusList = checkConnectionPreCondition(sourceView, targetView);
- return handlePreconditionFailure(preConditionStatusList);
- }
-
- /**
- * Check the preCondition
- *
- * @param sourceView
- * the future connection's source's View
- * @param targetView
- * the future connection's target's View
- * @return
- */
- protected abstract List<IStatus> checkConnectionPreCondition(View sourceView, View targetView);
-
- public ICommand getNodePreCommand(View containerView) {
- List<IStatus> preConditionStatusList = checkNodePreCondition(containerView);
- return handlePreconditionFailure(preConditionStatusList);
- }
-
- /**
- * Check the preCondition
- *
- * @param containerView
- * the future node's container's View
- * @return
- */
- protected abstract List<IStatus> checkNodePreCondition(View containerView);
-
- /**
- * If the precondition check fails, call this method. It generates an appropiate log window and offers the user to continue regardless if
- * allowContinue() returns true
- *
- * @param preConditionStatusList
- * the list of IStatus resulting from the precondition check
- * @return the appropriate command; null if no problems were encountered or the user chose to continue, UnexecutableCommand otherwise.
- */
- protected ICommand handlePreconditionFailure(List<IStatus> preConditionStatusList) {
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("The following precondition(s) failed with the error messages:");
- boolean failed = false;
- for(IStatus status : preConditionStatusList) {
- if(!status.isOK()) {
- stringBuilder.append("\n\r\n\r" + status.getMessage());
- failed = true;
- }
- }
-
- if(failed) {
- //If this precondition allows the user to continue regardless
- if(allowContinue()) {
- stringBuilder.append("\n\r\n\rDo you wish to continue?");
-
- //attempts to use NotificationBuilder cause the transaction to fail for reasons yet unknown (a rollback causes the view's element to be unset,
- //prompting NPEs in following postActions. See commented code below)
- MessageBox dialog = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
- dialog.setText("Precondition failure");
- dialog.setMessage(stringBuilder.toString());
- int returnCode = dialog.open();
- if(returnCode == SWT.OK) {
- return null;
- }
-
- /** XXX This is cleaner and allows for the use of html tags for improved readability, but causes errors */
- // NotificationBuilder builder = NotificationBuilder
- // .createYesNo(stringBuilder.toString())
- // .setHTML(true)
- // .setMessage(stringBuilder.toString());
- // INotification notification = builder.run();
- // if(notification instanceof PopupNotification) {
- // PopupNotification popupNotification = (PopupNotification)notification;
- // if(popupNotification.getResult() == SWT.YES) {
- // return null;
- // }
- // }
- return new UnexecutableCommand(Status.CANCEL_STATUS);
- } else {
- MessageBox dialog = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR | SWT.OK);
- dialog.setText("Precondition failure");
- dialog.setMessage(stringBuilder.toString());
- dialog.open();
- return new UnexecutableCommand(Status.CANCEL_STATUS);
- }
- }
- return null;
- }
-
- /**
- * @return true if this preCondition should allow the user to continue even if it returns false
- */
- protected abstract boolean allowContinue();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 Atos
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Philippe ROLAND (Atos) philippe.roland@atos.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.MessageBox;
+import org.w3c.dom.Node;
+
+/**
+ * Abstract aspect action class for preconditions
+ *
+ * @author proland
+ */
+public abstract class AbstractPreConditionAction implements IPreAction {
+
+ /** factory used to create this action */
+ protected IAspectActionProvider factory;
+
+ /**
+ * @{inheritDoc
+ */
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ this.factory = factory;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Image getImage() {
+ return factory.getImage();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getLabel() {
+ return factory.getName();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getFactoryId() {
+ return factory.getFactoryId();
+ }
+
+ public IStatus checkPostCondition() {
+ //Do nothing
+ return null;
+ }
+
+ public IStatus checkPreCondition() {
+ //Do nothing; this is already covered by the command itself,
+ //which can return an Unexecutable command
+ return null;
+ }
+
+ public ICommand getConnectionPreCommand(View sourceView, View targetView) {
+ List<IStatus> preConditionStatusList = checkConnectionPreCondition(sourceView, targetView);
+ return handlePreconditionFailure(preConditionStatusList);
+ }
+
+ /**
+ * Check the preCondition
+ *
+ * @param sourceView
+ * the future connection's source's View
+ * @param targetView
+ * the future connection's target's View
+ * @return
+ */
+ protected abstract List<IStatus> checkConnectionPreCondition(View sourceView, View targetView);
+
+ public ICommand getNodePreCommand(View containerView) {
+ List<IStatus> preConditionStatusList = checkNodePreCondition(containerView);
+ return handlePreconditionFailure(preConditionStatusList);
+ }
+
+ /**
+ * Check the preCondition
+ *
+ * @param containerView
+ * the future node's container's View
+ * @return
+ */
+ protected abstract List<IStatus> checkNodePreCondition(View containerView);
+
+ /**
+ * If the precondition check fails, call this method. It generates an appropiate log window and offers the user to continue regardless if
+ * allowContinue() returns true
+ *
+ * @param preConditionStatusList
+ * the list of IStatus resulting from the precondition check
+ * @return the appropriate command; null if no problems were encountered or the user chose to continue, UnexecutableCommand otherwise.
+ */
+ protected ICommand handlePreconditionFailure(List<IStatus> preConditionStatusList) {
+ StringBuilder stringBuilder = new StringBuilder();
+ stringBuilder.append("The following precondition(s) failed with the error messages:");
+ boolean failed = false;
+ for(IStatus status : preConditionStatusList) {
+ if(!status.isOK()) {
+ stringBuilder.append("\n\r\n\r" + status.getMessage());
+ failed = true;
+ }
+ }
+
+ if(failed) {
+ //If this precondition allows the user to continue regardless
+ if(allowContinue()) {
+ stringBuilder.append("\n\r\n\rDo you wish to continue?");
+
+ //attempts to use NotificationBuilder cause the transaction to fail for reasons yet unknown (a rollback causes the view's element to be unset,
+ //prompting NPEs in following postActions. See commented code below)
+ MessageBox dialog = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_QUESTION | SWT.OK | SWT.CANCEL);
+ dialog.setText("Precondition failure");
+ dialog.setMessage(stringBuilder.toString());
+ int returnCode = dialog.open();
+ if(returnCode == SWT.OK) {
+ return null;
+ }
+
+ /** XXX This is cleaner and allows for the use of html tags for improved readability, but causes errors */
+ // NotificationBuilder builder = NotificationBuilder
+ // .createYesNo(stringBuilder.toString())
+ // .setHTML(true)
+ // .setMessage(stringBuilder.toString());
+ // INotification notification = builder.run();
+ // if(notification instanceof PopupNotification) {
+ // PopupNotification popupNotification = (PopupNotification)notification;
+ // if(popupNotification.getResult() == SWT.YES) {
+ // return null;
+ // }
+ // }
+ return new UnexecutableCommand(Status.CANCEL_STATUS);
+ } else {
+ MessageBox dialog = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR | SWT.OK);
+ dialog.setText("Precondition failure");
+ dialog.setMessage(stringBuilder.toString());
+ dialog.open();
+ return new UnexecutableCommand(Status.CANCEL_STATUS);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return true if this preCondition should allow the user to continue even if it returns false
+ */
+ protected abstract boolean allowContinue();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectActionFactoryRegistry.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectActionFactoryRegistry.java
index fe2efa61de8..f9bc0bd4cc8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectActionFactoryRegistry.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectActionFactoryRegistry.java
@@ -1,85 +1,85 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Registry for the Aspect action factories.
- * <p>
- * This could be initialized and handled using extension points, instead of statically registered factories
- * </p>
- */
-public class AspectActionFactoryRegistry {
-
- /** singleton instance of this factory */
- public static AspectActionFactoryRegistry instance;
-
- /** Factories */
- protected Map<String, IAspectActionProvider> factories;
-
- /**
- * Constructor.
- */
- protected AspectActionFactoryRegistry() {
- instance = this;
- factories = new HashMap<String, IAspectActionProvider>();
- init(); // this should be replaced by extension point mechanism
-
- }
-
- /**
- * Initialize the factory
- */
- protected void init() {
- // factories.put(StereotypeAspectActionProvider.FACTORY_ID, new
- // StereotypeAspectActionProvider());
- // factories.put(SemanticAspectActionProvider.FACTORY_ID, new
- // SemanticAspectActionProvider());
- // factories.put(GraphicalAspectActionFactory.GraphicalAspectActionProvider,
- // new GraphicalAspectActionProvider());
- // factories.put(DisplayAppliedStereotypeAspectActionProvider.FACTORY_ID,
- // new DisplayAppliedStereotypeAspectActionProvider());
- // factories.put(ChangeStereotypeDisplayAspectActionProvider.FACTORY_ID,
- // new ChangeStereotypeDisplayAspectActionProvider());
- // factories.put(AssociationEndAspectActionProvider.FACTORY_ID, new
- // AssociationEndAspectActionProvider());
- }
-
- /**
- * Returns the singleton instance of this registry
- *
- * @return the singleton instance of this class
- */
- public static AspectActionFactoryRegistry getInstance() {
- if(instance == null) {
- instance = new AspectActionFactoryRegistry();
- }
- return instance;
- }
-
- public IAspectActionProvider getFactory(String id) {
- return factories.get(id);
- }
-
- /**
- * Returns the list of registered aspect actions
- *
- * @return the list of registered aspect actions
- */
- public Collection<IAspectActionProvider> getAspectActionFactories() {
- return factories.values();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Registry for the Aspect action factories.
+ * <p>
+ * This could be initialized and handled using extension points, instead of statically registered factories
+ * </p>
+ */
+public class AspectActionFactoryRegistry {
+
+ /** singleton instance of this factory */
+ public static AspectActionFactoryRegistry instance;
+
+ /** Factories */
+ protected Map<String, IAspectActionProvider> factories;
+
+ /**
+ * Constructor.
+ */
+ protected AspectActionFactoryRegistry() {
+ instance = this;
+ factories = new HashMap<String, IAspectActionProvider>();
+ init(); // this should be replaced by extension point mechanism
+
+ }
+
+ /**
+ * Initialize the factory
+ */
+ protected void init() {
+ // factories.put(StereotypeAspectActionProvider.FACTORY_ID, new
+ // StereotypeAspectActionProvider());
+ // factories.put(SemanticAspectActionProvider.FACTORY_ID, new
+ // SemanticAspectActionProvider());
+ // factories.put(GraphicalAspectActionFactory.GraphicalAspectActionProvider,
+ // new GraphicalAspectActionProvider());
+ // factories.put(DisplayAppliedStereotypeAspectActionProvider.FACTORY_ID,
+ // new DisplayAppliedStereotypeAspectActionProvider());
+ // factories.put(ChangeStereotypeDisplayAspectActionProvider.FACTORY_ID,
+ // new ChangeStereotypeDisplayAspectActionProvider());
+ // factories.put(AssociationEndAspectActionProvider.FACTORY_ID, new
+ // AssociationEndAspectActionProvider());
+ }
+
+ /**
+ * Returns the singleton instance of this registry
+ *
+ * @return the singleton instance of this class
+ */
+ public static AspectActionFactoryRegistry getInstance() {
+ if(instance == null) {
+ instance = new AspectActionFactoryRegistry();
+ }
+ return instance;
+ }
+
+ public IAspectActionProvider getFactory(String id) {
+ return factories.get(id);
+ }
+
+ /**
+ * Returns the list of registered aspect actions
+ *
+ * @return the list of registered aspect actions
+ */
+ public Collection<IAspectActionProvider> getAspectActionFactories() {
+ return factories.values();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolProviderConfiguration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolProviderConfiguration.java
index ccfa4ce46a4..68015652e42 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolProviderConfiguration.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolProviderConfiguration.java
@@ -1,65 +1,65 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration;
-
-/**
- * Provider configuration for the aspect tool factory extension point.
- */
-public class AspectToolProviderConfiguration extends AbstractProviderConfiguration {
-
- /** field for identifier */
- protected static final String ID = "id";
-
- /** identifier of the factory */
- protected final String id;
-
- /**
- * Creates and builds a new provider contribution descriptor ( <code>DecoratorProviderConfiguration</code>) by parsing its configuration
- * element.
- *
- * @param configElement
- * A provider XML configuration element
- * @return A provider XML contribution descriptor
- */
- public static AspectToolProviderConfiguration parse(IConfigurationElement configElement) {
- Assert.isNotNull(configElement, "null provider configuration element"); //$NON-NLS-1$
- return new AspectToolProviderConfiguration(configElement);
- }
-
- /**
- * Creates a new <code>ProviderContributionDescriptor</code> instance by
- * parsing its configuration element.
- *
- * @param configElement
- * The provider XML configuration element
- */
- protected AspectToolProviderConfiguration(IConfigurationElement configElement) {
- // retrieve only ID, to test if the factory is the right one before
- // creating whole element
- id = configElement.getAttribute(ID);
- Assert.isNotNull(id, "impossible to get the identifier for the factory");
- }
-
- /**
- * Returns the ID of the factory configured by this configuration
- *
- * @return the id of the factory
- */
- public String getId() {
- return id;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.gmf.runtime.common.core.service.AbstractProviderConfiguration;
+
+/**
+ * Provider configuration for the aspect tool factory extension point.
+ */
+public class AspectToolProviderConfiguration extends AbstractProviderConfiguration {
+
+ /** field for identifier */
+ protected static final String ID = "id";
+
+ /** identifier of the factory */
+ protected final String id;
+
+ /**
+ * Creates and builds a new provider contribution descriptor ( <code>DecoratorProviderConfiguration</code>) by parsing its configuration
+ * element.
+ *
+ * @param configElement
+ * A provider XML configuration element
+ * @return A provider XML contribution descriptor
+ */
+ public static AspectToolProviderConfiguration parse(IConfigurationElement configElement) {
+ Assert.isNotNull(configElement, "null provider configuration element"); //$NON-NLS-1$
+ return new AspectToolProviderConfiguration(configElement);
+ }
+
+ /**
+ * Creates a new <code>ProviderContributionDescriptor</code> instance by
+ * parsing its configuration element.
+ *
+ * @param configElement
+ * The provider XML configuration element
+ */
+ protected AspectToolProviderConfiguration(IConfigurationElement configElement) {
+ // retrieve only ID, to test if the factory is the right one before
+ // creating whole element
+ id = configElement.getAttribute(ID);
+ Assert.isNotNull(id, "impossible to get the identifier for the factory");
+ }
+
+ /**
+ * Returns the ID of the factory configured by this configuration
+ *
+ * @return the id of the factory
+ */
+ public String getId() {
+ return id;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolService.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolService.java
index 1cd1fa55e55..8a59e3fc084 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolService.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AspectToolService.java
@@ -1,167 +1,167 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.service.IProvider;
-import org.eclipse.gmf.runtime.common.core.service.Service;
-import org.eclipse.gmf.runtime.common.ui.services.util.ActivityFilterProviderDescriptor;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.w3c.dom.Node;
-
-/**
- * Service that manages aspect tool providers
- */
-public class AspectToolService extends Service implements IAspectToolProviderService {
-
- /** the singleton instance of the aspect tool provider service */
- protected final static AspectToolService instance = new AspectToolService();
-
- /**
- * initialize the service
- */
- static {
- instance.configureProviders(Activator.ID, "aspectToolProvider"); //$NON-NLS-1$
- }
-
- /**
- * Returns the singleton instance of this service
- *
- * @return the singleton instance of this service
- */
- public static AspectToolService getInstance() {
- return instance;
- }
-
- /**
- * Creates a new instance of the aspect tool provider Service
- */
- protected AspectToolService() {
- super();
- }
-
- /**
- * @see org.eclipse.gmf.runtime.common.core.service.Service#newProviderDescriptor(org.eclipse.core.runtime.IConfigurationElement)
- */
- protected Service.ProviderDescriptor newProviderDescriptor(IConfigurationElement element) {
- return new ProviderDescriptor(element);
- }
-
- /**
- * @{inheritDoc
- */
- public List<IAspectActionProvider> getProviders() {
- List<IAspectActionProvider> providers = new ArrayList<IAspectActionProvider>();
- execute(ExecutionStrategy.REVERSE, new GetAllAspectToolProvidersOperation(providers));
- return providers;
- }
-
- /**
- * @{inheritDoc
- */
- public IAspectActionProvider getProvider(String id) {
- List<IAspectActionProvider> providers = (List)execute(ExecutionStrategy.REVERSE, new GetAspectToolProviderOperation(id));
- if(providers == null) {
- return new StereotypeAspectActionProvider(); // backward
- // compatibility
- }
- Iterator<IAspectActionProvider> it = providers.iterator();
- while(it.hasNext()) {
- IAspectActionProvider aspectActionProvider = (IAspectActionProvider)it.next();
- if(aspectActionProvider != null) {
- return aspectActionProvider;
- }
- }
- return new StereotypeAspectActionProvider(); // backward compatibility
- }
-
- /**
- * A descriptor for aspect tool providers defined by a configuration
- * element.
- */
- protected static class ProviderDescriptor extends ActivityFilterProviderDescriptor {
-
- /** the provider configuration parsed from XML */
- protected AspectToolProviderConfiguration providerConfiguration;
-
- /**
- * Constructs a <code>ISemanticProvider</code> descriptor for the
- * specified configuration element.
- *
- * @param element
- * The configuration element describing the provider.
- */
- public ProviderDescriptor(IConfigurationElement element) {
- super(element);
- this.providerConfiguration = AspectToolProviderConfiguration.parse(element);
- Assert.isNotNull(providerConfiguration);
- }
-
- /**
- * @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation)
- */
- public boolean provides(IOperation operation) {
- if(!super.provides(operation)) {
- return false;
- }
- if(operation instanceof GetAllAspectToolProvidersOperation) {
- return true;
- }
- if(operation instanceof GetAspectToolProviderOperation) {
- return providerConfiguration.getId().equals(((GetAspectToolProviderOperation)operation).getIdentifier());
- }
- return false;
- }
-
- /**
- * @see org.eclipse.gmf.runtime.common.core.service.Service.ProviderDescriptor#getProvider()
- */
- public IProvider getProvider() {
- if(provider == null) {
- IProvider newProvider = super.getProvider();
- if(provider instanceof IAspectActionProvider) {
- IAspectActionProvider defaultProvider = (IAspectActionProvider)newProvider;
- defaultProvider.setConfiguration(getElement());
- }
- return newProvider;
- }
- return super.getProvider();
- }
- }
-
- /**
- * Returns the id of the provider in charge of the specified node
- *
- * @param actionNode
- * the node that handles the configuration for the post action
- * @return the id of the factory in charge of the node
- */
- public static String getProviderId(Node actionNode) {
- String id = "";
- Node node = actionNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.ID);
- if(node == null) {
- return StereotypeAspectActionProvider.FACTORY_ID; // backward
- // compatibility
- } else {
- id = node.getNodeValue();
- }
- return id;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.gmf.runtime.common.core.service.ExecutionStrategy;
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.common.core.service.IProvider;
+import org.eclipse.gmf.runtime.common.core.service.Service;
+import org.eclipse.gmf.runtime.common.ui.services.util.ActivityFilterProviderDescriptor;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.w3c.dom.Node;
+
+/**
+ * Service that manages aspect tool providers
+ */
+public class AspectToolService extends Service implements IAspectToolProviderService {
+
+ /** the singleton instance of the aspect tool provider service */
+ protected final static AspectToolService instance = new AspectToolService();
+
+ /**
+ * initialize the service
+ */
+ static {
+ instance.configureProviders(Activator.ID, "aspectToolProvider"); //$NON-NLS-1$
+ }
+
+ /**
+ * Returns the singleton instance of this service
+ *
+ * @return the singleton instance of this service
+ */
+ public static AspectToolService getInstance() {
+ return instance;
+ }
+
+ /**
+ * Creates a new instance of the aspect tool provider Service
+ */
+ protected AspectToolService() {
+ super();
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.core.service.Service#newProviderDescriptor(org.eclipse.core.runtime.IConfigurationElement)
+ */
+ protected Service.ProviderDescriptor newProviderDescriptor(IConfigurationElement element) {
+ return new ProviderDescriptor(element);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public List<IAspectActionProvider> getProviders() {
+ List<IAspectActionProvider> providers = new ArrayList<IAspectActionProvider>();
+ execute(ExecutionStrategy.REVERSE, new GetAllAspectToolProvidersOperation(providers));
+ return providers;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IAspectActionProvider getProvider(String id) {
+ List<IAspectActionProvider> providers = (List)execute(ExecutionStrategy.REVERSE, new GetAspectToolProviderOperation(id));
+ if(providers == null) {
+ return new StereotypeAspectActionProvider(); // backward
+ // compatibility
+ }
+ Iterator<IAspectActionProvider> it = providers.iterator();
+ while(it.hasNext()) {
+ IAspectActionProvider aspectActionProvider = (IAspectActionProvider)it.next();
+ if(aspectActionProvider != null) {
+ return aspectActionProvider;
+ }
+ }
+ return new StereotypeAspectActionProvider(); // backward compatibility
+ }
+
+ /**
+ * A descriptor for aspect tool providers defined by a configuration
+ * element.
+ */
+ protected static class ProviderDescriptor extends ActivityFilterProviderDescriptor {
+
+ /** the provider configuration parsed from XML */
+ protected AspectToolProviderConfiguration providerConfiguration;
+
+ /**
+ * Constructs a <code>ISemanticProvider</code> descriptor for the
+ * specified configuration element.
+ *
+ * @param element
+ * The configuration element describing the provider.
+ */
+ public ProviderDescriptor(IConfigurationElement element) {
+ super(element);
+ this.providerConfiguration = AspectToolProviderConfiguration.parse(element);
+ Assert.isNotNull(providerConfiguration);
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation)
+ */
+ public boolean provides(IOperation operation) {
+ if(!super.provides(operation)) {
+ return false;
+ }
+ if(operation instanceof GetAllAspectToolProvidersOperation) {
+ return true;
+ }
+ if(operation instanceof GetAspectToolProviderOperation) {
+ return providerConfiguration.getId().equals(((GetAspectToolProviderOperation)operation).getIdentifier());
+ }
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.gmf.runtime.common.core.service.Service.ProviderDescriptor#getProvider()
+ */
+ public IProvider getProvider() {
+ if(provider == null) {
+ IProvider newProvider = super.getProvider();
+ if(provider instanceof IAspectActionProvider) {
+ IAspectActionProvider defaultProvider = (IAspectActionProvider)newProvider;
+ defaultProvider.setConfiguration(getElement());
+ }
+ return newProvider;
+ }
+ return super.getProvider();
+ }
+ }
+
+ /**
+ * Returns the id of the provider in charge of the specified node
+ *
+ * @param actionNode
+ * the node that handles the configuration for the post action
+ * @return the id of the factory in charge of the node
+ */
+ public static String getProviderId(Node actionNode) {
+ String id = "";
+ Node node = actionNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.ID);
+ if(node == null) {
+ return StereotypeAspectActionProvider.FACTORY_ID; // backward
+ // compatibility
+ } else {
+ id = node.getNodeValue();
+ }
+ return id;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndAspectActionProvider.java
index c89207ea63b..60ad694036e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndAspectActionProvider.java
@@ -1,81 +1,81 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.w3c.dom.Node;
-
-/**
- * Factory in charge of the semantic aspect actions taken after palette actions
- */
-public class AssociationEndAspectActionProvider extends AbstractAspectActionProvider implements IAspectActionProvider {
-
- /** name of the association metaclass */
- protected static final String ASSOCIATION = "Association";
-
- /** semantic action key */
- public final static String SEMANTIC_ACTION_KEY = "org.eclipse.papyrus.postaction.associationendaction";
-
- /**
- * Constructor.
- *
- */
- public AssociationEndAspectActionProvider() {
- }
-
- /**
- * @{inheritDoc
- */
- public IAspectAction createAction(Node configurationNode) {
- AssociationEndPostAction action = new AssociationEndPostAction();
- action.init(configurationNode, this);
- return action;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean isEnable(IPaletteEntryProxy entryProxy) {
- PaletteEntry entry = entryProxy.getEntry();
-
- // check unicity
- if(entryProxy instanceof IPaletteAspectToolEntryProxy) {
- List<IPostAction> postActions = ((IPaletteAspectToolEntryProxy)entryProxy).getPostActions();
- for(IPostAction action : postActions) {
- if(action instanceof AssociationEndPostAction) {
- return false;
- }
- }
- }
-
- // check meta-element is an association
- if(entry instanceof CombinedTemplateCreationEntry) {
- EClass eClass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entry);
- List<EClass> superClasses = eClass.getEAllSuperTypes();
- if(ASSOCIATION.equals(eClass.getName())) {
- return true;
- }
- for(EClass superClass : superClasses) {
- if(ASSOCIATION.equals(superClass.getName())) {
- return true;
- }
- }
- }
- return false;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.w3c.dom.Node;
+
+/**
+ * Factory in charge of the semantic aspect actions taken after palette actions
+ */
+public class AssociationEndAspectActionProvider extends AbstractAspectActionProvider implements IAspectActionProvider {
+
+ /** name of the association metaclass */
+ protected static final String ASSOCIATION = "Association";
+
+ /** semantic action key */
+ public final static String SEMANTIC_ACTION_KEY = "org.eclipse.papyrus.postaction.associationendaction";
+
+ /**
+ * Constructor.
+ *
+ */
+ public AssociationEndAspectActionProvider() {
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IAspectAction createAction(Node configurationNode) {
+ AssociationEndPostAction action = new AssociationEndPostAction();
+ action.init(configurationNode, this);
+ return action;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean isEnable(IPaletteEntryProxy entryProxy) {
+ PaletteEntry entry = entryProxy.getEntry();
+
+ // check unicity
+ if(entryProxy instanceof IPaletteAspectToolEntryProxy) {
+ List<IPostAction> postActions = ((IPaletteAspectToolEntryProxy)entryProxy).getPostActions();
+ for(IPostAction action : postActions) {
+ if(action instanceof AssociationEndPostAction) {
+ return false;
+ }
+ }
+ }
+
+ // check meta-element is an association
+ if(entry instanceof CombinedTemplateCreationEntry) {
+ EClass eClass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entry);
+ List<EClass> superClasses = eClass.getEAllSuperTypes();
+ if(ASSOCIATION.equals(eClass.getName())) {
+ return true;
+ }
+ for(EClass superClass : superClasses) {
+ if(ASSOCIATION.equals(superClass.getName())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndPostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndPostAction.java
index 0e3e9db3099..6d023b2f9db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndPostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/AssociationEndPostAction.java
@@ -1,676 +1,676 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.IUndoableOperation;
-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.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.helper.AssociationHelper;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.papyrus.uml.tools.utils.MultiplicityElementUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.uml2.uml.AggregationKind;
-import org.eclipse.uml2.uml.Association;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.Property;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Aspect action that modifies association end on creation
- */
-public class AssociationEndPostAction extends ModelPostAction {
-
- /**
- * list of property configurations, identified by their positions in the
- * association end list
- */
- protected List<PropertyEndConfiguration> configurations;
-
- /** entry proxy "parent" of this action when configuring the action */
- protected IPaletteEntryProxy entryProxy;
-
- /** list of applied profiles */
- protected List<Profile> appliedProfiles;
-
- /** viewer for the attributes to initialize */
- protected TableViewer attributeViewer;
-
- /**
- * this attribute caches the value of the metaclass linked to the creation
- * entry (performance optimization)
- */
- protected EClass metaclass = null;
-
- /** path to the checked box image */
- protected final static String ICON_CHECKED = "/icons/complete_tsk.gif";
-
- /** path to the unchecked box image */
- protected final static String ICON_UNCHECKED = "/icons/incomplete_tsk.gif";
-
- /** separator used to serialize lists */
- protected static final String SEPARATOR = ",,";
-
- /** node name for the configuration of the association end */
- protected static final String ASSOCIATION_END_NODE_NAME = "associationEnd";
-
- /** attribute name for the index of the association end */
- protected static final String INDEX_ATTRIBUTE_NAME = "index";
-
- /** attribute name for the name of the association end */
- protected static final String NAME_ATTRIBUTE_NAME = "name";
-
- /** node name for the aggregation configuration of the association end */
- protected static final String AGGREGATION_NODE_NAME = "aggregation";
-
- /** node name for the value(s) */
- protected static final String VALUE_ATTRIBUTE_NAME = "value";
-
- /** node name for the multiplicity configuration of the association end */
- protected static final String MULTIPLICITY_NODE_NAME = "multiplicity";
-
- /** node name for the navigation configuration of the association end */
- protected static final String NAVIGABLE_NODE_NAME = "navigable";
-
- /** node name for the owner configuration of the association end */
- protected static final String OWNER_NODE_NAME = "owner";
-
- /** value of the owned by class configuration element */
- protected static final String CLASS_OWNER = "Class";
-
- /** value of the "navigability" configuration element */
- protected static final String NAVIGABLE_YES = "Yes";
-
- /** list of composites */
- protected List<PropertyEndComposite> configurationComposites = new ArrayList<PropertyEndComposite>();
-
- /**
- * Constructor.
- */
- public AssociationEndPostAction() {
- configurations = new ArrayList<PropertyEndConfiguration>();
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public void init(Node configurationNode, IAspectActionProvider factory) {
- super.init(configurationNode, factory);
- if(configurationNode == null) {
- // creates 2 default configuration property
- PropertyEndConfiguration sourceConfiguration = new PropertyEndConfiguration(0, "source");
- PropertyEndConfiguration targetConfiguration = new PropertyEndConfiguration(1, "target");
- configurations.add(sourceConfiguration);
- configurations.add(targetConfiguration);
- return;
- }
- NodeList childNodes = configurationNode.getChildNodes();
- for(int i = 0; i < childNodes.getLength(); i++) {
- Node featureNode = childNodes.item(i);
- if(ASSOCIATION_END_NODE_NAME.equals(featureNode.getNodeName())) {
- Node indexNode = featureNode.getAttributes().getNamedItem(INDEX_ATTRIBUTE_NAME);
- Node nameNode = featureNode.getAttributes().getNamedItem(NAME_ATTRIBUTE_NAME);
-
- if(indexNode != null && nameNode != null) {
- Integer index = Integer.parseInt(indexNode.getNodeValue());
- PropertyEndConfiguration configuration = new PropertyEndConfiguration(index, nameNode.getNodeValue());
- // parse sub nodes (aggregation, navigation, etc.)
- NodeList subNodes = featureNode.getChildNodes();
- for(int j = 0; j < subNodes.getLength(); j++) {
- Node subNode = subNodes.item(j);
- String subNodeName = subNode.getNodeName();
- if(AGGREGATION_NODE_NAME.equals(subNodeName)) {
- Node valueNode = subNode.getAttributes().getNamedItem(VALUE_ATTRIBUTE_NAME);
- if(valueNode != null) {
- configuration.setAggregationKind(valueNode.getNodeValue());
- }
- } else if(MULTIPLICITY_NODE_NAME.equals(subNodeName)) {
- Node valueNode = subNode.getAttributes().getNamedItem(VALUE_ATTRIBUTE_NAME);
- if(valueNode != null) {
- configuration.setMultiplicity(valueNode.getNodeValue());
- }
- } else if(NAVIGABLE_NODE_NAME.equals(subNodeName)) {
- Node valueNode = subNode.getAttributes().getNamedItem(VALUE_ATTRIBUTE_NAME);
- if(valueNode != null) {
- configuration.setNavigation(valueNode.getNodeValue());
- }
- } else if(OWNER_NODE_NAME.equals(subNodeName)) {
- Node valueNode = subNode.getAttributes().getNamedItem(VALUE_ATTRIBUTE_NAME);
- if(valueNode != null) {
- configuration.setOwner(valueNode.getNodeValue());
- }
- }
-
- }
- configurations.add(configuration);
- } else {
- Activator.log.error("Impossible to parse the configuration node for semantic post action", null);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getPostCommand(final IAdaptable viewAdapter) {
-
- final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
-
- return new AbstractTransactionalCommand(editingDomain, "Modify Association End", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- View view = (View)viewAdapter.getAdapter(View.class);
-
- if(view != null && view.getElement() instanceof Association) {
- EObject objectToEdit = view.getElement();
-
- for(PropertyEndConfiguration configuration : configurations) {
-
- // retrieve Property... more tests to do!!
- Property property = ((Association)objectToEdit).getMemberEnds().get(configuration.getIndex());
-
- if(!("".equals(configuration.getOwner()))) {
- // change the owner to the specified one
- IUndoableOperation operation = AssociationHelper.createSetOwnerCommand((Association)objectToEdit, property, CLASS_OWNER.equals(configuration.getOwner()));
- if(operation != null && operation.canExecute()) {
- operation.execute(null, null);
- }
- }
-
- if(!("".equals(configuration.getAggregationKind()))) {
- // change the aggregation kind
- AggregationKind aggregationKind = AggregationKind.get(configuration.getAggregationKind());
- AssociationHelper.createSetAggregationCommand(property, aggregationKind).execute(null, null);
- }
-
- if(!("".equals(configuration.getMultiplicity()))) {
- // change the aggregation kind
- String multiplicity = configuration.getMultiplicity();
- try {
- int[] values = MultiplicityElementUtil.parseMultiplicity(multiplicity);
- if(values.length == 2) {
- AssociationHelper.createSetMultiplicityCommand(property, values[0], values[1]).execute(null, null);
- }
- } catch (NumberFormatException e) {
- Activator.log.error("Multiplicity [" + multiplicity + "] can not be parsed", e);
- }
- }
-
- if(!("".equals(configuration.getNavigation()))) {
- String navigation = configuration.getNavigation();
- boolean isNavigable = NAVIGABLE_YES.equals(navigation);
- AssociationHelper.createSetNavigableCommand(((Association)objectToEdit), property, isNavigable).execute(null, null);
- }
- }
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- /**
- * @{inheritDoc
- */
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
- this.appliedProfiles = appliedProfiles;
- this.entryProxy = entryProxy;
-
- // retrieve tool metaclass
- if(entryProxy.getEntry() instanceof CombinedTemplateCreationEntry) {
- metaclass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entryProxy.getEntry());
- }
-
- Composite mainComposite = new Composite(parent, SWT.BORDER);
- GridLayout layout = new GridLayout(2, true);
- mainComposite.setLayout(layout);
-
- Label titleLabel = new Label(mainComposite, SWT.NONE);
- titleLabel.setText("Association end properties");
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
- titleLabel.setLayoutData(data);
-
- for(PropertyEndConfiguration configuration : configurations) {
- PropertyEndComposite composite = new PropertyEndComposite(configuration);
- composite.createComposite(mainComposite);
- configurationComposites.add(composite);
- }
- return mainComposite;
- }
-
- /**
- * @{inheritDoc
- */
- public void save(Node parentNode) {
- if(!(parentNode instanceof Element)) {
- Activator.log.error("parent node is not an Element", null);
- return;
- } else {
- // a sub node should be created for each configuration
- for(PropertyEndConfiguration configuration : configurations) {
- Element associationEndNode = ((Element)parentNode).getOwnerDocument().createElement(ASSOCIATION_END_NODE_NAME);
- associationEndNode.setAttribute(INDEX_ATTRIBUTE_NAME, configuration.getIndex() + "");
- associationEndNode.setAttribute(NAME_ATTRIBUTE_NAME, configuration.getName());
-
- // save child nodes, if required
- if(!"".equals(configuration.getAggregationKind())) {
- createChildNode(associationEndNode, AGGREGATION_NODE_NAME, configuration.getAggregationKind());
- }
- if(!"".equals(configuration.getMultiplicity())) {
- createChildNode(associationEndNode, MULTIPLICITY_NODE_NAME, configuration.getMultiplicity());
- }
- if(!"".equals(configuration.getNavigation())) {
- createChildNode(associationEndNode, NAVIGABLE_NODE_NAME, configuration.getNavigation());
- }
- if(!"".equals(configuration.getOwner())) {
- createChildNode(associationEndNode, OWNER_NODE_NAME, configuration.getOwner());
- }
- ((Element)parentNode).appendChild(associationEndNode);
- }
- }
- }
-
- /**
- * Creates a child node to the given element
- *
- * @param parent
- * the element owner of the new child node
- * @param tagName
- * the name of the child node
- * @param value
- * the value of the "value" attribute node
- */
- protected void createChildNode(Element parent, String tagName, String value) {
- Element childNode = parent.getOwnerDocument().createElement(tagName);
- childNode.setAttribute(VALUE_ATTRIBUTE_NAME, value);
- parent.appendChild(childNode);
- }
-
- /**
- * Composite to configure the property end
- */
- protected class PropertyEndComposite {
-
- /** list of items for the aggregation combo */
- final protected List<String> aggregationItems = Arrays.asList("", AggregationKind.NONE_LITERAL.getName(), AggregationKind.COMPOSITE_LITERAL.getName(), AggregationKind.SHARED_LITERAL.getName());
-
- /** list of items for the aggregation combo */
- final protected List<String> multiplicityItems = Arrays.asList("", "0..1", "1..1", "0..*", "1..*");
-
- /** List of items for navigation selection */
- final protected List<String> navigationItems = Arrays.asList("", NAVIGABLE_YES, "No");
-
- /** List of items for owner selection */
- final protected List<String> ownerItems = Arrays.asList("", CLASS_OWNER, "Association");
-
- /** property configuration */
- final protected PropertyEndConfiguration configuration;
-
- /** label for this composite */
- final protected String label;
-
- /** Combo for aggregation kind selection */
- protected Combo aggregationCombo;
-
- /** Button to select class as owner of the association end */
- protected Button ownerClassButton;
-
- /** Button to select association as owner of the association end */
- protected Button ownerAssociationButton;
-
- /** Combo for navigation selection */
- protected Combo navigationCombo;
-
- /** Combo for multiplicity selection */
- protected Combo multiplicityCombo;
-
- /** Combo for owner selection */
- protected Combo ownerCombo;
-
- /**
- * Constructor.
- *
- * @param index
- * the index of the property in the association ends list
- */
- public PropertyEndComposite(PropertyEndConfiguration configuration) {
- this.configuration = configuration;
- label = configuration.getName();
- }
-
- /**
- * Creates the composite for configuration
- *
- * @param parent
- * the composite in which sub-composite should be created
- */
- public void createComposite(Composite parent) {
- Group mainComposite = new Group(parent, SWT.NONE);
- mainComposite.setText("Property end " + this.label);
- GridLayout layout = new GridLayout(3, false);
- mainComposite.setLayout(layout);
- GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
- mainComposite.setLayoutData(data);
-
- // aggregation elements
- Label aggregationLabel = new Label(mainComposite, SWT.NONE);
- aggregationLabel.setText("Aggregation");
- aggregationLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
-
- aggregationCombo = new Combo(mainComposite, SWT.READ_ONLY);
- aggregationCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- aggregationCombo.setItems(aggregationItems.toArray(new String[]{}));
- aggregationCombo.addFocusListener(new FocusListener() {
-
- public void focusLost(FocusEvent e) {
- configuration.setAggregationKind(aggregationCombo.getText());
- }
-
- public void focusGained(FocusEvent e) {
-
- }
- });
-
- // owner elements
- Label ownerLabel = new Label(mainComposite, SWT.NONE);
- ownerLabel.setText("Owner");
- ownerLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
-
- ownerCombo = new Combo(mainComposite, SWT.READ_ONLY);
- ownerCombo.setItems(ownerItems.toArray(new String[]{}));
- ownerCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- ownerCombo.addSelectionListener(new SelectionListener() {
-
- /**
- * @{inheritDoc
- */
- public void widgetSelected(SelectionEvent e) {
- String value = ((Combo)e.widget).getText();
- configuration.setOwner(value);
- }
-
- /**
- * @{inheritDoc
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
-
- // navigation elements
- Label navigationLabel = new Label(mainComposite, SWT.NONE);
- navigationLabel.setText("Navigable");
- navigationLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
-
- navigationCombo = new Combo(mainComposite, SWT.READ_ONLY);
- navigationCombo.setItems(navigationItems.toArray(new String[]{}));
- navigationCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- navigationCombo.addSelectionListener(new SelectionListener() {
-
- /**
- * @{inheritDoc
- */
- public void widgetSelected(SelectionEvent e) {
- String value = ((Combo)e.widget).getText();
- configuration.setNavigation(value);
- }
-
- /**
- * @{inheritDoc
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
-
- // multiplicity elements
- Label multiplicityLabel = new Label(mainComposite, SWT.NONE);
- multiplicityLabel.setText("Multiplicity");
- multiplicityLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
-
- multiplicityCombo = new Combo(mainComposite, SWT.BORDER);
- multiplicityCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- multiplicityCombo.setItems(multiplicityItems.toArray(new String[]{}));
- multiplicityCombo.addFocusListener(new FocusListener() {
-
- /**
- * @{inheritDoc
- */
- public void focusLost(FocusEvent e) {
- // check validity. open a window to ask if we should stay on
- // multiplicity combo or left.
- String newValue = multiplicityCombo.getText();
- if(isMultiplicityValid(newValue.trim())) {
- configuration.setMultiplicity(newValue.trim());
- } else {
- boolean leaveCombo = MessageDialog.openQuestion(multiplicityCombo.getShell(), "Incorrect multiplicity value", "The text [" + newValue + "] is not a valid value.\nDo you really want to leave the combo, losing your modification on multiplicity value?");
- if(!leaveCombo) {
- multiplicityCombo.setFocus();
- multiplicityCombo.setText(newValue);
- } else {
- // restore old value
- multiplicityCombo.setText(configuration.getMultiplicity());
- }
- }
- }
-
- /**
- * @{inheritDoc
- */
- public void focusGained(FocusEvent e) {
-
- }
- });
-
- update();
- }
-
- /**
- * update the values in the various composites, given the currently hold
- * values
- */
- public void update() {
- navigationCombo.select(navigationItems.indexOf(configuration.getNavigation()));
- aggregationCombo.select(aggregationItems.indexOf(configuration.getAggregationKind()));
- ownerCombo.select(ownerItems.indexOf(configuration.getOwner()));
- multiplicityCombo.setText(configuration.getMultiplicity());
- }
-
- /**
- * Checks if the multiplicity is valid
- *
- * @param newValue
- * the value to check
- * @return true if the String represents a valid multiplicity
- */
- private boolean isMultiplicityValid(String newValue) {
- // checks if is only a string
- if(newValue.equals("")) {
- return true;
- }
- try {
- int[] values = MultiplicityElementUtil.parseMultiplicity(newValue);
- if(values.length == 2) {
- int lower = values[0];
- int upper = values[1];
-
- // returns true if upper = *, otherwise, returns true if
- // upper > lower
- return (upper == -1) ? true : upper >= lower;
- }
- return false;
- } catch (NumberFormatException e) {
- return false;
- }
- }
- }
-
- protected class PropertyEndConfiguration {
-
- /** current value of the aggregation kind attribute */
- protected String aggregationKind = "";
-
- /** current value of the owner */
- protected String owner = "";
-
- /** current value for the navigation */
- protected String navigation = "";
-
- /** current multiplicity */
- protected String multiplicity = "";
-
- /** index of the property end */
- protected final int index;
-
- /** name of the property end */
- protected final String name;
-
- /**
- * Returns the name of this configuration (the name of the property end)
- *
- * @return the name of this configuration (the name of the property end)
- */
- public String getName() {
- return name;
- }
-
- /**
- * Returns the index of this configuration (the index of the property
- * end)
- *
- * @return the index of this configuration (the index of the property
- * end
- */
- public int getIndex() {
- return index;
- }
-
- /**
- * Constructor.
- *
- * @param index
- * the index of the property end
- */
- public PropertyEndConfiguration(int index, String name) {
- this.index = index;
- this.name = name;
- }
-
- /**
- * Returns the current value of aggregationKind
- *
- * @return the current value of aggregationKind
- */
- public String getAggregationKind() {
- return aggregationKind;
- }
-
- /**
- * Sets the current value of aggregationKind
- *
- * @param aggregationKind
- * the aggregationKind to set
- */
- public void setAggregationKind(String aggregationKind) {
- this.aggregationKind = aggregationKind;
- }
-
- /**
- * Returns the current value of owner
- *
- * @return the current value of owner
- */
- public String getOwner() {
- return owner;
- }
-
- /**
- * Sets the current value of owner
- *
- * @param owner
- * the owner to set
- */
- public void setOwner(String owner) {
- this.owner = owner;
- }
-
- /**
- * Returns the current value of navigation
- *
- * @return the current value of navigation
- */
- public String getNavigation() {
- return navigation;
- }
-
- /**
- * Sets the current value of navigation
- *
- * @param navigation
- * the navigation to set
- */
- public void setNavigation(String navigation) {
- this.navigation = navigation;
- }
-
- /**
- * Returns the current value of multiplicity
- *
- * @return the current value of multiplicity
- */
- public String getMultiplicity() {
- return multiplicity;
- }
-
- /**
- * Sets the current value of multiplicity
- *
- * @param multiplicity
- * the multiplicity to set
- */
- public void setMultiplicity(String multiplicity) {
- this.multiplicity = multiplicity;
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IUndoableOperation;
+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.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.helper.AssociationHelper;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.papyrus.uml.tools.utils.MultiplicityElementUtil;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+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.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.uml2.uml.AggregationKind;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.Property;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Aspect action that modifies association end on creation
+ */
+public class AssociationEndPostAction extends ModelPostAction {
+
+ /**
+ * list of property configurations, identified by their positions in the
+ * association end list
+ */
+ protected List<PropertyEndConfiguration> configurations;
+
+ /** entry proxy "parent" of this action when configuring the action */
+ protected IPaletteEntryProxy entryProxy;
+
+ /** list of applied profiles */
+ protected List<Profile> appliedProfiles;
+
+ /** viewer for the attributes to initialize */
+ protected TableViewer attributeViewer;
+
+ /**
+ * this attribute caches the value of the metaclass linked to the creation
+ * entry (performance optimization)
+ */
+ protected EClass metaclass = null;
+
+ /** path to the checked box image */
+ protected final static String ICON_CHECKED = "/icons/complete_tsk.gif";
+
+ /** path to the unchecked box image */
+ protected final static String ICON_UNCHECKED = "/icons/incomplete_tsk.gif";
+
+ /** separator used to serialize lists */
+ protected static final String SEPARATOR = ",,";
+
+ /** node name for the configuration of the association end */
+ protected static final String ASSOCIATION_END_NODE_NAME = "associationEnd";
+
+ /** attribute name for the index of the association end */
+ protected static final String INDEX_ATTRIBUTE_NAME = "index";
+
+ /** attribute name for the name of the association end */
+ protected static final String NAME_ATTRIBUTE_NAME = "name";
+
+ /** node name for the aggregation configuration of the association end */
+ protected static final String AGGREGATION_NODE_NAME = "aggregation";
+
+ /** node name for the value(s) */
+ protected static final String VALUE_ATTRIBUTE_NAME = "value";
+
+ /** node name for the multiplicity configuration of the association end */
+ protected static final String MULTIPLICITY_NODE_NAME = "multiplicity";
+
+ /** node name for the navigation configuration of the association end */
+ protected static final String NAVIGABLE_NODE_NAME = "navigable";
+
+ /** node name for the owner configuration of the association end */
+ protected static final String OWNER_NODE_NAME = "owner";
+
+ /** value of the owned by class configuration element */
+ protected static final String CLASS_OWNER = "Class";
+
+ /** value of the "navigability" configuration element */
+ protected static final String NAVIGABLE_YES = "Yes";
+
+ /** list of composites */
+ protected List<PropertyEndComposite> configurationComposites = new ArrayList<PropertyEndComposite>();
+
+ /**
+ * Constructor.
+ */
+ public AssociationEndPostAction() {
+ configurations = new ArrayList<PropertyEndConfiguration>();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ super.init(configurationNode, factory);
+ if(configurationNode == null) {
+ // creates 2 default configuration property
+ PropertyEndConfiguration sourceConfiguration = new PropertyEndConfiguration(0, "source");
+ PropertyEndConfiguration targetConfiguration = new PropertyEndConfiguration(1, "target");
+ configurations.add(sourceConfiguration);
+ configurations.add(targetConfiguration);
+ return;
+ }
+ NodeList childNodes = configurationNode.getChildNodes();
+ for(int i = 0; i < childNodes.getLength(); i++) {
+ Node featureNode = childNodes.item(i);
+ if(ASSOCIATION_END_NODE_NAME.equals(featureNode.getNodeName())) {
+ Node indexNode = featureNode.getAttributes().getNamedItem(INDEX_ATTRIBUTE_NAME);
+ Node nameNode = featureNode.getAttributes().getNamedItem(NAME_ATTRIBUTE_NAME);
+
+ if(indexNode != null && nameNode != null) {
+ Integer index = Integer.parseInt(indexNode.getNodeValue());
+ PropertyEndConfiguration configuration = new PropertyEndConfiguration(index, nameNode.getNodeValue());
+ // parse sub nodes (aggregation, navigation, etc.)
+ NodeList subNodes = featureNode.getChildNodes();
+ for(int j = 0; j < subNodes.getLength(); j++) {
+ Node subNode = subNodes.item(j);
+ String subNodeName = subNode.getNodeName();
+ if(AGGREGATION_NODE_NAME.equals(subNodeName)) {
+ Node valueNode = subNode.getAttributes().getNamedItem(VALUE_ATTRIBUTE_NAME);
+ if(valueNode != null) {
+ configuration.setAggregationKind(valueNode.getNodeValue());
+ }
+ } else if(MULTIPLICITY_NODE_NAME.equals(subNodeName)) {
+ Node valueNode = subNode.getAttributes().getNamedItem(VALUE_ATTRIBUTE_NAME);
+ if(valueNode != null) {
+ configuration.setMultiplicity(valueNode.getNodeValue());
+ }
+ } else if(NAVIGABLE_NODE_NAME.equals(subNodeName)) {
+ Node valueNode = subNode.getAttributes().getNamedItem(VALUE_ATTRIBUTE_NAME);
+ if(valueNode != null) {
+ configuration.setNavigation(valueNode.getNodeValue());
+ }
+ } else if(OWNER_NODE_NAME.equals(subNodeName)) {
+ Node valueNode = subNode.getAttributes().getNamedItem(VALUE_ATTRIBUTE_NAME);
+ if(valueNode != null) {
+ configuration.setOwner(valueNode.getNodeValue());
+ }
+ }
+
+ }
+ configurations.add(configuration);
+ } else {
+ Activator.log.error("Impossible to parse the configuration node for semantic post action", null);
+ }
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand getPostCommand(final IAdaptable viewAdapter) {
+
+ final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
+
+ return new AbstractTransactionalCommand(editingDomain, "Modify Association End", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ View view = (View)viewAdapter.getAdapter(View.class);
+
+ if(view != null && view.getElement() instanceof Association) {
+ EObject objectToEdit = view.getElement();
+
+ for(PropertyEndConfiguration configuration : configurations) {
+
+ // retrieve Property... more tests to do!!
+ Property property = ((Association)objectToEdit).getMemberEnds().get(configuration.getIndex());
+
+ if(!("".equals(configuration.getOwner()))) {
+ // change the owner to the specified one
+ IUndoableOperation operation = AssociationHelper.createSetOwnerCommand((Association)objectToEdit, property, CLASS_OWNER.equals(configuration.getOwner()));
+ if(operation != null && operation.canExecute()) {
+ operation.execute(null, null);
+ }
+ }
+
+ if(!("".equals(configuration.getAggregationKind()))) {
+ // change the aggregation kind
+ AggregationKind aggregationKind = AggregationKind.get(configuration.getAggregationKind());
+ AssociationHelper.createSetAggregationCommand(property, aggregationKind).execute(null, null);
+ }
+
+ if(!("".equals(configuration.getMultiplicity()))) {
+ // change the aggregation kind
+ String multiplicity = configuration.getMultiplicity();
+ try {
+ int[] values = MultiplicityElementUtil.parseMultiplicity(multiplicity);
+ if(values.length == 2) {
+ AssociationHelper.createSetMultiplicityCommand(property, values[0], values[1]).execute(null, null);
+ }
+ } catch (NumberFormatException e) {
+ Activator.log.error("Multiplicity [" + multiplicity + "] can not be parsed", e);
+ }
+ }
+
+ if(!("".equals(configuration.getNavigation()))) {
+ String navigation = configuration.getNavigation();
+ boolean isNavigable = NAVIGABLE_YES.equals(navigation);
+ AssociationHelper.createSetNavigableCommand(((Association)objectToEdit), property, isNavigable).execute(null, null);
+ }
+ }
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
+ this.appliedProfiles = appliedProfiles;
+ this.entryProxy = entryProxy;
+
+ // retrieve tool metaclass
+ if(entryProxy.getEntry() instanceof CombinedTemplateCreationEntry) {
+ metaclass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entryProxy.getEntry());
+ }
+
+ Composite mainComposite = new Composite(parent, SWT.BORDER);
+ GridLayout layout = new GridLayout(2, true);
+ mainComposite.setLayout(layout);
+
+ Label titleLabel = new Label(mainComposite, SWT.NONE);
+ titleLabel.setText("Association end properties");
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ titleLabel.setLayoutData(data);
+
+ for(PropertyEndConfiguration configuration : configurations) {
+ PropertyEndComposite composite = new PropertyEndComposite(configuration);
+ composite.createComposite(mainComposite);
+ configurationComposites.add(composite);
+ }
+ return mainComposite;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void save(Node parentNode) {
+ if(!(parentNode instanceof Element)) {
+ Activator.log.error("parent node is not an Element", null);
+ return;
+ } else {
+ // a sub node should be created for each configuration
+ for(PropertyEndConfiguration configuration : configurations) {
+ Element associationEndNode = ((Element)parentNode).getOwnerDocument().createElement(ASSOCIATION_END_NODE_NAME);
+ associationEndNode.setAttribute(INDEX_ATTRIBUTE_NAME, configuration.getIndex() + "");
+ associationEndNode.setAttribute(NAME_ATTRIBUTE_NAME, configuration.getName());
+
+ // save child nodes, if required
+ if(!"".equals(configuration.getAggregationKind())) {
+ createChildNode(associationEndNode, AGGREGATION_NODE_NAME, configuration.getAggregationKind());
+ }
+ if(!"".equals(configuration.getMultiplicity())) {
+ createChildNode(associationEndNode, MULTIPLICITY_NODE_NAME, configuration.getMultiplicity());
+ }
+ if(!"".equals(configuration.getNavigation())) {
+ createChildNode(associationEndNode, NAVIGABLE_NODE_NAME, configuration.getNavigation());
+ }
+ if(!"".equals(configuration.getOwner())) {
+ createChildNode(associationEndNode, OWNER_NODE_NAME, configuration.getOwner());
+ }
+ ((Element)parentNode).appendChild(associationEndNode);
+ }
+ }
+ }
+
+ /**
+ * Creates a child node to the given element
+ *
+ * @param parent
+ * the element owner of the new child node
+ * @param tagName
+ * the name of the child node
+ * @param value
+ * the value of the "value" attribute node
+ */
+ protected void createChildNode(Element parent, String tagName, String value) {
+ Element childNode = parent.getOwnerDocument().createElement(tagName);
+ childNode.setAttribute(VALUE_ATTRIBUTE_NAME, value);
+ parent.appendChild(childNode);
+ }
+
+ /**
+ * Composite to configure the property end
+ */
+ protected class PropertyEndComposite {
+
+ /** list of items for the aggregation combo */
+ final protected List<String> aggregationItems = Arrays.asList("", AggregationKind.NONE_LITERAL.getName(), AggregationKind.COMPOSITE_LITERAL.getName(), AggregationKind.SHARED_LITERAL.getName());
+
+ /** list of items for the aggregation combo */
+ final protected List<String> multiplicityItems = Arrays.asList("", "0..1", "1..1", "0..*", "1..*");
+
+ /** List of items for navigation selection */
+ final protected List<String> navigationItems = Arrays.asList("", NAVIGABLE_YES, "No");
+
+ /** List of items for owner selection */
+ final protected List<String> ownerItems = Arrays.asList("", CLASS_OWNER, "Association");
+
+ /** property configuration */
+ final protected PropertyEndConfiguration configuration;
+
+ /** label for this composite */
+ final protected String label;
+
+ /** Combo for aggregation kind selection */
+ protected Combo aggregationCombo;
+
+ /** Button to select class as owner of the association end */
+ protected Button ownerClassButton;
+
+ /** Button to select association as owner of the association end */
+ protected Button ownerAssociationButton;
+
+ /** Combo for navigation selection */
+ protected Combo navigationCombo;
+
+ /** Combo for multiplicity selection */
+ protected Combo multiplicityCombo;
+
+ /** Combo for owner selection */
+ protected Combo ownerCombo;
+
+ /**
+ * Constructor.
+ *
+ * @param index
+ * the index of the property in the association ends list
+ */
+ public PropertyEndComposite(PropertyEndConfiguration configuration) {
+ this.configuration = configuration;
+ label = configuration.getName();
+ }
+
+ /**
+ * Creates the composite for configuration
+ *
+ * @param parent
+ * the composite in which sub-composite should be created
+ */
+ public void createComposite(Composite parent) {
+ Group mainComposite = new Group(parent, SWT.NONE);
+ mainComposite.setText("Property end " + this.label);
+ GridLayout layout = new GridLayout(3, false);
+ mainComposite.setLayout(layout);
+ GridData data = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
+ mainComposite.setLayoutData(data);
+
+ // aggregation elements
+ Label aggregationLabel = new Label(mainComposite, SWT.NONE);
+ aggregationLabel.setText("Aggregation");
+ aggregationLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
+
+ aggregationCombo = new Combo(mainComposite, SWT.READ_ONLY);
+ aggregationCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ aggregationCombo.setItems(aggregationItems.toArray(new String[]{}));
+ aggregationCombo.addFocusListener(new FocusListener() {
+
+ public void focusLost(FocusEvent e) {
+ configuration.setAggregationKind(aggregationCombo.getText());
+ }
+
+ public void focusGained(FocusEvent e) {
+
+ }
+ });
+
+ // owner elements
+ Label ownerLabel = new Label(mainComposite, SWT.NONE);
+ ownerLabel.setText("Owner");
+ ownerLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
+
+ ownerCombo = new Combo(mainComposite, SWT.READ_ONLY);
+ ownerCombo.setItems(ownerItems.toArray(new String[]{}));
+ ownerCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ ownerCombo.addSelectionListener(new SelectionListener() {
+
+ /**
+ * @{inheritDoc
+ */
+ public void widgetSelected(SelectionEvent e) {
+ String value = ((Combo)e.widget).getText();
+ configuration.setOwner(value);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ // navigation elements
+ Label navigationLabel = new Label(mainComposite, SWT.NONE);
+ navigationLabel.setText("Navigable");
+ navigationLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
+
+ navigationCombo = new Combo(mainComposite, SWT.READ_ONLY);
+ navigationCombo.setItems(navigationItems.toArray(new String[]{}));
+ navigationCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ navigationCombo.addSelectionListener(new SelectionListener() {
+
+ /**
+ * @{inheritDoc
+ */
+ public void widgetSelected(SelectionEvent e) {
+ String value = ((Combo)e.widget).getText();
+ configuration.setNavigation(value);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ // multiplicity elements
+ Label multiplicityLabel = new Label(mainComposite, SWT.NONE);
+ multiplicityLabel.setText("Multiplicity");
+ multiplicityLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1));
+
+ multiplicityCombo = new Combo(mainComposite, SWT.BORDER);
+ multiplicityCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ multiplicityCombo.setItems(multiplicityItems.toArray(new String[]{}));
+ multiplicityCombo.addFocusListener(new FocusListener() {
+
+ /**
+ * @{inheritDoc
+ */
+ public void focusLost(FocusEvent e) {
+ // check validity. open a window to ask if we should stay on
+ // multiplicity combo or left.
+ String newValue = multiplicityCombo.getText();
+ if(isMultiplicityValid(newValue.trim())) {
+ configuration.setMultiplicity(newValue.trim());
+ } else {
+ boolean leaveCombo = MessageDialog.openQuestion(multiplicityCombo.getShell(), "Incorrect multiplicity value", "The text [" + newValue + "] is not a valid value.\nDo you really want to leave the combo, losing your modification on multiplicity value?");
+ if(!leaveCombo) {
+ multiplicityCombo.setFocus();
+ multiplicityCombo.setText(newValue);
+ } else {
+ // restore old value
+ multiplicityCombo.setText(configuration.getMultiplicity());
+ }
+ }
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void focusGained(FocusEvent e) {
+
+ }
+ });
+
+ update();
+ }
+
+ /**
+ * update the values in the various composites, given the currently hold
+ * values
+ */
+ public void update() {
+ navigationCombo.select(navigationItems.indexOf(configuration.getNavigation()));
+ aggregationCombo.select(aggregationItems.indexOf(configuration.getAggregationKind()));
+ ownerCombo.select(ownerItems.indexOf(configuration.getOwner()));
+ multiplicityCombo.setText(configuration.getMultiplicity());
+ }
+
+ /**
+ * Checks if the multiplicity is valid
+ *
+ * @param newValue
+ * the value to check
+ * @return true if the String represents a valid multiplicity
+ */
+ private boolean isMultiplicityValid(String newValue) {
+ // checks if is only a string
+ if(newValue.equals("")) {
+ return true;
+ }
+ try {
+ int[] values = MultiplicityElementUtil.parseMultiplicity(newValue);
+ if(values.length == 2) {
+ int lower = values[0];
+ int upper = values[1];
+
+ // returns true if upper = *, otherwise, returns true if
+ // upper > lower
+ return (upper == -1) ? true : upper >= lower;
+ }
+ return false;
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ }
+ }
+
+ protected class PropertyEndConfiguration {
+
+ /** current value of the aggregation kind attribute */
+ protected String aggregationKind = "";
+
+ /** current value of the owner */
+ protected String owner = "";
+
+ /** current value for the navigation */
+ protected String navigation = "";
+
+ /** current multiplicity */
+ protected String multiplicity = "";
+
+ /** index of the property end */
+ protected final int index;
+
+ /** name of the property end */
+ protected final String name;
+
+ /**
+ * Returns the name of this configuration (the name of the property end)
+ *
+ * @return the name of this configuration (the name of the property end)
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns the index of this configuration (the index of the property
+ * end)
+ *
+ * @return the index of this configuration (the index of the property
+ * end
+ */
+ public int getIndex() {
+ return index;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param index
+ * the index of the property end
+ */
+ public PropertyEndConfiguration(int index, String name) {
+ this.index = index;
+ this.name = name;
+ }
+
+ /**
+ * Returns the current value of aggregationKind
+ *
+ * @return the current value of aggregationKind
+ */
+ public String getAggregationKind() {
+ return aggregationKind;
+ }
+
+ /**
+ * Sets the current value of aggregationKind
+ *
+ * @param aggregationKind
+ * the aggregationKind to set
+ */
+ public void setAggregationKind(String aggregationKind) {
+ this.aggregationKind = aggregationKind;
+ }
+
+ /**
+ * Returns the current value of owner
+ *
+ * @return the current value of owner
+ */
+ public String getOwner() {
+ return owner;
+ }
+
+ /**
+ * Sets the current value of owner
+ *
+ * @param owner
+ * the owner to set
+ */
+ public void setOwner(String owner) {
+ this.owner = owner;
+ }
+
+ /**
+ * Returns the current value of navigation
+ *
+ * @return the current value of navigation
+ */
+ public String getNavigation() {
+ return navigation;
+ }
+
+ /**
+ * Sets the current value of navigation
+ *
+ * @param navigation
+ * the navigation to set
+ */
+ public void setNavigation(String navigation) {
+ this.navigation = navigation;
+ }
+
+ /**
+ * Returns the current value of multiplicity
+ *
+ * @return the current value of multiplicity
+ */
+ public String getMultiplicity() {
+ return multiplicity;
+ }
+
+ /**
+ * Sets the current value of multiplicity
+ *
+ * @param multiplicity
+ * the multiplicity to set
+ */
+ public void setMultiplicity(String multiplicity) {
+ this.multiplicity = multiplicity;
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayAspectActionProvider.java
index 9878ba98b4c..1a405b736a6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayAspectActionProvider.java
@@ -1,47 +1,47 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.w3c.dom.Node;
-
-/**
- * Factory in charge of changing the display of stereotypes after palette
- * actions
- */
-public class ChangeStereotypeDisplayAspectActionProvider extends AbstractAspectActionProvider {
-
- /** semantic action key */
- public final static String ACTION_KEY = "org.eclipse.papyrus.postaction.changeStereotypeDisplayaction";
-
- /**
- * Constructor.
- */
- public ChangeStereotypeDisplayAspectActionProvider() {
- }
-
- /**
- * @{inheritDoc
- */
- public IAspectAction createAction(Node configurationNode) {
- ChangeStereotypeDisplayPostAction action = new ChangeStereotypeDisplayPostAction();
- action.init(configurationNode, this);
- return action;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean isEnable(IPaletteEntryProxy entryProxy) {
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.w3c.dom.Node;
+
+/**
+ * Factory in charge of changing the display of stereotypes after palette
+ * actions
+ */
+public class ChangeStereotypeDisplayAspectActionProvider extends AbstractAspectActionProvider {
+
+ /** semantic action key */
+ public final static String ACTION_KEY = "org.eclipse.papyrus.postaction.changeStereotypeDisplayaction";
+
+ /**
+ * Constructor.
+ */
+ public ChangeStereotypeDisplayAspectActionProvider() {
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IAspectAction createAction(Node configurationNode) {
+ ChangeStereotypeDisplayPostAction action = new ChangeStereotypeDisplayPostAction();
+ action.init(configurationNode, this);
+ return action;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean isEnable(IPaletteEntryProxy entryProxy) {
+ return true;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayPostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayPostAction.java
index a4dfa8bd24b..be56de5f3c0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayPostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ChangeStereotypeDisplayPostAction.java
@@ -1,332 +1,332 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.uml2.uml.Profile;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Post action that manages the display of applied stereotypes.
- */
-public class ChangeStereotypeDisplayPostAction extends GraphicalPostAction {
-
- /** list of stereotypes to display with their names */
- protected String displayKind = UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_HORIZONTAL_PRESENTATION;
-
- /** place where to display stereotypes */
- protected String displayPlace = UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION;
-
- /** combo for configuration of the stereotype display direction */
- protected Combo directionCombo;
-
- /** combo for configuration of the stereotype display */
- protected Combo displayCombo;
-
- /** combo for configuration of the stereotype display place */
- protected Combo placeCombo;
-
- /** text display */
- protected static final String TEXT = "text";
-
- /** icon display */
- protected static final String ICON = "icon";
-
- /** icon display */
- protected static final String SHAPE = "shape";
-
- /** text and icon display */
- protected static final String TEXT_AND_ICON = "text and icon";
-
- /** list of available items in the stereotype display combo */
- protected static final List<String> DISPLAY_LIST = Arrays.asList(TEXT, ICON, TEXT_AND_ICON, SHAPE);
-
- /** horizontal display constant */
- private static final String HORIZONTAL = "horizontal";
-
- /** vertical display constant */
- private static final String VERTICAL = "vertical";
-
- /** list of available items in the stereotype direction combo */
- protected static final List<String> DIRECTION_LIST = Arrays.asList(HORIZONTAL, VERTICAL);
-
- /** in comment display constant */
- protected static final String COMMENT = "comment";
-
- /** compartment display constant */
- protected static final String COMPARTMENT = "compartment";
-
- /** in brace display constant */
- protected static final String BRACE = "brace";
-
- /** list of available items in the stereotype place combo */
- protected static final List<String> PLACE_LIST = Arrays.asList(COMMENT, COMPARTMENT, BRACE);
-
- /** entry proxy "parent" of this action when configuring the action */
- protected IPaletteEntryProxy entryProxy;
-
- /** list of applied profiles */
- protected List<Profile> appliedProfiles;
-
- /**
- * @{inheritDoc
- */
- @Override
- public void init(Node configurationNode, IAspectActionProvider factory) {
- super.init(configurationNode, factory);
- if(configurationNode == null) {
- return;
- }
- Node node = configurationNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.DISPLAY_KIND);
- if(node != null) {
- displayKind = node.getNodeValue();
- }
- node = configurationNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.DISPLAY_PLACE);
- if(node != null) {
- displayPlace = node.getNodeValue();
- }
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public void save(Node configurationNode) {
- if(configurationNode instanceof Element) {
- ((Element)configurationNode).setAttribute(IPapyrusPaletteConstant.DISPLAY_KIND, displayKind);
- ((Element)configurationNode).setAttribute(IPapyrusPaletteConstant.DISPLAY_PLACE, displayPlace);
- } else {
- Activator.log.error("configuration node is not an Element", null);
- }
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public ICommand getPostCommand(final IAdaptable viewAdapter) {
-
- final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
- return new AbstractTransactionalCommand(editingDomain, "Modify Stereotype Display", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- View view = (View)viewAdapter.getAdapter(View.class);
-
- if(view != null) {
- String stereotypetoDisplay = AppliedStereotypeHelper.getStereotypesToDisplay(view);
- AppliedStereotypeHelper.getAppliedStereotypeToDisplayCommand(editingDomain, view, stereotypetoDisplay, displayKind).execute();
- }
- return null;
- }
- };
-
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
- this.appliedProfiles = appliedProfiles;
- this.entryProxy = entryProxy;
- Composite mainComposite = new Composite(parent, SWT.BORDER);
- GridLayout layout = new GridLayout(2, false);
- mainComposite.setLayout(layout);
-
- Label titleLabel = new Label(mainComposite, SWT.NONE);
- titleLabel.setText("Customize stereotype display");
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
- titleLabel.setLayoutData(data);
-
- Label displayLabel = new Label(mainComposite, SWT.NONE);
- displayLabel.setText("Stereotype Display:");
-
- displayCombo = new Combo(mainComposite, SWT.READ_ONLY | SWT.BORDER);
- displayCombo.setItems(DISPLAY_LIST.toArray(new String[]{}));
- data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- displayCombo.setLayoutData(data);
- displayCombo.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- updateDisplayKindValue();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // nothing to do
- }
- });
-
- Label directionLabel = new Label(mainComposite, SWT.NONE);
- directionLabel.setText("Text alignement:");
-
- directionCombo = new Combo(mainComposite, SWT.READ_ONLY | SWT.BORDER);
- directionCombo.setItems(DIRECTION_LIST.toArray(new String[]{}));
- // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- directionCombo.setLayoutData(data);
- directionCombo.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- updateDisplayKindValue();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // nothing to do
- }
- });
-
- Label placeLabel = new Label(mainComposite, SWT.NONE);
- placeLabel.setText("Display place:");
-
- placeCombo = new Combo(mainComposite, SWT.READ_ONLY | SWT.BORDER);
- placeCombo.add(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION);
- placeCombo.add(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION);
- placeCombo.add(UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION);
- // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- placeCombo.setLayoutData(data);
- placeCombo.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- updateDisplayPlaceValue();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // nothing to do
- }
- });
-
- updateCombos();
-
- return mainComposite;
- }
-
- /**
- * Update the display place value according to the combo selection
- */
- protected void updateDisplayPlaceValue() {
- int placeIndex = placeCombo.getSelectionIndex();
- String place = PLACE_LIST.get((placeIndex >= 0) ? placeIndex : 0);
-
- if(BRACE.equals(place)) {
- displayPlace = UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION;
- } else if(COMMENT.equals(place)) {
- displayPlace = UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION;
- } else {
- displayPlace = UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION;
- }
-
- // be sure display is up to date
- updateCombos();
- }
-
- /**
- * update the display kind value hold by this action, given the combo value
- */
- protected void updateDisplayKindValue() {
- int displayIndex = displayCombo.getSelectionIndex();
- String display = DISPLAY_LIST.get((displayIndex >= 0) ? displayIndex : 0);
- int directionIndex = directionCombo.getSelectionIndex();
- String direction = DIRECTION_LIST.get((directionIndex >= 0) ? directionIndex : 0);
- if(ICON.equals(display)) {
- displayKind = UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION;
- } else if(TEXT_AND_ICON.equals(display)) {
- displayKind = UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION;
- } else if(SHAPE.equals(display)) {
- displayKind = UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION;
- } else {
- if(VERTICAL.equals(direction)) {
- displayKind = UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION;
- } else {
- displayKind = UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_HORIZONTAL_PRESENTATION;
- }
- }
-
- // be sure display corresponds to the real values
- updateCombos();
- }
-
- /**
- * Updates the combo according to the current values hold by this action
- */
- protected void updateCombos() {
- // udpate the direction and display combo
- /*
- * VisualInformationPapyrusConstants.TEXT_ICON_STEREOTYPE_PRESENTATION,
- * VisualInformationPapyrusConstants.ICON_STEREOTYPE_PRESENTATION,
- * VisualInformationPapyrusConstants.IMAGE_STEREOTYPE_PRESENTATION,
- * VisualInformationPapyrusConstant
- * .STEREOTYPE_TEXT_HORIZONTAL_PRESENTATION,
- * VisualInformationPapyrusConstant
- * .STEREOTYPE_TEXT_VERTICAL_PRESENTATION
- */
- if(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION.equals(displayKind)) {
- displayCombo.select(DISPLAY_LIST.indexOf(TEXT_AND_ICON));
- directionCombo.select(DIRECTION_LIST.indexOf(HORIZONTAL));
- directionCombo.setEnabled(false);
- } else if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(displayKind)) {
- displayCombo.select(DISPLAY_LIST.indexOf(ICON));
- directionCombo.select(DIRECTION_LIST.indexOf(HORIZONTAL));
- directionCombo.setEnabled(false);
- } else if(UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION.equals(displayKind)) {
- displayCombo.select(DISPLAY_LIST.indexOf(SHAPE));
- directionCombo.select(DIRECTION_LIST.indexOf(HORIZONTAL));
- directionCombo.setEnabled(false);
- } else if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(displayKind)) {
- displayCombo.select(DISPLAY_LIST.indexOf(TEXT));
- directionCombo.select(DIRECTION_LIST.indexOf(VERTICAL));
- directionCombo.setEnabled(true);
- } else {
- displayCombo.select(DISPLAY_LIST.indexOf(TEXT));
- directionCombo.select(DIRECTION_LIST.indexOf(HORIZONTAL));
- directionCombo.setEnabled(true);
- }
-
- // update the place combo
- /*
- * VisualInformationPapyrusConstants.STEREOTYPE_COMMENT_LOCATION
- * VisualInformationPapyrusConstants.STEREOTYPE_COMPARTMENT_LOCATION
- * VisualInformationPapyrusConstants.STEREOTYPE_BRACE_LOCATION
- */
- if(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION.equals(displayPlace)) {
- placeCombo.select(PLACE_LIST.indexOf(COMMENT));
- } else if(UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION.equals(displayPlace)) {
- placeCombo.select(PLACE_LIST.indexOf(BRACE));
- } else {
- placeCombo.select(PLACE_LIST.indexOf(COMPARTMENT));
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.uml2.uml.Profile;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Post action that manages the display of applied stereotypes.
+ */
+public class ChangeStereotypeDisplayPostAction extends GraphicalPostAction {
+
+ /** list of stereotypes to display with their names */
+ protected String displayKind = UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_HORIZONTAL_PRESENTATION;
+
+ /** place where to display stereotypes */
+ protected String displayPlace = UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION;
+
+ /** combo for configuration of the stereotype display direction */
+ protected Combo directionCombo;
+
+ /** combo for configuration of the stereotype display */
+ protected Combo displayCombo;
+
+ /** combo for configuration of the stereotype display place */
+ protected Combo placeCombo;
+
+ /** text display */
+ protected static final String TEXT = "text";
+
+ /** icon display */
+ protected static final String ICON = "icon";
+
+ /** icon display */
+ protected static final String SHAPE = "shape";
+
+ /** text and icon display */
+ protected static final String TEXT_AND_ICON = "text and icon";
+
+ /** list of available items in the stereotype display combo */
+ protected static final List<String> DISPLAY_LIST = Arrays.asList(TEXT, ICON, TEXT_AND_ICON, SHAPE);
+
+ /** horizontal display constant */
+ private static final String HORIZONTAL = "horizontal";
+
+ /** vertical display constant */
+ private static final String VERTICAL = "vertical";
+
+ /** list of available items in the stereotype direction combo */
+ protected static final List<String> DIRECTION_LIST = Arrays.asList(HORIZONTAL, VERTICAL);
+
+ /** in comment display constant */
+ protected static final String COMMENT = "comment";
+
+ /** compartment display constant */
+ protected static final String COMPARTMENT = "compartment";
+
+ /** in brace display constant */
+ protected static final String BRACE = "brace";
+
+ /** list of available items in the stereotype place combo */
+ protected static final List<String> PLACE_LIST = Arrays.asList(COMMENT, COMPARTMENT, BRACE);
+
+ /** entry proxy "parent" of this action when configuring the action */
+ protected IPaletteEntryProxy entryProxy;
+
+ /** list of applied profiles */
+ protected List<Profile> appliedProfiles;
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ super.init(configurationNode, factory);
+ if(configurationNode == null) {
+ return;
+ }
+ Node node = configurationNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.DISPLAY_KIND);
+ if(node != null) {
+ displayKind = node.getNodeValue();
+ }
+ node = configurationNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.DISPLAY_PLACE);
+ if(node != null) {
+ displayPlace = node.getNodeValue();
+ }
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void save(Node configurationNode) {
+ if(configurationNode instanceof Element) {
+ ((Element)configurationNode).setAttribute(IPapyrusPaletteConstant.DISPLAY_KIND, displayKind);
+ ((Element)configurationNode).setAttribute(IPapyrusPaletteConstant.DISPLAY_PLACE, displayPlace);
+ } else {
+ Activator.log.error("configuration node is not an Element", null);
+ }
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public ICommand getPostCommand(final IAdaptable viewAdapter) {
+
+ final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
+ return new AbstractTransactionalCommand(editingDomain, "Modify Stereotype Display", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ View view = (View)viewAdapter.getAdapter(View.class);
+
+ if(view != null) {
+ String stereotypetoDisplay = AppliedStereotypeHelper.getStereotypesToDisplay(view);
+ AppliedStereotypeHelper.getAppliedStereotypeToDisplayCommand(editingDomain, view, stereotypetoDisplay, displayKind).execute();
+ }
+ return null;
+ }
+ };
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
+ this.appliedProfiles = appliedProfiles;
+ this.entryProxy = entryProxy;
+ Composite mainComposite = new Composite(parent, SWT.BORDER);
+ GridLayout layout = new GridLayout(2, false);
+ mainComposite.setLayout(layout);
+
+ Label titleLabel = new Label(mainComposite, SWT.NONE);
+ titleLabel.setText("Customize stereotype display");
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+ titleLabel.setLayoutData(data);
+
+ Label displayLabel = new Label(mainComposite, SWT.NONE);
+ displayLabel.setText("Stereotype Display:");
+
+ displayCombo = new Combo(mainComposite, SWT.READ_ONLY | SWT.BORDER);
+ displayCombo.setItems(DISPLAY_LIST.toArray(new String[]{}));
+ data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ displayCombo.setLayoutData(data);
+ displayCombo.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ updateDisplayKindValue();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // nothing to do
+ }
+ });
+
+ Label directionLabel = new Label(mainComposite, SWT.NONE);
+ directionLabel.setText("Text alignement:");
+
+ directionCombo = new Combo(mainComposite, SWT.READ_ONLY | SWT.BORDER);
+ directionCombo.setItems(DIRECTION_LIST.toArray(new String[]{}));
+ // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ directionCombo.setLayoutData(data);
+ directionCombo.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ updateDisplayKindValue();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // nothing to do
+ }
+ });
+
+ Label placeLabel = new Label(mainComposite, SWT.NONE);
+ placeLabel.setText("Display place:");
+
+ placeCombo = new Combo(mainComposite, SWT.READ_ONLY | SWT.BORDER);
+ placeCombo.add(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION);
+ placeCombo.add(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION);
+ placeCombo.add(UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION);
+ // data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ placeCombo.setLayoutData(data);
+ placeCombo.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ updateDisplayPlaceValue();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // nothing to do
+ }
+ });
+
+ updateCombos();
+
+ return mainComposite;
+ }
+
+ /**
+ * Update the display place value according to the combo selection
+ */
+ protected void updateDisplayPlaceValue() {
+ int placeIndex = placeCombo.getSelectionIndex();
+ String place = PLACE_LIST.get((placeIndex >= 0) ? placeIndex : 0);
+
+ if(BRACE.equals(place)) {
+ displayPlace = UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION;
+ } else if(COMMENT.equals(place)) {
+ displayPlace = UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION;
+ } else {
+ displayPlace = UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION;
+ }
+
+ // be sure display is up to date
+ updateCombos();
+ }
+
+ /**
+ * update the display kind value hold by this action, given the combo value
+ */
+ protected void updateDisplayKindValue() {
+ int displayIndex = displayCombo.getSelectionIndex();
+ String display = DISPLAY_LIST.get((displayIndex >= 0) ? displayIndex : 0);
+ int directionIndex = directionCombo.getSelectionIndex();
+ String direction = DIRECTION_LIST.get((directionIndex >= 0) ? directionIndex : 0);
+ if(ICON.equals(display)) {
+ displayKind = UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION;
+ } else if(TEXT_AND_ICON.equals(display)) {
+ displayKind = UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION;
+ } else if(SHAPE.equals(display)) {
+ displayKind = UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION;
+ } else {
+ if(VERTICAL.equals(direction)) {
+ displayKind = UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION;
+ } else {
+ displayKind = UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_HORIZONTAL_PRESENTATION;
+ }
+ }
+
+ // be sure display corresponds to the real values
+ updateCombos();
+ }
+
+ /**
+ * Updates the combo according to the current values hold by this action
+ */
+ protected void updateCombos() {
+ // udpate the direction and display combo
+ /*
+ * VisualInformationPapyrusConstants.TEXT_ICON_STEREOTYPE_PRESENTATION,
+ * VisualInformationPapyrusConstants.ICON_STEREOTYPE_PRESENTATION,
+ * VisualInformationPapyrusConstants.IMAGE_STEREOTYPE_PRESENTATION,
+ * VisualInformationPapyrusConstant
+ * .STEREOTYPE_TEXT_HORIZONTAL_PRESENTATION,
+ * VisualInformationPapyrusConstant
+ * .STEREOTYPE_TEXT_VERTICAL_PRESENTATION
+ */
+ if(UMLVisualInformationPapyrusConstant.TEXT_ICON_STEREOTYPE_PRESENTATION.equals(displayKind)) {
+ displayCombo.select(DISPLAY_LIST.indexOf(TEXT_AND_ICON));
+ directionCombo.select(DIRECTION_LIST.indexOf(HORIZONTAL));
+ directionCombo.setEnabled(false);
+ } else if(UMLVisualInformationPapyrusConstant.ICON_STEREOTYPE_PRESENTATION.equals(displayKind)) {
+ displayCombo.select(DISPLAY_LIST.indexOf(ICON));
+ directionCombo.select(DIRECTION_LIST.indexOf(HORIZONTAL));
+ directionCombo.setEnabled(false);
+ } else if(UMLVisualInformationPapyrusConstant.IMAGE_STEREOTYPE_PRESENTATION.equals(displayKind)) {
+ displayCombo.select(DISPLAY_LIST.indexOf(SHAPE));
+ directionCombo.select(DIRECTION_LIST.indexOf(HORIZONTAL));
+ directionCombo.setEnabled(false);
+ } else if(UMLVisualInformationPapyrusConstant.STEREOTYPE_TEXT_VERTICAL_PRESENTATION.equals(displayKind)) {
+ displayCombo.select(DISPLAY_LIST.indexOf(TEXT));
+ directionCombo.select(DIRECTION_LIST.indexOf(VERTICAL));
+ directionCombo.setEnabled(true);
+ } else {
+ displayCombo.select(DISPLAY_LIST.indexOf(TEXT));
+ directionCombo.select(DIRECTION_LIST.indexOf(HORIZONTAL));
+ directionCombo.setEnabled(true);
+ }
+
+ // update the place combo
+ /*
+ * VisualInformationPapyrusConstants.STEREOTYPE_COMMENT_LOCATION
+ * VisualInformationPapyrusConstants.STEREOTYPE_COMPARTMENT_LOCATION
+ * VisualInformationPapyrusConstants.STEREOTYPE_BRACE_LOCATION
+ */
+ if(UMLVisualInformationPapyrusConstant.STEREOTYPE_COMMENT_LOCATION.equals(displayPlace)) {
+ placeCombo.select(PLACE_LIST.indexOf(COMMENT));
+ } else if(UMLVisualInformationPapyrusConstant.STEREOTYPE_BRACE_LOCATION.equals(displayPlace)) {
+ placeCombo.select(PLACE_LIST.indexOf(BRACE));
+ } else {
+ placeCombo.select(PLACE_LIST.indexOf(COMPARTMENT));
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Configuration.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Configuration.java
index 4c1261726e3..66c956c45d0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Configuration.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Configuration.java
@@ -1,461 +1,461 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Stereotype;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- * This class provides methods to store the palette configuration concerning the
- * stereotypes application
- *
- */
-public class Configuration {
-
- /** name of the property node */
- public static final String PROPERTY = "property"; //$NON-NLS-1$
-
- /** name of the property name attribute */
- public static final String PROPERTY_NAME = "propertyName"; //$NON-NLS-1$
-
- /** name of the runtimeProperty attribute */
- public static final String RUNTIME_PROPERTY = "runtimeProperty"; //$NON-NLS-1$
-
- /** name of the stereotype node */
- public static final String STEREOTYPE = "stereotype"; //$NON-NLS-1$
-
- /** name of the stereotypes to apply node */
- public static final String STEREOTYPE_TO_APPLY = "stereotypesToApply"; //$NON-NLS-1$
-
- /** name of the property name */
- public static final String STEREOTYPE_NAME = "stereotypeName"; //$NON-NLS-1$
-
- /** name of the value node */
- public static final String VALUE = "value"; //$NON-NLS-1$
-
- /** the stereotypes representation list */
- private ArrayList<StereotypeRepresentation> myStereotypesList = new ArrayList<StereotypeRepresentation>();
-
- /** the configuration node */
- private Node configurationNode;
-
- /**
- * the applied profile
- */
- private List<Profile> appliedProfiles;
-
- /**
- *
- * Constructor.
- *
- * @param configurationNode
- */
- public Configuration(Node configurationNode) {
- this.configurationNode = configurationNode;
- this.buildConfiguration();
- }
-
- /**
- * builds the configuration with the configurationNode contents That's to
- * say create :
- * <ul>
- * <li> {@link StereotypeRepresentation}</li>
- * <li> {@link PropertyRepresentation}</li>
- * <li> {@link Value}</li>
- * </ul>
- * corresponding to the configuration node contents to populate the
- * configuration
- */
- public void buildConfiguration() {
- if(configurationNode == null) {
- return;
- }
- NamedNodeMap nodeAttributes = configurationNode.getAttributes();
- // transform old version in new version!
- if(null != nodeAttributes.getNamedItem(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY)) {// old
- // version
- String stereotypesToApplyQN = configurationNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY).getNodeValue();
- if(stereotypesToApplyQN != null && !"".equals(stereotypesToApplyQN)) { //$NON-NLS-1$
- List<String> stereotypesToApply = PaletteUtil.getStereotypeListFromString(stereotypesToApplyQN);
- for(String qualifiedName : stereotypesToApply) {
- myStereotypesList.add(new StereotypeRepresentation(qualifiedName));
- }
- }
- } else {// new version
-
- NodeList configurationChildren = configurationNode.getChildNodes();// stereotypesToApply
- // Node
- Node stereotypesToApplyNode = null;
-
- for(int i = 0; i < configurationChildren.getLength(); i++) {
- Node configurationChild = configurationChildren.item(i);
- if(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY.equals(configurationChild.getLocalName())) {
- stereotypesToApplyNode = configurationChild;
- }
- }
-
- if(stereotypesToApplyNode != null && stereotypesToApplyNode.hasChildNodes()) {
- NodeList childNodes = stereotypesToApplyNode.getChildNodes();
- for(int iter = 0; iter < childNodes.getLength(); iter++) {
- Node steNode = childNodes.item(iter);
- if(STEREOTYPE.equals(steNode.getLocalName())) {// this node
- // is really
- // a
- // stereotype?
-
- String stereotypeName = steNode.getAttributes().getNamedItem(STEREOTYPE_NAME).getNodeValue();
- StereotypeRepresentation mySte = null;
- // does this stereotype exist?
- if(getStereotypeRepresentation(stereotypeName) == null) {
- mySte = new StereotypeRepresentation(stereotypeName);
- } else {
- mySte = getStereotypeRepresentation(stereotypeName);
- }
-
- // we store the stereotype
- if(steNode.hasChildNodes()) {// there are associated
- // properties and values
- NodeList properties = steNode.getChildNodes();
- for(int i = 0; i < properties.getLength(); i++) {// we
- // iterate
- // on
- // the
- // properties
- Node propertyNode = properties.item(i);
- if(PROPERTY.equals(propertyNode.getLocalName())) {// ist'
- // a
- // property
- // node?
- String propertyName = propertyNode.getAttributes().getNamedItem(PROPERTY_NAME).getNodeValue();
- PropertyRepresentation proper = null;
- if(mySte.getPropertyRepresentation(stereotypeName, propertyName) != null) {
- proper = mySte.getPropertyRepresentation(stereotypeName, propertyName);
- } else {
- proper = new PropertyRepresentation(stereotypeName, propertyName);
- mySte.addProperty(proper);
- }
-
- NodeList valuesList = propertyNode.getChildNodes();
-
- for(int ii = 0; ii < valuesList.getLength(); ii++) {// we iterate
- // on the
- // values
- Node valueNode = valuesList.item(ii);
- if(VALUE.equals(valueNode.getLocalName())) {// this node
- // is really
- // a value?
- Value myValue = new Value(valueNode.getTextContent());
- proper.addValue(myValue);
- }
- }
-
- } else if(RUNTIME_PROPERTY.equals(propertyNode.getLocalName())) {// it's a runtime
- // property
- String propertyName = propertyNode.getAttributes().getNamedItem(PROPERTY_NAME).getNodeValue();
- propertyName = propertyNode.getAttributes().getNamedItem(PROPERTY_NAME).getNodeValue();
- PropertyRepresentation prop = null;
- if(mySte.getPropertyRepresentation(stereotypeName, propertyName) != null) {
- prop = mySte.getPropertyRepresentation(stereotypeName, propertyName);
- } else {
- prop = new PropertyRepresentation(stereotypeName, propertyName);
- mySte.addProperty(prop);
- }
- prop.setRuntime(true);
- }
- }
- }
- myStereotypesList.add(mySte);
- }
- }
- }
- }
- }
-
- /**
- * This method completes the {@link Configuration} object with the
- * properties owned by each stereotype. It completes the contents obtained
- * with the {@link #buildConfiguration()} method. This method is called by :
- * <ul>
- * <li>{@link #setAppliedProfiles(List)}</li>
- * <li>{@link #setStereotypesRepresentations(ArrayList)}</li>
- * </ul>
- *
- */
- protected void completeData() {
- List<Stereotype> stereotypeList = retrieveAllStereotypesOwnedByTheProfiles();
- if(!stereotypeList.isEmpty()) {
- for(Stereotype ste : stereotypeList) {
- if(ste != null) {
- StereotypeRepresentation currentSte = null;
- // does this stereotype exist?
- if(getStereotypeRepresentation(ste.getQualifiedName()) == null) {
- currentSte = new StereotypeRepresentation(ste.getQualifiedName());
- myStereotypesList.add(currentSte);
- } else {
- currentSte = getStereotypeRepresentation(ste.getQualifiedName());
- }
- currentSte.setUMLStereotype(ste);
- EList<Property> attributs = ste.getAllAttributes();
- for(Property prop : attributs) {
- if(prop != null) {
- if((prop.getAssociation() == null && !prop.isDerived()) || ((prop.getAssociation() != null) && (!prop.getName().startsWith("base_")) && !prop.isDerived())) { //$NON-NLS-1$
- if(currentSte.getPropertyRepresentation(ste.getQualifiedName(), prop.getQualifiedName()) == null) {
- PropertyRepresentation myProp = new PropertyRepresentation(ste.getQualifiedName(), prop.getQualifiedName());
- myProp.setUMLProperty(prop);
- currentSte.addProperty(myProp);
- } else {
- currentSte.getPropertyRepresentation(ste.getQualifiedName(), prop.getQualifiedName()).setUMLProperty(prop);
- }
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * Saves the configuration in the parentNode}
- *
- * @param parentNode
- * the node that contains the configuration
- */
- public void save(Node parentNode) {
- ListIterator<StereotypeRepresentation> it = getStereotypesRepresentations().listIterator();
- Element appliedStereotypeNode = ((Element)parentNode).getOwnerDocument().createElement(STEREOTYPE_TO_APPLY);
- while(it.hasNext()) {// iteration on stereotypes
- StereotypeRepresentation currentStereotype = it.next();
- Element stereotypeNode = ((Element)parentNode).getOwnerDocument().createElement(STEREOTYPE);
- stereotypeNode.setAttribute(STEREOTYPE_NAME, currentStereotype.getStereotypeQualifiedName());
-
- // the properties with value
- for(PropertyRepresentation prop : currentStereotype.getPropertiesWithValues()) {
- Element propertyNode = ((Element)parentNode).getOwnerDocument().createElement(PROPERTY);
- propertyNode.setAttribute(PROPERTY_NAME, prop.getQualifiedName());
- ArrayList<Value> values = prop.getValues();
-
- for(int i = 0; i < ((ArrayList<?>)values).size(); i++) {// iteration
- // on
- // values
- Element valueNode = ((Element)parentNode).getOwnerDocument().createElement(VALUE);
- valueNode.setTextContent(((ArrayList<?>)values).get(i).toString());
- propertyNode.appendChild(valueNode);
- }
-
- stereotypeNode.appendChild(propertyNode);
-
- }
-
- // the runtime properties
- for(PropertyRepresentation prop : currentStereotype.getRuntimeProperties()) {
- Element propertyNode = ((Element)parentNode).getOwnerDocument().createElement(RUNTIME_PROPERTY);
- propertyNode.setAttribute(PROPERTY_NAME, prop.getQualifiedName());
- stereotypeNode.appendChild(propertyNode);
- }
-
- appliedStereotypeNode.appendChild(stereotypeNode);
-
- }// end of iteration on stereotype
- parentNode.appendChild(appliedStereotypeNode);
-
- }
-
- /**
- * Adds new stereotypes to the {@link Configuration}
- *
- * @param stereotypesQNList
- * the list of stereotypes to add, identified by the qualified
- * name
- */
- public void setStereotypesRepresentations(ArrayList<String> stereotypesQNList) {
- // 1. remove unused stereotype
- for(String oldSte : getStereotypesToApplyQN()) {
- if(!stereotypesQNList.contains(oldSte)) {
- myStereotypesList.remove(getStereotypeRepresentation(oldSte));
- }
- }
- // 2. add new stereotypes
- for(String ste : stereotypesQNList) {
- this.myStereotypesList.add(new StereotypeRepresentation(ste));
- }
-
- // 3. complete datas
- completeData();
- }
-
- /**
- *
- * @param stereotypeQN
- * the stereotype to find in the configuration, identified by its
- * qualified name
- * @return <ul>
- * <li> {@link StereotypeRepresentation} if it exits
- * <li> {@code null} if not</li>
- * </ul>
- */
- public StereotypeRepresentation getStereotypeRepresentation(String stereotypeQN) {
- for(StereotypeRepresentation ste : myStereotypesList) {
- if(ste.getStereotypeQualifiedName().equals(stereotypeQN)) {
- return ste;
- }
- }
- return null;
- }
-
- /**
- * Returns the list of stereotypes contained by the {@link Configuration}
- *
- * @return all the {@link StereotypeRepresentation} owned by the {@link Configuration}
- */
- public ArrayList<StereotypeRepresentation> getStereotypesRepresentations() {
- return myStereotypesList;
- }
-
- /**
- * Returns the list of applied stereotypes contained by the {@link Configuration}
- *
- * @return the list of applied stereotypes identified by its qualified name
- */
- public ArrayList<String> getStereotypesToApplyQN() {
- ArrayList<String> stereotypesList = new ArrayList<String>();
- for(StereotypeRepresentation ste : getStereotypesRepresentations()) {
- stereotypesList.add(ste.getStereotypeQualifiedName());
- }
- return stereotypesList;
- }
-
- /**
- *
- * @param stereotype
- * the stereotype to remove from the {@link Configuration}
- */
- public void removeStereotype(StereotypeRepresentation stereotype) {
- myStereotypesList.remove(stereotype);
- }
-
- /**
- * setter for {@link #appliedProfiles} moreover call {@link #completeData()} to complete the {@link Configuration}
- *
- * @param appliedProfiles
- * the profiles to apply
- */
- public void setAppliedProfiles(List<Profile> appliedProfiles) {
- this.appliedProfiles = appliedProfiles;
- this.completeData();
-
- }
-
- /**
- * Returns the list of the applied {@link Profile}
- *
- * @return the applied profiles
- */
- public List<Profile> getAppliedProfiles() {
- return this.appliedProfiles;
- }
-
- /**
- * Retrieves the list of stereotypes owned by {@link #appliedProfiles}
- *
- * @return the list of stereotypes owned by the profiles
- *
- */
- protected List<Stereotype> retrieveAllStereotypesOwnedByTheProfiles() {
- List<Stereotype> stereotypes = new ArrayList<Stereotype>();
- for(String qualifiedName : getStereotypesToApplyQN()) {
- Stereotype stereotype = null;
- Iterator<Profile> it = getAppliedProfiles().iterator();
- while(stereotype == null && it.hasNext()) {
- stereotype = retrieveStereotypeFromQualifiedName(qualifiedName, it.next());
- }
- if(stereotype == null) {
- Activator.log.error("impossible to retrieve stereotype " + qualifiedName, null); //$NON-NLS-1$
- }
- stereotypes.add(stereotype);
- }
- return stereotypes;
- }
-
- /**
- * Retrieves a Stereotype in a profile, given its qualified name.
- *
- * @param qualifiedName
- * the qualified name of the stereotype to find
- * @param profile
- * the profile to look in
- * @return <code>null</code> or the found stereotype
- */
- protected Stereotype retrieveStereotypeFromQualifiedName(String qualifiedName, Profile profile) {
- for(Stereotype stereotype : profile.getOwnedStereotypes()) {
- if(qualifiedName.equals(stereotype.getQualifiedName())) {
- return stereotype;
- }
- }
- return null;
- }
-
- /**
- * Returns all the stereotypes
- *
- * @return all the stereotypes
- */
- public List<Stereotype> getUMLStereotypes() {
- ArrayList<Stereotype> list = new ArrayList<Stereotype>();
- for(StereotypeRepresentation ste : myStereotypesList) {
- list.add(ste.getUMLStereotype());
- }
- return list;
- }
-
- /**
- *
- * @return <ul>
- * <li> {@code true} if there is runtime properties
- * <li> {@code false} if not</li>
- * </ul>
- */
- public boolean hasRuntimeProperties() {
- for(StereotypeRepresentation ste : myStereotypesList) {
- if(ste.hasRuntimeProperties()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns the configuration node
- *
- * @return the configuration node
- */
- public Node getConfigurationNode() {
- return configurationNode;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ *
+ * This class provides methods to store the palette configuration concerning the
+ * stereotypes application
+ *
+ */
+public class Configuration {
+
+ /** name of the property node */
+ public static final String PROPERTY = "property"; //$NON-NLS-1$
+
+ /** name of the property name attribute */
+ public static final String PROPERTY_NAME = "propertyName"; //$NON-NLS-1$
+
+ /** name of the runtimeProperty attribute */
+ public static final String RUNTIME_PROPERTY = "runtimeProperty"; //$NON-NLS-1$
+
+ /** name of the stereotype node */
+ public static final String STEREOTYPE = "stereotype"; //$NON-NLS-1$
+
+ /** name of the stereotypes to apply node */
+ public static final String STEREOTYPE_TO_APPLY = "stereotypesToApply"; //$NON-NLS-1$
+
+ /** name of the property name */
+ public static final String STEREOTYPE_NAME = "stereotypeName"; //$NON-NLS-1$
+
+ /** name of the value node */
+ public static final String VALUE = "value"; //$NON-NLS-1$
+
+ /** the stereotypes representation list */
+ private ArrayList<StereotypeRepresentation> myStereotypesList = new ArrayList<StereotypeRepresentation>();
+
+ /** the configuration node */
+ private Node configurationNode;
+
+ /**
+ * the applied profile
+ */
+ private List<Profile> appliedProfiles;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param configurationNode
+ */
+ public Configuration(Node configurationNode) {
+ this.configurationNode = configurationNode;
+ this.buildConfiguration();
+ }
+
+ /**
+ * builds the configuration with the configurationNode contents That's to
+ * say create :
+ * <ul>
+ * <li> {@link StereotypeRepresentation}</li>
+ * <li> {@link PropertyRepresentation}</li>
+ * <li> {@link Value}</li>
+ * </ul>
+ * corresponding to the configuration node contents to populate the
+ * configuration
+ */
+ public void buildConfiguration() {
+ if(configurationNode == null) {
+ return;
+ }
+ NamedNodeMap nodeAttributes = configurationNode.getAttributes();
+ // transform old version in new version!
+ if(null != nodeAttributes.getNamedItem(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY)) {// old
+ // version
+ String stereotypesToApplyQN = configurationNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY).getNodeValue();
+ if(stereotypesToApplyQN != null && !"".equals(stereotypesToApplyQN)) { //$NON-NLS-1$
+ List<String> stereotypesToApply = PaletteUtil.getStereotypeListFromString(stereotypesToApplyQN);
+ for(String qualifiedName : stereotypesToApply) {
+ myStereotypesList.add(new StereotypeRepresentation(qualifiedName));
+ }
+ }
+ } else {// new version
+
+ NodeList configurationChildren = configurationNode.getChildNodes();// stereotypesToApply
+ // Node
+ Node stereotypesToApplyNode = null;
+
+ for(int i = 0; i < configurationChildren.getLength(); i++) {
+ Node configurationChild = configurationChildren.item(i);
+ if(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY.equals(configurationChild.getLocalName())) {
+ stereotypesToApplyNode = configurationChild;
+ }
+ }
+
+ if(stereotypesToApplyNode != null && stereotypesToApplyNode.hasChildNodes()) {
+ NodeList childNodes = stereotypesToApplyNode.getChildNodes();
+ for(int iter = 0; iter < childNodes.getLength(); iter++) {
+ Node steNode = childNodes.item(iter);
+ if(STEREOTYPE.equals(steNode.getLocalName())) {// this node
+ // is really
+ // a
+ // stereotype?
+
+ String stereotypeName = steNode.getAttributes().getNamedItem(STEREOTYPE_NAME).getNodeValue();
+ StereotypeRepresentation mySte = null;
+ // does this stereotype exist?
+ if(getStereotypeRepresentation(stereotypeName) == null) {
+ mySte = new StereotypeRepresentation(stereotypeName);
+ } else {
+ mySte = getStereotypeRepresentation(stereotypeName);
+ }
+
+ // we store the stereotype
+ if(steNode.hasChildNodes()) {// there are associated
+ // properties and values
+ NodeList properties = steNode.getChildNodes();
+ for(int i = 0; i < properties.getLength(); i++) {// we
+ // iterate
+ // on
+ // the
+ // properties
+ Node propertyNode = properties.item(i);
+ if(PROPERTY.equals(propertyNode.getLocalName())) {// ist'
+ // a
+ // property
+ // node?
+ String propertyName = propertyNode.getAttributes().getNamedItem(PROPERTY_NAME).getNodeValue();
+ PropertyRepresentation proper = null;
+ if(mySte.getPropertyRepresentation(stereotypeName, propertyName) != null) {
+ proper = mySte.getPropertyRepresentation(stereotypeName, propertyName);
+ } else {
+ proper = new PropertyRepresentation(stereotypeName, propertyName);
+ mySte.addProperty(proper);
+ }
+
+ NodeList valuesList = propertyNode.getChildNodes();
+
+ for(int ii = 0; ii < valuesList.getLength(); ii++) {// we iterate
+ // on the
+ // values
+ Node valueNode = valuesList.item(ii);
+ if(VALUE.equals(valueNode.getLocalName())) {// this node
+ // is really
+ // a value?
+ Value myValue = new Value(valueNode.getTextContent());
+ proper.addValue(myValue);
+ }
+ }
+
+ } else if(RUNTIME_PROPERTY.equals(propertyNode.getLocalName())) {// it's a runtime
+ // property
+ String propertyName = propertyNode.getAttributes().getNamedItem(PROPERTY_NAME).getNodeValue();
+ propertyName = propertyNode.getAttributes().getNamedItem(PROPERTY_NAME).getNodeValue();
+ PropertyRepresentation prop = null;
+ if(mySte.getPropertyRepresentation(stereotypeName, propertyName) != null) {
+ prop = mySte.getPropertyRepresentation(stereotypeName, propertyName);
+ } else {
+ prop = new PropertyRepresentation(stereotypeName, propertyName);
+ mySte.addProperty(prop);
+ }
+ prop.setRuntime(true);
+ }
+ }
+ }
+ myStereotypesList.add(mySte);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This method completes the {@link Configuration} object with the
+ * properties owned by each stereotype. It completes the contents obtained
+ * with the {@link #buildConfiguration()} method. This method is called by :
+ * <ul>
+ * <li>{@link #setAppliedProfiles(List)}</li>
+ * <li>{@link #setStereotypesRepresentations(ArrayList)}</li>
+ * </ul>
+ *
+ */
+ protected void completeData() {
+ List<Stereotype> stereotypeList = retrieveAllStereotypesOwnedByTheProfiles();
+ if(!stereotypeList.isEmpty()) {
+ for(Stereotype ste : stereotypeList) {
+ if(ste != null) {
+ StereotypeRepresentation currentSte = null;
+ // does this stereotype exist?
+ if(getStereotypeRepresentation(ste.getQualifiedName()) == null) {
+ currentSte = new StereotypeRepresentation(ste.getQualifiedName());
+ myStereotypesList.add(currentSte);
+ } else {
+ currentSte = getStereotypeRepresentation(ste.getQualifiedName());
+ }
+ currentSte.setUMLStereotype(ste);
+ EList<Property> attributs = ste.getAllAttributes();
+ for(Property prop : attributs) {
+ if(prop != null) {
+ if((prop.getAssociation() == null && !prop.isDerived()) || ((prop.getAssociation() != null) && (!prop.getName().startsWith("base_")) && !prop.isDerived())) { //$NON-NLS-1$
+ if(currentSte.getPropertyRepresentation(ste.getQualifiedName(), prop.getQualifiedName()) == null) {
+ PropertyRepresentation myProp = new PropertyRepresentation(ste.getQualifiedName(), prop.getQualifiedName());
+ myProp.setUMLProperty(prop);
+ currentSte.addProperty(myProp);
+ } else {
+ currentSte.getPropertyRepresentation(ste.getQualifiedName(), prop.getQualifiedName()).setUMLProperty(prop);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Saves the configuration in the parentNode}
+ *
+ * @param parentNode
+ * the node that contains the configuration
+ */
+ public void save(Node parentNode) {
+ ListIterator<StereotypeRepresentation> it = getStereotypesRepresentations().listIterator();
+ Element appliedStereotypeNode = ((Element)parentNode).getOwnerDocument().createElement(STEREOTYPE_TO_APPLY);
+ while(it.hasNext()) {// iteration on stereotypes
+ StereotypeRepresentation currentStereotype = it.next();
+ Element stereotypeNode = ((Element)parentNode).getOwnerDocument().createElement(STEREOTYPE);
+ stereotypeNode.setAttribute(STEREOTYPE_NAME, currentStereotype.getStereotypeQualifiedName());
+
+ // the properties with value
+ for(PropertyRepresentation prop : currentStereotype.getPropertiesWithValues()) {
+ Element propertyNode = ((Element)parentNode).getOwnerDocument().createElement(PROPERTY);
+ propertyNode.setAttribute(PROPERTY_NAME, prop.getQualifiedName());
+ ArrayList<Value> values = prop.getValues();
+
+ for(int i = 0; i < ((ArrayList<?>)values).size(); i++) {// iteration
+ // on
+ // values
+ Element valueNode = ((Element)parentNode).getOwnerDocument().createElement(VALUE);
+ valueNode.setTextContent(((ArrayList<?>)values).get(i).toString());
+ propertyNode.appendChild(valueNode);
+ }
+
+ stereotypeNode.appendChild(propertyNode);
+
+ }
+
+ // the runtime properties
+ for(PropertyRepresentation prop : currentStereotype.getRuntimeProperties()) {
+ Element propertyNode = ((Element)parentNode).getOwnerDocument().createElement(RUNTIME_PROPERTY);
+ propertyNode.setAttribute(PROPERTY_NAME, prop.getQualifiedName());
+ stereotypeNode.appendChild(propertyNode);
+ }
+
+ appliedStereotypeNode.appendChild(stereotypeNode);
+
+ }// end of iteration on stereotype
+ parentNode.appendChild(appliedStereotypeNode);
+
+ }
+
+ /**
+ * Adds new stereotypes to the {@link Configuration}
+ *
+ * @param stereotypesQNList
+ * the list of stereotypes to add, identified by the qualified
+ * name
+ */
+ public void setStereotypesRepresentations(ArrayList<String> stereotypesQNList) {
+ // 1. remove unused stereotype
+ for(String oldSte : getStereotypesToApplyQN()) {
+ if(!stereotypesQNList.contains(oldSte)) {
+ myStereotypesList.remove(getStereotypeRepresentation(oldSte));
+ }
+ }
+ // 2. add new stereotypes
+ for(String ste : stereotypesQNList) {
+ this.myStereotypesList.add(new StereotypeRepresentation(ste));
+ }
+
+ // 3. complete datas
+ completeData();
+ }
+
+ /**
+ *
+ * @param stereotypeQN
+ * the stereotype to find in the configuration, identified by its
+ * qualified name
+ * @return <ul>
+ * <li> {@link StereotypeRepresentation} if it exits
+ * <li> {@code null} if not</li>
+ * </ul>
+ */
+ public StereotypeRepresentation getStereotypeRepresentation(String stereotypeQN) {
+ for(StereotypeRepresentation ste : myStereotypesList) {
+ if(ste.getStereotypeQualifiedName().equals(stereotypeQN)) {
+ return ste;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the list of stereotypes contained by the {@link Configuration}
+ *
+ * @return all the {@link StereotypeRepresentation} owned by the {@link Configuration}
+ */
+ public ArrayList<StereotypeRepresentation> getStereotypesRepresentations() {
+ return myStereotypesList;
+ }
+
+ /**
+ * Returns the list of applied stereotypes contained by the {@link Configuration}
+ *
+ * @return the list of applied stereotypes identified by its qualified name
+ */
+ public ArrayList<String> getStereotypesToApplyQN() {
+ ArrayList<String> stereotypesList = new ArrayList<String>();
+ for(StereotypeRepresentation ste : getStereotypesRepresentations()) {
+ stereotypesList.add(ste.getStereotypeQualifiedName());
+ }
+ return stereotypesList;
+ }
+
+ /**
+ *
+ * @param stereotype
+ * the stereotype to remove from the {@link Configuration}
+ */
+ public void removeStereotype(StereotypeRepresentation stereotype) {
+ myStereotypesList.remove(stereotype);
+ }
+
+ /**
+ * setter for {@link #appliedProfiles} moreover call {@link #completeData()} to complete the {@link Configuration}
+ *
+ * @param appliedProfiles
+ * the profiles to apply
+ */
+ public void setAppliedProfiles(List<Profile> appliedProfiles) {
+ this.appliedProfiles = appliedProfiles;
+ this.completeData();
+
+ }
+
+ /**
+ * Returns the list of the applied {@link Profile}
+ *
+ * @return the applied profiles
+ */
+ public List<Profile> getAppliedProfiles() {
+ return this.appliedProfiles;
+ }
+
+ /**
+ * Retrieves the list of stereotypes owned by {@link #appliedProfiles}
+ *
+ * @return the list of stereotypes owned by the profiles
+ *
+ */
+ protected List<Stereotype> retrieveAllStereotypesOwnedByTheProfiles() {
+ List<Stereotype> stereotypes = new ArrayList<Stereotype>();
+ for(String qualifiedName : getStereotypesToApplyQN()) {
+ Stereotype stereotype = null;
+ Iterator<Profile> it = getAppliedProfiles().iterator();
+ while(stereotype == null && it.hasNext()) {
+ stereotype = retrieveStereotypeFromQualifiedName(qualifiedName, it.next());
+ }
+ if(stereotype == null) {
+ Activator.log.error("impossible to retrieve stereotype " + qualifiedName, null); //$NON-NLS-1$
+ }
+ stereotypes.add(stereotype);
+ }
+ return stereotypes;
+ }
+
+ /**
+ * Retrieves a Stereotype in a profile, given its qualified name.
+ *
+ * @param qualifiedName
+ * the qualified name of the stereotype to find
+ * @param profile
+ * the profile to look in
+ * @return <code>null</code> or the found stereotype
+ */
+ protected Stereotype retrieveStereotypeFromQualifiedName(String qualifiedName, Profile profile) {
+ for(Stereotype stereotype : profile.getOwnedStereotypes()) {
+ if(qualifiedName.equals(stereotype.getQualifiedName())) {
+ return stereotype;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns all the stereotypes
+ *
+ * @return all the stereotypes
+ */
+ public List<Stereotype> getUMLStereotypes() {
+ ArrayList<Stereotype> list = new ArrayList<Stereotype>();
+ for(StereotypeRepresentation ste : myStereotypesList) {
+ list.add(ste.getUMLStereotype());
+ }
+ return list;
+ }
+
+ /**
+ *
+ * @return <ul>
+ * <li> {@code true} if there is runtime properties
+ * <li> {@code false} if not</li>
+ * </ul>
+ */
+ public boolean hasRuntimeProperties() {
+ for(StereotypeRepresentation ste : myStereotypesList) {
+ if(ste.hasRuntimeProperties()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns the configuration node
+ *
+ * @return the configuration node
+ */
+ public Node getConfigurationNode() {
+ return configurationNode;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DefinedPropertiesAtRuntimeDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DefinedPropertiesAtRuntimeDialog.java
index 284dde90636..ac1fbd45c32 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DefinedPropertiesAtRuntimeDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DefinedPropertiesAtRuntimeDialog.java
@@ -1,350 +1,350 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- * This Class provides a dialog to edit meta-elements properties. The editor is
- * chosen following the property type. The editor order is the following :
- * <ul>
- * <li> {@link Text}</li>
- * <li> {@link Combo}</li>
- * <li> {@link Button} (checkBox)</li>
- * </ul>
- *
- */
-public class DefinedPropertiesAtRuntimeDialog extends Dialog {
-
- /** The runtime properties. */
- protected List<String> runtimeProperties;
-
- /** The title. */
- protected String title;
-
- /** The message. */
- private String message;
-
- /** The element to edit. */
- private EObject elementToEdit;
-
- /** The list of applied stereotypes */
- protected List<Stereotype> appliedStereotypes = null;
-
- /** The boolean meta properties. */
- private ArrayList<EAttribute> booleanMetaProperties = new ArrayList<EAttribute>();
-
- /** The string meta properties. */
- private ArrayList<EAttribute> stringMetaProperties = new ArrayList<EAttribute>();
-
- /** The enumeration meta properties. */
- private ArrayList<EAttribute> enumerationMetaProperties = new ArrayList<EAttribute>();
-
- /**
- * Instantiates a new dialog.
- *
- * @param shell
- * the shell
- * @param title
- * the title
- * @param message
- * the message
- * @param runtimeProperties
- * the runtime properties
- * @param objectToEdit
- * the object to edit
- */
- protected DefinedPropertiesAtRuntimeDialog(Shell shell, String title, String message, List<String> runtimeProperties, EObject objectToEdit) {
- super(shell);
- this.runtimeProperties = runtimeProperties;
- this.title = title;
- this.elementToEdit = objectToEdit;
- this.message = message;
- if(elementToEdit instanceof Element) {
- appliedStereotypes = ((Element)elementToEdit).getAppliedStereotypes();
- }
- EClass currentEClass = (EClass)elementToEdit.eClass();
- EList<EAttribute> allAttributs = currentEClass.getEAllAttributes();
- for(EAttribute eAttribute : allAttributs) {
- if((!eAttribute.isDerived()) && eAttribute.isChangeable()) {
- // we class the properties following its type
- EClassifier eType = eAttribute.getEType();
- String instanceTypeName = eType.getInstanceClassName();
- if(runtimeProperties.contains(eAttribute.getName())) {
- if(eType instanceof EEnum) {
- enumerationMetaProperties.add(eAttribute);
- } else if(instanceTypeName.equals(Integer.class.getCanonicalName())) {
- stringMetaProperties.add(eAttribute);
- } else if(instanceTypeName.equals("boolean")) { //$NON-NLS-1$
- booleanMetaProperties.add(eAttribute);
- } else if(instanceTypeName.equals(String.class.getCanonicalName())) {
- stringMetaProperties.add(eAttribute);
- }
- }
- }
-
- }
-
- }
-
- /**
- *
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- *
- * @param shell
- */
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if(title != null) {
- shell.setText(title);
- }
-
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- * we remove the CANCEL Button
- * @param parent
- */
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- *
- * @param parent
- * @return
- */
- @Override
- protected Control createDialogArea(Composite parent) {
-
- // create the composite
- Composite composite = (Composite)super.createDialogArea(parent);
- GridLayout layout = new GridLayout(2, false);
- composite.setLayout(layout);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- composite.setLayoutData(data);
-
- // trick to have the message on the two columns!(a GridData with
- // horizontalSpan = 2 on label doesn't work)
- Composite compo = new Composite(composite, SWT.NONE);
- GridLayout compoLayout = new GridLayout(1, false);
- compo.setLayout(compoLayout);
- GridData compoData = new GridData(GridData.FILL_HORIZONTAL);
- compoData.horizontalSpan = 2;
- compo.setLayoutData(compoData);
-
- Label label = new Label(compo, SWT.NONE);
- label.setText(message);
-
- // create the editors
- if(stringMetaProperties.size() != 0) {
- createTextArea(composite);
- }
- if(enumerationMetaProperties.size() != 0) {
- createCombo(composite);
- }
- if(booleanMetaProperties.size() != 0) {
- createCheckBox(composite);
- }
-
- return composite;
- }
-
- /**
- * Makes the title, that's to say, put the first letter in upper case
- *
- * @param name
- * the name
- * @return the string
- */
- protected String makeTitle(String name) {
- String title = null;
- if(name != null) {
- title = new String(name);
- String firstLetter = name.substring(0, 1);
- title = title.replaceFirst(firstLetter, firstLetter.toUpperCase());
- }
- return title;
- }
-
- /**
- * Creates the text area.
- *
- * @param composite
- * the composite
- */
- private void createTextArea(Composite composite) {
- for(int iter = 0; iter < stringMetaProperties.size(); iter++) {
- Label label = new Label(composite, SWT.NONE);
- String fieldTitle = makeTitle(stringMetaProperties.get(iter).getName()) + " :"; //$NON-NLS-1$
- label.setText(fieldTitle);
-
- Text text = new Text(composite, SWT.BORDER);
- GridData textData = new GridData(GridData.FILL_HORIZONTAL);
- text.setLayoutData(textData);
-
- String value = (String)((EObject)elementToEdit).eGet(stringMetaProperties.get(iter));
- text.setText(value);
-
- final int iterFinal = iter;
- final Text textFinal = text;
- text.addFocusListener(new FocusAdapter() {
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
- */
- public void focusLost(FocusEvent e) {
- ((EObject)elementToEdit).eSet(stringMetaProperties.get(iterFinal), textFinal.getText());
- }
- });
-
- }
-
- }
-
- /**
- * Creates the combo.
- *
- * @param composite
- * the composite
- */
- private void createCombo(Composite composite) {
- for(int iter = 0; iter < enumerationMetaProperties.size(); iter++) {
- Label label = new Label(composite, SWT.NONE);
- String fieldTitle = makeTitle(enumerationMetaProperties.get(iter).getName()) + " :"; //$NON-NLS-1$
- label.setText(fieldTitle);
- Combo combo = new Combo(composite, SWT.READ_ONLY);
-
- // get the items
- EAttribute currentAttributes = enumerationMetaProperties.get(iter);
- EEnum eType = (EEnum)currentAttributes.getEType();
-
- final List<EEnumLiteral> literals = eType.getELiterals();
- final String[] proposals = new String[literals.size() + 1];
- ArrayList<String> list = new ArrayList<String>();
- list.add(""); //$NON-NLS-1$
- proposals[0] = ""; //$NON-NLS-1$
- for(int i = 0; i < literals.size(); i++) {
- // i+1 because there is already the "" string
- proposals[i + 1] = literals.get(i).getLiteral();
- list.add(i + 1, literals.get(i).getLiteral());
- }
- combo.setItems(proposals);
- // get initial value
- Object selection = ((EObject)elementToEdit).eGet(currentAttributes);
- combo.select(list.indexOf(selection.toString()));
- GridData textData = new GridData(GridData.FILL_HORIZONTAL);
- combo.setLayoutData(textData);
- final Combo comboFinal = combo;
- final int iterFinal = iter;
- combo.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- int index = comboFinal.getSelectionIndex();
- if(index == 0) {
- ((EObject)elementToEdit).eUnset(enumerationMetaProperties.get(iterFinal));
- } else {
- ((EObject)elementToEdit).eSet(enumerationMetaProperties.get(iterFinal), literals.get(index - 1).getInstance());
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
-
- }
- }
-
- /**
- * Creates the check box.
- *
- * @param parent
- * the parent
- */
- private void createCheckBox(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(1, false);
- GridData data = new GridData();
- data.horizontalSpan = 2;
-
- composite.setLayoutData(data);
- layout.numColumns = 3;
- composite.setLayout(layout);
- for(int iter = 0; iter < booleanMetaProperties.size(); iter++) {
- Composite grp = new Composite(composite, SWT.NONE);
- GridLayout layout2 = new GridLayout();
- layout2.numColumns = 2;
- grp.setLayout(layout2);
-
- Button button = new Button(grp, SWT.FLAT | SWT.CHECK);
- Label label = new Label(grp, SWT.NONE);
- String fieldTitle = makeTitle(booleanMetaProperties.get(iter).getName());
- label.setText(fieldTitle);
- // get button state
- Boolean state = (Boolean)((EObject)elementToEdit).eGet(booleanMetaProperties.get(iter));
- button.setSelection(state);
- final int iterFinal = iter;
- button.addSelectionListener(new SelectionAdapter() {
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- // get the old value
- Boolean oldValue = (Boolean)((EObject)elementToEdit).eGet(booleanMetaProperties.get(iterFinal));
- ((EObject)elementToEdit).eSet(booleanMetaProperties.get(iterFinal), !oldValue);
- }
- });
-
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+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.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Stereotype;
+
+/**
+ * This Class provides a dialog to edit meta-elements properties. The editor is
+ * chosen following the property type. The editor order is the following :
+ * <ul>
+ * <li> {@link Text}</li>
+ * <li> {@link Combo}</li>
+ * <li> {@link Button} (checkBox)</li>
+ * </ul>
+ *
+ */
+public class DefinedPropertiesAtRuntimeDialog extends Dialog {
+
+ /** The runtime properties. */
+ protected List<String> runtimeProperties;
+
+ /** The title. */
+ protected String title;
+
+ /** The message. */
+ private String message;
+
+ /** The element to edit. */
+ private EObject elementToEdit;
+
+ /** The list of applied stereotypes */
+ protected List<Stereotype> appliedStereotypes = null;
+
+ /** The boolean meta properties. */
+ private ArrayList<EAttribute> booleanMetaProperties = new ArrayList<EAttribute>();
+
+ /** The string meta properties. */
+ private ArrayList<EAttribute> stringMetaProperties = new ArrayList<EAttribute>();
+
+ /** The enumeration meta properties. */
+ private ArrayList<EAttribute> enumerationMetaProperties = new ArrayList<EAttribute>();
+
+ /**
+ * Instantiates a new dialog.
+ *
+ * @param shell
+ * the shell
+ * @param title
+ * the title
+ * @param message
+ * the message
+ * @param runtimeProperties
+ * the runtime properties
+ * @param objectToEdit
+ * the object to edit
+ */
+ protected DefinedPropertiesAtRuntimeDialog(Shell shell, String title, String message, List<String> runtimeProperties, EObject objectToEdit) {
+ super(shell);
+ this.runtimeProperties = runtimeProperties;
+ this.title = title;
+ this.elementToEdit = objectToEdit;
+ this.message = message;
+ if(elementToEdit instanceof Element) {
+ appliedStereotypes = ((Element)elementToEdit).getAppliedStereotypes();
+ }
+ EClass currentEClass = (EClass)elementToEdit.eClass();
+ EList<EAttribute> allAttributs = currentEClass.getEAllAttributes();
+ for(EAttribute eAttribute : allAttributs) {
+ if((!eAttribute.isDerived()) && eAttribute.isChangeable()) {
+ // we class the properties following its type
+ EClassifier eType = eAttribute.getEType();
+ String instanceTypeName = eType.getInstanceClassName();
+ if(runtimeProperties.contains(eAttribute.getName())) {
+ if(eType instanceof EEnum) {
+ enumerationMetaProperties.add(eAttribute);
+ } else if(instanceTypeName.equals(Integer.class.getCanonicalName())) {
+ stringMetaProperties.add(eAttribute);
+ } else if(instanceTypeName.equals("boolean")) { //$NON-NLS-1$
+ booleanMetaProperties.add(eAttribute);
+ } else if(instanceTypeName.equals(String.class.getCanonicalName())) {
+ stringMetaProperties.add(eAttribute);
+ }
+ }
+ }
+
+ }
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ *
+ * @param shell
+ */
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ if(title != null) {
+ shell.setText(title);
+ }
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ * we remove the CANCEL Button
+ * @param parent
+ */
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * @return
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+
+ // create the composite
+ Composite composite = (Composite)super.createDialogArea(parent);
+ GridLayout layout = new GridLayout(2, false);
+ composite.setLayout(layout);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ composite.setLayoutData(data);
+
+ // trick to have the message on the two columns!(a GridData with
+ // horizontalSpan = 2 on label doesn't work)
+ Composite compo = new Composite(composite, SWT.NONE);
+ GridLayout compoLayout = new GridLayout(1, false);
+ compo.setLayout(compoLayout);
+ GridData compoData = new GridData(GridData.FILL_HORIZONTAL);
+ compoData.horizontalSpan = 2;
+ compo.setLayoutData(compoData);
+
+ Label label = new Label(compo, SWT.NONE);
+ label.setText(message);
+
+ // create the editors
+ if(stringMetaProperties.size() != 0) {
+ createTextArea(composite);
+ }
+ if(enumerationMetaProperties.size() != 0) {
+ createCombo(composite);
+ }
+ if(booleanMetaProperties.size() != 0) {
+ createCheckBox(composite);
+ }
+
+ return composite;
+ }
+
+ /**
+ * Makes the title, that's to say, put the first letter in upper case
+ *
+ * @param name
+ * the name
+ * @return the string
+ */
+ protected String makeTitle(String name) {
+ String title = null;
+ if(name != null) {
+ title = new String(name);
+ String firstLetter = name.substring(0, 1);
+ title = title.replaceFirst(firstLetter, firstLetter.toUpperCase());
+ }
+ return title;
+ }
+
+ /**
+ * Creates the text area.
+ *
+ * @param composite
+ * the composite
+ */
+ private void createTextArea(Composite composite) {
+ for(int iter = 0; iter < stringMetaProperties.size(); iter++) {
+ Label label = new Label(composite, SWT.NONE);
+ String fieldTitle = makeTitle(stringMetaProperties.get(iter).getName()) + " :"; //$NON-NLS-1$
+ label.setText(fieldTitle);
+
+ Text text = new Text(composite, SWT.BORDER);
+ GridData textData = new GridData(GridData.FILL_HORIZONTAL);
+ text.setLayoutData(textData);
+
+ String value = (String)((EObject)elementToEdit).eGet(stringMetaProperties.get(iter));
+ text.setText(value);
+
+ final int iterFinal = iter;
+ final Text textFinal = text;
+ text.addFocusListener(new FocusAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
+ */
+ public void focusLost(FocusEvent e) {
+ ((EObject)elementToEdit).eSet(stringMetaProperties.get(iterFinal), textFinal.getText());
+ }
+ });
+
+ }
+
+ }
+
+ /**
+ * Creates the combo.
+ *
+ * @param composite
+ * the composite
+ */
+ private void createCombo(Composite composite) {
+ for(int iter = 0; iter < enumerationMetaProperties.size(); iter++) {
+ Label label = new Label(composite, SWT.NONE);
+ String fieldTitle = makeTitle(enumerationMetaProperties.get(iter).getName()) + " :"; //$NON-NLS-1$
+ label.setText(fieldTitle);
+ Combo combo = new Combo(composite, SWT.READ_ONLY);
+
+ // get the items
+ EAttribute currentAttributes = enumerationMetaProperties.get(iter);
+ EEnum eType = (EEnum)currentAttributes.getEType();
+
+ final List<EEnumLiteral> literals = eType.getELiterals();
+ final String[] proposals = new String[literals.size() + 1];
+ ArrayList<String> list = new ArrayList<String>();
+ list.add(""); //$NON-NLS-1$
+ proposals[0] = ""; //$NON-NLS-1$
+ for(int i = 0; i < literals.size(); i++) {
+ // i+1 because there is already the "" string
+ proposals[i + 1] = literals.get(i).getLiteral();
+ list.add(i + 1, literals.get(i).getLiteral());
+ }
+ combo.setItems(proposals);
+ // get initial value
+ Object selection = ((EObject)elementToEdit).eGet(currentAttributes);
+ combo.select(list.indexOf(selection.toString()));
+ GridData textData = new GridData(GridData.FILL_HORIZONTAL);
+ combo.setLayoutData(textData);
+ final Combo comboFinal = combo;
+ final int iterFinal = iter;
+ combo.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ int index = comboFinal.getSelectionIndex();
+ if(index == 0) {
+ ((EObject)elementToEdit).eUnset(enumerationMetaProperties.get(iterFinal));
+ } else {
+ ((EObject)elementToEdit).eSet(enumerationMetaProperties.get(iterFinal), literals.get(index - 1).getInstance());
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ }
+ }
+
+ /**
+ * Creates the check box.
+ *
+ * @param parent
+ * the parent
+ */
+ private void createCheckBox(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(1, false);
+ GridData data = new GridData();
+ data.horizontalSpan = 2;
+
+ composite.setLayoutData(data);
+ layout.numColumns = 3;
+ composite.setLayout(layout);
+ for(int iter = 0; iter < booleanMetaProperties.size(); iter++) {
+ Composite grp = new Composite(composite, SWT.NONE);
+ GridLayout layout2 = new GridLayout();
+ layout2.numColumns = 2;
+ grp.setLayout(layout2);
+
+ Button button = new Button(grp, SWT.FLAT | SWT.CHECK);
+ Label label = new Label(grp, SWT.NONE);
+ String fieldTitle = makeTitle(booleanMetaProperties.get(iter).getName());
+ label.setText(fieldTitle);
+ // get button state
+ Boolean state = (Boolean)((EObject)elementToEdit).eGet(booleanMetaProperties.get(iter));
+ button.setSelection(state);
+ final int iterFinal = iter;
+ button.addSelectionListener(new SelectionAdapter() {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ public void widgetSelected(SelectionEvent e) {
+ // get the old value
+ Boolean oldValue = (Boolean)((EObject)elementToEdit).eGet(booleanMetaProperties.get(iterFinal));
+ ((EObject)elementToEdit).eSet(booleanMetaProperties.get(iterFinal), !oldValue);
+ }
+ });
+
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypeAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypeAspectActionProvider.java
index 7406926f128..6abc3e441db 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypeAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypeAspectActionProvider.java
@@ -1,46 +1,46 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.w3c.dom.Node;
-
-/**
- * Factory in charge of the graphical aspect actions taken after palette actions
- */
-public class DisplayAppliedStereotypeAspectActionProvider extends AbstractAspectActionProvider {
-
- /** semantic action key */
- public final static String DISPLAY_APPLIED_STEREOTYPE_ACTION_KEY = "org.eclipse.papyrus.postaction.displayAppliedStereotypeaction";
-
- /**
- * Constructor.
- */
- public DisplayAppliedStereotypeAspectActionProvider() {
- }
-
- /**
- * @{inheritDoc
- */
- public IAspectAction createAction(Node configurationNode) {
- DisplayAppliedStereotypePostAction action = new DisplayAppliedStereotypePostAction();
- action.init(configurationNode, this);
- return action;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean isEnable(IPaletteEntryProxy entryProxy) {
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.w3c.dom.Node;
+
+/**
+ * Factory in charge of the graphical aspect actions taken after palette actions
+ */
+public class DisplayAppliedStereotypeAspectActionProvider extends AbstractAspectActionProvider {
+
+ /** semantic action key */
+ public final static String DISPLAY_APPLIED_STEREOTYPE_ACTION_KEY = "org.eclipse.papyrus.postaction.displayAppliedStereotypeaction";
+
+ /**
+ * Constructor.
+ */
+ public DisplayAppliedStereotypeAspectActionProvider() {
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IAspectAction createAction(Node configurationNode) {
+ DisplayAppliedStereotypePostAction action = new DisplayAppliedStereotypePostAction();
+ action.init(configurationNode, this);
+ return action;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean isEnable(IPaletteEntryProxy entryProxy) {
+ return true;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePostAction.java
index 130073a3caa..c9b778d9ce4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePostAction.java
@@ -1,339 +1,339 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnViewer;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.Stereotype;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Post action that manages the display of applied stereotypes.
- */
-public class DisplayAppliedStereotypePostAction extends GraphicalPostAction {
-
- /** list of stereotypes to display with their names */
- protected List<String> stereotypesToDisplay = new ArrayList<String>();
-
- /** list of stereotypes to display with their qualified names */
- protected List<String> stereotypesQNToDisplay = new ArrayList<String>();
-
- /** entry proxy "parent" of this action when configuring the action */
- protected IPaletteEntryProxy entryProxy;
-
- /** list of applied profiles */
- protected List<Profile> appliedProfiles;
-
- /** add icon path */
- protected static final String ICONS_ADD = "/icons/obj16/Add_16x16.gif"; //$NON-NLS-1$
-
- /** remove icon path */
- protected static final String ICONS_REMOVE = "/icons/delete.gif"; //$NON-NLS-1$
-
- /** TableViewer that shows the stereotypes to display */
- private TableViewer stereotypesToShowTableViewer;
-
- /** HashMap of displayable Stereotypes */
- protected HashMap<String, Integer> listOfDisplayableStereotypes = new HashMap<String, Integer>();
-
- /** Constants for the display options */
- private final int DONT_DISPLAY = 0;
-
- private final int DISPLAY_SIMPLE_NAME = 1;
-
- private final int DISPLAY_QUALIFIED_NAME = 2;
-
- /** The display options */
- private String[] diplayOptions = { "Do not display", "Display the stereotype", "Display qualified name of the stereotype" };
-
- /**
- * @{inheritDoc
- */
- @Override
- public void init(Node configurationNode, IAspectActionProvider factory) {
- super.init(configurationNode, factory);
- if(configurationNode == null) {
- return;
- }
- NodeList childNodes = configurationNode.getChildNodes();
- for(int i = 0; i < childNodes.getLength(); i++) {
- String nodeName = childNodes.item(i).getNodeName();
- if("displayName".equals(nodeName)) {
- Node stereotypeNameNode = childNodes.item(i).getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
- if(stereotypeNameNode != null) {
- stereotypesToDisplay.add(stereotypeNameNode.getNodeValue());
- }
- } else if("displayQualifiedName".equals(nodeName)) {
- Node stereotypeNameNode = childNodes.item(i).getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
- if(stereotypeNameNode != null) {
- stereotypesQNToDisplay.add(stereotypeNameNode.getNodeValue());
- }
- }
- }
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public void save(Node parentNode) {
- for(String stereotypeName : listOfDisplayableStereotypes.keySet()) {
-
- switch(listOfDisplayableStereotypes.get(stereotypeName)) {
- case DISPLAY_SIMPLE_NAME:
- Element displayName = ((Element)parentNode).getOwnerDocument().createElement("displayName");
- displayName.setAttribute(IPapyrusPaletteConstant.NAME, stereotypeName);
- ((Element)parentNode).appendChild(displayName);
- break;
- case DISPLAY_QUALIFIED_NAME:
- Element displayQualifiedName = ((Element)parentNode).getOwnerDocument().createElement("displayQualifiedName");
- displayQualifiedName.setAttribute(IPapyrusPaletteConstant.NAME, stereotypeName);
- ((Element)parentNode).appendChild(displayQualifiedName);
- break;
-
- default:
- break;
- }
-
- }
- }
-
- /**
- * @{inheritDoc
- */
- public ICommand getPostCommand(final IAdaptable viewAdapter) {
- final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
-
- return new AbstractTransactionalCommand(editingDomain, "Modify Stereotype Display", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- View view = (View)viewAdapter.getAdapter(View.class);
-
- // creates the commands to display simple stereotypes name
- for(String stereotypeName : stereotypesToDisplay) {
- String presentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(view);
- AppliedStereotypeHelper.getAddAppliedStereotypeCommand(editingDomain, view, stereotypeName, presentationKind).execute();
- }
-
- // creates the commands to display qualified names of stereotypes
- for(String stereotypeName : stereotypesQNToDisplay) {
- AppliedStereotypeHelper.getAddAppliedStereotypeToDisplayWithQNCommand(editingDomain, view, stereotypeName).execute();
- }
-
- org.eclipse.uml2.uml.Element element = (org.eclipse.uml2.uml.Element)view.getElement();
- for(Stereotype stereo : element.getAppliedStereotypes()) {
- if(!stereotypesQNToDisplay.contains(stereo.getQualifiedName()) && !stereotypesToDisplay.contains(stereo.getQualifiedName())) {
- String presentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(view);
- AppliedStereotypeHelper.getRemoveAppliedStereotypeCommand(editingDomain, view, stereo.getQualifiedName(), presentationKind).execute();
- }
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
- this.appliedProfiles = appliedProfiles;
- this.entryProxy = entryProxy;
-
- // retrieve displayable stereotypes
- if(entryProxy instanceof IPaletteAspectToolEntryProxy) {
- for(IPostAction postAction : ((IPaletteAspectToolEntryProxy)entryProxy).getPostActions()) {
- if(postAction instanceof StereotypePostAction) {
- for(String stereotype : ((StereotypePostAction)postAction).getStereotypesToApply()) {
- if(!listOfDisplayableStereotypes.containsKey(stereotype)) {
- listOfDisplayableStereotypes.put(stereotype, DONT_DISPLAY);
- }
- }
- }
- }
- }
-
- // Load from config
- for(String stereotypeName : stereotypesToDisplay) {
- if(listOfDisplayableStereotypes.containsKey(stereotypeName)) {
- listOfDisplayableStereotypes.put(stereotypeName, DISPLAY_SIMPLE_NAME);
- }
- }
- for(String stereotypeName : stereotypesQNToDisplay) {
- if(listOfDisplayableStereotypes.containsKey(stereotypeName)) {
- listOfDisplayableStereotypes.put(stereotypeName, DISPLAY_QUALIFIED_NAME);
- }
- }
-
- Composite composite = new Composite(parent, SWT.BORDER);
- composite.setLayout(new GridLayout(1, false));
-
- Label label = new Label(composite, SWT.None);
- label.setText("Choose applied stereotypes to display : ");
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- label.setLayoutData(data);
-
- stereotypesToShowTableViewer = new TableViewer(composite, SWT.FULL_SELECTION);
- GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
- stereotypesToShowTableViewer.getControl().setLayoutData(layoutData);
- createColumns(stereotypesToShowTableViewer);
- stereotypesToShowTableViewer.setContentProvider(new IStructuredContentProvider() {
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // TODO Auto-generated method stub
-
- }
-
- public void dispose() {
- // TODO Auto-generated method stub
-
- }
-
- @SuppressWarnings("unchecked")
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof HashMap<?, ?>) {
- return ((HashMap<String, Integer>)inputElement).keySet().toArray();
- }
- return null;
- }
- });
-
- stereotypesToShowTableViewer.setLabelProvider(new StereotypeToDisplayLabelProvider());
-
- stereotypesToShowTableViewer.setInput(listOfDisplayableStereotypes);
-
- return composite;
- }
-
- /**
- * The label provider for the tableviewer : one columns shows the stereotype
- * name and the other shows the display option
- */
- class StereotypeToDisplayLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- switch(columnIndex) {
- case 0:
- return (String)element;
- case 1:
- return diplayOptions[listOfDisplayableStereotypes.get(element)];
-
- default:
- break;
- }
- return null;
- }
- }
-
- /**
- * EditingSupport for the display option : combo editor
- */
- class StereotypeToDisplayEditingSupport extends EditingSupport {
-
- private CellEditor editor;
-
- public StereotypeToDisplayEditingSupport(ColumnViewer viewer) {
- super(viewer);
-
- editor = new ComboBoxCellEditor(((TableViewer)viewer).getTable(), diplayOptions);
- }
-
- @Override
- protected CellEditor getCellEditor(Object element) {
- return editor;
- }
-
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
-
- @Override
- protected Object getValue(Object element) {
- return listOfDisplayableStereotypes.get(element);
- }
-
- @Override
- protected void setValue(Object element, Object value) {
- listOfDisplayableStereotypes.put((String)element, (Integer)value);
- getViewer().update(element, null);
- }
- }
-
- /**
- * Creates appropriate columns : one for the stereotype and one for its
- * display options
- *
- * @param viewer
- * the table to create the columns in
- */
- protected void createColumns(TableViewer viewer) {
-
- TableViewerColumn columnStereotype = new TableViewerColumn(viewer, SWT.NONE);
- columnStereotype.getColumn().setText("Stereotype");
- columnStereotype.getColumn().setWidth(300);
- columnStereotype.getColumn().setResizable(true);
- columnStereotype.getColumn().setMoveable(false);
-
- TableViewerColumn columnDisplay = new TableViewerColumn(viewer, SWT.NONE);
- columnDisplay.getColumn().setText("Display");
- columnDisplay.getColumn().setWidth(300);
- columnDisplay.getColumn().setResizable(true);
- columnDisplay.getColumn().setMoveable(false);
- // enable editing support
- columnDisplay.setEditingSupport(new StereotypeToDisplayEditingSupport(viewer));
-
- Table table = viewer.getTable();
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.Stereotype;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Post action that manages the display of applied stereotypes.
+ */
+public class DisplayAppliedStereotypePostAction extends GraphicalPostAction {
+
+ /** list of stereotypes to display with their names */
+ protected List<String> stereotypesToDisplay = new ArrayList<String>();
+
+ /** list of stereotypes to display with their qualified names */
+ protected List<String> stereotypesQNToDisplay = new ArrayList<String>();
+
+ /** entry proxy "parent" of this action when configuring the action */
+ protected IPaletteEntryProxy entryProxy;
+
+ /** list of applied profiles */
+ protected List<Profile> appliedProfiles;
+
+ /** add icon path */
+ protected static final String ICONS_ADD = "/icons/obj16/Add_16x16.gif"; //$NON-NLS-1$
+
+ /** remove icon path */
+ protected static final String ICONS_REMOVE = "/icons/delete.gif"; //$NON-NLS-1$
+
+ /** TableViewer that shows the stereotypes to display */
+ private TableViewer stereotypesToShowTableViewer;
+
+ /** HashMap of displayable Stereotypes */
+ protected HashMap<String, Integer> listOfDisplayableStereotypes = new HashMap<String, Integer>();
+
+ /** Constants for the display options */
+ private final int DONT_DISPLAY = 0;
+
+ private final int DISPLAY_SIMPLE_NAME = 1;
+
+ private final int DISPLAY_QUALIFIED_NAME = 2;
+
+ /** The display options */
+ private String[] diplayOptions = { "Do not display", "Display the stereotype", "Display qualified name of the stereotype" };
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ super.init(configurationNode, factory);
+ if(configurationNode == null) {
+ return;
+ }
+ NodeList childNodes = configurationNode.getChildNodes();
+ for(int i = 0; i < childNodes.getLength(); i++) {
+ String nodeName = childNodes.item(i).getNodeName();
+ if("displayName".equals(nodeName)) {
+ Node stereotypeNameNode = childNodes.item(i).getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
+ if(stereotypeNameNode != null) {
+ stereotypesToDisplay.add(stereotypeNameNode.getNodeValue());
+ }
+ } else if("displayQualifiedName".equals(nodeName)) {
+ Node stereotypeNameNode = childNodes.item(i).getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
+ if(stereotypeNameNode != null) {
+ stereotypesQNToDisplay.add(stereotypeNameNode.getNodeValue());
+ }
+ }
+ }
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void save(Node parentNode) {
+ for(String stereotypeName : listOfDisplayableStereotypes.keySet()) {
+
+ switch(listOfDisplayableStereotypes.get(stereotypeName)) {
+ case DISPLAY_SIMPLE_NAME:
+ Element displayName = ((Element)parentNode).getOwnerDocument().createElement("displayName");
+ displayName.setAttribute(IPapyrusPaletteConstant.NAME, stereotypeName);
+ ((Element)parentNode).appendChild(displayName);
+ break;
+ case DISPLAY_QUALIFIED_NAME:
+ Element displayQualifiedName = ((Element)parentNode).getOwnerDocument().createElement("displayQualifiedName");
+ displayQualifiedName.setAttribute(IPapyrusPaletteConstant.NAME, stereotypeName);
+ ((Element)parentNode).appendChild(displayQualifiedName);
+ break;
+
+ default:
+ break;
+ }
+
+ }
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public ICommand getPostCommand(final IAdaptable viewAdapter) {
+ final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
+
+ return new AbstractTransactionalCommand(editingDomain, "Modify Stereotype Display", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ View view = (View)viewAdapter.getAdapter(View.class);
+
+ // creates the commands to display simple stereotypes name
+ for(String stereotypeName : stereotypesToDisplay) {
+ String presentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(view);
+ AppliedStereotypeHelper.getAddAppliedStereotypeCommand(editingDomain, view, stereotypeName, presentationKind).execute();
+ }
+
+ // creates the commands to display qualified names of stereotypes
+ for(String stereotypeName : stereotypesQNToDisplay) {
+ AppliedStereotypeHelper.getAddAppliedStereotypeToDisplayWithQNCommand(editingDomain, view, stereotypeName).execute();
+ }
+
+ org.eclipse.uml2.uml.Element element = (org.eclipse.uml2.uml.Element)view.getElement();
+ for(Stereotype stereo : element.getAppliedStereotypes()) {
+ if(!stereotypesQNToDisplay.contains(stereo.getQualifiedName()) && !stereotypesToDisplay.contains(stereo.getQualifiedName())) {
+ String presentationKind = AppliedStereotypeHelper.getAppliedStereotypePresentationKind(view);
+ AppliedStereotypeHelper.getRemoveAppliedStereotypeCommand(editingDomain, view, stereo.getQualifiedName(), presentationKind).execute();
+ }
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
+ this.appliedProfiles = appliedProfiles;
+ this.entryProxy = entryProxy;
+
+ // retrieve displayable stereotypes
+ if(entryProxy instanceof IPaletteAspectToolEntryProxy) {
+ for(IPostAction postAction : ((IPaletteAspectToolEntryProxy)entryProxy).getPostActions()) {
+ if(postAction instanceof StereotypePostAction) {
+ for(String stereotype : ((StereotypePostAction)postAction).getStereotypesToApply()) {
+ if(!listOfDisplayableStereotypes.containsKey(stereotype)) {
+ listOfDisplayableStereotypes.put(stereotype, DONT_DISPLAY);
+ }
+ }
+ }
+ }
+ }
+
+ // Load from config
+ for(String stereotypeName : stereotypesToDisplay) {
+ if(listOfDisplayableStereotypes.containsKey(stereotypeName)) {
+ listOfDisplayableStereotypes.put(stereotypeName, DISPLAY_SIMPLE_NAME);
+ }
+ }
+ for(String stereotypeName : stereotypesQNToDisplay) {
+ if(listOfDisplayableStereotypes.containsKey(stereotypeName)) {
+ listOfDisplayableStereotypes.put(stereotypeName, DISPLAY_QUALIFIED_NAME);
+ }
+ }
+
+ Composite composite = new Composite(parent, SWT.BORDER);
+ composite.setLayout(new GridLayout(1, false));
+
+ Label label = new Label(composite, SWT.None);
+ label.setText("Choose applied stereotypes to display : ");
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ label.setLayoutData(data);
+
+ stereotypesToShowTableViewer = new TableViewer(composite, SWT.FULL_SELECTION);
+ GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ stereotypesToShowTableViewer.getControl().setLayoutData(layoutData);
+ createColumns(stereotypesToShowTableViewer);
+ stereotypesToShowTableViewer.setContentProvider(new IStructuredContentProvider() {
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void dispose() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof HashMap<?, ?>) {
+ return ((HashMap<String, Integer>)inputElement).keySet().toArray();
+ }
+ return null;
+ }
+ });
+
+ stereotypesToShowTableViewer.setLabelProvider(new StereotypeToDisplayLabelProvider());
+
+ stereotypesToShowTableViewer.setInput(listOfDisplayableStereotypes);
+
+ return composite;
+ }
+
+ /**
+ * The label provider for the tableviewer : one columns shows the stereotype
+ * name and the other shows the display option
+ */
+ class StereotypeToDisplayLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ switch(columnIndex) {
+ case 0:
+ return (String)element;
+ case 1:
+ return diplayOptions[listOfDisplayableStereotypes.get(element)];
+
+ default:
+ break;
+ }
+ return null;
+ }
+ }
+
+ /**
+ * EditingSupport for the display option : combo editor
+ */
+ class StereotypeToDisplayEditingSupport extends EditingSupport {
+
+ private CellEditor editor;
+
+ public StereotypeToDisplayEditingSupport(ColumnViewer viewer) {
+ super(viewer);
+
+ editor = new ComboBoxCellEditor(((TableViewer)viewer).getTable(), diplayOptions);
+ }
+
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ return editor;
+ }
+
+ @Override
+ protected boolean canEdit(Object element) {
+ return true;
+ }
+
+ @Override
+ protected Object getValue(Object element) {
+ return listOfDisplayableStereotypes.get(element);
+ }
+
+ @Override
+ protected void setValue(Object element, Object value) {
+ listOfDisplayableStereotypes.put((String)element, (Integer)value);
+ getViewer().update(element, null);
+ }
+ }
+
+ /**
+ * Creates appropriate columns : one for the stereotype and one for its
+ * display options
+ *
+ * @param viewer
+ * the table to create the columns in
+ */
+ protected void createColumns(TableViewer viewer) {
+
+ TableViewerColumn columnStereotype = new TableViewerColumn(viewer, SWT.NONE);
+ columnStereotype.getColumn().setText("Stereotype");
+ columnStereotype.getColumn().setWidth(300);
+ columnStereotype.getColumn().setResizable(true);
+ columnStereotype.getColumn().setMoveable(false);
+
+ TableViewerColumn columnDisplay = new TableViewerColumn(viewer, SWT.NONE);
+ columnDisplay.getColumn().setText("Display");
+ columnDisplay.getColumn().setWidth(300);
+ columnDisplay.getColumn().setResizable(true);
+ columnDisplay.getColumn().setMoveable(false);
+ // enable editing support
+ columnDisplay.setEditingSupport(new StereotypeToDisplayEditingSupport(viewer));
+
+ Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider.java
index bf61c094204..aa93404244c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider.java
@@ -1,46 +1,46 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.w3c.dom.Node;
-
-/**
- * Factory in charge of the graphical aspect actions taken after palette actions
- */
-public class DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider extends AbstractAspectActionProvider {
-
- /** semantic action key */
- public final static String DISPLAY_APPLIED_STEREOTYPE_ACTION_KEY = "org.eclipse.papyrus.postaction.displayAppliedStereotypePropertiesInCompartmentAction";
-
- /**
- * Constructor.
- */
- public DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider() {
- }
-
- /**
- * @{inheritDoc
- */
- public IAspectAction createAction(Node configurationNode) {
- DisplayAppliedStereotypePropertiesInCompartmentPostAction action = new DisplayAppliedStereotypePropertiesInCompartmentPostAction();
- action.init(configurationNode, this);
- return action;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean isEnable(IPaletteEntryProxy entryProxy) {
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.w3c.dom.Node;
+
+/**
+ * Factory in charge of the graphical aspect actions taken after palette actions
+ */
+public class DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider extends AbstractAspectActionProvider {
+
+ /** semantic action key */
+ public final static String DISPLAY_APPLIED_STEREOTYPE_ACTION_KEY = "org.eclipse.papyrus.postaction.displayAppliedStereotypePropertiesInCompartmentAction";
+
+ /**
+ * Constructor.
+ */
+ public DisplayAppliedStereotypePropertiesInCompartmentAspectActionProvider() {
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IAspectAction createAction(Node configurationNode) {
+ DisplayAppliedStereotypePropertiesInCompartmentPostAction action = new DisplayAppliedStereotypePropertiesInCompartmentPostAction();
+ action.init(configurationNode, this);
+ return action;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean isEnable(IPaletteEntryProxy entryProxy) {
+ return true;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentPostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentPostAction.java
index 4c6faa016b3..4dba6e45cbb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentPostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DisplayAppliedStereotypePropertiesInCompartmentPostAction.java
@@ -1,436 +1,436 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ICheckStateProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
-import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Stereotype;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Post action that manages the display of applied stereotypes.
- * <p>
- * More precisely, it is in charge of the display of properties of Stereotypes in Compartments
- * </p>
- */
-public class DisplayAppliedStereotypePropertiesInCompartmentPostAction extends GraphicalPostAction {
-
- /** map of stereotypes / properties to display with their qualified names */
- protected Map<String, String> stereotypePropertiesToDisplay = new HashMap<String, String>();
-
- /** entry proxy "parent" of this action when configuring the action */
- protected IPaletteEntryProxy entryProxy;
-
- /** list of applied profiles */
- protected List<Profile> appliedProfiles;
-
- /** add icon path */
- protected static final String ICONS_ADD = "/icons/obj16/Add_16x16.gif"; //$NON-NLS-1$
-
- /** remove icon path */
- protected static final String ICONS_REMOVE = "/icons/delete.gif"; //$NON-NLS-1$
-
- /** TreeViewer that shows the stereotypes to display and their properties */
- private CheckboxTreeViewer stereotypePropertiesToShowTreeViewer;
-
- /** HashMap of displayed Properties */
- protected Set<String> listOfDisplayableStereotypeProperties = new HashSet<String>();
-
- /** Node names and constants */
- private static final String PROPERTIES_NODE_NAME = "propertiesToDisplay";
-
- private static final String PROPERTY_NODE_NAME = "propertyToDisplay";
-
- /**
- * @{inheritDoc
- */
- @Override
- public void init(Node configurationNode, IAspectActionProvider factory) {
- super.init(configurationNode, factory);
- if(configurationNode == null) {
- return;
- }
- NodeList childNodes = configurationNode.getChildNodes();
- for(int i = 0; i < childNodes.getLength(); i++) {
- String nodeName = childNodes.item(i).getNodeName();
- if(PROPERTIES_NODE_NAME.equals(nodeName)) {
- NodeList propertyNodes = childNodes.item(i).getChildNodes();
- for(int j = 0; j < propertyNodes.getLength(); j++) {
- String propertyNodeName = propertyNodes.item(j).getNodeName();
- if(PROPERTY_NODE_NAME.equals(propertyNodeName)) {
- Node propertyNameNode = propertyNodes.item(j).getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
- if(propertyNameNode != null) {
- listOfDisplayableStereotypeProperties.add(propertyNameNode.getNodeValue());
- }
- }
- }
- }
- }
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public void save(Node parentNode) {
- Element propertiesNode = ((Element)parentNode).getOwnerDocument().createElement(PROPERTIES_NODE_NAME);
- for(String propertyName : listOfDisplayableStereotypeProperties) {
- Element propertyNode = propertiesNode.getOwnerDocument().createElement(PROPERTY_NODE_NAME);
- propertyNode.setAttribute(IPapyrusPaletteConstant.NAME, propertyName);
- propertiesNode.appendChild(propertyNode);
- }
- ((Element)parentNode).appendChild(propertiesNode);
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public ICommand getPostCommand(final IAdaptable viewAdapter) {
- final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
-
- return new AbstractTransactionalCommand(editingDomain, "Modify Stereotype Properties Display", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- View view = (View)viewAdapter.getAdapter(View.class);
- String stereotypesStrList = PaletteUtil.convertToCommaSeparatedRepresentation(listOfDisplayableStereotypeProperties);
-
- AppliedStereotypeHelper.getAddAppliedStereotypePropertiesCommand(editingDomain, view, stereotypesStrList).execute();
- AppliedStereotypeHelper.getAppliedStereotypeToDisplayCommand(editingDomain, view, "", UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION).execute();
-
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
- this.appliedProfiles = appliedProfiles;
- this.entryProxy = entryProxy;
- // retrieve displayed stereotypes
- List<String> displayedStereotypeNames = new ArrayList<String>();
- if(entryProxy instanceof IPaletteAspectToolEntryProxy) {
- for(IPostAction postAction : ((IPaletteAspectToolEntryProxy)entryProxy).getPostActions()) {
- if(postAction instanceof StereotypePostAction) {
- for(String stereotypeName : ((StereotypePostAction)postAction).getStereotypesToApply()) {
- displayedStereotypeNames.add(stereotypeName);
- }
- }
- }
- }
- // get the stereotypes to display, looking in the list of applied profiles and comparing with the list of stereotype qualified names to be displayed
- List<Stereotype> displayedStereotypes = new ArrayList<Stereotype>();
- for(Profile appliedProfile : appliedProfiles) {
- for(Stereotype stereotype : appliedProfile.getOwnedStereotypes()) {
- if(stereotype != null && displayedStereotypeNames.contains(stereotype.getQualifiedName())) {
- displayedStereotypes.add(stereotype);
- }
- }
- }
- // check list has same size...
- if(displayedStereotypeNames.size() != displayedStereotypes.size()) {
- Activator.log.error("all the stereotypes were not resolved:\n" + displayedStereotypeNames + "\n" + displayedStereotypes, null);
- }
- Composite composite = new Composite(parent, SWT.BORDER);
- composite.setLayout(new GridLayout(1, false));
- Label label = new Label(composite, SWT.None);
- label.setText("Choose applied stereotype Properties to display in compartment: ");
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- label.setLayoutData(data);
- stereotypePropertiesToShowTreeViewer = new CheckboxTreeViewer(composite, SWT.BORDER | SWT.CHECK);
- GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
- stereotypePropertiesToShowTreeViewer.getControl().setLayoutData(layoutData);
- stereotypePropertiesToShowTreeViewer.setContentProvider(new ITreeContentProvider() {
-
- /**
- * {@inheritDoc}
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // nothing to do here
- }
-
- /**
- * {@inheritDoc}
- */
- public void dispose() {
- // nothing to do here
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean hasChildren(Object element) {
- if(element instanceof ITreeElement) {
- return ((ITreeElement)element).getChildren().length > 0;
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public Object getParent(Object element) {
- if(element instanceof ITreeElement) {
- return ((ITreeElement)element).getParent();
- }
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List) {
- List<StereotypeTreeItem> stereotypeTreeItems = new ArrayList<DisplayAppliedStereotypePropertiesInCompartmentPostAction.StereotypeTreeItem>();
- for(Object object : (List<?>)inputElement) {
- if(object instanceof Stereotype) {
- stereotypeTreeItems.add(new StereotypeTreeItem((Stereotype)object));
- }
- }
- return stereotypeTreeItems.toArray();
- }
- return new Object[0];
- }
-
- /**
- * {@inheritDoc}
- */
- public Object[] getChildren(Object parentElement) {
- if(parentElement instanceof ITreeElement) {
- return ((ITreeElement)parentElement).getChildren();
- }
- return new Object[0];
- }
- });
- stereotypePropertiesToShowTreeViewer.setLabelProvider(new TreeItemLabelProvider());
- stereotypePropertiesToShowTreeViewer.setCheckStateProvider(new CheckStateProvider());
- stereotypePropertiesToShowTreeViewer.addCheckStateListener(new CheckStateListener());
- stereotypePropertiesToShowTreeViewer.setInput(displayedStereotypes);
- return composite;
- }
-
- /**
- * Listener for the check/uncheck states of the event.
- */
- public class CheckStateListener implements ICheckStateListener {
-
- /**
- * {@inheritDoc}
- */
- public void checkStateChanged(CheckStateChangedEvent event) {
- for(TreeItem stereotypeItem : ((CheckboxTreeViewer)event.getCheckable()).getTree().getItems()) {
- Stereotype stereotype = ((StereotypeTreeItem)stereotypeItem.getData()).getStereotype();
- if(stereotype == null) {
- Activator.log.debug("impossible to find stereotype");
- return;
- }
- for(TreeItem propertyItem : stereotypeItem.getItems()) {
- PropertyTreeItem propertyTreeItem = ((PropertyTreeItem)propertyItem.getData());
- if(propertyTreeItem != null && propertyTreeItem.getProperty() != null) {
- if(propertyItem.getChecked()) {
- listOfDisplayableStereotypeProperties.add(getPropertyName(stereotype, ((PropertyTreeItem)propertyItem.getData()).getProperty()));
- } else {
- listOfDisplayableStereotypeProperties.remove(getPropertyName(stereotype, ((PropertyTreeItem)propertyItem.getData()).getProperty()));
- }
- }
- }
- }
-
- }
- }
-
- /**
- * The label provider for the tableviewer : one columns shows the stereotype
- * name and the other shows the display option
- */
- class TreeItemLabelProvider extends LabelProvider {
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getText(Object element) {
- if(element instanceof StereotypeTreeItem) {
- return ((StereotypeTreeItem)element).getStereotype().getQualifiedName();
- } else if(element instanceof PropertyTreeItem) {
- return ((PropertyTreeItem)element).getProperty().getQualifiedName();
- }
- return super.getText(element);
- }
- }
-
- public class CheckStateProvider implements ICheckStateProvider {
-
- /**
- * {@inheritDoc}
- */
- public boolean isChecked(Object element) {
- if(element instanceof PropertyTreeItem) {
- Property property = ((PropertyTreeItem)element).getProperty();
- Stereotype stereotype = ((PropertyTreeItem)element).getParent().getStereotype();
- if(property != null && stereotype != null) {
- String name = getPropertyName(stereotype, property);
- return listOfDisplayableStereotypeProperties.contains(name);
- }
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isGrayed(Object element) {
- return false;
- }
- }
-
- public String getPropertyName(Stereotype stereotype, Property property) {
- StringBuilder buffer = new StringBuilder();
- buffer.append(stereotype.getQualifiedName());
- buffer.append(".");
- buffer.append(property.getName());
- return buffer.toString();
- }
-
- public interface ITreeElement {
-
- public ITreeElement[] getChildren();
-
- public ITreeElement getParent();
- }
-
- /**
- * Tree Item to manage Stereotypes
- */
- public class StereotypeTreeItem implements ITreeElement {
-
- private Stereotype stereotype;
-
- private PropertyTreeItem[] propertyTreeItems;
-
- /**
- * Constructor.
- *
- * @param parentItem
- * th parent item for this tree item
- * @param style
- * the style of this tree item
- */
- public StereotypeTreeItem(Stereotype stereotype) {
- this.stereotype = stereotype;
- }
-
- /**
- * Returns the Stereotype represented by this tree item
- */
- public Stereotype getStereotype() {
- return stereotype;
- }
-
- public PropertyTreeItem[] getChildren() {
- if(propertyTreeItems == null) {
- List<PropertyTreeItem> items = new ArrayList<DisplayAppliedStereotypePropertiesInCompartmentPostAction.PropertyTreeItem>();
- for(Property property : stereotype.getAllAttributes()) {
- if(property != null) {
- items.add(new PropertyTreeItem(this, property));
- }
- }
- propertyTreeItems = items.toArray(new PropertyTreeItem[]{});
- }
- return propertyTreeItems;
- }
-
- public ITreeElement getParent() {
- return null;
- }
- }
-
- /**
- * Tree Item to manage Stereotypes
- */
- public class PropertyTreeItem implements ITreeElement {
-
- private Property property;
-
- private StereotypeTreeItem stereotypeTreeItem;
-
- /**
- * Constructor.
- *
- * @param parentItem
- * the parent item for this tree item
- * @param style
- * the style of this tree item
- */
- public PropertyTreeItem(StereotypeTreeItem stereotypeTreeItem, Property property) {
- this.stereotypeTreeItem = stereotypeTreeItem;
- this.property = property;
- }
-
- /**
- * Returns the Property represented by this tree item
- */
- public Property getProperty() {
- return property;
- }
-
- public StereotypeTreeItem getParent() {
- return stereotypeTreeItem;
- }
-
- public ITreeElement[] getChildren() {
- return new ITreeElement[0];
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.ICheckStateProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.uml.appearance.helper.AppliedStereotypeHelper;
+import org.eclipse.papyrus.uml.appearance.helper.UMLVisualInformationPapyrusConstant;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Post action that manages the display of applied stereotypes.
+ * <p>
+ * More precisely, it is in charge of the display of properties of Stereotypes in Compartments
+ * </p>
+ */
+public class DisplayAppliedStereotypePropertiesInCompartmentPostAction extends GraphicalPostAction {
+
+ /** map of stereotypes / properties to display with their qualified names */
+ protected Map<String, String> stereotypePropertiesToDisplay = new HashMap<String, String>();
+
+ /** entry proxy "parent" of this action when configuring the action */
+ protected IPaletteEntryProxy entryProxy;
+
+ /** list of applied profiles */
+ protected List<Profile> appliedProfiles;
+
+ /** add icon path */
+ protected static final String ICONS_ADD = "/icons/obj16/Add_16x16.gif"; //$NON-NLS-1$
+
+ /** remove icon path */
+ protected static final String ICONS_REMOVE = "/icons/delete.gif"; //$NON-NLS-1$
+
+ /** TreeViewer that shows the stereotypes to display and their properties */
+ private CheckboxTreeViewer stereotypePropertiesToShowTreeViewer;
+
+ /** HashMap of displayed Properties */
+ protected Set<String> listOfDisplayableStereotypeProperties = new HashSet<String>();
+
+ /** Node names and constants */
+ private static final String PROPERTIES_NODE_NAME = "propertiesToDisplay";
+
+ private static final String PROPERTY_NODE_NAME = "propertyToDisplay";
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ super.init(configurationNode, factory);
+ if(configurationNode == null) {
+ return;
+ }
+ NodeList childNodes = configurationNode.getChildNodes();
+ for(int i = 0; i < childNodes.getLength(); i++) {
+ String nodeName = childNodes.item(i).getNodeName();
+ if(PROPERTIES_NODE_NAME.equals(nodeName)) {
+ NodeList propertyNodes = childNodes.item(i).getChildNodes();
+ for(int j = 0; j < propertyNodes.getLength(); j++) {
+ String propertyNodeName = propertyNodes.item(j).getNodeName();
+ if(PROPERTY_NODE_NAME.equals(propertyNodeName)) {
+ Node propertyNameNode = propertyNodes.item(j).getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
+ if(propertyNameNode != null) {
+ listOfDisplayableStereotypeProperties.add(propertyNameNode.getNodeValue());
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void save(Node parentNode) {
+ Element propertiesNode = ((Element)parentNode).getOwnerDocument().createElement(PROPERTIES_NODE_NAME);
+ for(String propertyName : listOfDisplayableStereotypeProperties) {
+ Element propertyNode = propertiesNode.getOwnerDocument().createElement(PROPERTY_NODE_NAME);
+ propertyNode.setAttribute(IPapyrusPaletteConstant.NAME, propertyName);
+ propertiesNode.appendChild(propertyNode);
+ }
+ ((Element)parentNode).appendChild(propertiesNode);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public ICommand getPostCommand(final IAdaptable viewAdapter) {
+ final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
+
+ return new AbstractTransactionalCommand(editingDomain, "Modify Stereotype Properties Display", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+
+ View view = (View)viewAdapter.getAdapter(View.class);
+ String stereotypesStrList = PaletteUtil.convertToCommaSeparatedRepresentation(listOfDisplayableStereotypeProperties);
+
+ AppliedStereotypeHelper.getAddAppliedStereotypePropertiesCommand(editingDomain, view, stereotypesStrList).execute();
+ AppliedStereotypeHelper.getAppliedStereotypeToDisplayCommand(editingDomain, view, "", UMLVisualInformationPapyrusConstant.STEREOTYPE_COMPARTMENT_LOCATION).execute();
+
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
+ this.appliedProfiles = appliedProfiles;
+ this.entryProxy = entryProxy;
+ // retrieve displayed stereotypes
+ List<String> displayedStereotypeNames = new ArrayList<String>();
+ if(entryProxy instanceof IPaletteAspectToolEntryProxy) {
+ for(IPostAction postAction : ((IPaletteAspectToolEntryProxy)entryProxy).getPostActions()) {
+ if(postAction instanceof StereotypePostAction) {
+ for(String stereotypeName : ((StereotypePostAction)postAction).getStereotypesToApply()) {
+ displayedStereotypeNames.add(stereotypeName);
+ }
+ }
+ }
+ }
+ // get the stereotypes to display, looking in the list of applied profiles and comparing with the list of stereotype qualified names to be displayed
+ List<Stereotype> displayedStereotypes = new ArrayList<Stereotype>();
+ for(Profile appliedProfile : appliedProfiles) {
+ for(Stereotype stereotype : appliedProfile.getOwnedStereotypes()) {
+ if(stereotype != null && displayedStereotypeNames.contains(stereotype.getQualifiedName())) {
+ displayedStereotypes.add(stereotype);
+ }
+ }
+ }
+ // check list has same size...
+ if(displayedStereotypeNames.size() != displayedStereotypes.size()) {
+ Activator.log.error("all the stereotypes were not resolved:\n" + displayedStereotypeNames + "\n" + displayedStereotypes, null);
+ }
+ Composite composite = new Composite(parent, SWT.BORDER);
+ composite.setLayout(new GridLayout(1, false));
+ Label label = new Label(composite, SWT.None);
+ label.setText("Choose applied stereotype Properties to display in compartment: ");
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ label.setLayoutData(data);
+ stereotypePropertiesToShowTreeViewer = new CheckboxTreeViewer(composite, SWT.BORDER | SWT.CHECK);
+ GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ stereotypePropertiesToShowTreeViewer.getControl().setLayoutData(layoutData);
+ stereotypePropertiesToShowTreeViewer.setContentProvider(new ITreeContentProvider() {
+
+ /**
+ * {@inheritDoc}
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // nothing to do here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dispose() {
+ // nothing to do here
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean hasChildren(Object element) {
+ if(element instanceof ITreeElement) {
+ return ((ITreeElement)element).getChildren().length > 0;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getParent(Object element) {
+ if(element instanceof ITreeElement) {
+ return ((ITreeElement)element).getParent();
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof List) {
+ List<StereotypeTreeItem> stereotypeTreeItems = new ArrayList<DisplayAppliedStereotypePropertiesInCompartmentPostAction.StereotypeTreeItem>();
+ for(Object object : (List<?>)inputElement) {
+ if(object instanceof Stereotype) {
+ stereotypeTreeItems.add(new StereotypeTreeItem((Stereotype)object));
+ }
+ }
+ return stereotypeTreeItems.toArray();
+ }
+ return new Object[0];
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object[] getChildren(Object parentElement) {
+ if(parentElement instanceof ITreeElement) {
+ return ((ITreeElement)parentElement).getChildren();
+ }
+ return new Object[0];
+ }
+ });
+ stereotypePropertiesToShowTreeViewer.setLabelProvider(new TreeItemLabelProvider());
+ stereotypePropertiesToShowTreeViewer.setCheckStateProvider(new CheckStateProvider());
+ stereotypePropertiesToShowTreeViewer.addCheckStateListener(new CheckStateListener());
+ stereotypePropertiesToShowTreeViewer.setInput(displayedStereotypes);
+ return composite;
+ }
+
+ /**
+ * Listener for the check/uncheck states of the event.
+ */
+ public class CheckStateListener implements ICheckStateListener {
+
+ /**
+ * {@inheritDoc}
+ */
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ for(TreeItem stereotypeItem : ((CheckboxTreeViewer)event.getCheckable()).getTree().getItems()) {
+ Stereotype stereotype = ((StereotypeTreeItem)stereotypeItem.getData()).getStereotype();
+ if(stereotype == null) {
+ Activator.log.debug("impossible to find stereotype");
+ return;
+ }
+ for(TreeItem propertyItem : stereotypeItem.getItems()) {
+ PropertyTreeItem propertyTreeItem = ((PropertyTreeItem)propertyItem.getData());
+ if(propertyTreeItem != null && propertyTreeItem.getProperty() != null) {
+ if(propertyItem.getChecked()) {
+ listOfDisplayableStereotypeProperties.add(getPropertyName(stereotype, ((PropertyTreeItem)propertyItem.getData()).getProperty()));
+ } else {
+ listOfDisplayableStereotypeProperties.remove(getPropertyName(stereotype, ((PropertyTreeItem)propertyItem.getData()).getProperty()));
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ /**
+ * The label provider for the tableviewer : one columns shows the stereotype
+ * name and the other shows the display option
+ */
+ class TreeItemLabelProvider extends LabelProvider {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getText(Object element) {
+ if(element instanceof StereotypeTreeItem) {
+ return ((StereotypeTreeItem)element).getStereotype().getQualifiedName();
+ } else if(element instanceof PropertyTreeItem) {
+ return ((PropertyTreeItem)element).getProperty().getQualifiedName();
+ }
+ return super.getText(element);
+ }
+ }
+
+ public class CheckStateProvider implements ICheckStateProvider {
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isChecked(Object element) {
+ if(element instanceof PropertyTreeItem) {
+ Property property = ((PropertyTreeItem)element).getProperty();
+ Stereotype stereotype = ((PropertyTreeItem)element).getParent().getStereotype();
+ if(property != null && stereotype != null) {
+ String name = getPropertyName(stereotype, property);
+ return listOfDisplayableStereotypeProperties.contains(name);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isGrayed(Object element) {
+ return false;
+ }
+ }
+
+ public String getPropertyName(Stereotype stereotype, Property property) {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(stereotype.getQualifiedName());
+ buffer.append(".");
+ buffer.append(property.getName());
+ return buffer.toString();
+ }
+
+ public interface ITreeElement {
+
+ public ITreeElement[] getChildren();
+
+ public ITreeElement getParent();
+ }
+
+ /**
+ * Tree Item to manage Stereotypes
+ */
+ public class StereotypeTreeItem implements ITreeElement {
+
+ private Stereotype stereotype;
+
+ private PropertyTreeItem[] propertyTreeItems;
+
+ /**
+ * Constructor.
+ *
+ * @param parentItem
+ * th parent item for this tree item
+ * @param style
+ * the style of this tree item
+ */
+ public StereotypeTreeItem(Stereotype stereotype) {
+ this.stereotype = stereotype;
+ }
+
+ /**
+ * Returns the Stereotype represented by this tree item
+ */
+ public Stereotype getStereotype() {
+ return stereotype;
+ }
+
+ public PropertyTreeItem[] getChildren() {
+ if(propertyTreeItems == null) {
+ List<PropertyTreeItem> items = new ArrayList<DisplayAppliedStereotypePropertiesInCompartmentPostAction.PropertyTreeItem>();
+ for(Property property : stereotype.getAllAttributes()) {
+ if(property != null) {
+ items.add(new PropertyTreeItem(this, property));
+ }
+ }
+ propertyTreeItems = items.toArray(new PropertyTreeItem[]{});
+ }
+ return propertyTreeItems;
+ }
+
+ public ITreeElement getParent() {
+ return null;
+ }
+ }
+
+ /**
+ * Tree Item to manage Stereotypes
+ */
+ public class PropertyTreeItem implements ITreeElement {
+
+ private Property property;
+
+ private StereotypeTreeItem stereotypeTreeItem;
+
+ /**
+ * Constructor.
+ *
+ * @param parentItem
+ * the parent item for this tree item
+ * @param style
+ * the style of this tree item
+ */
+ public PropertyTreeItem(StereotypeTreeItem stereotypeTreeItem, Property property) {
+ this.stereotypeTreeItem = stereotypeTreeItem;
+ this.property = property;
+ }
+
+ /**
+ * Returns the Property represented by this tree item
+ */
+ public Property getProperty() {
+ return property;
+ }
+
+ public StereotypeTreeItem getParent() {
+ return stereotypeTreeItem;
+ }
+
+ public ITreeElement[] getChildren() {
+ return new ITreeElement[0];
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DynamicConfigureRequest.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DynamicConfigureRequest.java
index e7bdf8b1a22..8afc2284564 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DynamicConfigureRequest.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/DynamicConfigureRequest.java
@@ -1,79 +1,79 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.emf.type.core.EditHelperContext;
-import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
-import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
-
-/**
- * Request to edit values of an object, after a dialog is opened to ask for the
- * values to set
- */
-public class DynamicConfigureRequest extends AbstractEditCommandRequest {
-
- /** list of properties to define */
- protected List<String> propertiesToDefine;
-
- /** eobject to edit */
- protected EObject elementToEdit;
-
- /**
- * Constructor.
- *
- * @param objectToEdit
- * the object that will be modified
- * @param propertiesToDefine
- * the list of properties to define, using their name
- */
- protected DynamicConfigureRequest(EObject objectToEdit, List<String> propertiesToDefine) {
- super(TransactionUtil.getEditingDomain(objectToEdit));
- this.elementToEdit = objectToEdit;
- this.propertiesToDefine = propertiesToDefine;
- }
-
- /**
- * @{inheritDoc
- */
- public Object getEditHelperContext() {
- IClientContext context = getClientContext();
-
- if(context == null) {
- return elementToEdit;
- } else {
- return new EditHelperContext(elementToEdit, context);
- }
- }
-
- /**
- * Gets the owner of the structural feature.
- *
- * @return the owner of the structural feature
- */
- public EObject getElementToEdit() {
- return elementToEdit;
- }
-
- /**
- * Returns the list of properties to define, identified by their name
- *
- * @return the list of properties to define
- */
- public List<String> getPropertiesToDefine() {
- return propertiesToDefine;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.emf.type.core.EditHelperContext;
+import org.eclipse.gmf.runtime.emf.type.core.IClientContext;
+import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
+
+/**
+ * Request to edit values of an object, after a dialog is opened to ask for the
+ * values to set
+ */
+public class DynamicConfigureRequest extends AbstractEditCommandRequest {
+
+ /** list of properties to define */
+ protected List<String> propertiesToDefine;
+
+ /** eobject to edit */
+ protected EObject elementToEdit;
+
+ /**
+ * Constructor.
+ *
+ * @param objectToEdit
+ * the object that will be modified
+ * @param propertiesToDefine
+ * the list of properties to define, using their name
+ */
+ protected DynamicConfigureRequest(EObject objectToEdit, List<String> propertiesToDefine) {
+ super(TransactionUtil.getEditingDomain(objectToEdit));
+ this.elementToEdit = objectToEdit;
+ this.propertiesToDefine = propertiesToDefine;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Object getEditHelperContext() {
+ IClientContext context = getClientContext();
+
+ if(context == null) {
+ return elementToEdit;
+ } else {
+ return new EditHelperContext(elementToEdit, context);
+ }
+ }
+
+ /**
+ * Gets the owner of the structural feature.
+ *
+ * @return the owner of the structural feature
+ */
+ public EObject getElementToEdit() {
+ return elementToEdit;
+ }
+
+ /**
+ * Returns the list of properties to define, identified by their name
+ *
+ * @return the list of properties to define
+ */
+ public List<String> getPropertiesToDefine() {
+ return propertiesToDefine;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAllAspectToolProvidersOperation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAllAspectToolProvidersOperation.java
index 59519a30a46..96df4922872 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAllAspectToolProvidersOperation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAllAspectToolProvidersOperation.java
@@ -1,40 +1,40 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.List;
-
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.service.IProvider;
-
-/**
- * Operation to find an aspect tool provider, given its unique identifier
- */
-public class GetAllAspectToolProvidersOperation implements IOperation {
-
- protected List<IAspectActionProvider> providers;
-
- /**
- * Creates a new GetAllAspectToolProvidersOperation.
- */
- protected GetAllAspectToolProvidersOperation(List<IAspectActionProvider> providers) {
- this.providers = providers;
- }
-
- /**
- * @{inheritDoc
- */
- public Object execute(IProvider provider) {
- providers.add((IAspectActionProvider)provider);
- return providers;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.List;
+
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.common.core.service.IProvider;
+
+/**
+ * Operation to find an aspect tool provider, given its unique identifier
+ */
+public class GetAllAspectToolProvidersOperation implements IOperation {
+
+ protected List<IAspectActionProvider> providers;
+
+ /**
+ * Creates a new GetAllAspectToolProvidersOperation.
+ */
+ protected GetAllAspectToolProvidersOperation(List<IAspectActionProvider> providers) {
+ this.providers = providers;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Object execute(IProvider provider) {
+ providers.add((IAspectActionProvider)provider);
+ return providers;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAspectToolProviderOperation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAspectToolProviderOperation.java
index 96a51e078f0..4029b1ceaac 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAspectToolProviderOperation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GetAspectToolProviderOperation.java
@@ -1,53 +1,53 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.common.core.service.IProvider;
-
-/**
- * Operation to find an aspect tool provider, given its unique identifier
- */
-public class GetAspectToolProviderOperation implements IOperation {
-
- /** id of the action to retrieve */
- private final String identifier;
-
- /**
- * Creates a new GetAspectToolProviderOperation.
- *
- * @param identifier
- * the identifier of the operation to retrieve
- */
- protected GetAspectToolProviderOperation(String identifier) {
- assert null != identifier : "GetAspectToolOperation constructor received NULL as argument"; //$NON-NLS-1$
-
- this.identifier = identifier;
- }
-
- /**
- * @{inheritDoc
- */
- public Object execute(IProvider provider) {
- String id = ((IAspectActionProvider)provider).getFactoryId();
- return (identifier.equals(id) ? provider : null);
- }
-
- /**
- * Returns the identifier of the provider this operation is looking for
- *
- * @return the identifier of the provider this operation is looking for
- */
- public String getIdentifier() {
- return identifier;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.gmf.runtime.common.core.service.IOperation;
+import org.eclipse.gmf.runtime.common.core.service.IProvider;
+
+/**
+ * Operation to find an aspect tool provider, given its unique identifier
+ */
+public class GetAspectToolProviderOperation implements IOperation {
+
+ /** id of the action to retrieve */
+ private final String identifier;
+
+ /**
+ * Creates a new GetAspectToolProviderOperation.
+ *
+ * @param identifier
+ * the identifier of the operation to retrieve
+ */
+ protected GetAspectToolProviderOperation(String identifier) {
+ assert null != identifier : "GetAspectToolOperation constructor received NULL as argument"; //$NON-NLS-1$
+
+ this.identifier = identifier;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Object execute(IProvider provider) {
+ String id = ((IAspectActionProvider)provider).getFactoryId();
+ return (identifier.equals(id) ? provider : null);
+ }
+
+ /**
+ * Returns the identifier of the provider this operation is looking for
+ *
+ * @return the identifier of the provider this operation is looking for
+ */
+ public String getIdentifier() {
+ return identifier;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalAspectActionProvider.java
index c212dcc6060..0f0fa99a3bc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalAspectActionProvider.java
@@ -1,46 +1,46 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.w3c.dom.Node;
-
-/**
- * Factory in charge of the graphical aspect actions taken after palette actions
- */
-public class GraphicalAspectActionProvider extends AbstractAspectActionProvider {
-
- /** semantic action key */
- public final static String GRAPHICAL_ACTION_KEY = "org.eclipse.papyrus.postaction.graphicalaction";
-
- /**
- * Constructor.
- *
- */
- public GraphicalAspectActionProvider() {
- }
-
- /**
- * @{inheritDoc
- */
- public IAspectAction createAction(Node configurationNode) {
- GraphicalPostAction action = new GraphicalPostAction();
- action.init(configurationNode, this);
- return action;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean isEnable(IPaletteEntryProxy entryProxy) {
- return true;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.w3c.dom.Node;
+
+/**
+ * Factory in charge of the graphical aspect actions taken after palette actions
+ */
+public class GraphicalAspectActionProvider extends AbstractAspectActionProvider {
+
+ /** semantic action key */
+ public final static String GRAPHICAL_ACTION_KEY = "org.eclipse.papyrus.postaction.graphicalaction";
+
+ /**
+ * Constructor.
+ *
+ */
+ public GraphicalAspectActionProvider() {
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IAspectAction createAction(Node configurationNode) {
+ GraphicalPostAction action = new GraphicalPostAction();
+ action.init(configurationNode, this);
+ return action;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean isEnable(IPaletteEntryProxy entryProxy) {
+ return true;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalPostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalPostAction.java
index 1f713c8b3b3..1b48739355d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalPostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/GraphicalPostAction.java
@@ -1,136 +1,136 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.HashMap;
-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.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.uml2.uml.Profile;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Aspect action that modifies graphical appearance on the edit part newly
- * created
- */
-public class GraphicalPostAction extends ModelPostAction {
-
- /** list of properties to update, identified by their names */
- protected Map<String, Object> propertiesToUpdate;
-
- /** entry proxy "parent" of this action when configuring the action */
- protected IPaletteEntryProxy entryProxy;
-
- /** list of applied profiles */
- protected List<Profile> appliedProfiles;
-
- /**
- * Constructor.
- */
- public GraphicalPostAction() {
- propertiesToUpdate = new HashMap<String, Object>();
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public void init(Node configurationNode, IAspectActionProvider factory) {
- super.init(configurationNode, factory);
- if(configurationNode == null) {
- return;
- }
- NodeList childNodes = configurationNode.getChildNodes();
- for(int i = 0; i < childNodes.getLength(); i++) {
- Node featureNode = childNodes.item(i);
- if(IPapyrusPaletteConstant.FEATURE_NODE_NAME.equals(featureNode.getNodeName())) {
- Node nameNode = childNodes.item(i).getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
- Node valueNode = childNodes.item(i).getAttributes().getNamedItem(IPapyrusPaletteConstant.VALUE);
- if(nameNode != null && valueNode != null) {
- propertiesToUpdate.put(nameNode.getNodeValue(), valueNode.getNodeValue());
- } else {
- Activator.log.error("Impossible to parse the configuration node for graphical post action", null);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getPostCommand(final IAdaptable viewAdapter) {
- final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
-
- return new AbstractTransactionalCommand(editingDomain, "Modify Graphic", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- View view = (View)viewAdapter.getAdapter(View.class);
- for(String featureName : propertiesToUpdate.keySet()) {
- // retrieve feature to set
- EStructuralFeature feature = view.eClass().getEStructuralFeature(featureName);
- if(feature == null) {
- Activator.log.error("Impossible to find the feature " + featureName + " for element " + view, null);
- } else {
- view.eSet(feature, getValue(feature, propertiesToUpdate.get(featureName)));
- }
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- /**
- * @{inheritDoc
- */
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
- this.appliedProfiles = appliedProfiles;
- this.entryProxy = entryProxy;
-
- Composite composite = new Composite(parent, SWT.BORDER);
- composite.setLayout(new GridLayout(1, false));
-
- Label label = new Label(composite, SWT.None);
- label.setText("Configuration of graphical post action : ");
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
- label.setLayoutData(data);
-
- return composite;
- }
-
- /**
- * @{inheritDoc
- */
- public void save(Node parentNode) {
- // TODO Auto-generated method stub
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.HashMap;
+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.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.uml2.uml.Profile;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Aspect action that modifies graphical appearance on the edit part newly
+ * created
+ */
+public class GraphicalPostAction extends ModelPostAction {
+
+ /** list of properties to update, identified by their names */
+ protected Map<String, Object> propertiesToUpdate;
+
+ /** entry proxy "parent" of this action when configuring the action */
+ protected IPaletteEntryProxy entryProxy;
+
+ /** list of applied profiles */
+ protected List<Profile> appliedProfiles;
+
+ /**
+ * Constructor.
+ */
+ public GraphicalPostAction() {
+ propertiesToUpdate = new HashMap<String, Object>();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ super.init(configurationNode, factory);
+ if(configurationNode == null) {
+ return;
+ }
+ NodeList childNodes = configurationNode.getChildNodes();
+ for(int i = 0; i < childNodes.getLength(); i++) {
+ Node featureNode = childNodes.item(i);
+ if(IPapyrusPaletteConstant.FEATURE_NODE_NAME.equals(featureNode.getNodeName())) {
+ Node nameNode = childNodes.item(i).getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
+ Node valueNode = childNodes.item(i).getAttributes().getNamedItem(IPapyrusPaletteConstant.VALUE);
+ if(nameNode != null && valueNode != null) {
+ propertiesToUpdate.put(nameNode.getNodeValue(), valueNode.getNodeValue());
+ } else {
+ Activator.log.error("Impossible to parse the configuration node for graphical post action", null);
+ }
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand getPostCommand(final IAdaptable viewAdapter) {
+ final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
+
+ return new AbstractTransactionalCommand(editingDomain, "Modify Graphic", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ View view = (View)viewAdapter.getAdapter(View.class);
+ for(String featureName : propertiesToUpdate.keySet()) {
+ // retrieve feature to set
+ EStructuralFeature feature = view.eClass().getEStructuralFeature(featureName);
+ if(feature == null) {
+ Activator.log.error("Impossible to find the feature " + featureName + " for element " + view, null);
+ } else {
+ view.eSet(feature, getValue(feature, propertiesToUpdate.get(featureName)));
+ }
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
+ this.appliedProfiles = appliedProfiles;
+ this.entryProxy = entryProxy;
+
+ Composite composite = new Composite(parent, SWT.BORDER);
+ composite.setLayout(new GridLayout(1, false));
+
+ Label label = new Label(composite, SWT.None);
+ label.setText("Configuration of graphical post action : ");
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
+ label.setLayoutData(data);
+
+ return composite;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void save(Node parentNode) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectAction.java
index 606650e84b1..422434bd466 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectAction.java
@@ -1,89 +1,89 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.gef.EditPart;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.uml2.uml.Profile;
-import org.w3c.dom.Node;
-
-/**
- * Interface implemented by actions run after or before palette creation
- */
-public interface IAspectAction {
-
- /**
- * Initializes the action with some elements
- *
- * @param configurationNode
- * the configuration {@link Node} that initialize the action
- */
- public void init(Node configurationNode, IAspectActionProvider factory);
-
- /**
- * Runs post condition tests before runnning the action
- *
- * @return the status corresponding to the check
- */
- public IStatus checkPreCondition();
-
- /**
- * Runs post condition tests after runnning the action
- *
- * @return the status corresponding to the check
- */
- public IStatus checkPostCondition();
-
- /**
- * Returns the label displayed by this action
- *
- * @return the label displayed by this action
- */
- public String getLabel();
-
- /**
- * Returns the image displayed by this action
- *
- * @return the image displayed by this action
- */
- public Image getImage();
-
- /**
- * Creates the control where the action can be configured
- *
- * @param parent
- * the composite parent of the created element(s)
- * @return the control where the action can be configured
- */
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles);
-
- /**
- * Serializes the current action configuration
- *
- * @param parentNode
- * the configuration node where to place values
- */
- public void save(Node parentNode);
-
- /**
- * Returns the id of the factory in charge of the creation of this action
- *
- * @return the id of the factory in charge of the creation of this action
- */
- public String getFactoryId();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.gef.EditPart;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.uml2.uml.Profile;
+import org.w3c.dom.Node;
+
+/**
+ * Interface implemented by actions run after or before palette creation
+ */
+public interface IAspectAction {
+
+ /**
+ * Initializes the action with some elements
+ *
+ * @param configurationNode
+ * the configuration {@link Node} that initialize the action
+ */
+ public void init(Node configurationNode, IAspectActionProvider factory);
+
+ /**
+ * Runs post condition tests before runnning the action
+ *
+ * @return the status corresponding to the check
+ */
+ public IStatus checkPreCondition();
+
+ /**
+ * Runs post condition tests after runnning the action
+ *
+ * @return the status corresponding to the check
+ */
+ public IStatus checkPostCondition();
+
+ /**
+ * Returns the label displayed by this action
+ *
+ * @return the label displayed by this action
+ */
+ public String getLabel();
+
+ /**
+ * Returns the image displayed by this action
+ *
+ * @return the image displayed by this action
+ */
+ public Image getImage();
+
+ /**
+ * Creates the control where the action can be configured
+ *
+ * @param parent
+ * the composite parent of the created element(s)
+ * @return the control where the action can be configured
+ */
+ public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles);
+
+ /**
+ * Serializes the current action configuration
+ *
+ * @param parentNode
+ * the configuration node where to place values
+ */
+ public void save(Node parentNode);
+
+ /**
+ * Returns the id of the factory in charge of the creation of this action
+ *
+ * @return the id of the factory in charge of the creation of this action
+ */
+ public String getFactoryId();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectActionProvider.java
index a18281ba4aa..7a30d68f3b8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectActionProvider.java
@@ -1,69 +1,69 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.gmf.runtime.common.core.service.IProvider;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Node;
-
-/**
- * Interface for aspect action factories
- */
-public interface IAspectActionProvider extends IProvider {
-
- /**
- * Creates an action, given the specified parameters
- *
- * @param configurationNode
- * the configuration node that specifies parameter to the action
- */
- public IAspectAction createAction(Node configurationNode);
-
- /**
- * Returns the id of this factory
- *
- * @return the id of this factory
- */
- public String getFactoryId();
-
- /**
- * Returns the name of the factory
- *
- * @return the name of the factory
- */
- public String getName();
-
- /**
- * Returns the image representing the factory
- *
- * @return the image representing the factory
- */
- public Image getImage();
-
- /**
- * returns <code>true</code> if this factory is enabled
- *
- * @param entryProxy
- * the entry proxy for which aspect action will be added or
- * removed
- *
- * @return <code>true</code> if this factory is enabled
- */
- public boolean isEnable(IPaletteEntryProxy entryProxy);
-
- /**
- * Sets the configuration for this provider, given the configuration element
- */
- public void setConfiguration(IConfigurationElement element);
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.gmf.runtime.common.core.service.IProvider;
+import org.eclipse.swt.graphics.Image;
+import org.w3c.dom.Node;
+
+/**
+ * Interface for aspect action factories
+ */
+public interface IAspectActionProvider extends IProvider {
+
+ /**
+ * Creates an action, given the specified parameters
+ *
+ * @param configurationNode
+ * the configuration node that specifies parameter to the action
+ */
+ public IAspectAction createAction(Node configurationNode);
+
+ /**
+ * Returns the id of this factory
+ *
+ * @return the id of this factory
+ */
+ public String getFactoryId();
+
+ /**
+ * Returns the name of the factory
+ *
+ * @return the name of the factory
+ */
+ public String getName();
+
+ /**
+ * Returns the image representing the factory
+ *
+ * @return the image representing the factory
+ */
+ public Image getImage();
+
+ /**
+ * returns <code>true</code> if this factory is enabled
+ *
+ * @param entryProxy
+ * the entry proxy for which aspect action will be added or
+ * removed
+ *
+ * @return <code>true</code> if this factory is enabled
+ */
+ public boolean isEnable(IPaletteEntryProxy entryProxy);
+
+ /**
+ * Sets the configuration for this provider, given the configuration element
+ */
+ public void setConfiguration(IConfigurationElement element);
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectToolProviderService.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectToolProviderService.java
index 37804b9417b..1688ea7ba18 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectToolProviderService.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IAspectToolProviderService.java
@@ -1,36 +1,36 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.List;
-
-/**
- * Interface that should be implemented by all aspect tool factory providers
- */
-public interface IAspectToolProviderService {
-
- /**
- * Returns the factory, given the id of the factory to return
- *
- * @param id
- * the id of the factory to retrieve
- * @return the found factory or <code>null</code>
- */
- public IAspectActionProvider getProvider(String id);
-
- /**
- * Returns the list of factories present in the workbench
- *
- * @return the list of available factories
- */
- public List<IAspectActionProvider> getProviders();
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.List;
+
+/**
+ * Interface that should be implemented by all aspect tool factory providers
+ */
+public interface IAspectToolProviderService {
+
+ /**
+ * Returns the factory, given the id of the factory to return
+ *
+ * @param id
+ * the id of the factory to retrieve
+ * @return the found factory or <code>null</code>
+ */
+ public IAspectActionProvider getProvider(String id);
+
+ /**
+ * Returns the list of factories present in the workbench
+ *
+ * @return the list of available factories
+ */
+ public List<IAspectActionProvider> getProviders();
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IFeatureSetterAspectAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IFeatureSetterAspectAction.java
index e7780e7d46e..8804ab789a3 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IFeatureSetterAspectAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IFeatureSetterAspectAction.java
@@ -1,120 +1,120 @@
-/*****************************************************************************
- * Copyright (c) 2011 AtoS.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tristan FAURE (Atos) tristan.faure@atos.net - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.Request;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
-
-/**
- * Annotation to apply to Aspect Actions which modify references
- *
- * @author tristan.faure@atos.net
- *
- */
-public interface IFeatureSetterAspectAction {
-
- public EStructuralFeature[] getAllImpactedFeatures();
-
- public static class IFeatureSetterAspectActionUtil {
- /**
- * Return all the impacted features for a given request the array of int
- * represents the ids
- *
- * @param request
- * @return never null
- */
- public static Set<EStructuralFeature> getAllImpactedFeatures(
- Request request) {
- return getAllImpactedFeatures(request.getExtendedData());
- }
-
- /**
- * Return all the impacted Features from a map given by a request
- * @param map
- * @return the features impacted by an action
- */
- public static Set<EStructuralFeature> getAllImpactedFeatures(
- Map map) {
- Set<EStructuralFeature> result = new HashSet<EStructuralFeature>();
- List<IAspectAction> aspectActions = AspectUnspecifiedTypeCreationTool
- .getAspectActions(map);
- if (aspectActions != null)
- {
- for (IAspectAction a : aspectActions)
- {
- if (a instanceof IFeatureSetterAspectAction) {
- IFeatureSetterAspectAction featureSetter = (IFeatureSetterAspectAction) a;
- result.addAll(Arrays.asList(featureSetter.getAllImpactedFeatures()));
- }
- }
- }
- return result;
- }
-
- /**
- * Return all the impacted features in a {@link IEditCommandRequest} containing Pre and Post actions
- * @param request
- * @return
- */
- public static Set<EStructuralFeature> getAllImpactedFeatures(
- IEditCommandRequest request) {
- return getAllImpactedFeatures(request.getParameters());
- }
-
- /**
- * Determine if the features in parameters are managed by Pre/Post
- * Action in the request
- * @param request
- * @param features
- * @return true if they are ALL managed
- */
- public static boolean areFeaturesManaged(Request request, EStructuralFeature... features)
- {
- return request != null && areFeaturesManaged(request.getExtendedData(), features);
- }
-
- /**
- * Determine if the features in parameters are managed by Pre/Post
- * Action in the request
- * @param request
- * @param features
- * @return true if they are ALL managed
- */
- public static boolean areFeaturesManaged(IEditCommandRequest request, EStructuralFeature features)
- {
- return request != null && areFeaturesManaged(request.getParameters(), features);
- }
-
- private static boolean areFeaturesManaged(Map map, EStructuralFeature... feature)
- {
- Set<EStructuralFeature> impacted = getAllImpactedFeatures(map);
- for (EStructuralFeature f : feature)
- {
- if (!impacted.contains(f))
- {
- return false ;
- }
- }
- return true ;
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 AtoS.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tristan FAURE (Atos) tristan.faure@atos.net - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.Request;
+import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
+import org.eclipse.papyrus.uml.diagram.common.service.AspectUnspecifiedTypeCreationTool;
+
+/**
+ * Annotation to apply to Aspect Actions which modify references
+ *
+ * @author tristan.faure@atos.net
+ *
+ */
+public interface IFeatureSetterAspectAction {
+
+ public EStructuralFeature[] getAllImpactedFeatures();
+
+ public static class IFeatureSetterAspectActionUtil {
+ /**
+ * Return all the impacted features for a given request the array of int
+ * represents the ids
+ *
+ * @param request
+ * @return never null
+ */
+ public static Set<EStructuralFeature> getAllImpactedFeatures(
+ Request request) {
+ return getAllImpactedFeatures(request.getExtendedData());
+ }
+
+ /**
+ * Return all the impacted Features from a map given by a request
+ * @param map
+ * @return the features impacted by an action
+ */
+ public static Set<EStructuralFeature> getAllImpactedFeatures(
+ Map map) {
+ Set<EStructuralFeature> result = new HashSet<EStructuralFeature>();
+ List<IAspectAction> aspectActions = AspectUnspecifiedTypeCreationTool
+ .getAspectActions(map);
+ if (aspectActions != null)
+ {
+ for (IAspectAction a : aspectActions)
+ {
+ if (a instanceof IFeatureSetterAspectAction) {
+ IFeatureSetterAspectAction featureSetter = (IFeatureSetterAspectAction) a;
+ result.addAll(Arrays.asList(featureSetter.getAllImpactedFeatures()));
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Return all the impacted features in a {@link IEditCommandRequest} containing Pre and Post actions
+ * @param request
+ * @return
+ */
+ public static Set<EStructuralFeature> getAllImpactedFeatures(
+ IEditCommandRequest request) {
+ return getAllImpactedFeatures(request.getParameters());
+ }
+
+ /**
+ * Determine if the features in parameters are managed by Pre/Post
+ * Action in the request
+ * @param request
+ * @param features
+ * @return true if they are ALL managed
+ */
+ public static boolean areFeaturesManaged(Request request, EStructuralFeature... features)
+ {
+ return request != null && areFeaturesManaged(request.getExtendedData(), features);
+ }
+
+ /**
+ * Determine if the features in parameters are managed by Pre/Post
+ * Action in the request
+ * @param request
+ * @param features
+ * @return true if they are ALL managed
+ */
+ public static boolean areFeaturesManaged(IEditCommandRequest request, EStructuralFeature features)
+ {
+ return request != null && areFeaturesManaged(request.getParameters(), features);
+ }
+
+ private static boolean areFeaturesManaged(Map map, EStructuralFeature... feature)
+ {
+ Set<EStructuralFeature> impacted = getAllImpactedFeatures(map);
+ for (EStructuralFeature f : feature)
+ {
+ if (!impacted.contains(f))
+ {
+ return false ;
+ }
+ }
+ return true ;
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteAspectToolEntryProxy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteAspectToolEntryProxy.java
index a1232a67728..fcd00d97703 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteAspectToolEntryProxy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteAspectToolEntryProxy.java
@@ -1,36 +1,36 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.List;
-
-/**
- * Interface implemented by all proxies for entries that contain pre/post
- * actions
- */
-public interface IPaletteAspectToolEntryProxy extends IPaletteEntryProxy {
-
- /**
- * Returns the list of post actions to execute on creation
- *
- * @return the list of post actions to execute on creation
- */
- public List<IPostAction> getPostActions();
-
- /**
- * Returns the list of pre actions to execute on creation
- *
- * @return the list of pre actions to execute on creation
- */
- public List<IPreAction> getPreActions();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.List;
+
+/**
+ * Interface implemented by all proxies for entries that contain pre/post
+ * actions
+ */
+public interface IPaletteAspectToolEntryProxy extends IPaletteEntryProxy {
+
+ /**
+ * Returns the list of post actions to execute on creation
+ *
+ * @return the list of post actions to execute on creation
+ */
+ public List<IPostAction> getPostActions();
+
+ /**
+ * Returns the list of pre actions to execute on creation
+ *
+ * @return the list of pre actions to execute on creation
+ */
+ public List<IPreAction> getPreActions();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteEntryProxy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteEntryProxy.java
index 0094fa18910..8fe844a978d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteEntryProxy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPaletteEntryProxy.java
@@ -1,28 +1,28 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.gef.palette.PaletteEntry;
-
-/**
- * Interface implemented by all proxies for the palette customization dialog
- */
-public interface IPaletteEntryProxy {
-
- /**
- * Returns the entry managed by this proxy
- *
- * @return the entry managed by this proxy
- */
- public PaletteEntry getEntry();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.gef.palette.PaletteEntry;
+
+/**
+ * Interface implemented by all proxies for the palette customization dialog
+ */
+public interface IPaletteEntryProxy {
+
+ /**
+ * Returns the entry managed by this proxy
+ *
+ * @return the entry managed by this proxy
+ */
+ public PaletteEntry getEntry();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPostAction.java
index 84fc2ff9d09..42a2583174c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPostAction.java
@@ -1,51 +1,51 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-
-/**
- * Interface implemented by post exectuion actions
- */
-public interface IPostAction extends IAspectAction {
-
- /**
- * command that will be execute after the creation command
- *
- * @param viewAdapter
- * an adapter to retrieve the view created by the creation command.
- * the view will be available in the adapter
- * during the execute() of the command but is not available when
- * this method is called.
- * @return
- */
- public ICommand getPostCommand(IAdaptable viewAdapter);
-
- /**
- * Do an action after the edit part has been created from the view.
- * This is executed in post commit so you can't run a transactional command
- * Except in unprotected mode which is dangerous.
- * Please consider the use of getPostCommand instead if possible.
- *
- * @param editPart
- */
- public void runInPostCommit(EditPart editPart);
-
- /**
- * Needs to return true if an action is specified in runInPostCommit()
- * @return
- */
- public boolean needsPostCommitRun();
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+
+/**
+ * Interface implemented by post exectuion actions
+ */
+public interface IPostAction extends IAspectAction {
+
+ /**
+ * command that will be execute after the creation command
+ *
+ * @param viewAdapter
+ * an adapter to retrieve the view created by the creation command.
+ * the view will be available in the adapter
+ * during the execute() of the command but is not available when
+ * this method is called.
+ * @return
+ */
+ public ICommand getPostCommand(IAdaptable viewAdapter);
+
+ /**
+ * Do an action after the edit part has been created from the view.
+ * This is executed in post commit so you can't run a transactional command
+ * Except in unprotected mode which is dangerous.
+ * Please consider the use of getPostCommand instead if possible.
+ *
+ * @param editPart
+ */
+ public void runInPostCommit(EditPart editPart);
+
+ /**
+ * Needs to return true if an action is specified in runInPostCommit()
+ * @return
+ */
+ public boolean needsPostCommitRun();
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPreAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPreAction.java
index 6a47564ce21..0823d650f7a 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPreAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/IPreAction.java
@@ -1,43 +1,43 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Philippe ROLAND (Atos) philippe.roland@atos.net - Defined additional methods for Nodes and Connections
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Interface implemented by pre execution actions
- */
-public interface IPreAction extends IAspectAction {
-
- /**
- * Get the precommand for a node element.
- *
- * @param containerView
- * the View corresponding to the parent of the element that is about to created
- * @return
- */
- public ICommand getNodePreCommand(View containerView);
-
- /**
- * Get the precommand for a connection element.
- *
- * @param sourceView
- * the View corresponding to the connection's source
- * @param targetView
- * the View corresponding to the connection's target
- * @return
- */
- public ICommand getConnectionPreCommand(View sourceView, View targetView);
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * Philippe ROLAND (Atos) philippe.roland@atos.net - Defined additional methods for Nodes and Connections
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * Interface implemented by pre execution actions
+ */
+public interface IPreAction extends IAspectAction {
+
+ /**
+ * Get the precommand for a node element.
+ *
+ * @param containerView
+ * the View corresponding to the parent of the element that is about to created
+ * @return
+ */
+ public ICommand getNodePreCommand(View containerView);
+
+ /**
+ * Get the precommand for a connection element.
+ *
+ * @param sourceView
+ * the View corresponding to the connection's source
+ * @param targetView
+ * the View corresponding to the connection's target
+ * @return
+ */
+ public ICommand getConnectionPreCommand(View sourceView, View targetView);
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Messages.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Messages.java
index d6402ad84c9..7ce691ae239 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Messages.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Messages.java
@@ -1,32 +1,32 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-
- private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.common.service.palette.messages"; //$NON-NLS-1$
-
- public static String SetDynamicValueCommand_DialogMessage;
-
- public static String SetDynamicValueCommand_DialogTile;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.papyrus.uml.diagram.common.service.palette.messages"; //$NON-NLS-1$
+
+ public static String SetDynamicValueCommand_DialogMessage;
+
+ public static String SetDynamicValueCommand_DialogTile;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ModelPostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ModelPostAction.java
index 31ed3c7938f..69d91c4bdd6 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ModelPostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/ModelPostAction.java
@@ -1,248 +1,248 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.gef.EditPart;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.graphics.Image;
-import org.w3c.dom.Node;
-
-/**
- * Generic class for actions modifying directly the models (graphic or semantic
- * model)
- */
-public abstract class ModelPostAction implements IPostAction {
-
- /** factory used to create this action */
- protected IAspectActionProvider factory;
-
- /**
- * @{inheritDoc
- */
- public IStatus checkPostCondition() {
- return Status.OK_STATUS;
- }
-
- /**
- * @{inheritDoc
- */
- public IStatus checkPreCondition() {
- return Status.OK_STATUS;
- }
-
- /**
- * @{inheritDoc
- */
- public void init(Node configurationNode, IAspectActionProvider factory) {
- this.factory = factory;
- }
-
- /**
- * @{inheritDoc
- */
- public String getFactoryId() {
- return factory.getFactoryId();
- }
-
- /**
- * @{inheritDoc
- */
- public Image getImage() {
- return factory.getImage();
- }
-
- /**
- * @{inheritDoc
- */
- public String getLabel() {
- return factory.getName();
- }
-
- /**
- * Retrieves the valid type of an object given the structural feature for
- * which it gives a value
- *
- * @param feature
- * the valued feature
- * @param value
- * value of the feature
- * @return the same value, but correctly cast.
- */
- protected Object getValue(EStructuralFeature feature, Object value) {
- EClassifier type = feature.getEType();
- if(type instanceof EDataType) {
- Class<?> iClass = type.getInstanceClass();
- if(Boolean.TYPE.equals(iClass)) {
- if(value instanceof Boolean) {
- // ok
- } else if(value instanceof String) {
- value = Boolean.valueOf((String)value);
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- } else if(Character.TYPE.equals(iClass)) {
- if(value instanceof Character) {
- // ok
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- value = new Character(s.charAt(0));
- }
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- } else if(Byte.TYPE.equals(iClass)) {
- if(value instanceof Byte) {
- // ok
- } else if(value instanceof Number) {
- value = new Byte(((Number)value).byteValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Byte.valueOf(s);
- } catch (NumberFormatException nfe) {
- Activator.log.error("impossible to parse value " + value, nfe);
- }
- }
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- } else if(Short.TYPE.equals(iClass)) {
- if(value instanceof Short) {
- // ok
- } else if(value instanceof Number) {
- value = new Short(((Number)value).shortValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Short.valueOf(s);
- } catch (NumberFormatException nfe) {
- Activator.log.error("impossible to parse value " + value, nfe);
- }
- }
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- } else if(Integer.TYPE.equals(iClass)) {
- if(value instanceof Integer) {
- // ok
- } else if(value instanceof Number) {
- value = new Integer(((Number)value).intValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Integer.valueOf(s);
- } catch (NumberFormatException nfe) {
- Activator.log.error("impossible to parse value " + value, nfe);
- }
- }
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- } else if(Long.TYPE.equals(iClass)) {
- if(value instanceof Long) {
- // ok
- } else if(value instanceof Number) {
- value = new Long(((Number)value).longValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Long.valueOf(s);
- } catch (NumberFormatException nfe) {
- Activator.log.error("impossible to parse value " + value, nfe);
- }
- }
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- } else if(Float.TYPE.equals(iClass)) {
- if(value instanceof Float) {
- // ok
- } else if(value instanceof Number) {
- value = new Float(((Number)value).floatValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Float.valueOf(s);
- } catch (NumberFormatException nfe) {
- Activator.log.error("impossible to parse value " + value, nfe);
- }
- }
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- } else if(Double.TYPE.equals(iClass)) {
- if(value instanceof Double) {
- // ok
- } else if(value instanceof Number) {
- value = new Double(((Number)value).doubleValue());
- } else if(value instanceof String) {
- String s = (String)value;
- if(s.length() == 0) {
- value = null;
- } else {
- try {
- value = Double.valueOf(s);
- } catch (NumberFormatException nfe) {
- Activator.log.error("impossible to parse value " + value, nfe);
- }
- }
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- } else if(type instanceof EEnum) {
- if(value instanceof String) {
- EEnumLiteral literal = ((EEnum)type).getEEnumLiteralByLiteral((String)value);
- if(literal == null) {
- Activator.log.error("impossible to parse null value literal", null);
- } else {
- value = literal.getInstance();
- }
- } else {
- Activator.log.error("impossible to parse value " + value, null);
- }
- }
- }
- return value;
- }
-
- public void runInPostCommit(EditPart editPart) {
- }
-
- public boolean needsPostCommitRun() {
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gef.EditPart;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.graphics.Image;
+import org.w3c.dom.Node;
+
+/**
+ * Generic class for actions modifying directly the models (graphic or semantic
+ * model)
+ */
+public abstract class ModelPostAction implements IPostAction {
+
+ /** factory used to create this action */
+ protected IAspectActionProvider factory;
+
+ /**
+ * @{inheritDoc
+ */
+ public IStatus checkPostCondition() {
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IStatus checkPreCondition() {
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ this.factory = factory;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getFactoryId() {
+ return factory.getFactoryId();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Image getImage() {
+ return factory.getImage();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getLabel() {
+ return factory.getName();
+ }
+
+ /**
+ * Retrieves the valid type of an object given the structural feature for
+ * which it gives a value
+ *
+ * @param feature
+ * the valued feature
+ * @param value
+ * value of the feature
+ * @return the same value, but correctly cast.
+ */
+ protected Object getValue(EStructuralFeature feature, Object value) {
+ EClassifier type = feature.getEType();
+ if(type instanceof EDataType) {
+ Class<?> iClass = type.getInstanceClass();
+ if(Boolean.TYPE.equals(iClass)) {
+ if(value instanceof Boolean) {
+ // ok
+ } else if(value instanceof String) {
+ value = Boolean.valueOf((String)value);
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ } else if(Character.TYPE.equals(iClass)) {
+ if(value instanceof Character) {
+ // ok
+ } else if(value instanceof String) {
+ String s = (String)value;
+ if(s.length() == 0) {
+ value = null;
+ } else {
+ value = new Character(s.charAt(0));
+ }
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ } else if(Byte.TYPE.equals(iClass)) {
+ if(value instanceof Byte) {
+ // ok
+ } else if(value instanceof Number) {
+ value = new Byte(((Number)value).byteValue());
+ } else if(value instanceof String) {
+ String s = (String)value;
+ if(s.length() == 0) {
+ value = null;
+ } else {
+ try {
+ value = Byte.valueOf(s);
+ } catch (NumberFormatException nfe) {
+ Activator.log.error("impossible to parse value " + value, nfe);
+ }
+ }
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ } else if(Short.TYPE.equals(iClass)) {
+ if(value instanceof Short) {
+ // ok
+ } else if(value instanceof Number) {
+ value = new Short(((Number)value).shortValue());
+ } else if(value instanceof String) {
+ String s = (String)value;
+ if(s.length() == 0) {
+ value = null;
+ } else {
+ try {
+ value = Short.valueOf(s);
+ } catch (NumberFormatException nfe) {
+ Activator.log.error("impossible to parse value " + value, nfe);
+ }
+ }
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ } else if(Integer.TYPE.equals(iClass)) {
+ if(value instanceof Integer) {
+ // ok
+ } else if(value instanceof Number) {
+ value = new Integer(((Number)value).intValue());
+ } else if(value instanceof String) {
+ String s = (String)value;
+ if(s.length() == 0) {
+ value = null;
+ } else {
+ try {
+ value = Integer.valueOf(s);
+ } catch (NumberFormatException nfe) {
+ Activator.log.error("impossible to parse value " + value, nfe);
+ }
+ }
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ } else if(Long.TYPE.equals(iClass)) {
+ if(value instanceof Long) {
+ // ok
+ } else if(value instanceof Number) {
+ value = new Long(((Number)value).longValue());
+ } else if(value instanceof String) {
+ String s = (String)value;
+ if(s.length() == 0) {
+ value = null;
+ } else {
+ try {
+ value = Long.valueOf(s);
+ } catch (NumberFormatException nfe) {
+ Activator.log.error("impossible to parse value " + value, nfe);
+ }
+ }
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ } else if(Float.TYPE.equals(iClass)) {
+ if(value instanceof Float) {
+ // ok
+ } else if(value instanceof Number) {
+ value = new Float(((Number)value).floatValue());
+ } else if(value instanceof String) {
+ String s = (String)value;
+ if(s.length() == 0) {
+ value = null;
+ } else {
+ try {
+ value = Float.valueOf(s);
+ } catch (NumberFormatException nfe) {
+ Activator.log.error("impossible to parse value " + value, nfe);
+ }
+ }
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ } else if(Double.TYPE.equals(iClass)) {
+ if(value instanceof Double) {
+ // ok
+ } else if(value instanceof Number) {
+ value = new Double(((Number)value).doubleValue());
+ } else if(value instanceof String) {
+ String s = (String)value;
+ if(s.length() == 0) {
+ value = null;
+ } else {
+ try {
+ value = Double.valueOf(s);
+ } catch (NumberFormatException nfe) {
+ Activator.log.error("impossible to parse value " + value, nfe);
+ }
+ }
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ } else if(type instanceof EEnum) {
+ if(value instanceof String) {
+ EEnumLiteral literal = ((EEnum)type).getEEnumLiteralByLiteral((String)value);
+ if(literal == null) {
+ Activator.log.error("impossible to parse null value literal", null);
+ } else {
+ value = literal.getInstance();
+ }
+ } else {
+ Activator.log.error("impossible to parse value " + value, null);
+ }
+ }
+ }
+ return value;
+ }
+
+ public void runInPostCommit(EditPart editPart) {
+ }
+
+ public boolean needsPostCommitRun() {
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/PropertyRepresentation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/PropertyRepresentation.java
index 5fc9365b263..907123af0d2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/PropertyRepresentation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/PropertyRepresentation.java
@@ -1,309 +1,309 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Type;
-
-/**
- *
- * This class is used to represent a UML Property
- *
- */
-public class PropertyRepresentation {
-
- /**
- * The property ID is used to represent a unique property. It's composed by
- * : stereotype qualified name + {@link #separator} + {@link #propertyQualifiedName}
- */
- private String propID;
-
- /** the values owned by this property */
- private ArrayList<Value> values;
-
- /** the UML property represented by this class */
- private Property UMLProperty;
-
- /** Is it a runtime property? */
- private boolean isRuntimeProperty = false;
-
-/**
- * the {@link StereotypeRepresentation owning this
- *
- * @link PropertyRepresentation}
- */
- private StereotypeRepresentation stereotype;
-
- /** the property qualified name */
- private String propertyQualifiedName;
-
- /** the name of the property */
- private String name;
-
- /**
- * separator used in the {@link #propID}. It's not useful, it's only to
- * facilitate debug!
- */
- static public String separator = "|";; //$NON-NLS-1$
-
- /**
- *
- * Constructor.
- *
- * @param stereotypeQualifiedName
- * the stereotype owning this property
- * @param propertyQualifiedName
- * the property represented by this {@link PropertyRepresentation}
- */
- public PropertyRepresentation(String stereotypeQualifiedName, String propertyQualifiedName) {
- this.propertyQualifiedName = propertyQualifiedName;
- this.propID = stereotypeQualifiedName + separator + propertyQualifiedName;
- values = new ArrayList<Value>();
- }
-
- /**
- *
- * Constructor. Note : the values aren't not duplicated. The two
- * PropertyRepresentation share the same instances of the values
- *
- * @param propRep
- * the PropertyRepresentation used to instantiate a new
- * PropertyRepresentation
- */
- public PropertyRepresentation(PropertyRepresentation propRep) {
- this.propertyQualifiedName = new String(propRep.getQualifiedName());
- this.propID = new String(propRep.getPropertyId());
- this.setUMLProperty(propRep.getUMLProperty());
- this.setRuntime(propRep.isRuntimeProperty);
- this.values = propRep.getValues();
- }
-
- /**
- * Returns the property qualified name
- *
- * @return the property qualified name
- */
- public String getQualifiedName() {
- return propertyQualifiedName;
- }
-
- /**
- * Adds the value to this property
- *
- * @param value
- * the value to add to this property
- */
- public void addValue(Value value) {
- value.setPropertyRepresentation(this);
- values.add(value);
- }
-
- /**
- * Returns all the values owned by this property
- *
- * @return all the values owned by this property
- */
- public ArrayList<Value> getValues() {
- return values;
- }
-
- /**
- * Returns the type of the property
- *
- * @return the type of the property
- */
- public Type getType() {
- Assert.isNotNull(UMLProperty, "The property has not been set!"); //$NON-NLS-1$
- return UMLProperty.getType();
- }
-
- /**
- * Setter for {@link #propID}
- *
- * @return {@link #propID}
- */
- public String getPropertyId() {
- return propID;
- }
-
- /**
- * Returns the upper multiplicity
- *
- * @return the upper multiplicity
- */
- public int getUpperMultiplicity() {
- Assert.isNotNull(UMLProperty, "The property has not been set!"); //$NON-NLS-1$
- return UMLProperty.getUpper();
- }
-
- /**
- * Returns the string corresponding to the property multiplicity
- *
- * @return the string corresponding to the property multiplicity
- */
- protected String getPropertyMultiplicity() {
- Assert.isNotNull(UMLProperty, "The property has not been set!"); //$NON-NLS-1$
- String multiplicity = "[" + UMLProperty.getLower() + ".."; //$NON-NLS-1$ //$NON-NLS-2$
- int upper = UMLProperty.getUpper();
- if(upper == -1) {
- multiplicity += "*"; //$NON-NLS-1$
- } else {
- multiplicity += upper;
- }
- multiplicity += "]"; //$NON-NLS-1$
- return multiplicity;
- }
-
- /**
- *
- * @see java.lang.Object#toString()
- *
- * @return
- */
- public String toString() {
- return this.propID;
- }
-
- /**
- * Returns the string corresponding to the value to display for the property
- *
- * @return the string corresponding to the value to display for the property
- *
- */
- protected String getValueToDisplay() {
- String label = null;
- ArrayList<Value> values = getValues();
- if(!values.isEmpty()) {
- label = values.toString();
- } else if(UMLProperty.isSetDefault()) {
- label = UMLProperty.getDefault();
- } else if(UMLProperty.isMultivalued()) {
- label = "[]"; //$NON-NLS-1$
- }
- return label;
- }
-
- /**
- * Setter for the value to {@link #isRuntimeProperty}
- *
- * @param value
- */
- public void setRuntime(boolean value) {
- isRuntimeProperty = value;
- }
-
- /**
- * Getter for {@link #isRuntimeProperty}
- *
- * @return {@link #isRuntimeProperty}
- */
- public boolean isRuntime() {
- return isRuntimeProperty;
- }
-
- /**
- * Setter for {@link #UMLProperty}
- *
- * @param property
- * the UML {@link Property}
- */
- public void setUMLProperty(Property property) {
- this.UMLProperty = property;
- this.name = property.getName();
- }
-
- /**
- * Set the stereotype owning this property (often called by {@link StereotypeRepresentation#addProperty(PropertyRepresentation)})
- *
- * @param ste
- *
- */
- public void setStereotype(StereotypeRepresentation ste) {
- this.stereotype = ste;
- }
-
- /**
- *
- * @param value
- * the value to remove
- */
- public void removeValue(Value value) {
- values.remove(value);
- }
-
- /**
- *
- * @return <ul>
- * <li>{@code true} if the property has values</li>
- * <li>{@code false} if not</li>
- * </ul>
- */
- public boolean hasValues() {
- return !values.isEmpty();
- }
-
- /**
- * Returns the {@link StereotypeRepresentation} owning this {@link PropertyRepresentation}
- *
- * @return the {@link StereotypeRepresentation} owning this {@link PropertyRepresentation}
- */
- public StereotypeRepresentation getStereotypeRepresentation() {
- return stereotype;
- }
-
- /**
- * Returns the {@link org.eclipse.uml.uml.Property} represented by this {@link PropertyRepresentation}
- *
- * @return the {@link org.eclipse.uml.uml.Property} represented by this {@link PropertyRepresentation}
- */
- public Property getUMLProperty() {
- Assert.isNotNull(UMLProperty, "The property has not been set!"); //$NON-NLS-1$
- return UMLProperty;
- }
-
- /**
- * Returns the string representing this property, with this type and this
- * value
- *
- * @return the string representing this property, with this type and this
- * value
- */
- public String getLabel() {
- String label = this.name;
- String type = ""; //$NON-NLS-1$
- if(getType() != null) {
- type = getType().getLabel();
- }
- label += ": " + type + getPropertyMultiplicity() + " = " + getValueToDisplay(); //$NON-NLS-1$ //$NON-NLS-2$
- return label;
- }
-
- /**
- * Returns the values owned by this {@link PropertyRepresentation},
- * represented by a string
- *
- * @return the values owned by this {@link PropertyRepresentation},
- * represented by a string
- */
- public ArrayList<String> getStringValue() {
- ArrayList<String> stringValues = new ArrayList<String>();
- for(Value val : values) {
- stringValues.add(val.getValue());
- }
- return stringValues;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ *
+ * This class is used to represent a UML Property
+ *
+ */
+public class PropertyRepresentation {
+
+ /**
+ * The property ID is used to represent a unique property. It's composed by
+ * : stereotype qualified name + {@link #separator} + {@link #propertyQualifiedName}
+ */
+ private String propID;
+
+ /** the values owned by this property */
+ private ArrayList<Value> values;
+
+ /** the UML property represented by this class */
+ private Property UMLProperty;
+
+ /** Is it a runtime property? */
+ private boolean isRuntimeProperty = false;
+
+/**
+ * the {@link StereotypeRepresentation owning this
+ *
+ * @link PropertyRepresentation}
+ */
+ private StereotypeRepresentation stereotype;
+
+ /** the property qualified name */
+ private String propertyQualifiedName;
+
+ /** the name of the property */
+ private String name;
+
+ /**
+ * separator used in the {@link #propID}. It's not useful, it's only to
+ * facilitate debug!
+ */
+ static public String separator = "|";; //$NON-NLS-1$
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param stereotypeQualifiedName
+ * the stereotype owning this property
+ * @param propertyQualifiedName
+ * the property represented by this {@link PropertyRepresentation}
+ */
+ public PropertyRepresentation(String stereotypeQualifiedName, String propertyQualifiedName) {
+ this.propertyQualifiedName = propertyQualifiedName;
+ this.propID = stereotypeQualifiedName + separator + propertyQualifiedName;
+ values = new ArrayList<Value>();
+ }
+
+ /**
+ *
+ * Constructor. Note : the values aren't not duplicated. The two
+ * PropertyRepresentation share the same instances of the values
+ *
+ * @param propRep
+ * the PropertyRepresentation used to instantiate a new
+ * PropertyRepresentation
+ */
+ public PropertyRepresentation(PropertyRepresentation propRep) {
+ this.propertyQualifiedName = new String(propRep.getQualifiedName());
+ this.propID = new String(propRep.getPropertyId());
+ this.setUMLProperty(propRep.getUMLProperty());
+ this.setRuntime(propRep.isRuntimeProperty);
+ this.values = propRep.getValues();
+ }
+
+ /**
+ * Returns the property qualified name
+ *
+ * @return the property qualified name
+ */
+ public String getQualifiedName() {
+ return propertyQualifiedName;
+ }
+
+ /**
+ * Adds the value to this property
+ *
+ * @param value
+ * the value to add to this property
+ */
+ public void addValue(Value value) {
+ value.setPropertyRepresentation(this);
+ values.add(value);
+ }
+
+ /**
+ * Returns all the values owned by this property
+ *
+ * @return all the values owned by this property
+ */
+ public ArrayList<Value> getValues() {
+ return values;
+ }
+
+ /**
+ * Returns the type of the property
+ *
+ * @return the type of the property
+ */
+ public Type getType() {
+ Assert.isNotNull(UMLProperty, "The property has not been set!"); //$NON-NLS-1$
+ return UMLProperty.getType();
+ }
+
+ /**
+ * Setter for {@link #propID}
+ *
+ * @return {@link #propID}
+ */
+ public String getPropertyId() {
+ return propID;
+ }
+
+ /**
+ * Returns the upper multiplicity
+ *
+ * @return the upper multiplicity
+ */
+ public int getUpperMultiplicity() {
+ Assert.isNotNull(UMLProperty, "The property has not been set!"); //$NON-NLS-1$
+ return UMLProperty.getUpper();
+ }
+
+ /**
+ * Returns the string corresponding to the property multiplicity
+ *
+ * @return the string corresponding to the property multiplicity
+ */
+ protected String getPropertyMultiplicity() {
+ Assert.isNotNull(UMLProperty, "The property has not been set!"); //$NON-NLS-1$
+ String multiplicity = "[" + UMLProperty.getLower() + ".."; //$NON-NLS-1$ //$NON-NLS-2$
+ int upper = UMLProperty.getUpper();
+ if(upper == -1) {
+ multiplicity += "*"; //$NON-NLS-1$
+ } else {
+ multiplicity += upper;
+ }
+ multiplicity += "]"; //$NON-NLS-1$
+ return multiplicity;
+ }
+
+ /**
+ *
+ * @see java.lang.Object#toString()
+ *
+ * @return
+ */
+ public String toString() {
+ return this.propID;
+ }
+
+ /**
+ * Returns the string corresponding to the value to display for the property
+ *
+ * @return the string corresponding to the value to display for the property
+ *
+ */
+ protected String getValueToDisplay() {
+ String label = null;
+ ArrayList<Value> values = getValues();
+ if(!values.isEmpty()) {
+ label = values.toString();
+ } else if(UMLProperty.isSetDefault()) {
+ label = UMLProperty.getDefault();
+ } else if(UMLProperty.isMultivalued()) {
+ label = "[]"; //$NON-NLS-1$
+ }
+ return label;
+ }
+
+ /**
+ * Setter for the value to {@link #isRuntimeProperty}
+ *
+ * @param value
+ */
+ public void setRuntime(boolean value) {
+ isRuntimeProperty = value;
+ }
+
+ /**
+ * Getter for {@link #isRuntimeProperty}
+ *
+ * @return {@link #isRuntimeProperty}
+ */
+ public boolean isRuntime() {
+ return isRuntimeProperty;
+ }
+
+ /**
+ * Setter for {@link #UMLProperty}
+ *
+ * @param property
+ * the UML {@link Property}
+ */
+ public void setUMLProperty(Property property) {
+ this.UMLProperty = property;
+ this.name = property.getName();
+ }
+
+ /**
+ * Set the stereotype owning this property (often called by {@link StereotypeRepresentation#addProperty(PropertyRepresentation)})
+ *
+ * @param ste
+ *
+ */
+ public void setStereotype(StereotypeRepresentation ste) {
+ this.stereotype = ste;
+ }
+
+ /**
+ *
+ * @param value
+ * the value to remove
+ */
+ public void removeValue(Value value) {
+ values.remove(value);
+ }
+
+ /**
+ *
+ * @return <ul>
+ * <li>{@code true} if the property has values</li>
+ * <li>{@code false} if not</li>
+ * </ul>
+ */
+ public boolean hasValues() {
+ return !values.isEmpty();
+ }
+
+ /**
+ * Returns the {@link StereotypeRepresentation} owning this {@link PropertyRepresentation}
+ *
+ * @return the {@link StereotypeRepresentation} owning this {@link PropertyRepresentation}
+ */
+ public StereotypeRepresentation getStereotypeRepresentation() {
+ return stereotype;
+ }
+
+ /**
+ * Returns the {@link org.eclipse.uml.uml.Property} represented by this {@link PropertyRepresentation}
+ *
+ * @return the {@link org.eclipse.uml.uml.Property} represented by this {@link PropertyRepresentation}
+ */
+ public Property getUMLProperty() {
+ Assert.isNotNull(UMLProperty, "The property has not been set!"); //$NON-NLS-1$
+ return UMLProperty;
+ }
+
+ /**
+ * Returns the string representing this property, with this type and this
+ * value
+ *
+ * @return the string representing this property, with this type and this
+ * value
+ */
+ public String getLabel() {
+ String label = this.name;
+ String type = ""; //$NON-NLS-1$
+ if(getType() != null) {
+ type = getType().getLabel();
+ }
+ label += ": " + type + getPropertyMultiplicity() + " = " + getValueToDisplay(); //$NON-NLS-1$ //$NON-NLS-2$
+ return label;
+ }
+
+ /**
+ * Returns the values owned by this {@link PropertyRepresentation},
+ * represented by a string
+ *
+ * @return the values owned by this {@link PropertyRepresentation},
+ * represented by a string
+ */
+ public ArrayList<String> getStringValue() {
+ ArrayList<String> stringValues = new ArrayList<String>();
+ for(Value val : values) {
+ stringValues.add(val.getValue());
+ }
+ return stringValues;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticAspectActionProvider.java
index 02870f73706..16e4b7f8c90 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticAspectActionProvider.java
@@ -1,47 +1,47 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.w3c.dom.Node;
-
-/**
- * Factory in charge of the semantic aspect actions taken after palette actions
- */
-public class SemanticAspectActionProvider extends AbstractAspectActionProvider {
-
- /** semantic action key */
- public final static String SEMANTIC_ACTION_KEY = "org.eclipse.papyrus.postaction.semanticaction";
-
- /**
- * Constructor.
- *
- */
- public SemanticAspectActionProvider() {
- }
-
- /**
- * @{inheritDoc
- */
- public IAspectAction createAction(Node configurationNode) {
- SemanticPostAction action = new SemanticPostAction();
- action.init(configurationNode, this);
- return action;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean isEnable(IPaletteEntryProxy entryProxy) {
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.w3c.dom.Node;
+
+/**
+ * Factory in charge of the semantic aspect actions taken after palette actions
+ */
+public class SemanticAspectActionProvider extends AbstractAspectActionProvider {
+
+ /** semantic action key */
+ public final static String SEMANTIC_ACTION_KEY = "org.eclipse.papyrus.postaction.semanticaction";
+
+ /**
+ * Constructor.
+ *
+ */
+ public SemanticAspectActionProvider() {
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IAspectAction createAction(Node configurationNode) {
+ SemanticPostAction action = new SemanticPostAction();
+ action.init(configurationNode, this);
+ return action;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean isEnable(IPaletteEntryProxy entryProxy) {
+ return true;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticPostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticPostAction.java
index cee5a341927..06638f1d7e9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticPostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SemanticPostAction.java
@@ -1,738 +1,738 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EEnumLiteral;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.ColumnViewer;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.uml2.uml.Profile;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Aspect action that modifies semantic information on the edit part newly
- * created
- */
-public class SemanticPostAction extends ModelPostAction {
-
- /** list of properties to update, identified by their names */
- protected Map<String, Object> propertiesToUpdate;
-
- /** list of properties defined at runtime */
- protected List<String> runtimeDefinedProperties;
-
- /** entry proxy "parent" of this action when configuring the action */
- protected IPaletteEntryProxy entryProxy;
-
- /** list of applied profiles */
- protected List<Profile> appliedProfiles;
-
- /** viewer for the attributes to initialize */
- protected TableViewer attributeViewer;
-
- /**
- * this attribute caches the value of the metaclass linked to the creation
- * entry (performance optimization)
- */
- protected EClass metaclass = null;
-
- /** path to the checked box image */
- protected final static String ICON_CHECKED = "/icons/complete_tsk.gif";
-
- /** path to the unchecked box image */
- protected final static String ICON_UNCHECKED = "/icons/incomplete_tsk.gif";
-
- /** separator used to serialize lists */
- protected static final String SEPARATOR = ",,";
-
- /**
- * Constructor.
- */
- public SemanticPostAction() {
- propertiesToUpdate = new HashMap<String, Object>();
- runtimeDefinedProperties = new ArrayList<String>();
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- public void init(Node configurationNode, IAspectActionProvider factory) {
- super.init(configurationNode, factory);
- if(configurationNode == null) {
- return;
- }
- NodeList childNodes = configurationNode.getChildNodes();
- for(int i = 0; i < childNodes.getLength(); i++) {
- Node featureNode = childNodes.item(i);
- if(IPapyrusPaletteConstant.FEATURE_NODE_NAME.equals(featureNode.getNodeName())) {
- Node nameNode = featureNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
- Node valueNode = featureNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.VALUE);
- Node separatorNode = featureNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.SEPARATOR);
- if(nameNode != null && valueNode != null && separatorNode != null) {
- propertiesToUpdate.put(nameNode.getNodeValue(), parseValue(valueNode.getNodeValue(), separatorNode.getNodeValue()));
- } else {
- Activator.log.error("Impossible to parse the configuration node for semantic post action", null);
- }
- } else if(IPapyrusPaletteConstant.RUNTIME_FEATURE_NODE_NAME.equals(featureNode.getNodeName())) {
- Node nameNode = featureNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
- if(nameNode != null) {
- runtimeDefinedProperties.add(nameNode.getNodeValue());
- } else {
- Activator.log.error("Impossible to parse the configuration node for semantic post action", null);
- }
- }
- }
- }
-
- /**
- * parse the value from the serialized form
- *
- * @param nodeValue
- * the serialized value of the element
- * @param separator
- * the separator used to serialized, in case the element is a
- * list
- * @return the value of the element
- */
- protected Object parseValue(String nodeValue, String separator) {
- // check this was a list
- if(nodeValue.indexOf(separator) > 0) {
- // this is a list
- List<Object> values = new ArrayList<Object>();
-
- StringTokenizer tokenizer = new StringTokenizer(nodeValue, separator);
- while(tokenizer.hasMoreElements()) {
- Object value = tokenizer.nextElement();
- values.add(value);
- }
- return values;
- } else {
- // this is not a list
- return nodeValue;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getPostCommand(final IAdaptable viewAdpater) {
- final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
-
- return new AbstractTransactionalCommand(editingDomain, "Modify Semantic", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- View view = (View)viewAdpater.getAdapter(View.class);
-
- if (view != null) {
- EObject objectToEdit = view.getElement();
-
- for(String featureName : propertiesToUpdate.keySet()) {
- // retrieve feature to set
- EStructuralFeature feature = objectToEdit.eClass().getEStructuralFeature(featureName);
- if(feature == null) {
- Activator.log.error("Impossible to find the feature " + featureName + " for element " + objectToEdit, null);
- } else {
- objectToEdit.eSet(feature, getValue(feature, propertiesToUpdate.get(featureName)));
- }
- }
-
- // create the command to open the dialog to set properties on runtime
- if(runtimeDefinedProperties.size() > 0) {
- DynamicConfigureRequest request = new DynamicConfigureRequest(objectToEdit, runtimeDefinedProperties);
- new SetDynamicValueCommand(request).doExecuteWithResult(null, null);
- }
-
- }
- return CommandResult.newOKCommandResult();
- }
- };
- }
-
- /**
- * Returns the map of properties to update
- *
- * @return the map of properties to update
- */
- public Map<String, Object> getPropertiesToUpdate() {
- return propertiesToUpdate;
- }
-
- /**
- * @{inheritDoc
- */
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
- this.appliedProfiles = appliedProfiles;
- this.entryProxy = entryProxy;
-
- // retrieve tool metaclass
- if(entryProxy.getEntry() instanceof CombinedTemplateCreationEntry) {
- metaclass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entryProxy.getEntry());
- }
-
- Composite mainComposite = new Composite(parent, SWT.BORDER);
- GridLayout layout = new GridLayout(3, false);
- mainComposite.setLayout(layout);
-
- Label titleLabel = new Label(mainComposite, SWT.NONE);
- titleLabel.setText("Values to set for the semantic element");
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
- titleLabel.setLayoutData(data);
-
- attributeViewer = new TableViewer(mainComposite, SWT.BORDER | SWT.FULL_SELECTION);
- createColumns(attributeViewer);
- attributeViewer.setContentProvider(new AttributeContentProvider());
- attributeViewer.setLabelProvider(new AttributeLabelProvider());
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.horizontalSpan = 3;
- attributeViewer.getControl().setLayoutData(data);
-
- updateAttributesViewer();
- return mainComposite;
- }
-
- /**
- * This will create the columns for the table
- *
- * @param viewer
- * the viewer for which column are created
- */
- protected void createColumns(TableViewer viewer) {
- // name column
- TableViewerColumn nameColumn = new TableViewerColumn(viewer, SWT.NONE);
- nameColumn.getColumn().setText("Feature Name");
- nameColumn.getColumn().setWidth(130);
- nameColumn.getColumn().setResizable(true);
- nameColumn.getColumn().setMoveable(false);
-
- // runtime defined property column
- TableViewerColumn runtimeColumn = new TableViewerColumn(viewer, SWT.NONE);
- runtimeColumn.getColumn().setText("Runtime");
- runtimeColumn.getColumn().setWidth(70);
- runtimeColumn.getColumn().setResizable(true);
- runtimeColumn.getColumn().setMoveable(false);
- runtimeColumn.setEditingSupport(new DynamicFeatureEditingSupport(viewer));
-
- // value column
- TableViewerColumn valueColumn = new TableViewerColumn(viewer, SWT.NONE);
- valueColumn.getColumn().setText("Values");
- valueColumn.getColumn().setWidth(300);
- valueColumn.getColumn().setResizable(true);
- valueColumn.getColumn().setMoveable(false);
- valueColumn.setEditingSupport(new AttributeEditingSupport(viewer));
-
- Table table = viewer.getTable();
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- }
-
- /**
- * updates the stereotype viewer
- */
- protected void updateAttributesViewer() {
- attributeViewer.setInput(metaclass);
- }
-
- /**
- * @{inheritDoc
- */
- public void save(Node parentNode) {
- if(!(parentNode instanceof Element)) {
- Activator.log.error("parent node is not an Element", null);
- return;
- } else {
- for(String featureName : propertiesToUpdate.keySet()) {
- Element childElement = ((Element)parentNode).getOwnerDocument().createElement(IPapyrusPaletteConstant.FEATURE_NODE_NAME);
- childElement.setAttribute(IPapyrusPaletteConstant.NAME, featureName);
- childElement.setAttribute(IPapyrusPaletteConstant.VALUE, serializeValue(propertiesToUpdate.get(featureName), SEPARATOR));
- childElement.setAttribute(IPapyrusPaletteConstant.SEPARATOR, SEPARATOR);
- parentNode.appendChild(childElement);
- }
-
- for(String featureName : runtimeDefinedProperties) {
- Element childElement = ((Element)parentNode).getOwnerDocument().createElement(IPapyrusPaletteConstant.RUNTIME_FEATURE_NODE_NAME);
- childElement.setAttribute(IPapyrusPaletteConstant.NAME, featureName);
- parentNode.appendChild(childElement);
- }
- }
- }
-
- /**
- * Serialize the value of the element
- *
- * @param object
- * the object to serialize
- * @return the string corresponding to the serialize value
- */
- @SuppressWarnings("rawtypes")
- protected String serializeValue(Object object, String separator) {
- if(object instanceof Collection) {
- return PaletteUtil.convertToFlatRepresentation((Collection)object, separator);
- }
- return object.toString();
- }
-
- /**
- * Returns <code>true</code> if the value of this feature is defined at
- * runtime
- *
- * @param feature
- * the feature to check
- * @return <code>true</code> if the value of this feature is defined at
- * runtime, else <code>false</code>
- */
- protected boolean isRuntimeDefined(EStructuralFeature feature) {
- return runtimeDefinedProperties.contains(feature.getName());
- }
-
- /**
- * Content provider for the attribute viewer
- */
- protected class AttributeContentProvider implements IStructuredContentProvider {
-
- /** current edited metaclass */
- protected EClass currentEClass;
-
- /**
- * @{inheritDoc
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof EClass) {
- currentEClass = (EClass)inputElement;
- List<EAttribute> attributes = new ArrayList<EAttribute>();
- // create a new list with only non derived attributes
- for(EAttribute attribute : currentEClass.getEAllAttributes()) {
- if(!attribute.isDerived() && attribute.isChangeable()) {
- attributes.add(attribute);
- }
- }
- return attributes.toArray();
- }
- return new Object[0];
- }
-
- /**
- * @{inheritDoc
- */
- public void dispose() {
-
- }
-
- /**
- * @{inheritDoc
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- }
-
- /**
- * Class giving cell editors for statically defined values
- */
- protected class AttributeEditingSupport extends EditingSupport {
-
- /** proposals for boolean */
- protected final String[] booleanProposals = new String[]{ "", "true", "false" };
-
- /**
- * Constructor.
- *
- * @param viewer
- * viewer in which editors will open
- */
- public AttributeEditingSupport(ColumnViewer viewer) {
- super(viewer);
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected CellEditor getCellEditor(Object element) {
- EStructuralFeature feature = (EStructuralFeature)element;
- EClassifier eType = feature.getEType();
- if(eType instanceof EEnum) {
- return createEnumerationEditor(feature);
- }
- String instanceTypeName = eType.getInstanceClassName();
- if(instanceTypeName.equals(String.class.getCanonicalName())) {
- return new TextCellEditor(((TableViewer)getViewer()).getTable());
- } else if(instanceTypeName.equals(Integer.class.getCanonicalName())) {
- return new TextCellEditor(((TableViewer)getViewer()).getTable());
- } else if(instanceTypeName.equals("boolean")) {
- return createBooleanEditor(feature);
- }
-
- return new TextCellEditor(((TableViewer)getViewer()).getTable());
- }
-
- /**
- * Creates and return a combobox cell editor for a boolean type
- *
- * @param feature
- * the feature to edit
- * @return the newly created combo box cell editor
- */
- protected CellEditor createBooleanEditor(EStructuralFeature feature) {
- return new ComboBoxCellEditor(((TableViewer)getViewer()).getTable(), booleanProposals, SWT.READ_ONLY);
- }
-
- /**
- * Creates and return a combobox cell editor for an enumeration type
- *
- * @param feature
- * the feature to edit
- * @return the newly created combo box cell editor
- */
- protected CellEditor createEnumerationEditor(EStructuralFeature feature) {
- EEnum eType = (EEnum)feature.getEType();
- List<EEnumLiteral> literals = eType.getELiterals();
- String[] proposals = new String[literals.size() + 1];
- proposals[0] = "";
- for(int i = 0; i < literals.size(); i++) {
- // i+1 because there is already the "" string
- proposals[i + 1] = literals.get(i).getLiteral();
- }
- return new ComboBoxCellEditor(((TableViewer)getViewer()).getTable(), proposals, SWT.READ_ONLY);
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected Object getValue(Object element) {
- EStructuralFeature feature = (EStructuralFeature)element;
- EClassifier eType = feature.getEType();
- if(eType instanceof EEnum) {
- return getEnumerationValue(feature);
- } else {
- String instanceTypeName = eType.getInstanceClassName();
- if(instanceTypeName.equals("boolean")) {
- return getBooleanValue(feature);
- }
- return (propertiesToUpdate.get(feature.getName()) != null) ? propertiesToUpdate.get(feature.getName()) : "";
- }
- }
-
- /**
- * Returns the value from the feature
- *
- * @param feature
- * the feature to edit
- * @return the boolean value
- */
- protected Object getEnumerationValue(EStructuralFeature feature) {
- EEnum eType = (EEnum)feature.getEType();
- List<EEnumLiteral> literals = eType.getELiterals();
- List<String> proposals = new ArrayList<String>();
- proposals.add("");
- for(int i = 0; i < literals.size(); i++) {
- // i+1 because there is already the "" string
- proposals.add(i + 1, literals.get(i).getLiteral());
- }
- Object value = propertiesToUpdate.get(feature.getName());
-
- if(value == null) {
- return 0;
- } else {
- return proposals.indexOf(value);
- }
- }
-
- /**
- * Returns the value from the feature
- *
- * @param feature
- * the feature to edit
- * @return the boolean value
- */
- protected Object getBooleanValue(EStructuralFeature feature) {
- List<String> booleans = Arrays.asList(booleanProposals);
- Object value = propertiesToUpdate.get(feature.getName());
- if(value == null || value.equals("")) {
- return 0;
- } else {
- return booleans.indexOf(value);
- }
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected void setValue(Object element, Object value) {
- EStructuralFeature feature = (EStructuralFeature)element;
- String featureName = ((EStructuralFeature)element).getName();
- EClassifier eType = feature.getEType();
- if(eType instanceof EEnum) {
- setEnumerationValue(element, value);
- } else {
- String instanceTypeName = eType.getInstanceClassName();
- if(instanceTypeName.equals("boolean")) {
- setBooleanValue(element, value);
- } else {
- if(value == null || value.equals("")) {
- propertiesToUpdate.remove(featureName);
- } else {
- propertiesToUpdate.put(featureName, value);
- }
- }
- }
-
- getViewer().update(element, null);
- }
-
- /**
- * Sets the new boolean value on the given element.
- *
- * @param element
- * the model element
- * @param value
- * the new value
- */
- protected void setEnumerationValue(Object element, Object value) {
- EStructuralFeature feature = (EStructuralFeature)element;
- EEnum eType = (EEnum)feature.getEType();
- List<EEnumLiteral> literals = eType.getELiterals();
- List<String> proposals = new ArrayList<String>();
- proposals.add("");
- for(int i = 0; i < literals.size(); i++) {
- // i+1 because there is already the "" string
- proposals.add(i + 1, literals.get(i).getLiteral());
- }
- String featureName = feature.getName();
- if(value == null || value.equals(0)) {
- propertiesToUpdate.remove(featureName);
- } else {
- // retrieve the index of the current value in the list
- int index = (Integer)value;
- propertiesToUpdate.put(featureName, proposals.get(index));
- }
-
- }
-
- /**
- * Sets the new boolean value on the given element.
- *
- * @param element
- * the model element
- * @param value
- * the new value
- */
- protected void setBooleanValue(Object element, Object value) {
- EStructuralFeature feature = (EStructuralFeature)element;
- String featureName = feature.getName();
- if(value == null || value.equals(0)) {
- propertiesToUpdate.remove(featureName);
- } else if(value.equals(1)) {
- propertiesToUpdate.put(featureName, booleanProposals[1]);
- } else if(value.equals(2)) {
- propertiesToUpdate.put(featureName, booleanProposals[2]);
- } else {
- Activator.log.error("impossible to set boolean value " + value, null);
- }
- }
-
- }
-
- /**
- * Class giving cell editors for statically defined values
- */
- protected class DynamicFeatureEditingSupport extends EditingSupport {
-
- /** editor */
- private CellEditor editor;
-
- /**
- * Constructor.
- *
- * @param viewer
- * viewer in which editors will open
- */
- public DynamicFeatureEditingSupport(ColumnViewer viewer) {
- super(viewer);
- editor = new CheckboxCellEditor(null, SWT.NONE);
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected CellEditor getCellEditor(Object element) {
- return editor;
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected Object getValue(Object element) {
- EStructuralFeature feature = (EStructuralFeature)element;
- return runtimeDefinedProperties.contains(feature.getName());
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected void setValue(Object element, Object value) {
- String featureName = ((EStructuralFeature)element).getName();
- // it should be in the list
- if(!runtimeDefinedProperties.contains(featureName)) {
- runtimeDefinedProperties.add(featureName);
- } else {
- runtimeDefinedProperties.remove(featureName);
- }
- getViewer().update(element, null);
- }
-
- }
-
- /**
- * Label provider for the attribute viewer
- */
- protected class AttributeLabelProvider implements ITableLabelProvider {
-
- /**
- * @{inheritDoc
- */
- public Image getColumnImage(Object element, int columnIndex) {
- if(columnIndex == 1) {
- EStructuralFeature feature = (EStructuralFeature)element;
- // check if it is defined at runtime, using a popup dialog
- if(isRuntimeDefined(feature)) {
- return Activator.getPluginIconImage(Activator.ID, ICON_CHECKED);
- } else {
- return Activator.getPluginIconImage(Activator.ID, ICON_UNCHECKED);
- }
-
- }
- return null;
- }
-
- /**
- * @{inheritDoc
- */
- public String getColumnText(Object element, int columnIndex) {
- String text = "";
- EStructuralFeature feature = (EStructuralFeature)element;
- switch(columnIndex) {
- case 0:
- text = feature.getName();
- break;
- case 1:
- break;
- case 2:
- // retrieve current given values
- Object value = propertiesToUpdate.get(feature.getName());
- text = (value != null) ? value.toString() : "";
-
- default:
- break;
- }
-
- return text;
- }
-
- /**
- * @{inheritDoc
- */
- public void addListener(ILabelProviderListener listener) {
-
- }
-
- /**
- * @{inheritDoc
- */
- public void dispose() {
-
- }
-
- /**
- * @{inheritDoc
- */
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- /**
- * @{inheritDoc
- */
- public void removeListener(ILabelProviderListener listener) {
-
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EEnum;
+import org.eclipse.emf.ecore.EEnumLiteral;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.palette.CombinedTemplateCreationEntry;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.CheckboxCellEditor;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.uml2.uml.Profile;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Aspect action that modifies semantic information on the edit part newly
+ * created
+ */
+public class SemanticPostAction extends ModelPostAction {
+
+ /** list of properties to update, identified by their names */
+ protected Map<String, Object> propertiesToUpdate;
+
+ /** list of properties defined at runtime */
+ protected List<String> runtimeDefinedProperties;
+
+ /** entry proxy "parent" of this action when configuring the action */
+ protected IPaletteEntryProxy entryProxy;
+
+ /** list of applied profiles */
+ protected List<Profile> appliedProfiles;
+
+ /** viewer for the attributes to initialize */
+ protected TableViewer attributeViewer;
+
+ /**
+ * this attribute caches the value of the metaclass linked to the creation
+ * entry (performance optimization)
+ */
+ protected EClass metaclass = null;
+
+ /** path to the checked box image */
+ protected final static String ICON_CHECKED = "/icons/complete_tsk.gif";
+
+ /** path to the unchecked box image */
+ protected final static String ICON_UNCHECKED = "/icons/incomplete_tsk.gif";
+
+ /** separator used to serialize lists */
+ protected static final String SEPARATOR = ",,";
+
+ /**
+ * Constructor.
+ */
+ public SemanticPostAction() {
+ propertiesToUpdate = new HashMap<String, Object>();
+ runtimeDefinedProperties = new ArrayList<String>();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ super.init(configurationNode, factory);
+ if(configurationNode == null) {
+ return;
+ }
+ NodeList childNodes = configurationNode.getChildNodes();
+ for(int i = 0; i < childNodes.getLength(); i++) {
+ Node featureNode = childNodes.item(i);
+ if(IPapyrusPaletteConstant.FEATURE_NODE_NAME.equals(featureNode.getNodeName())) {
+ Node nameNode = featureNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
+ Node valueNode = featureNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.VALUE);
+ Node separatorNode = featureNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.SEPARATOR);
+ if(nameNode != null && valueNode != null && separatorNode != null) {
+ propertiesToUpdate.put(nameNode.getNodeValue(), parseValue(valueNode.getNodeValue(), separatorNode.getNodeValue()));
+ } else {
+ Activator.log.error("Impossible to parse the configuration node for semantic post action", null);
+ }
+ } else if(IPapyrusPaletteConstant.RUNTIME_FEATURE_NODE_NAME.equals(featureNode.getNodeName())) {
+ Node nameNode = featureNode.getAttributes().getNamedItem(IPapyrusPaletteConstant.NAME);
+ if(nameNode != null) {
+ runtimeDefinedProperties.add(nameNode.getNodeValue());
+ } else {
+ Activator.log.error("Impossible to parse the configuration node for semantic post action", null);
+ }
+ }
+ }
+ }
+
+ /**
+ * parse the value from the serialized form
+ *
+ * @param nodeValue
+ * the serialized value of the element
+ * @param separator
+ * the separator used to serialized, in case the element is a
+ * list
+ * @return the value of the element
+ */
+ protected Object parseValue(String nodeValue, String separator) {
+ // check this was a list
+ if(nodeValue.indexOf(separator) > 0) {
+ // this is a list
+ List<Object> values = new ArrayList<Object>();
+
+ StringTokenizer tokenizer = new StringTokenizer(nodeValue, separator);
+ while(tokenizer.hasMoreElements()) {
+ Object value = tokenizer.nextElement();
+ values.add(value);
+ }
+ return values;
+ } else {
+ // this is not a list
+ return nodeValue;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand getPostCommand(final IAdaptable viewAdpater) {
+ final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
+
+ return new AbstractTransactionalCommand(editingDomain, "Modify Semantic", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ View view = (View)viewAdpater.getAdapter(View.class);
+
+ if (view != null) {
+ EObject objectToEdit = view.getElement();
+
+ for(String featureName : propertiesToUpdate.keySet()) {
+ // retrieve feature to set
+ EStructuralFeature feature = objectToEdit.eClass().getEStructuralFeature(featureName);
+ if(feature == null) {
+ Activator.log.error("Impossible to find the feature " + featureName + " for element " + objectToEdit, null);
+ } else {
+ objectToEdit.eSet(feature, getValue(feature, propertiesToUpdate.get(featureName)));
+ }
+ }
+
+ // create the command to open the dialog to set properties on runtime
+ if(runtimeDefinedProperties.size() > 0) {
+ DynamicConfigureRequest request = new DynamicConfigureRequest(objectToEdit, runtimeDefinedProperties);
+ new SetDynamicValueCommand(request).doExecuteWithResult(null, null);
+ }
+
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+ }
+
+ /**
+ * Returns the map of properties to update
+ *
+ * @return the map of properties to update
+ */
+ public Map<String, Object> getPropertiesToUpdate() {
+ return propertiesToUpdate;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
+ this.appliedProfiles = appliedProfiles;
+ this.entryProxy = entryProxy;
+
+ // retrieve tool metaclass
+ if(entryProxy.getEntry() instanceof CombinedTemplateCreationEntry) {
+ metaclass = PaletteUtil.getToolMetaclass((CombinedTemplateCreationEntry)entryProxy.getEntry());
+ }
+
+ Composite mainComposite = new Composite(parent, SWT.BORDER);
+ GridLayout layout = new GridLayout(3, false);
+ mainComposite.setLayout(layout);
+
+ Label titleLabel = new Label(mainComposite, SWT.NONE);
+ titleLabel.setText("Values to set for the semantic element");
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
+ titleLabel.setLayoutData(data);
+
+ attributeViewer = new TableViewer(mainComposite, SWT.BORDER | SWT.FULL_SELECTION);
+ createColumns(attributeViewer);
+ attributeViewer.setContentProvider(new AttributeContentProvider());
+ attributeViewer.setLabelProvider(new AttributeLabelProvider());
+ data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ data.horizontalSpan = 3;
+ attributeViewer.getControl().setLayoutData(data);
+
+ updateAttributesViewer();
+ return mainComposite;
+ }
+
+ /**
+ * This will create the columns for the table
+ *
+ * @param viewer
+ * the viewer for which column are created
+ */
+ protected void createColumns(TableViewer viewer) {
+ // name column
+ TableViewerColumn nameColumn = new TableViewerColumn(viewer, SWT.NONE);
+ nameColumn.getColumn().setText("Feature Name");
+ nameColumn.getColumn().setWidth(130);
+ nameColumn.getColumn().setResizable(true);
+ nameColumn.getColumn().setMoveable(false);
+
+ // runtime defined property column
+ TableViewerColumn runtimeColumn = new TableViewerColumn(viewer, SWT.NONE);
+ runtimeColumn.getColumn().setText("Runtime");
+ runtimeColumn.getColumn().setWidth(70);
+ runtimeColumn.getColumn().setResizable(true);
+ runtimeColumn.getColumn().setMoveable(false);
+ runtimeColumn.setEditingSupport(new DynamicFeatureEditingSupport(viewer));
+
+ // value column
+ TableViewerColumn valueColumn = new TableViewerColumn(viewer, SWT.NONE);
+ valueColumn.getColumn().setText("Values");
+ valueColumn.getColumn().setWidth(300);
+ valueColumn.getColumn().setResizable(true);
+ valueColumn.getColumn().setMoveable(false);
+ valueColumn.setEditingSupport(new AttributeEditingSupport(viewer));
+
+ Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ }
+
+ /**
+ * updates the stereotype viewer
+ */
+ protected void updateAttributesViewer() {
+ attributeViewer.setInput(metaclass);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void save(Node parentNode) {
+ if(!(parentNode instanceof Element)) {
+ Activator.log.error("parent node is not an Element", null);
+ return;
+ } else {
+ for(String featureName : propertiesToUpdate.keySet()) {
+ Element childElement = ((Element)parentNode).getOwnerDocument().createElement(IPapyrusPaletteConstant.FEATURE_NODE_NAME);
+ childElement.setAttribute(IPapyrusPaletteConstant.NAME, featureName);
+ childElement.setAttribute(IPapyrusPaletteConstant.VALUE, serializeValue(propertiesToUpdate.get(featureName), SEPARATOR));
+ childElement.setAttribute(IPapyrusPaletteConstant.SEPARATOR, SEPARATOR);
+ parentNode.appendChild(childElement);
+ }
+
+ for(String featureName : runtimeDefinedProperties) {
+ Element childElement = ((Element)parentNode).getOwnerDocument().createElement(IPapyrusPaletteConstant.RUNTIME_FEATURE_NODE_NAME);
+ childElement.setAttribute(IPapyrusPaletteConstant.NAME, featureName);
+ parentNode.appendChild(childElement);
+ }
+ }
+ }
+
+ /**
+ * Serialize the value of the element
+ *
+ * @param object
+ * the object to serialize
+ * @return the string corresponding to the serialize value
+ */
+ @SuppressWarnings("rawtypes")
+ protected String serializeValue(Object object, String separator) {
+ if(object instanceof Collection) {
+ return PaletteUtil.convertToFlatRepresentation((Collection)object, separator);
+ }
+ return object.toString();
+ }
+
+ /**
+ * Returns <code>true</code> if the value of this feature is defined at
+ * runtime
+ *
+ * @param feature
+ * the feature to check
+ * @return <code>true</code> if the value of this feature is defined at
+ * runtime, else <code>false</code>
+ */
+ protected boolean isRuntimeDefined(EStructuralFeature feature) {
+ return runtimeDefinedProperties.contains(feature.getName());
+ }
+
+ /**
+ * Content provider for the attribute viewer
+ */
+ protected class AttributeContentProvider implements IStructuredContentProvider {
+
+ /** current edited metaclass */
+ protected EClass currentEClass;
+
+ /**
+ * @{inheritDoc
+ */
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof EClass) {
+ currentEClass = (EClass)inputElement;
+ List<EAttribute> attributes = new ArrayList<EAttribute>();
+ // create a new list with only non derived attributes
+ for(EAttribute attribute : currentEClass.getEAllAttributes()) {
+ if(!attribute.isDerived() && attribute.isChangeable()) {
+ attributes.add(attribute);
+ }
+ }
+ return attributes.toArray();
+ }
+ return new Object[0];
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void dispose() {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ }
+
+ /**
+ * Class giving cell editors for statically defined values
+ */
+ protected class AttributeEditingSupport extends EditingSupport {
+
+ /** proposals for boolean */
+ protected final String[] booleanProposals = new String[]{ "", "true", "false" };
+
+ /**
+ * Constructor.
+ *
+ * @param viewer
+ * viewer in which editors will open
+ */
+ public AttributeEditingSupport(ColumnViewer viewer) {
+ super(viewer);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected boolean canEdit(Object element) {
+ return true;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ EStructuralFeature feature = (EStructuralFeature)element;
+ EClassifier eType = feature.getEType();
+ if(eType instanceof EEnum) {
+ return createEnumerationEditor(feature);
+ }
+ String instanceTypeName = eType.getInstanceClassName();
+ if(instanceTypeName.equals(String.class.getCanonicalName())) {
+ return new TextCellEditor(((TableViewer)getViewer()).getTable());
+ } else if(instanceTypeName.equals(Integer.class.getCanonicalName())) {
+ return new TextCellEditor(((TableViewer)getViewer()).getTable());
+ } else if(instanceTypeName.equals("boolean")) {
+ return createBooleanEditor(feature);
+ }
+
+ return new TextCellEditor(((TableViewer)getViewer()).getTable());
+ }
+
+ /**
+ * Creates and return a combobox cell editor for a boolean type
+ *
+ * @param feature
+ * the feature to edit
+ * @return the newly created combo box cell editor
+ */
+ protected CellEditor createBooleanEditor(EStructuralFeature feature) {
+ return new ComboBoxCellEditor(((TableViewer)getViewer()).getTable(), booleanProposals, SWT.READ_ONLY);
+ }
+
+ /**
+ * Creates and return a combobox cell editor for an enumeration type
+ *
+ * @param feature
+ * the feature to edit
+ * @return the newly created combo box cell editor
+ */
+ protected CellEditor createEnumerationEditor(EStructuralFeature feature) {
+ EEnum eType = (EEnum)feature.getEType();
+ List<EEnumLiteral> literals = eType.getELiterals();
+ String[] proposals = new String[literals.size() + 1];
+ proposals[0] = "";
+ for(int i = 0; i < literals.size(); i++) {
+ // i+1 because there is already the "" string
+ proposals[i + 1] = literals.get(i).getLiteral();
+ }
+ return new ComboBoxCellEditor(((TableViewer)getViewer()).getTable(), proposals, SWT.READ_ONLY);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected Object getValue(Object element) {
+ EStructuralFeature feature = (EStructuralFeature)element;
+ EClassifier eType = feature.getEType();
+ if(eType instanceof EEnum) {
+ return getEnumerationValue(feature);
+ } else {
+ String instanceTypeName = eType.getInstanceClassName();
+ if(instanceTypeName.equals("boolean")) {
+ return getBooleanValue(feature);
+ }
+ return (propertiesToUpdate.get(feature.getName()) != null) ? propertiesToUpdate.get(feature.getName()) : "";
+ }
+ }
+
+ /**
+ * Returns the value from the feature
+ *
+ * @param feature
+ * the feature to edit
+ * @return the boolean value
+ */
+ protected Object getEnumerationValue(EStructuralFeature feature) {
+ EEnum eType = (EEnum)feature.getEType();
+ List<EEnumLiteral> literals = eType.getELiterals();
+ List<String> proposals = new ArrayList<String>();
+ proposals.add("");
+ for(int i = 0; i < literals.size(); i++) {
+ // i+1 because there is already the "" string
+ proposals.add(i + 1, literals.get(i).getLiteral());
+ }
+ Object value = propertiesToUpdate.get(feature.getName());
+
+ if(value == null) {
+ return 0;
+ } else {
+ return proposals.indexOf(value);
+ }
+ }
+
+ /**
+ * Returns the value from the feature
+ *
+ * @param feature
+ * the feature to edit
+ * @return the boolean value
+ */
+ protected Object getBooleanValue(EStructuralFeature feature) {
+ List<String> booleans = Arrays.asList(booleanProposals);
+ Object value = propertiesToUpdate.get(feature.getName());
+ if(value == null || value.equals("")) {
+ return 0;
+ } else {
+ return booleans.indexOf(value);
+ }
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected void setValue(Object element, Object value) {
+ EStructuralFeature feature = (EStructuralFeature)element;
+ String featureName = ((EStructuralFeature)element).getName();
+ EClassifier eType = feature.getEType();
+ if(eType instanceof EEnum) {
+ setEnumerationValue(element, value);
+ } else {
+ String instanceTypeName = eType.getInstanceClassName();
+ if(instanceTypeName.equals("boolean")) {
+ setBooleanValue(element, value);
+ } else {
+ if(value == null || value.equals("")) {
+ propertiesToUpdate.remove(featureName);
+ } else {
+ propertiesToUpdate.put(featureName, value);
+ }
+ }
+ }
+
+ getViewer().update(element, null);
+ }
+
+ /**
+ * Sets the new boolean value on the given element.
+ *
+ * @param element
+ * the model element
+ * @param value
+ * the new value
+ */
+ protected void setEnumerationValue(Object element, Object value) {
+ EStructuralFeature feature = (EStructuralFeature)element;
+ EEnum eType = (EEnum)feature.getEType();
+ List<EEnumLiteral> literals = eType.getELiterals();
+ List<String> proposals = new ArrayList<String>();
+ proposals.add("");
+ for(int i = 0; i < literals.size(); i++) {
+ // i+1 because there is already the "" string
+ proposals.add(i + 1, literals.get(i).getLiteral());
+ }
+ String featureName = feature.getName();
+ if(value == null || value.equals(0)) {
+ propertiesToUpdate.remove(featureName);
+ } else {
+ // retrieve the index of the current value in the list
+ int index = (Integer)value;
+ propertiesToUpdate.put(featureName, proposals.get(index));
+ }
+
+ }
+
+ /**
+ * Sets the new boolean value on the given element.
+ *
+ * @param element
+ * the model element
+ * @param value
+ * the new value
+ */
+ protected void setBooleanValue(Object element, Object value) {
+ EStructuralFeature feature = (EStructuralFeature)element;
+ String featureName = feature.getName();
+ if(value == null || value.equals(0)) {
+ propertiesToUpdate.remove(featureName);
+ } else if(value.equals(1)) {
+ propertiesToUpdate.put(featureName, booleanProposals[1]);
+ } else if(value.equals(2)) {
+ propertiesToUpdate.put(featureName, booleanProposals[2]);
+ } else {
+ Activator.log.error("impossible to set boolean value " + value, null);
+ }
+ }
+
+ }
+
+ /**
+ * Class giving cell editors for statically defined values
+ */
+ protected class DynamicFeatureEditingSupport extends EditingSupport {
+
+ /** editor */
+ private CellEditor editor;
+
+ /**
+ * Constructor.
+ *
+ * @param viewer
+ * viewer in which editors will open
+ */
+ public DynamicFeatureEditingSupport(ColumnViewer viewer) {
+ super(viewer);
+ editor = new CheckboxCellEditor(null, SWT.NONE);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected boolean canEdit(Object element) {
+ return true;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ return editor;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected Object getValue(Object element) {
+ EStructuralFeature feature = (EStructuralFeature)element;
+ return runtimeDefinedProperties.contains(feature.getName());
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected void setValue(Object element, Object value) {
+ String featureName = ((EStructuralFeature)element).getName();
+ // it should be in the list
+ if(!runtimeDefinedProperties.contains(featureName)) {
+ runtimeDefinedProperties.add(featureName);
+ } else {
+ runtimeDefinedProperties.remove(featureName);
+ }
+ getViewer().update(element, null);
+ }
+
+ }
+
+ /**
+ * Label provider for the attribute viewer
+ */
+ protected class AttributeLabelProvider implements ITableLabelProvider {
+
+ /**
+ * @{inheritDoc
+ */
+ public Image getColumnImage(Object element, int columnIndex) {
+ if(columnIndex == 1) {
+ EStructuralFeature feature = (EStructuralFeature)element;
+ // check if it is defined at runtime, using a popup dialog
+ if(isRuntimeDefined(feature)) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_CHECKED);
+ } else {
+ return Activator.getPluginIconImage(Activator.ID, ICON_UNCHECKED);
+ }
+
+ }
+ return null;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getColumnText(Object element, int columnIndex) {
+ String text = "";
+ EStructuralFeature feature = (EStructuralFeature)element;
+ switch(columnIndex) {
+ case 0:
+ text = feature.getName();
+ break;
+ case 1:
+ break;
+ case 2:
+ // retrieve current given values
+ Object value = propertiesToUpdate.get(feature.getName());
+ text = (value != null) ? value.toString() : "";
+
+ default:
+ break;
+ }
+
+ return text;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void addListener(ILabelProviderListener listener) {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void dispose() {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void removeListener(ILabelProviderListener listener) {
+
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SetDynamicValueCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SetDynamicValueCommand.java
index 4d5f633fadc..46f702d3448 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SetDynamicValueCommand.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/SetDynamicValueCommand.java
@@ -1,82 +1,82 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.operations.IUndoableOperation;
-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.ui.util.DisplayUtils;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-
-/**
- * Command that pops up a dialog to ask which values you want.
- */
-public class SetDynamicValueCommand extends EditElementCommand implements IUndoableOperation {
-
- /** request that configures this command */
- protected AbstractEditCommandRequest request;
-
- /** list of properties to edit */
- protected List<String> propertiesToEdit;
-
- /** title for the dialog */
- private String title = Messages.SetDynamicValueCommand_DialogTile;
-
- /** message for the dialog */
- private String message = Messages.SetDynamicValueCommand_DialogMessage;
-
- /**
- * Constructor.
- *
- * @param label
- * @param elementToEdit
- * @param request
- */
- protected SetDynamicValueCommand(DynamicConfigureRequest request) {
- super(request.getLabel(), request.getElementToEdit(), request);
- this.propertiesToEdit = request.getPropertiesToDefine();
- this.request = request;
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // we edit meta-element properties
- DefinedPropertiesAtRuntimeDialog dialog = new DefinedPropertiesAtRuntimeDialog(DisplayUtils.getDefaultShell(), title, message, propertiesToEdit, getElementToEdit());
- dialog.open();
-
- return CommandResult.newOKCommandResult();
- }
-
- /**
- * Checks that the feature is a modifiable feature of the element whose
- * value will be set by this command. Also checks that the new value is of
- * the correct type for the feature.
- */
- public boolean canExecute() {
- EObject elementToEdit = getElementToEdit();
- if(elementToEdit == null || !super.canExecute()) {
- return false;
- }
- return true;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.IUndoableOperation;
+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.ui.util.DisplayUtils;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.AbstractEditCommandRequest;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+
+/**
+ * Command that pops up a dialog to ask which values you want.
+ */
+public class SetDynamicValueCommand extends EditElementCommand implements IUndoableOperation {
+
+ /** request that configures this command */
+ protected AbstractEditCommandRequest request;
+
+ /** list of properties to edit */
+ protected List<String> propertiesToEdit;
+
+ /** title for the dialog */
+ private String title = Messages.SetDynamicValueCommand_DialogTile;
+
+ /** message for the dialog */
+ private String message = Messages.SetDynamicValueCommand_DialogMessage;
+
+ /**
+ * Constructor.
+ *
+ * @param label
+ * @param elementToEdit
+ * @param request
+ */
+ protected SetDynamicValueCommand(DynamicConfigureRequest request) {
+ super(request.getLabel(), request.getElementToEdit(), request);
+ this.propertiesToEdit = request.getPropertiesToDefine();
+ this.request = request;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // we edit meta-element properties
+ DefinedPropertiesAtRuntimeDialog dialog = new DefinedPropertiesAtRuntimeDialog(DisplayUtils.getDefaultShell(), title, message, propertiesToEdit, getElementToEdit());
+ dialog.open();
+
+ return CommandResult.newOKCommandResult();
+ }
+
+ /**
+ * Checks that the feature is a modifiable feature of the element whose
+ * value will be set by this command. Also checks that the new value is of
+ * the correct type for the feature.
+ */
+ public boolean canExecute() {
+ EObject elementToEdit = getElementToEdit();
+ if(elementToEdit == null || !super.canExecute()) {
+ return false;
+ }
+ return true;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeAspectActionProvider.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeAspectActionProvider.java
index 812f6b9729e..d7771dc895f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeAspectActionProvider.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeAspectActionProvider.java
@@ -1,91 +1,91 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Factory in charge of the aspect actions taken before/after palette actions
- */
-public class StereotypeAspectActionProvider extends AbstractAspectActionProvider {
-
- /** stereotype action key */
- public final static String STEREOTYPE_ACTION_KEY = "org.eclipse.papyrus.postaction.applystereotype";
-
- /** Factory ID */
- public final static String FACTORY_ID = "org.eclipse.papyrus.applystereotypeactionprovider";
-
- /**
- * Constructor.
- */
- public StereotypeAspectActionProvider() {
- }
-
- /**
- * @{inheritDoc
- */
- public IAspectAction createAction(Node configurationNode) {
- StereotypePostAction action = new StereotypePostAction();
- action.init(configurationNode, this);
- return action;
- }
-
- /**
- * Creates a configuration node for this provider, given a list of
- * stereotypes to apply.
- * <P>
- * This method is used in the customize palette dialog, when pre-creating all available tools with stereotypes applied
- * </P>
- *
- * @param stereotypeList
- * the list of stereotypes to apply
- * @return the configuration node from the list
- */
- public static NodeList createConfigurationNode(String stereotypeList) {
- DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
- documentBuilderFactory.setNamespaceAware(true);
- DocumentBuilder documentBuilder;
- try {
- documentBuilder = documentBuilderFactory.newDocumentBuilder();
- Document document = documentBuilder.newDocument();
- Element paletteDefElement = document.createElement(IPapyrusPaletteConstant.ASPECT_TOOL);
-
- // create post action for stereotype application
- Element postActionNode = document.createElement(IPapyrusPaletteConstant.POST_ACTION);
- postActionNode.setAttribute(IPapyrusPaletteConstant.ID, FACTORY_ID);
- postActionNode.setAttribute(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY, stereotypeList);
- paletteDefElement.appendChild(postActionNode);
- return paletteDefElement.getChildNodes();
-
- } catch (ParserConfigurationException e) {
- Activator.getDefault().logError("impossible to create the palette tree viewer content", e);
- }
- return null;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean isEnable(IPaletteEntryProxy entryProxy) {
- return true;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.service.IPapyrusPaletteConstant;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Factory in charge of the aspect actions taken before/after palette actions
+ */
+public class StereotypeAspectActionProvider extends AbstractAspectActionProvider {
+
+ /** stereotype action key */
+ public final static String STEREOTYPE_ACTION_KEY = "org.eclipse.papyrus.postaction.applystereotype";
+
+ /** Factory ID */
+ public final static String FACTORY_ID = "org.eclipse.papyrus.applystereotypeactionprovider";
+
+ /**
+ * Constructor.
+ */
+ public StereotypeAspectActionProvider() {
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public IAspectAction createAction(Node configurationNode) {
+ StereotypePostAction action = new StereotypePostAction();
+ action.init(configurationNode, this);
+ return action;
+ }
+
+ /**
+ * Creates a configuration node for this provider, given a list of
+ * stereotypes to apply.
+ * <P>
+ * This method is used in the customize palette dialog, when pre-creating all available tools with stereotypes applied
+ * </P>
+ *
+ * @param stereotypeList
+ * the list of stereotypes to apply
+ * @return the configuration node from the list
+ */
+ public static NodeList createConfigurationNode(String stereotypeList) {
+ DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+ documentBuilderFactory.setNamespaceAware(true);
+ DocumentBuilder documentBuilder;
+ try {
+ documentBuilder = documentBuilderFactory.newDocumentBuilder();
+ Document document = documentBuilder.newDocument();
+ Element paletteDefElement = document.createElement(IPapyrusPaletteConstant.ASPECT_TOOL);
+
+ // create post action for stereotype application
+ Element postActionNode = document.createElement(IPapyrusPaletteConstant.POST_ACTION);
+ postActionNode.setAttribute(IPapyrusPaletteConstant.ID, FACTORY_ID);
+ postActionNode.setAttribute(IPapyrusPaletteConstant.STEREOTYPES_TO_APPLY, stereotypeList);
+ paletteDefElement.appendChild(postActionNode);
+ return paletteDefElement.getChildNodes();
+
+ } catch (ParserConfigurationException e) {
+ Activator.getDefault().logError("impossible to create the palette tree viewer content", e);
+ }
+ return null;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean isEnable(IPaletteEntryProxy entryProxy) {
+ return true;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypePostAction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypePostAction.java
index afe54690055..7ea97fcedc4 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypePostAction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypePostAction.java
@@ -1,2172 +1,2172 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.palette.PaletteEntry;
-import org.eclipse.gef.palette.ToolEntry;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
-import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
-import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CellLabelProvider;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.ColumnViewer;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.TreeViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-import org.eclipse.papyrus.uml.diagram.common.commands.ApplyStereotypeCommand;
-import org.eclipse.papyrus.uml.diagram.common.commands.DefferedAppliedStereotypeToDisplayCommand;
-import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
-import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
-import org.eclipse.papyrus.uml.diagram.common.ui.dialogs.PropertyEditors;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
-import org.eclipse.uml2.uml.Class;
-import org.eclipse.uml2.uml.DataType;
-import org.eclipse.uml2.uml.PrimitiveType;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.Type;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * Aspect action that applies stereotypes on the edit part newly created
- *
- * /!\ WARNING use the setters and getters for manipulating the {@link #propertiesToUpdate} and {@link #valuesToProperties}
- *
- *
- */
-public class StereotypePostAction extends ModelPostAction {
-
- /*
- * the icons paths
- */
- /** up icon path */
- protected static final String ICONS_UP = "/icons/arrow_up.gif"; //$NON-NLS-1$
-
- /** down icon path */
- protected static final String ICONS_DOWN = "/icons/arrow_down.gif"; //$NON-NLS-1$
-
- /** add icon path */
- protected static final String ICONS_ADD = "/icons/obj16/Add_16x16.gif"; //$NON-NLS-1$
-
- /** remove icon path */
- protected static final String ICONS_REMOVE = "/icons/delete.gif"; //$NON-NLS-1$
-
- /** stereotype icon path */
- protected static final String ICON_STEREOTYPE = "/icons/stereotype.gif"; //$NON-NLS-1$
-
- /** profile icon path */
- protected static final String ICON_PROFILE = "/icons/profile.gif"; //$NON-NLS-1$
-
- /** property icon path */
- protected static final String ICON_PROPERTY = "/icons/property.gif"; //$NON-NLS-1$
-
- /** metaclass icon path */
- protected static final String ICON_METACLASS = "/icons/Metaclass.gif"; //$NON-NLS-1$
-
- /** boolean icon path */
- protected static final String ICON_LITERALBOOLEAN = "/icons/LiteralBoolean.gif"; //$NON-NLS-1$
-
- /** integer icon path */
- protected static final String ICON_LITERALINTEGER = "/icons/LiteralInteger.gif"; //$NON-NLS-1$
-
- /** integer icon path */
- protected static final String ICON_LITERALREAL = "/icons/LiteralReal.gif"; //$NON-NLS-1$
-
- /** string icon path */
- protected static final String ICON_LITERALSTRING = "/icons/LiteralString.gif"; //$NON-NLS-1$
-
- /** unlimited natural icon path */
- protected static final String ICON_LITERALUNLIMITEDNATURAL = "/icons/LiteralUnlimitedNatural.gif"; //$NON-NLS-1$
-
- /** unknown icon path */
- protected static final String ICON_UNKNOWN = "/icons/Clause.gif"; //$NON-NLS-1$
-
- /** enumeration icon path */
- protected static final String ICON_ENUMERATION = "/icons/Enumeration.gif"; //$NON-NLS-1$
-
- /** datatype icon path */
- protected static final String ICON_DATATYPE = "/icons/DataType.gif"; //$NON-NLS-1$
-
- /** the configuration for the palette element */
- protected Configuration config;
-
- /**
- * Separator for displaying the different values owned by a multi-valued
- * property
- */
- protected static final String SEPARATOR = ", "; //$NON-NLS-1$
-
- /** viewer to display stereotypes to apply */
- protected TreeViewer stereotypesViewer;
-
- /** entry proxy "parent" of this action when configuring the action */
- protected IPaletteEntryProxy entryProxy;
-
- /** editor label provider */
- protected EditorLabelProvider editorLabelProvider = new EditorLabelProvider();
-
- /** editor content provider */
- protected StereotypeContentProvider stereotypeContentProvider = new StereotypeContentProvider();
-
- /*
- * the buttons
- */
-
- /** remove button */
- protected Button removeButton;
-
- /** add button */
- protected Button addButton;
-
- /** up button */
- protected Button upButton;
-
- /** down button */
- protected Button downButton;
-
- /** string used with the upButton */
- public static final String MOVE_DOWN = "move down"; //$NON-NLS-1$
-
- /** string used with the downButton */
- public static final String MOVE_UP = "move up"; //$NON-NLS-1$
-
- /** contains the expanded nodes */
- private Object[] expandedElements = null;
-
- /** constant to identify the type of a Boolean property */
- final static public String UMLPrimitiveTypes_BOOLEAN = "PrimitiveTypes::Boolean"; //$NON-NLS-1$
-
- /** constant to identify the type of an Integer property */
- final static public String UMLPrimitiveTypes_INTEGER = "PrimitiveTypes::Integer"; //$NON-NLS-1$
-
- /** constant to identify the type of a String property */
- final static public String UMLPrimitiveTypes_STRING = "PrimitiveTypes::String"; //$NON-NLS-1$
-
- /** constant to identify the type of an Unlimited Natural property */
- final static public String UMLPrimitiveTypes_UNLIMITED_NATURAL = "PrimitiveTypes::UnlimitedNatural"; //$NON-NLS-1$
-
- /** constant to identify the type of an Unlimited Natural property */
- final static public String UMLPrimitiveTypes_REAL = "PrimitiveTypes::Real"; //$NON-NLS-1$
-
- /** path to the checked box image */
- protected final static String ICON_CHECKED = "/icons/complete_tsk.gif"; //$NON-NLS-1$
-
- /** path to the unchecked box image */
- protected final static String ICON_UNCHECKED = "/icons/incomplete_tsk.gif"; //$NON-NLS-1$
-
- /** the column for the stereotypes */
- private TreeViewerColumn stereotypeColumn = null;
-
- /** the column with the checkboxes for the runtime properties */
- private TreeViewerColumn runtimeColumn = null;
-
- private ArrayList<Value> savedValues;
-
- /**
- * Constructor.
- */
- public StereotypePostAction() {
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IStatus checkPostCondition() {
- return Status.OK_STATUS;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IStatus checkPreCondition() {
- return Status.OK_STATUS;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.service.palette.ModelPostAction#init(org.w3c.dom.Node,
- * org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider)
- *
- * @param configurationNode
- * @param factory
- */
- @Override
- public void init(Node configurationNode, IAspectActionProvider factory) {
- super.init(configurationNode, factory);
- config = new Configuration(configurationNode);
- }
-
- /**
- * @{inheritDoc
- */
- public void save(Node parentNode) {
- if(parentNode instanceof Element) {
- config.save(parentNode);
- } else {
- Activator.log.error("parent node is not an Element", null); //$NON-NLS-1$
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public ICommand getPostCommand(IAdaptable viewAdapter) {
- // so, we doesn't need to save the default values which can be modified
- // during the runtime
- config = new Configuration(config.getConfigurationNode());
-
- final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
-
- CompositeTransactionalCommand cmd = new CompositeTransactionalCommand (editingDomain, "Apply stereotype");
-
- // Apply the required stereotypes
- final ApplyStereotypeRequest request = new ApplyStereotypeRequest(viewAdapter, config.getStereotypesToApplyQN(), true);
-
- cmd.add(new ApplyStereotypeCommand(editingDomain, request));
-
- // 2. display stereotypes
- cmd.add(new EMFtoGMFCommandWrapper(new DefferedAppliedStereotypeToDisplayCommand(editingDomain, viewAdapter, "")));
-
- AbstractTransactionalCommand setPropertiesCommand = new AbstractTransactionalCommand(editingDomain, "Set stereotype values", null) {
-
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // we search the container for the object
- org.eclipse.uml2.uml.Element element = request.getElement();
- org.eclipse.uml2.uml.Element packageContainer = element;
- do {
- packageContainer = packageContainer.getOwner();
- } while(!(packageContainer instanceof org.eclipse.uml2.uml.Package) && packageContainer != null);
-
-
- config.setAppliedProfiles(((org.eclipse.uml2.uml.Package)packageContainer).getAllAppliedProfiles());
-
- if(config.hasRuntimeProperties()) {
- defineRuntimeProperties(config);
- }
-
- ArrayList<StereotypeRepresentation> stereotypes = config.getStereotypesRepresentations();
- for(StereotypeRepresentation stereotype : stereotypes) {
- final Stereotype stereotypeToEdit = stereotype.getUMLStereotype();
- ArrayList<PropertyRepresentation> properties = stereotype.getPropertiesWithValues();
- for(PropertyRepresentation property : properties) {
- if(property.hasValues()) {
- Type type = property.getType();
- final String propertyName = property.getUMLProperty().getName();
- if(type != null && propertyName != null) {
- Object newValue = null;
- if(type instanceof PrimitiveType) {
- newValue = Util.getValueFromString(property.getUMLProperty(), property.getStringValue());
- } else if(Util.isMetaclass(type)) {
- newValue = Util.retrievesMetaclassElementFromString(property.getUMLProperty(), property.getStringValue(), packageContainer);
- // property is an Enumeration
- } else if(type instanceof org.eclipse.uml2.uml.Enumeration) {
- newValue = Util.retrievesEnumerationLiteralFromString(property.getUMLProperty(), property.getStringValue(), packageContainer);
- // property is a DataType
- } else if(type instanceof org.eclipse.uml2.uml.DataType) {
- newValue = Util.getValueFromString(property.getUMLProperty(), property.getStringValue());
- // property is a Stereotype
- } else if(type instanceof Stereotype) {
- newValue = Util.retrievesStereotypedElementFromString(property.getUMLProperty(), property.getStringValue(), packageContainer);
- // property is a composite class
- } else if((type instanceof org.eclipse.uml2.uml.Class) && !(type instanceof Stereotype) && property.getUMLProperty().isMultivalued()) {
- // TODO
- newValue = null;
- } else {
- Activator.log.error("impossible to find a correct editor for the property" + property, null); //$NON-NLS-1$
- }
-
- if (newValue != null) {
- element.setValue(stereotypeToEdit, propertyName, newValue);
- }
-
- }
- }
- }
- }
- return CommandResult.newOKCommandResult();
- }
- };
-
- cmd.add(setPropertiesCommand);
-
- return cmd;
- }
-
- private void saveValues() {
- savedValues = new ArrayList<Value>();
- for(StereotypeRepresentation steRep : config.getStereotypesRepresentations()) {
- if(steRep.hasRuntimeProperties()) {
- for(PropertyRepresentation propRep : steRep.getRuntimeProperties()) {
- for(Value value : propRep.getValues()) {
- Value newVal = new Value(value);
- newVal.setPropertyRepresentation(propRep);
- savedValues.add(newVal);
- }
- }
- }
- }
-
- }
-
- private void restoreValues() {
- for(Value val : savedValues) {
-
- }
-
- }
-
- /**
- * @{inheritDoc
- */
- public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
- config.setAppliedProfiles(appliedProfiles);
- this.entryProxy = entryProxy;
-
- Composite mainComposite = new Composite(parent, SWT.BORDER);
- GridLayout layout = new GridLayout(5, false);
- mainComposite.setLayout(layout);
-
- Label titleLabel = new Label(mainComposite, SWT.NONE);
- titleLabel.setText("Stereotypes to Apply"); //$NON-NLS-1$
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
- titleLabel.setLayoutData(data);
-
- addButton = new Button(mainComposite, SWT.NONE);
- addButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_ADD));
- addButton.addMouseListener(new MouseListener() {
-
- /**
- * @{inheritDoc
- */
- public void mouseUp(MouseEvent e) {
- performAddButtonPressed(stereotypesViewer);
- selectionHasChange();
- }
-
- /**
- * @{inheritDoc
- */
- public void mouseDown(MouseEvent e) {
-
- }
-
- /**
- * @{inheritDoc
- */
- public void mouseDoubleClick(MouseEvent e) {
-
- }
- });
-
- removeButton = new Button(mainComposite, SWT.NONE);
- removeButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_REMOVE));
- removeButton.addMouseListener(new MouseListener() {
-
- /**
- * @{inheritDoc
- */
- public void mouseUp(MouseEvent e) {
- performRemoveAction(stereotypesViewer);
- }
-
- /**
- * @{inheritDoc
- */
- public void mouseDown(MouseEvent e) {
-
- }
-
- /**
- * @{inheritDoc
- */
- public void mouseDoubleClick(MouseEvent e) {
-
- }
- });
- removeButton.setEnabled(false);
-
- upButton = new Button(mainComposite, SWT.NONE);
- upButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_UP));
- upButton.addMouseListener(new MouseListener() {
-
- /**
- * @{inheritDoc
- */
- public void mouseUp(MouseEvent e) {
- moveElement(MOVE_UP, stereotypesViewer);
- selectionHasChange();
- }
-
- /**
- * @{inheritDoc
- */
- public void mouseDown(MouseEvent e) {
-
- }
-
- /**
- * @{inheritDoc
- */
- public void mouseDoubleClick(MouseEvent e) {
-
- }
- });
- upButton.setEnabled(false);
-
- downButton = new Button(mainComposite, SWT.NONE);
- downButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_DOWN));
- downButton.addMouseListener(new MouseListener() {
-
- /**
- * @{inheritDoc
- */
- public void mouseUp(MouseEvent e) {
- moveElement(MOVE_DOWN, stereotypesViewer);
- selectionHasChange();
-
- }
-
- /**
- * @{inheritDoc
- */
- public void mouseDown(MouseEvent e) {
-
- }
-
- /**
- * @{inheritDoc
- */
- public void mouseDoubleClick(MouseEvent e) {
-
- }
- });
- downButton.setEnabled(false);
-
- // stereotype viewer creation
- stereotypesViewer = new TreeViewer(mainComposite, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.horizontalSpan = 5;
-
- stereotypesViewer.getControl().setLayoutData(data);
- stereotypesViewer.setContentProvider(stereotypeContentProvider);
- stereotypesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- performSelectionChange(event);
-
- }
- });
-
- stereotypesViewer.getControl().addKeyListener(new KeyListener() {
-
- public void keyReleased(KeyEvent e) {
-
- }
-
- public void keyPressed(KeyEvent e) {
- if(e.keyCode == SWT.F2) {
- performF2Action(stereotypesViewer);
- } else if(e.character == SWT.DEL) {
- performRemoveAction(stereotypesViewer);
- } else if(e.stateMask == SWT.CTRL && e.keyCode == 110) {// e.character=='N'
- // doesn't
- // work
- performCTRL_N_Action(e, stereotypesViewer);
- }
- selectionHasChange();
- }
- });
-
- /*
- * we can't do : stereotypesViewer.addDoubleClickListener, because we
- * can't know on which column we are to make something or nothing!
- */
- stereotypesViewer.getControl().addMouseListener(new MouseListener() {
-
- public void mouseUp(MouseEvent e) {
- }
-
- public void mouseDown(MouseEvent e) {
- }
-
- public void mouseDoubleClick(MouseEvent e) {
- if(stereotypeColumn != null) {
- if(e.x < stereotypeColumn.getColumn().getWidth()) {// we
- // are
- // on
- // the
- // stereotype
- // column
- performDoubleClickAction(stereotypesViewer);
- } else {// change the property value
- ViewerCell cell = runtimeColumn.getViewer().getCell(new Point(e.x, e.y));
- if(cell != null) {
- Object element = ((TreeSelection)stereotypesViewer.getSelection()).getFirstElement();
- stereotypesViewer.editElement(element, 1);
- }
- }
- }
- }
- });
- createColumn(stereotypesViewer);
- updateStereotypeViewer();
- return mainComposite;
-
- }
-
- /**
- * Create the necessary columns to have CellEditor in the tree
- *
- * @param viewer
- * the viewer owning the columns
- */
- protected void createColumn(TreeViewer viewer) {
- stereotypeColumn = new TreeViewerColumn(viewer, SWT.FILL);
- stereotypeColumn.getColumn().setResizable(true);
- stereotypeColumn.getColumn().setWidth(300);
- stereotypeColumn.setLabelProvider(editorLabelProvider);
- stereotypeColumn.setEditingSupport(new AttributeEditingSupport(viewer));
-
- runtimeColumn = new TreeViewerColumn(viewer, SWT.CENTER);
- runtimeColumn.getColumn().setText("Runtime"); //$NON-NLS-1$
- runtimeColumn.getColumn().setResizable(true);
- runtimeColumn.getColumn().setWidth(80);
- runtimeColumn.setLabelProvider(new RuntimeLabelProvider());
- runtimeColumn.setEditingSupport(new RuntimeEditingSupport(viewer));
-
- viewer.getTree().setLinesVisible(true);
- viewer.getTree().setHeaderVisible(true);
- }
-
- /**
- * updates the stereotype viewer set the expandedNode refresh the status
- * button this method is called by
- * <ul>
- * <li>
- * {@link #createConfigurationComposite(Composite, PaletteEntryProxy, List)}</li>
- * <li> {@link #performAddButtonPressed(TreeViewer)} when we add or remove stereotypes</li>
- * </ul>
- */
- protected void updateStereotypeViewer() {
- if(stereotypesViewer != null) {
- saveExpandedNode();
- stereotypesViewer.setInput(config.getStereotypesRepresentations());
- restoreExpandedNode();
- }
- }
-
- /**
- * used to force the buttons update
- */
- protected void selectionHasChange() {
- performSelectionChange(new SelectionChangedEvent(stereotypesViewer, stereotypesViewer.getSelection()));
- }
-
- /**
- * Action done when the add button is pressed
- *
- * @param tree
- *
- */
- protected void performAddButtonPressed(TreeViewer tree) {
- TreeSelection selection = (TreeSelection)tree.getSelection();
- Object selectedElement = selection.getFirstElement();
- if(selection != null && selection.size() == 1 && !(selectedElement instanceof StereotypeRepresentation)) {
- if(selectedElement instanceof PropertyRepresentation) {
- // We want add a value to a multi-valued property or edit a
- // value to a mono-valued property
- PropertyRepresentation prop = (PropertyRepresentation)selectedElement;
- if(prop.getUpperMultiplicity() != 1) {
- editMe(prop, null);// we add a value
- } else if(!prop.getValues().isEmpty()) { // mono-valued
- // property and the
- // valu exists
- editMe(prop, prop.getValues().get(0));
- } else {// monovalued property, the value doesn't exist
- editMe(prop, null);
- }
- tree.refresh(selectedElement);
- }
- return;
- }
-
- // pops-up a dialog window where users can select the additionnal
- // stereotypes to apply
- // it needs the metaclass information...
- // for this, entry Proxy should be a Palette entry proxy
- if(!(entryProxy instanceof IPaletteAspectToolEntryProxy)) {
- return;
- }
-
- PaletteEntry entry = ((IPaletteAspectToolEntryProxy)entryProxy).getEntry();
- if(!(entry instanceof ToolEntry)) {
- return;
- }
-
- // this is a PaletteAspectToolEntryProxy
- // try to find the metaclass on which the element is working
- EClass metaClass = PaletteUtil.getToolMetaclass((ToolEntry)entry);
-
- if(metaClass == null) {
- Activator.log.error("Impossible to find metaclass", null); //$NON-NLS-1$
- return;
- }
-
- // retrieve the original stereotype list from the qualified names
- List<Stereotype> stereotypeList = config.getUMLStereotypes();// retrieveStereotypesFromQualifiedNames();
-
- // we have all applied profiles, the list of already applied
- // stereotypes, the metaclass of the created element...
- // just have to open a selection dialog
- final CheckedTreeSelectionDialog selectionDialog = new CheckedTreeSelectionDialog(DisplayUtils.getDisplay().getActiveShell(), editorLabelProvider, new ProfileContentProvider(metaClass));
- selectionDialog.setTitle(Messages.StereotypePostAction_StereotypeSelectionTitle);
- selectionDialog.setMessage(Messages.StereotypePostAction_StereotypeSelectionMessage);
- selectionDialog.setContainerMode(true);
- selectionDialog.setInitialElementSelections(stereotypeList);
- selectionDialog.setInput(config.getAppliedProfiles());
- selectionDialog.setExpandedElements(config.getAppliedProfiles().toArray());
-
- ViewerComparator comparator = new ViewerComparator();
- selectionDialog.setComparator(comparator);
-
- if(CheckedTreeSelectionDialog.OK == selectionDialog.open()) {
- // update the list of stereotype to apply
- Object[] result = selectionDialog.getResult();
- ArrayList<String> stereotypesToApply = new ArrayList<String>();
- for(int i = 0; i < result.length; i++) {
- if(result[i] instanceof Stereotype) {
- stereotypesToApply.add(((Stereotype)result[i]).getQualifiedName());
-
- }
- }
- config.setStereotypesRepresentations(stereotypesToApply);
- // it's not possible to use refresh or update here!
- updateStereotypeViewer();
- }
-
- }
-
- /**
- * Action done when the remove button is pressed
- *
- * @param viewer
- * the viewer on which the remove action is applied
- */
- protected void performRemoveAction(TreeViewer viewer) {
-
- ITreeSelection selection = (ITreeSelection)viewer.getSelection();
- if(selection != null) {
- List<?> selectedElements = ((TreeSelection)selection).toList();
- if(sameLevelForFullSelection(selection)) {
- // all the element have the same type
- if(selection.getFirstElement() instanceof StereotypeRepresentation) {
- for(Object object : selectedElements) {
- if(object instanceof StereotypeRepresentation) {
- config.removeStereotype((StereotypeRepresentation)object);
- }
- }
-
- } else if(selection.getFirstElement() instanceof PropertyRepresentation) {
- // we delete the value for mono-valued property
- for(Object object : selectedElements) {
- if(object instanceof PropertyRepresentation) {
- if(!((PropertyRepresentation)object).getUMLProperty().isMultivalued()) {
- ((PropertyRepresentation)object).getValues().remove(0);
- }
- }
- }
- } else if(selection.getFirstElement() instanceof Value) {
- // we remove value from a multivalued property
- for(Object object : selectedElements) {
- if(object instanceof Value) {
- ((Value)object).getPropertyRepresentation().removeValue((Value)object);
- }
- }
- }
- viewer.refresh();
- }
- }
- }
-
- /**
- * Action to do when the F2 key is pressed
- * <ul>
- * <li>open a CellEditor for the PrimitiveType and DataType</li>
- * <li>open a popup editor for others types</li>
- * </ul>
- *
- * @param viewer
- * the viewer on which the F2 action is applied
- */
- protected void performF2Action(TreeViewer viewer) {
-
- TreeSelection selection = (TreeSelection)viewer.getSelection();
- if((selection != null) && (selection.size() == 1)) {
- Object objectToEdit = selection.getFirstElement();
- if(objectToEdit instanceof PropertyRepresentation) {
- Property prop = ((PropertyRepresentation)objectToEdit).getUMLProperty();
- if(prop.isMultivalued() == false) {
- if((prop.getType() instanceof PrimitiveType) || (prop.getType() instanceof DataType)) {
- viewer.editElement(prop, 0);
- } else {
- // TODO
- }
- }
- } else if(objectToEdit instanceof Value) {
- PropertyRepresentation propRep = ((Value)objectToEdit).getPropertyRepresentation();
- Type type = propRep.getType();
- if(type != null) {
- if(type instanceof PrimitiveType || type instanceof DataType) {
- viewer.editElement(objectToEdit, 0);
-
- // the refresh is do by the cellEditor! (if the resfresh
- // is do here, there is a bug!)
- // viewer.refresh(property);
- } else {// popupEditor
- editMe(propRep, (Value)objectToEdit);
- viewer.refresh(propRep);
- }
- }
- }
- }
-
- }
-
- /**
- * Action done when a DoubleClick is received by the tree
- *
- * @param viewer
- * the viewer on which the DoubleClick action is applied
- */
- protected void performDoubleClickAction(TreeViewer viewer) {
-
- TreeSelection selection = (TreeSelection)viewer.getSelection();
- if(selection != null && selection.size() == 1) {
- Object selectedObject = selection.getFirstElement();
- if(selectedObject instanceof StereotypeRepresentation) {
- // we expand or collapse the node
- viewer.setExpandedState(selectedObject, !viewer.getExpandedState(selectedObject));
- } else if(selectedObject instanceof PropertyRepresentation) {
- Property prop = ((PropertyRepresentation)selectedObject).getUMLProperty();
- if(prop.isMultivalued()) {
- // we expand or collapse the node
- viewer.setExpandedState(selectedObject, !viewer.getExpandedState(selectedObject));
- } else {
- // we edit a value
- if(((PropertyRepresentation)selectedObject).getValues().isEmpty()) {
- editMe((PropertyRepresentation)selectedObject, null);
- } else {
- editMe((PropertyRepresentation)selectedObject, ((PropertyRepresentation)selectedObject).getValues().get(0));
- }
-
- viewer.update(selectedObject, null);
- }
- } else if(selectedObject instanceof Value) {
- editMe(((Value)selectedObject).getPropertyRepresentation(), (Value)selectedObject);
- viewer.refresh(selectedObject);
- }
- }
- }
-
- /**
- * Action done when the user does a CTRL^N on the tree
- *
- * @param e
- * the KeyEvent
- * @param viewer
- * the TreeViewer in which we add something
- */
- protected void performCTRL_N_Action(KeyEvent e, TreeViewer viewer) {
-
- TreeSelection selection = (TreeSelection)viewer.getSelection();
- if(selection != null && selection.size() == 1) {
- Object selectedObject = selection.getFirstElement();
- if(selectedObject != null) {
- if(selectedObject instanceof PropertyRepresentation) {
- Property property = ((PropertyRepresentation)selectedObject).getUMLProperty();
- if(property.isMultivalued()) {
- // can we add a new value?
- int upperMultiplicity = property.getUpper();
- ArrayList<Value> values = ((PropertyRepresentation)selectedObject).getValues();
- if(upperMultiplicity == -1 || values.size() < upperMultiplicity) {
- editMe((PropertyRepresentation)selectedObject, null);
- } else if(values.size() == 0) {
- editMe((PropertyRepresentation)selectedObject, null);
- }
- viewer.refresh(selectedObject);
- }
- }
- }
- }
- }
-
- /**
- * Set the {@link Button#setEnabled(boolean)} parameter to true or false for
- * the buttons following the selected element in the {@link StereotypePostAction#stereotypeViewer}
- * <ul>
- * <li> {@link StereotypePostAction#addButton}</li>
- * <li> {@link StereotypePostAction#removeButton}</li>
- * <li> {@link StereotypePostAction#upButton}</li>
- * <li> {@link StereotypePostAction#downButton}</li>
- * </ul>
- *
- * @param event
- * the SelectionChangeEvent
- */
- protected void performSelectionChange(SelectionChangedEvent event) {
- ITreeSelection selection = (ITreeSelection)event.getSelection();
- int selectionSize = selection.size();
- if((selectionSize == 0) || !(sameLevelForFullSelection(selection))) {
- addButton.setEnabled(true);
- removeButton.setEnabled(false);
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- } else if(selectionSize == 1) {
- Object selectedElement = selection.getFirstElement();
- // removeButton state
- if(selectedElement instanceof StereotypeRepresentation) {
- removeButton.setEnabled(true);
- } else if(selectedElement instanceof PropertyRepresentation) {
- if(((PropertyRepresentation)selectedElement).getUpperMultiplicity() == 1) {
- removeButton.setEnabled(true);
- } else {
- removeButton.setEnabled(false);
- }
- } else if(selectedElement instanceof Value) {
- removeButton.setEnabled(true);
-
- }
-
- // addButton state
- if(selectedElement instanceof StereotypeRepresentation) {
- addButton.setEnabled(true);
- } else if(selectedElement instanceof PropertyRepresentation) {
- ArrayList<Value> values = ((PropertyRepresentation)selectedElement).getValues();
- Property prop = ((PropertyRepresentation)selectedElement).getUMLProperty();
- if(!prop.isMultivalued()) {
- if(values.size() == 0) {
- addButton.setEnabled(true);
- } else {
- addButton.setEnabled(false);
- }
- } else {// multi-valued property}
- int upper = prop.getUpper();
- if(upper == -1) {
- addButton.setEnabled(true);
- } else if(values.size() < upper) {
- addButton.setEnabled(true);
- } else {
- addButton.setEnabled(false);
- }
- }
- } else if(selectedElement instanceof Value) {
- addButton.setEnabled(false);
- }
- // upButton and downButton states
- if(selectedElement instanceof StereotypeRepresentation) {
- int index = config.getStereotypesRepresentations().indexOf(selectedElement);
- if(config.getStereotypesRepresentations().size() == 1) {
- downButton.setEnabled(false);
- upButton.setEnabled(false);
- } else if(index == 0) {
- downButton.setEnabled(true);
- upButton.setEnabled(false);
- } else if(index == config.getStereotypesRepresentations().size() - 1) {
- downButton.setEnabled(false);
- upButton.setEnabled(true);
- } else {
- downButton.setEnabled(true);
- upButton.setEnabled(true);
- }
- } else if(selectedElement instanceof PropertyRepresentation) {
- downButton.setEnabled(false);
- upButton.setEnabled(false);
- } else if(selectedElement instanceof Value) {
- ArrayList<Value> valuesList = ((Value)selectedElement).getPropertyRepresentation().getValues();
- int index = valuesList.indexOf(selectedElement);
- if(valuesList.size() == 1) {
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- } else if(index == 0) {
- upButton.setEnabled(false);
- downButton.setEnabled(true);
- } else if(index == valuesList.size() - 1) {
- upButton.setEnabled(true);
- downButton.setEnabled(false);
- } else {
- upButton.setEnabled(true);
- downButton.setEnabled(true);
- }
- }
-
- } else {// all the elements are from the same level
-
- List<?> selectedElements = ((TreeSelection)selection).toList();
- if(selection.getFirstElement() instanceof StereotypeRepresentation) {
- removeButton.setEnabled(true);
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- addButton.setEnabled(true);
- } else
-
- if(selection.getFirstElement() instanceof Value) {
- removeButton.setEnabled(true);
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- addButton.setEnabled(false);
- }
- }
- }
-
- /**
- * move the selected element in stereotypeViewer following shiftValue
- *
- *
- *
- * @param shiftValue
- * shiftValue can take the values :
- * <ul>
- * <li>{@link StereotypePostAction#MOVE_UP}</li>
- * <li>{@link StereotypePostAction#MOVE_DOWN}</li>
- * </ul>
- * @param viewer
- * the TreeViewer in which we move elements
- *
- */
- protected void moveElement(String shiftValue, TreeViewer viewer) {
-
- TreeSelection selection = (TreeSelection)viewer.getSelection();
- if(selection != null && selection.size() == 1) {
- Object selectedElement = selection.getFirstElement();
- if(selectedElement instanceof Value) {
-
- /** it's a property value */
- exchangeTwoValues(((Value)selectedElement).getPropertyRepresentation().getValues(), selectedElement, shiftValue);
-
- viewer.refresh(((Value)selectedElement).getPropertyRepresentation());
-
- } else if(selectedElement instanceof StereotypeRepresentation) {
- /** it's a stereotype */
- exchangeTwoValues(config.getStereotypesRepresentations(), selectedElement, shiftValue);
- viewer.refresh();
- }
- }
- }
-
- /**
- * Exchange the selectedElement with its neighbor, in arrayList, up or down
- * following shiftValue
- *
- *
- * @param arrayList
- * the ArrayList containing the elements to move
- * @param selectedElement
- * the element to move
- * @param shiftValue
- * shiftValue can take the values :
- * <ul>
- * <li>{@link StereotypePostAction#MOVE_UP}</li>
- * <li>{@link StereotypePostAction#MOVE_DOWN}</li>
- * </ul>
- */
- @SuppressWarnings({ "rawtypes", "unchecked" })
- protected void exchangeTwoValues(ArrayList arrayList, Object selectedElement, String shiftValue) {
- int index = getIndexOf(arrayList, selectedElement);
- /**
- * is it possible to move the objects ?
- */
- if(arrayList == null || arrayList.size() < 2) {
- // the list is to small
- return;
- }
- if((shiftValue.equals(MOVE_UP) && index == 0) || (shiftValue.equals(MOVE_DOWN) && arrayList.size() == (index + 1))) {
- // the selected element is already the first or the last
- return;
- }
-
- if(shiftValue.equals(MOVE_DOWN)) {
- arrayList.set(index, arrayList.get(index + 1));
- arrayList.set(index + 1, selectedElement);
-
- } else if(shiftValue.equals(MOVE_UP)) {
- arrayList.set(index, arrayList.get(index - 1));
- arrayList.set(index - 1, selectedElement);
- }
- }
-
- /**
- * test if all the selected element in the selection are fron the same level
- *
- * @param selection
- * @return <ul>
- * <li>{@code true} if all the element are from the same level in the tree</li>
- * <li>{@code false if not}</li>
- * </ul>
- *
- */
- protected boolean sameLevelForFullSelection(ITreeSelection selection) {
- // ITreeSelection selection =
- // (ITreeSelection)stereotypesViewer.getSelection();
- // we do the delete action, only if all the elements have the same level
- List<?> selectedElements = ((TreeSelection)selection).toList();
- if(!selectedElements.isEmpty()) {
- TreePath[] path = selection.getPathsFor(selectedElements.get(0));
- if(path != null) {
- // the level for the first selected Element
- int level = path[0].getSegmentCount();
- for(Object object : selectedElements) {
- path = selection.getPathsFor(object);
- if(level != path[0].getSegmentCount()) {
- /**
- * the selection is a mixed between different types of
- * elements
- */
- return false;
- }
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns the list of stereotypes applied by this action
- *
- * @return the list of stereotypes applied by this action
- */
- public List<String> getStereotypesToApply() {
- return config.getStereotypesToApplyQN();
- }
-
- /**
- * This class provides the methods for displaying the stereotypeViewer's
- * column. This class gives the correct Label and it's {@link Image} to
- * display for each element
- *
- *
- */
- protected class EditorLabelProvider extends CellLabelProvider implements ILabelProvider {
-
- /**
- * @see org.eclipse.jface.viewers.CellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell)
- *
- * @param cell
- */
-
- @Override
- public void update(ViewerCell cell) {
- cell.setText(getText(cell.getElement()));
- cell.setImage(getImage(cell.getElement()));
- }
-
- /**
- * @{inheritDoc
- */
- public String getText(Object element) {
- if(element instanceof Profile) {
- return ((Profile)element).getLabel();
- } else if(element instanceof Stereotype) {
- return ((Stereotype)element).getLabel();
- } else if(element instanceof StereotypeRepresentation) {
- return ((StereotypeRepresentation)element).getStereotypeQualifiedName();
- } else if(element instanceof Value) {
- return ((Value)element).getValue();
- } else if(element instanceof PropertyRepresentation) {
- return ((PropertyRepresentation)element).getLabel();
- }
- return element.toString();
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- *
- * @param element
- * @return
- */
-
- public Image getImage(Object element) {
- if(element instanceof StereotypeRepresentation) {
- return Activator.getPluginIconImage(Activator.ID, ICON_STEREOTYPE);
- } else if(element instanceof PropertyRepresentation) {
- return Activator.getPluginIconImage(Activator.ID, ICON_PROPERTY);
- } else if(element instanceof Value) {
- Property property = ((Value)element).getPropertyRepresentation().getUMLProperty();
- Type type = property.getType();
- if(type != null) {
- if(type instanceof PrimitiveType) {
- String typeName = type.getQualifiedName();
- // property is a boolean property
-
- if(UMLPrimitiveTypes_BOOLEAN.equals(typeName)) {
- return Activator.getPluginIconImage(Activator.ID, ICON_LITERALBOOLEAN);
-
- // property is a String
- } else if(UMLPrimitiveTypes_STRING.equals(typeName)) {
- return Activator.getPluginIconImage(Activator.ID, ICON_LITERALSTRING);
-
- // property is an Integer
- } else if(UMLPrimitiveTypes_INTEGER.equals(typeName)) {
- return Activator.getPluginIconImage(Activator.ID, ICON_LITERALINTEGER);
-
- // property is an unlimitedNatural
- } else if(UMLPrimitiveTypes_REAL.equals(typeName)) {
- return Activator.getPluginIconImage(Activator.ID, ICON_LITERALREAL);
-
- // property is an unlimitedNatural
- } else if(UMLPrimitiveTypes_UNLIMITED_NATURAL.equals(typeName)) {
- return Activator.getPluginIconImage(Activator.ID, ICON_LITERALUNLIMITEDNATURAL);
- // property is a user primitive Type
- } else {
- // never used!
- // newVTO = new
- // UserPrimitiveTypeValueTreeObject(parent,
- // newValue, domain);
- }
-
- // property is a Metaclass property
- } else if(Util.isMetaclass(type)) {
- return Activator.getPluginIconImage(Activator.ID, ICON_METACLASS);
-
- // property is an Enumeration
- } else if(type instanceof org.eclipse.uml2.uml.Enumeration) {
- return Activator.getPluginIconImage(Activator.ID, ICON_ENUMERATION);
-
- // property is a DataType
- } else if(type instanceof org.eclipse.uml2.uml.DataType) {
- return Activator.getPluginIconImage(Activator.ID, ICON_DATATYPE);
-
- // property is a Stereotype
- } else if(type instanceof Stereotype) {
- return Activator.getPluginIconImage(Activator.ID, ICON_STEREOTYPE);
-
- // property is a composite class
- } else if((type instanceof org.eclipse.uml2.uml.Class) && !(type instanceof Stereotype) && property.isMultivalued()) {
- // TODO
-
- }
- }
- } else if(element instanceof Profile) {
- return Activator.getPluginIconImage(Activator.ID, ICON_PROFILE);
- } else if(element instanceof Stereotype) {// it's a stereotype
- return Activator.getPluginIconImage(Activator.ID, ICON_STEREOTYPE);
- }
-
- return Activator.getPluginIconImage(Activator.ID, ICON_UNKNOWN);
- }
- }
-
- /**
- * Content provider for the stereotype viewer
- */
- protected class StereotypeContentProvider implements ITreeContentProvider {
-
- /**
- * @{inheritDoc
- */
- public Object[] getChildren(Object parentElement) {
-
- if(parentElement instanceof List<?>) {
- return ((List<?>)parentElement).toArray();
- } else if(parentElement instanceof StereotypeRepresentation) {
- return ((StereotypeRepresentation)parentElement).getPropertyRepresentations().toArray();
- } else if(parentElement instanceof PropertyRepresentation) {
- if(((PropertyRepresentation)parentElement).getUpperMultiplicity() != 1 && ((PropertyRepresentation)parentElement).getValues().size() != 0) {
- return ((PropertyRepresentation)parentElement).getValues().toArray();
- }
- }
- return new Object[0];
- }
-
- /**
- * @{inheritDoc
- */
- public Object getParent(Object element) {
- if(element instanceof Value) {
- return ((Value)element).getPropertyRepresentation();
- } else if(element instanceof PropertyRepresentation) {
- return ((PropertyRepresentation)element).getStereotypeRepresentation();
- }
- return null;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean hasChildren(Object element) {
- return getChildren(element) != null && (getChildren(element).length > 0);
-
- }
-
- /**
- * @{inheritDoc
- */
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- /**
- * @{inheritDoc
- */
- public void dispose() {
-
- }
-
- /**
- * @{inheritDoc
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
- }
-
- /**
- * Content provider for the selection dialog
- */
- protected class ProfileContentProvider implements ITreeContentProvider {
-
- /** metaclass of the element created by the tool */
- final protected EClass metaclass;
-
- /**
- * Constructor.
- *
- * @param metaclass
- * the metaclass on which stereotypes can be applied
- */
- public ProfileContentProvider(EClass metaclass) {
- this.metaclass = metaclass;
- }
-
- /**
- * @{inheritDoc
- */
- public Object[] getChildren(Object parentElement) {
- List<org.eclipse.uml2.uml.Element> children = new ArrayList<org.eclipse.uml2.uml.Element>();
- if(parentElement instanceof Profile) {
- for(Stereotype stereotype : ((Profile)parentElement).getOwnedStereotypes()) {
- // check applicability
- boolean isValid = false;
- List<Class> metaclasses = stereotype.getAllExtendedMetaclasses();
- for(Class stMetaclass : metaclasses) {
- java.lang.Class<? extends Class> metaclassClass = stMetaclass.getClass();
- if(metaclassClass != null) {
- EClassifier metaClassifier = UMLPackage.eINSTANCE.getEClassifier(stMetaclass.getName());
- if(((EClass)metaClassifier).isSuperTypeOf(metaclass)) {
- isValid = true;
- }
- }
- }
- if(isValid) {
- children.add(stereotype);
- }
- }
- }
- return children.toArray();
- }
-
- /**
- * @{inheritDoc
- */
- public Object getParent(Object element) {
- if(element instanceof Profile) {
- return ((Profile)element).getOwner();
- } else if(element instanceof Stereotype) {
- return ((Stereotype)element).getProfile();
- }
- return null;
- }
-
- /**
- * @{inheritDoc
- */
- public boolean hasChildren(Object element) {
- return (element instanceof Profile);
- }
-
- /**
- * @{inheritDoc
- */
- public Object[] getElements(Object inputElement) {
- if(inputElement instanceof List<?>) {
- return ((List<?>)inputElement).toArray();
- }
- return new Object[0];
- }
-
- /**
- * @{inheritDoc
- */
- public void dispose() {
-
- }
-
- /**
- * @{inheritDoc
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-
- }
-
- }
-
- /**
- * Give the correct editor to a property following the property type. Fill
- * the hashmaps with the new value
- * <ul>
- * <li>if {@code value==null}, we add a value to a multi-valued property</li>
- * <li>if {@code value!=null}, we modify a value</li>
- * </ul>
- *
- * @param property
- * @param value
- */
- public void editMe(PropertyRepresentation propRepresentation, Value valueToEdit) {
-
- Type type = propRepresentation.getType();
- Property property = propRepresentation.getUMLProperty();
- String value = null;
- // property is a a primitive type
- if(type instanceof PrimitiveType) {
- String typeName = type.getQualifiedName();
- // property is a boolean property
- if(UMLPrimitiveTypes_BOOLEAN.equals(typeName)) {
- value = PropertyEditors.BooleanEditor(property, valueToEdit);
- // property is a String
-
- } else if(UMLPrimitiveTypes_STRING.equals(typeName)) {
- value = PropertyEditors.StringEditor(property, valueToEdit);
- // property is a real
- } else if(UMLPrimitiveTypes_REAL.equals(typeName)) {
- value = PropertyEditors.RealEditor(property, valueToEdit);
- /** property is a user primitive Type */
- } else if(UMLPrimitiveTypes_INTEGER.equals(typeName)) {
- value = PropertyEditors.IntegerEditor(property, valueToEdit);
-
- // property is an unlimitedNatural
- } else if(UMLPrimitiveTypes_UNLIMITED_NATURAL.equals(typeName)) {
-
- value = PropertyEditors.UnlimitedNaturalEditor(property, valueToEdit);
-
- /** property is a user primitive Type */
- } else {
- // never used!
- // newVTO = new UserPrimitiveTypeValueTreeObject(parent,
- // newValue, domain);
- }
-
- // property is a Metaclass property
- } else if(Util.isMetaclass(type)) {
- value = PropertyEditors.MetaclassEditor(property, valueToEdit, config.getAppliedProfiles());
-
- // property is an Enumeration
- } else if(type instanceof org.eclipse.uml2.uml.Enumeration) {
- value = PropertyEditors.EnumerationEditor(property, valueToEdit);
-
- // property is a DataType
- } else if(type instanceof org.eclipse.uml2.uml.DataType) {
-
- value = PropertyEditors.DataTypeEditor(property, valueToEdit);
-
- // property is a Stereotype
- } else if(type instanceof Stereotype) {
- value = PropertyEditors.StereotypeEditor(property, valueToEdit, config.getAppliedProfiles());
-
- // property is a composite class
- } else if((type instanceof org.eclipse.uml2.uml.Class) && !(type instanceof Stereotype) && property.isMultivalued()) {
- value = PropertyEditors.CompositeClassEditor(property, valueToEdit);
- } else {
- Activator.log.error("Impossible to find a correct editor for the property" + property, null); //$NON-NLS-1$
- return;
- }
-
- if(value == null && valueToEdit == null) {
- // nothing to do
- return;
- } else if(value == null && valueToEdit != null) {
- // we delete a value
- valueToEdit.getPropertyRepresentation().getValues().remove(valueToEdit);
- } else if(value != null && valueToEdit == null) {
- // we add a value
- propRepresentation.addValue(new Value(value));
- } else if(value != null && valueToEdit != null) {
- // we change a value
- valueToEdit.setValue(value);
- }
-
- }
-
- /**
- * search the object in the ArrayList list, using == and not the equals
- * method
- *
- * @param list
- * @param obj
- * @return return the index of the object or -1 if it doesn't exist in the
- * list
- */
- public int getIndexOf(ArrayList<?> list, Object obj) {
- int index = -1;
- for(int i = 0; i < list.size(); i++) {
- if(list.get(i) == obj) {
- index = i;
- }
- }
- return index;
- }
-
- /**
- * save the expanded Nodes
- */
- protected void saveExpandedNode() {
- expandedElements = stereotypesViewer.getExpandedElements();
- }
-
- /**
- * restore the expanded nodes
- */
- protected void restoreExpandedNode() {
- if(expandedElements != null) {
- stereotypesViewer.setExpandedElements(expandedElements);
- expandedElements = null;
- }
- }
-
- /**
- * Class giving cell editors for the {@link stereotypesViewer} and for the {@link RuntimePropertiesDialog#tree}
- */
- public class AttributeEditingSupport extends EditingSupport {
-
- /** proposals for boolean */
- protected final String[] booleanProposals = new String[]{ "", "true", "false" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- protected TreeViewer treeViewer = null;
-
- /**
- * Constructor.
- *
- * @param viewer
- * viewer in which editors will open
- */
- public AttributeEditingSupport(ColumnViewer viewer) {
- super(viewer);
- this.treeViewer = (TreeViewer)viewer;
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected CellEditor getCellEditor(Object element) {
- Type type = null;
- CellEditor editor = null;
- if(element instanceof Value) {
- type = ((Value)element).getPropertyRepresentation().getType();
- }
- if(type != null) {
- if(type instanceof PrimitiveType) {
- String typeName = type.getQualifiedName();
-
- // property is a boolean property
- if(UMLPrimitiveTypes_BOOLEAN.equals(typeName)) {
- editor = createBooleanEditor(treeViewer.getTree());
-
- // property is a String
- } else if(UMLPrimitiveTypes_STRING.equals(typeName)) {
- editor = new TextCellEditor(treeViewer.getTree());
-
- // property is an Integer
- } else if(UMLPrimitiveTypes_INTEGER.equals(typeName)) {
- editor = new TextCellEditor(treeViewer.getTree());
-
- // property is an unlimitedNatural
- } else if(UMLPrimitiveTypes_UNLIMITED_NATURAL.equals(typeName)) {
- editor = new TextCellEditor(treeViewer.getTree());
-
- // property is a user primitive Type
- } else {
- // never used!
- // newVTO = new UserPrimitiveTypeValueTreeObject(parent,
- // newValue, domain);
- }
-
- }
- }
- return editor;
-
- }
-
- /**
- * Creates and return a combobox cell editor for a boolean type
- *
- * @param feature
- * the feature to edit
- * @return the newly created combo box cell editor
- */
- protected CellEditor createBooleanEditor(Composite parent) {
- return new ComboBoxCellEditor(parent, booleanProposals, SWT.READ_ONLY);
- }
-
- /**
- * @{inheritDoc
- */
- @Override
- protected Object getValue(Object element) {
-
- if(element instanceof Value) {
- Property prop = ((Value)element).getPropertyRepresentation().getUMLProperty();
- if(prop.getType() != null) {
- if(prop.getType().getQualifiedName().equals(UMLPrimitiveTypes_BOOLEAN)) {
- for(int index = 0; index < booleanProposals.length; index++) {
- if(booleanProposals[index].equals(element.toString())) {
- return index;
- }
- }
- return 0;
- }
- }
- }
- return element.toString();
- }
-
- /**
- * we use the Cell Editor only to replace a value.
- */
- @Override
- protected void setValue(Object oldValue, Object newValue) {
- // property can't be null, because, we change a value, we never
- // create a new value
- if(!"".equals(newValue)) { //$NON-NLS-1$
- if(oldValue instanceof Value) {
- Property property = ((Value)oldValue).getPropertyRepresentation().getUMLProperty();
- if(property.getType() != null) {
- if(property.getType() instanceof PrimitiveType) {
-
- String typeName = property.getType().getQualifiedName();
- if(UMLPrimitiveTypes_BOOLEAN.equals(typeName)) {
- setBooleanValue(oldValue, newValue);
- } else {
- ((Value)oldValue).setValue((String)newValue);
- }
- } else {
- ((Value)oldValue).setValue((String)newValue);
- }
- }
- treeViewer.refresh(oldValue);
-
- }
- }
- }
-
- /**
- * Sets the new boolean value on the given element.
- *
- * @param element
- * the model element
- * @param value
- * the new value
- */
- protected void setBooleanValue(Object oldValue, Object newValue) {
- if(newValue == null || newValue.equals(0)) {
- ((Value)oldValue).getPropertyRepresentation().getValues().remove(oldValue);
- } else if(newValue.equals(1)) {
- ((Value)oldValue).setValue(booleanProposals[1]);
- } else if(newValue.equals(2)) {
- ((Value)oldValue).setValue(booleanProposals[2]);
- } else {
- Activator.log.error("Impossible to set boolean value " + newValue, null); //$NON-NLS-1$
- }
- }
-
- }
-
- /**
- * This class provides a {@link CheckboxCellEditor} for the {@link StereotypePostAction#runtimeColumn}
- *
- *
- */
- protected class RuntimeEditingSupport extends EditingSupport {
-
- /** editor */
- private final CellEditor editor;
-
- /**
- *
- * Constructor.
- *
- * @param viewer
- * viewer in which editors will open
- */
- public RuntimeEditingSupport(ColumnViewer viewer) {
- super(viewer);
- editor = new CheckboxCellEditor(null, SWT.NONE);
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.EditingSupport#getCellEditor(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- protected CellEditor getCellEditor(Object element) {
- return editor;
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.EditingSupport#canEdit(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- protected boolean canEdit(Object element) {
- if(element instanceof PropertyRepresentation) {
- return true;
- }
- return false;
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.EditingSupport#getValue(java.lang.Object)
- *
- * @param element
- * @return
- */
- @Override
- protected Object getValue(Object element) {
- if(element instanceof PropertyRepresentation) {
- return ((PropertyRepresentation)element).isRuntime();
- }
- return null;
- }
-
- /**
- *
- * @see org.eclipse.jface.viewers.EditingSupport#setValue(java.lang.Object, java.lang.Object)
- *
- * @param element
- * @param value
- */
- @Override
- protected void setValue(Object element, Object value) {
- if(element instanceof PropertyRepresentation) {
- ((PropertyRepresentation)element).setRuntime((Boolean)value);
- stereotypesViewer.update(element, null);
- }
- }
- }
-
- /**
- * This class provides the methods for displaying the stereotypeViewer's
- * column. This class gives the correct Label and it's {@link Image} to
- * display for each element
- *
- */
- protected class RuntimeLabelProvider extends CellLabelProvider implements ILabelProvider {
-
- /**
- * @see org.eclipse.jface.viewers.CellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell)
- *
- * @param cell
- */
-
- @Override
- public void update(ViewerCell cell) {
- cell.setText(getText(cell.getElement()));
- cell.setImage(getImage(cell.getElement()));
- }
-
- /**
- * @{inheritDoc
- */
- public String getText(Object element) {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
- *
- * @param element
- * @return the image corresponding to the status (define or not at
- * runtime)
- */
-
- public Image getImage(Object element) {
- if(element instanceof PropertyRepresentation) {
- if(((PropertyRepresentation)element).isRuntime()) {
- return Activator.getPluginIconImage(Activator.ID, ICON_CHECKED);
- }
- return Activator.getPluginIconImage(Activator.ID, ICON_UNCHECKED);
-
- }
- return null;
- }
- }
-
- /**
- * This method does the action to define the properties defined at runtime,
- * that's to say, open a dialog to propose editing the properties defined
- * during the palette customisation
- *
- * @param config
- * the configuration which contains all the applied stereotypes
- * with properties and values
- * @param editPart
- * the edit
- */
- protected void defineRuntimeProperties(Configuration config) {
-
- /*
- * we copy the stereotype with runtime properties we copy the runtime
- * properties (note that the values aren't not copied)
- *
- * so steWithPropToEdit contains only stereotypes with only their
- * runtime properties.
- */
-
- List<StereotypeRepresentation> steWithPropToEdit = new ArrayList<StereotypeRepresentation>();
- for(StereotypeRepresentation ste : config.getStereotypesRepresentations()) {
- if(ste.hasRuntimeProperties()) {
- StereotypeRepresentation newSte = new StereotypeRepresentation(ste);
- for(PropertyRepresentation propRep : ste.getRuntimeProperties()) {
- PropertyRepresentation prop = new PropertyRepresentation(propRep);
- newSte.addProperty(prop);
- }
- steWithPropToEdit.add(newSte);
- }
- }
-
- RuntimePropertiesDialog dialog = new RuntimePropertiesDialog(new Shell(), steWithPropToEdit);
- dialog.open();
-
- }
-
- /**
- *
- * This class provides a Dialog to define the properties values during the
- * element creation
- *
- */
- protected class RuntimePropertiesDialog extends Dialog {
-
- /** the dialog title */
- private String title = null;
-
- /** the dialog message */
- private String message = null;
-
- /** the viewer */
- private TreeViewer tree = null;
-
- /**
- * the list containing the {@link StereotypeRepresentation} with the
- * runtime roperties
- */
- private List<StereotypeRepresentation> stereotypesRep;
-
- /**
- *
- * Constructor.
- *
- * @param parent
- * @param stereotypesList
- */
-
- public RuntimePropertiesDialog(Shell parent, List<StereotypeRepresentation> steWithPropToEdit) {
- super(parent);
- this.title = Messages.StereotypePostAction_EditRuntimePropertiesTitle;
- this.message = Messages.StereotypePostAction_EditRuntimePropertiesMessage;
- this.stereotypesRep = steWithPropToEdit;
- }
-
- /**
- *
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
- *
- * @param shell
- */
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if(title != null) {
- shell.setText(title);
- }
-
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- * we remove the CANCEL Button
- * @param parent
- */
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- *
- * @param parent
- * @return
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- // create composite
- Composite composite = (Composite)super.createDialogArea(parent);
- GridLayout layout = new GridLayout(5, false);
- composite.setLayout(layout);
- if(message != null) {
- Label titleLabel = new Label(composite, SWT.WRAP);
- titleLabel.setText(message);
- GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
- titleLabel.setLayoutData(data);
- }
-
- downButton = new Button(composite, SWT.NONE);
- downButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_DOWN));
- downButton.setEnabled(false);
- downButton.addMouseListener(new MouseListener() {
-
- public void mouseUp(MouseEvent e) {
- moveElement(MOVE_DOWN, tree);
- runtimeSelectionHasChange();
- }
-
- public void mouseDown(MouseEvent e) {
- }
-
- public void mouseDoubleClick(MouseEvent e) {
- }
- });
-
- upButton = new Button(composite, SWT.NONE);
- upButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_UP));
- upButton.setEnabled(false);
- upButton.addMouseListener(new MouseListener() {
-
- public void mouseUp(MouseEvent e) {
- moveElement(MOVE_UP, tree);
- runtimeSelectionHasChange();
- }
-
- public void mouseDown(MouseEvent e) {
- }
-
- public void mouseDoubleClick(MouseEvent e) {
-
- }
- });
-
- addButton = new Button(composite, SWT.NONE);
- addButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_ADD));
- addButton.setEnabled(false);
- addButton.addMouseListener(new MouseListener() {
-
- public void mouseUp(MouseEvent e) {
- // performedAddButtonRuntime(e);
- performAddButtonPressed(tree);
- tree.refresh();
- runtimeSelectionHasChange();
- }
-
- public void mouseDown(MouseEvent e) {
-
- }
-
- public void mouseDoubleClick(MouseEvent e) {
-
- }
- });
-
- removeButton = new Button(composite, SWT.NONE);
- removeButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_REMOVE));
- removeButton.setEnabled(false);
- removeButton.addMouseListener(new MouseListener() {
-
- public void mouseUp(MouseEvent e) {
- performRemoveAction(tree);
- runtimeSelectionHasChange();
- }
-
- public void mouseDown(MouseEvent e) {
-
- }
-
- public void mouseDoubleClick(MouseEvent e) {
-
- }
- });
-
- // create the tree
- tree = new TreeViewer(parent, SWT.BORDER | SWT.MULTI);
- // tree.setContentProvider(new
- // RuntimePropertiesStereotypeContentProvider());
- tree.setContentProvider(new StereotypeContentProvider());
- tree.getControl().setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
- createColumn(tree);
- tree.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- performSelectionChangeRuntime(event);
- }
- });
-
- tree.addDoubleClickListener(new IDoubleClickListener() {
-
- public void doubleClick(DoubleClickEvent event) {
-
- performDoubleClickAction(tree);
- runtimeSelectionHasChange();
- }
-
- });
-
- tree.getControl().addKeyListener(new KeyListener() {
-
- public void keyReleased(KeyEvent e) {
-
- }
-
- public void keyPressed(KeyEvent e) {
-
- if(e.keyCode == SWT.F2) {
- performF2Action(tree);
- } else if(e.character == SWT.DEL) {
- performRemoveAction(tree);
- } else if(e.stateMask == SWT.CTRL && e.keyCode == 110) {// e.character=='N'
- // doesn't
- // work
- // on
- // my
- // computer
- performCTRL_N_Action(e, tree);
- }
- runtimeSelectionHasChange();
- }
-
- });
- updateTreeViewer();
- tree.expandAll();
- return composite;
- }
-
- /**
- * create the column for the given
- *
- * @param viewer
- */
- protected void createColumn(TreeViewer viewer) {
- final TreeViewerColumn stereotypeColumn = new TreeViewerColumn(viewer, SWT.FILL);
- stereotypeColumn.getColumn().setResizable(true);
- stereotypeColumn.getColumn().setWidth(400);
- stereotypeColumn.setLabelProvider(editorLabelProvider);
- stereotypeColumn.setEditingSupport(new AttributeEditingSupport(viewer));
- }
-
- /**
- * update the TreevViewer
- */
- private void updateTreeViewer() {
- tree.setInput(stereotypesRep);
- runtimeSelectionHasChange();
- }
-
- /**
- * use to force the buttons's update
- */
- private void runtimeSelectionHasChange() {
- performSelectionChangeRuntime(new SelectionChangedEvent(this.tree, tree.getSelection()));
- }
-
- /**
- * this function updates the buttons status
- *
- * @param event
- */
- protected void performSelectionChangeRuntime(SelectionChangedEvent event) {
-
- ITreeSelection selection = (ITreeSelection)event.getSelection();
- int selectionSize = selection.size();
- if((selectionSize == 0) || !(sameLevelForFullSelection(selection))) {
- addButton.setEnabled(true);
- removeButton.setEnabled(false);
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- } else if(selectionSize == 1) {
- Object selectedElement = selection.getFirstElement();
- // removeButton state
- if(selectedElement instanceof StereotypeRepresentation) {
- removeButton.setEnabled(false);
- } else if(selectedElement instanceof PropertyRepresentation) {
- if(((PropertyRepresentation)selectedElement).getUpperMultiplicity() == 1) {
- removeButton.setEnabled(true);
- } else {
- removeButton.setEnabled(false);
- }
- } else if(selectedElement instanceof Value) {
- removeButton.setEnabled(true);
-
- }
-
- // addButton state
- if(selectedElement instanceof StereotypeRepresentation) {
- addButton.setEnabled(false);
- } else if(selectedElement instanceof PropertyRepresentation) {
- ArrayList<Value> values = ((PropertyRepresentation)selectedElement).getValues();
- Property prop = ((PropertyRepresentation)selectedElement).getUMLProperty();
- if(!prop.isMultivalued()) {
- if(values.size() == 0) {
- addButton.setEnabled(true);
- } else {
- addButton.setEnabled(false);
- }
- } else {// multi-valued property}
- int upper = prop.getUpper();
- if(upper == -1) {
- addButton.setEnabled(true);
- } else if(values.size() < upper) {
- addButton.setEnabled(true);
- } else {
- addButton.setEnabled(false);
- }
- }
- } else if(selectedElement instanceof Value) {
- addButton.setEnabled(false);
- }
- // upButton and downButton states
- if(selectedElement instanceof StereotypeRepresentation) {
- int index = stereotypesRep.indexOf(selectedElement);
- if(config.getStereotypesRepresentations().size() == 1) {
- downButton.setEnabled(false);
- upButton.setEnabled(false);
- } else if(index == 0) {
- downButton.setEnabled(true);
- upButton.setEnabled(false);
- } else if(index == stereotypesRep.indexOf(selectedElement) - 1) {
- downButton.setEnabled(false);
- upButton.setEnabled(true);
- } else {
- downButton.setEnabled(true);
- upButton.setEnabled(true);
- }
- } else if(selectedElement instanceof PropertyRepresentation) {
- downButton.setEnabled(false);
- upButton.setEnabled(false);
- } else if(selectedElement instanceof Value) {
- ArrayList<Value> valuesList = ((Value)selectedElement).getPropertyRepresentation().getValues();
- int index = valuesList.indexOf(selectedElement);
- if(valuesList.size() == 1) {
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- } else if(index == 0) {
- upButton.setEnabled(false);
- downButton.setEnabled(true);
- } else if(index == valuesList.size() - 1) {
- upButton.setEnabled(true);
- downButton.setEnabled(false);
- } else {
- upButton.setEnabled(true);
- downButton.setEnabled(true);
- }
- }
-
- } else {// all the elements are from the same level
-
- if(selection.getFirstElement() instanceof StereotypeRepresentation) {
- removeButton.setEnabled(true);
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- addButton.setEnabled(true);
- } else
-
- if(selection.getFirstElement() instanceof Value) {
- removeButton.setEnabled(true);
- upButton.setEnabled(false);
- downButton.setEnabled(false);
- addButton.setEnabled(false);
- }
- }
- }
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.palette.PaletteEntry;
+import org.eclipse.gef.palette.ToolEntry;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.util.DisplayUtils;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.CellLabelProvider;
+import org.eclipse.jface.viewers.CheckboxCellEditor;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.ComboBoxCellEditor;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TextCellEditor;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.TreeViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.papyrus.uml.diagram.common.commands.ApplyStereotypeCommand;
+import org.eclipse.papyrus.uml.diagram.common.commands.DefferedAppliedStereotypeToDisplayCommand;
+import org.eclipse.papyrus.uml.diagram.common.part.PaletteUtil;
+import org.eclipse.papyrus.uml.diagram.common.service.ApplyStereotypeRequest;
+import org.eclipse.papyrus.uml.diagram.common.ui.dialogs.PropertyEditors;
+import org.eclipse.papyrus.uml.diagram.common.util.Util;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.PrimitiveType;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * Aspect action that applies stereotypes on the edit part newly created
+ *
+ * /!\ WARNING use the setters and getters for manipulating the {@link #propertiesToUpdate} and {@link #valuesToProperties}
+ *
+ *
+ */
+public class StereotypePostAction extends ModelPostAction {
+
+ /*
+ * the icons paths
+ */
+ /** up icon path */
+ protected static final String ICONS_UP = "/icons/arrow_up.gif"; //$NON-NLS-1$
+
+ /** down icon path */
+ protected static final String ICONS_DOWN = "/icons/arrow_down.gif"; //$NON-NLS-1$
+
+ /** add icon path */
+ protected static final String ICONS_ADD = "/icons/obj16/Add_16x16.gif"; //$NON-NLS-1$
+
+ /** remove icon path */
+ protected static final String ICONS_REMOVE = "/icons/delete.gif"; //$NON-NLS-1$
+
+ /** stereotype icon path */
+ protected static final String ICON_STEREOTYPE = "/icons/stereotype.gif"; //$NON-NLS-1$
+
+ /** profile icon path */
+ protected static final String ICON_PROFILE = "/icons/profile.gif"; //$NON-NLS-1$
+
+ /** property icon path */
+ protected static final String ICON_PROPERTY = "/icons/property.gif"; //$NON-NLS-1$
+
+ /** metaclass icon path */
+ protected static final String ICON_METACLASS = "/icons/Metaclass.gif"; //$NON-NLS-1$
+
+ /** boolean icon path */
+ protected static final String ICON_LITERALBOOLEAN = "/icons/LiteralBoolean.gif"; //$NON-NLS-1$
+
+ /** integer icon path */
+ protected static final String ICON_LITERALINTEGER = "/icons/LiteralInteger.gif"; //$NON-NLS-1$
+
+ /** integer icon path */
+ protected static final String ICON_LITERALREAL = "/icons/LiteralReal.gif"; //$NON-NLS-1$
+
+ /** string icon path */
+ protected static final String ICON_LITERALSTRING = "/icons/LiteralString.gif"; //$NON-NLS-1$
+
+ /** unlimited natural icon path */
+ protected static final String ICON_LITERALUNLIMITEDNATURAL = "/icons/LiteralUnlimitedNatural.gif"; //$NON-NLS-1$
+
+ /** unknown icon path */
+ protected static final String ICON_UNKNOWN = "/icons/Clause.gif"; //$NON-NLS-1$
+
+ /** enumeration icon path */
+ protected static final String ICON_ENUMERATION = "/icons/Enumeration.gif"; //$NON-NLS-1$
+
+ /** datatype icon path */
+ protected static final String ICON_DATATYPE = "/icons/DataType.gif"; //$NON-NLS-1$
+
+ /** the configuration for the palette element */
+ protected Configuration config;
+
+ /**
+ * Separator for displaying the different values owned by a multi-valued
+ * property
+ */
+ protected static final String SEPARATOR = ", "; //$NON-NLS-1$
+
+ /** viewer to display stereotypes to apply */
+ protected TreeViewer stereotypesViewer;
+
+ /** entry proxy "parent" of this action when configuring the action */
+ protected IPaletteEntryProxy entryProxy;
+
+ /** editor label provider */
+ protected EditorLabelProvider editorLabelProvider = new EditorLabelProvider();
+
+ /** editor content provider */
+ protected StereotypeContentProvider stereotypeContentProvider = new StereotypeContentProvider();
+
+ /*
+ * the buttons
+ */
+
+ /** remove button */
+ protected Button removeButton;
+
+ /** add button */
+ protected Button addButton;
+
+ /** up button */
+ protected Button upButton;
+
+ /** down button */
+ protected Button downButton;
+
+ /** string used with the upButton */
+ public static final String MOVE_DOWN = "move down"; //$NON-NLS-1$
+
+ /** string used with the downButton */
+ public static final String MOVE_UP = "move up"; //$NON-NLS-1$
+
+ /** contains the expanded nodes */
+ private Object[] expandedElements = null;
+
+ /** constant to identify the type of a Boolean property */
+ final static public String UMLPrimitiveTypes_BOOLEAN = "PrimitiveTypes::Boolean"; //$NON-NLS-1$
+
+ /** constant to identify the type of an Integer property */
+ final static public String UMLPrimitiveTypes_INTEGER = "PrimitiveTypes::Integer"; //$NON-NLS-1$
+
+ /** constant to identify the type of a String property */
+ final static public String UMLPrimitiveTypes_STRING = "PrimitiveTypes::String"; //$NON-NLS-1$
+
+ /** constant to identify the type of an Unlimited Natural property */
+ final static public String UMLPrimitiveTypes_UNLIMITED_NATURAL = "PrimitiveTypes::UnlimitedNatural"; //$NON-NLS-1$
+
+ /** constant to identify the type of an Unlimited Natural property */
+ final static public String UMLPrimitiveTypes_REAL = "PrimitiveTypes::Real"; //$NON-NLS-1$
+
+ /** path to the checked box image */
+ protected final static String ICON_CHECKED = "/icons/complete_tsk.gif"; //$NON-NLS-1$
+
+ /** path to the unchecked box image */
+ protected final static String ICON_UNCHECKED = "/icons/incomplete_tsk.gif"; //$NON-NLS-1$
+
+ /** the column for the stereotypes */
+ private TreeViewerColumn stereotypeColumn = null;
+
+ /** the column with the checkboxes for the runtime properties */
+ private TreeViewerColumn runtimeColumn = null;
+
+ private ArrayList<Value> savedValues;
+
+ /**
+ * Constructor.
+ */
+ public StereotypePostAction() {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IStatus checkPostCondition() {
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public IStatus checkPreCondition() {
+ return Status.OK_STATUS;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.service.palette.ModelPostAction#init(org.w3c.dom.Node,
+ * org.eclipse.papyrus.uml.diagram.common.service.palette.IAspectActionProvider)
+ *
+ * @param configurationNode
+ * @param factory
+ */
+ @Override
+ public void init(Node configurationNode, IAspectActionProvider factory) {
+ super.init(configurationNode, factory);
+ config = new Configuration(configurationNode);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void save(Node parentNode) {
+ if(parentNode instanceof Element) {
+ config.save(parentNode);
+ } else {
+ Activator.log.error("parent node is not an Element", null); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ICommand getPostCommand(IAdaptable viewAdapter) {
+ // so, we doesn't need to save the default values which can be modified
+ // during the runtime
+ config = new Configuration(config.getConfigurationNode());
+
+ final TransactionalEditingDomain editingDomain = EditorUtils.getTransactionalEditingDomain();
+
+ CompositeTransactionalCommand cmd = new CompositeTransactionalCommand (editingDomain, "Apply stereotype");
+
+ // Apply the required stereotypes
+ final ApplyStereotypeRequest request = new ApplyStereotypeRequest(viewAdapter, config.getStereotypesToApplyQN(), true);
+
+ cmd.add(new ApplyStereotypeCommand(editingDomain, request));
+
+ // 2. display stereotypes
+ cmd.add(new EMFtoGMFCommandWrapper(new DefferedAppliedStereotypeToDisplayCommand(editingDomain, viewAdapter, "")));
+
+ AbstractTransactionalCommand setPropertiesCommand = new AbstractTransactionalCommand(editingDomain, "Set stereotype values", null) {
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ // we search the container for the object
+ org.eclipse.uml2.uml.Element element = request.getElement();
+ org.eclipse.uml2.uml.Element packageContainer = element;
+ do {
+ packageContainer = packageContainer.getOwner();
+ } while(!(packageContainer instanceof org.eclipse.uml2.uml.Package) && packageContainer != null);
+
+
+ config.setAppliedProfiles(((org.eclipse.uml2.uml.Package)packageContainer).getAllAppliedProfiles());
+
+ if(config.hasRuntimeProperties()) {
+ defineRuntimeProperties(config);
+ }
+
+ ArrayList<StereotypeRepresentation> stereotypes = config.getStereotypesRepresentations();
+ for(StereotypeRepresentation stereotype : stereotypes) {
+ final Stereotype stereotypeToEdit = stereotype.getUMLStereotype();
+ ArrayList<PropertyRepresentation> properties = stereotype.getPropertiesWithValues();
+ for(PropertyRepresentation property : properties) {
+ if(property.hasValues()) {
+ Type type = property.getType();
+ final String propertyName = property.getUMLProperty().getName();
+ if(type != null && propertyName != null) {
+ Object newValue = null;
+ if(type instanceof PrimitiveType) {
+ newValue = Util.getValueFromString(property.getUMLProperty(), property.getStringValue());
+ } else if(Util.isMetaclass(type)) {
+ newValue = Util.retrievesMetaclassElementFromString(property.getUMLProperty(), property.getStringValue(), packageContainer);
+ // property is an Enumeration
+ } else if(type instanceof org.eclipse.uml2.uml.Enumeration) {
+ newValue = Util.retrievesEnumerationLiteralFromString(property.getUMLProperty(), property.getStringValue(), packageContainer);
+ // property is a DataType
+ } else if(type instanceof org.eclipse.uml2.uml.DataType) {
+ newValue = Util.getValueFromString(property.getUMLProperty(), property.getStringValue());
+ // property is a Stereotype
+ } else if(type instanceof Stereotype) {
+ newValue = Util.retrievesStereotypedElementFromString(property.getUMLProperty(), property.getStringValue(), packageContainer);
+ // property is a composite class
+ } else if((type instanceof org.eclipse.uml2.uml.Class) && !(type instanceof Stereotype) && property.getUMLProperty().isMultivalued()) {
+ // TODO
+ newValue = null;
+ } else {
+ Activator.log.error("impossible to find a correct editor for the property" + property, null); //$NON-NLS-1$
+ }
+
+ if (newValue != null) {
+ element.setValue(stereotypeToEdit, propertyName, newValue);
+ }
+
+ }
+ }
+ }
+ }
+ return CommandResult.newOKCommandResult();
+ }
+ };
+
+ cmd.add(setPropertiesCommand);
+
+ return cmd;
+ }
+
+ private void saveValues() {
+ savedValues = new ArrayList<Value>();
+ for(StereotypeRepresentation steRep : config.getStereotypesRepresentations()) {
+ if(steRep.hasRuntimeProperties()) {
+ for(PropertyRepresentation propRep : steRep.getRuntimeProperties()) {
+ for(Value value : propRep.getValues()) {
+ Value newVal = new Value(value);
+ newVal.setPropertyRepresentation(propRep);
+ savedValues.add(newVal);
+ }
+ }
+ }
+ }
+
+ }
+
+ private void restoreValues() {
+ for(Value val : savedValues) {
+
+ }
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Control createConfigurationComposite(Composite parent, IPaletteEntryProxy entryProxy, List<Profile> appliedProfiles) {
+ config.setAppliedProfiles(appliedProfiles);
+ this.entryProxy = entryProxy;
+
+ Composite mainComposite = new Composite(parent, SWT.BORDER);
+ GridLayout layout = new GridLayout(5, false);
+ mainComposite.setLayout(layout);
+
+ Label titleLabel = new Label(mainComposite, SWT.NONE);
+ titleLabel.setText("Stereotypes to Apply"); //$NON-NLS-1$
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
+ titleLabel.setLayoutData(data);
+
+ addButton = new Button(mainComposite, SWT.NONE);
+ addButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_ADD));
+ addButton.addMouseListener(new MouseListener() {
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseUp(MouseEvent e) {
+ performAddButtonPressed(stereotypesViewer);
+ selectionHasChange();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseDown(MouseEvent e) {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseDoubleClick(MouseEvent e) {
+
+ }
+ });
+
+ removeButton = new Button(mainComposite, SWT.NONE);
+ removeButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_REMOVE));
+ removeButton.addMouseListener(new MouseListener() {
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseUp(MouseEvent e) {
+ performRemoveAction(stereotypesViewer);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseDown(MouseEvent e) {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseDoubleClick(MouseEvent e) {
+
+ }
+ });
+ removeButton.setEnabled(false);
+
+ upButton = new Button(mainComposite, SWT.NONE);
+ upButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_UP));
+ upButton.addMouseListener(new MouseListener() {
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseUp(MouseEvent e) {
+ moveElement(MOVE_UP, stereotypesViewer);
+ selectionHasChange();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseDown(MouseEvent e) {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseDoubleClick(MouseEvent e) {
+
+ }
+ });
+ upButton.setEnabled(false);
+
+ downButton = new Button(mainComposite, SWT.NONE);
+ downButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_DOWN));
+ downButton.addMouseListener(new MouseListener() {
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseUp(MouseEvent e) {
+ moveElement(MOVE_DOWN, stereotypesViewer);
+ selectionHasChange();
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseDown(MouseEvent e) {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void mouseDoubleClick(MouseEvent e) {
+
+ }
+ });
+ downButton.setEnabled(false);
+
+ // stereotype viewer creation
+ stereotypesViewer = new TreeViewer(mainComposite, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ data = new GridData(SWT.FILL, SWT.FILL, true, true);
+ data.horizontalSpan = 5;
+
+ stereotypesViewer.getControl().setLayoutData(data);
+ stereotypesViewer.setContentProvider(stereotypeContentProvider);
+ stereotypesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ performSelectionChange(event);
+
+ }
+ });
+
+ stereotypesViewer.getControl().addKeyListener(new KeyListener() {
+
+ public void keyReleased(KeyEvent e) {
+
+ }
+
+ public void keyPressed(KeyEvent e) {
+ if(e.keyCode == SWT.F2) {
+ performF2Action(stereotypesViewer);
+ } else if(e.character == SWT.DEL) {
+ performRemoveAction(stereotypesViewer);
+ } else if(e.stateMask == SWT.CTRL && e.keyCode == 110) {// e.character=='N'
+ // doesn't
+ // work
+ performCTRL_N_Action(e, stereotypesViewer);
+ }
+ selectionHasChange();
+ }
+ });
+
+ /*
+ * we can't do : stereotypesViewer.addDoubleClickListener, because we
+ * can't know on which column we are to make something or nothing!
+ */
+ stereotypesViewer.getControl().addMouseListener(new MouseListener() {
+
+ public void mouseUp(MouseEvent e) {
+ }
+
+ public void mouseDown(MouseEvent e) {
+ }
+
+ public void mouseDoubleClick(MouseEvent e) {
+ if(stereotypeColumn != null) {
+ if(e.x < stereotypeColumn.getColumn().getWidth()) {// we
+ // are
+ // on
+ // the
+ // stereotype
+ // column
+ performDoubleClickAction(stereotypesViewer);
+ } else {// change the property value
+ ViewerCell cell = runtimeColumn.getViewer().getCell(new Point(e.x, e.y));
+ if(cell != null) {
+ Object element = ((TreeSelection)stereotypesViewer.getSelection()).getFirstElement();
+ stereotypesViewer.editElement(element, 1);
+ }
+ }
+ }
+ }
+ });
+ createColumn(stereotypesViewer);
+ updateStereotypeViewer();
+ return mainComposite;
+
+ }
+
+ /**
+ * Create the necessary columns to have CellEditor in the tree
+ *
+ * @param viewer
+ * the viewer owning the columns
+ */
+ protected void createColumn(TreeViewer viewer) {
+ stereotypeColumn = new TreeViewerColumn(viewer, SWT.FILL);
+ stereotypeColumn.getColumn().setResizable(true);
+ stereotypeColumn.getColumn().setWidth(300);
+ stereotypeColumn.setLabelProvider(editorLabelProvider);
+ stereotypeColumn.setEditingSupport(new AttributeEditingSupport(viewer));
+
+ runtimeColumn = new TreeViewerColumn(viewer, SWT.CENTER);
+ runtimeColumn.getColumn().setText("Runtime"); //$NON-NLS-1$
+ runtimeColumn.getColumn().setResizable(true);
+ runtimeColumn.getColumn().setWidth(80);
+ runtimeColumn.setLabelProvider(new RuntimeLabelProvider());
+ runtimeColumn.setEditingSupport(new RuntimeEditingSupport(viewer));
+
+ viewer.getTree().setLinesVisible(true);
+ viewer.getTree().setHeaderVisible(true);
+ }
+
+ /**
+ * updates the stereotype viewer set the expandedNode refresh the status
+ * button this method is called by
+ * <ul>
+ * <li>
+ * {@link #createConfigurationComposite(Composite, PaletteEntryProxy, List)}</li>
+ * <li> {@link #performAddButtonPressed(TreeViewer)} when we add or remove stereotypes</li>
+ * </ul>
+ */
+ protected void updateStereotypeViewer() {
+ if(stereotypesViewer != null) {
+ saveExpandedNode();
+ stereotypesViewer.setInput(config.getStereotypesRepresentations());
+ restoreExpandedNode();
+ }
+ }
+
+ /**
+ * used to force the buttons update
+ */
+ protected void selectionHasChange() {
+ performSelectionChange(new SelectionChangedEvent(stereotypesViewer, stereotypesViewer.getSelection()));
+ }
+
+ /**
+ * Action done when the add button is pressed
+ *
+ * @param tree
+ *
+ */
+ protected void performAddButtonPressed(TreeViewer tree) {
+ TreeSelection selection = (TreeSelection)tree.getSelection();
+ Object selectedElement = selection.getFirstElement();
+ if(selection != null && selection.size() == 1 && !(selectedElement instanceof StereotypeRepresentation)) {
+ if(selectedElement instanceof PropertyRepresentation) {
+ // We want add a value to a multi-valued property or edit a
+ // value to a mono-valued property
+ PropertyRepresentation prop = (PropertyRepresentation)selectedElement;
+ if(prop.getUpperMultiplicity() != 1) {
+ editMe(prop, null);// we add a value
+ } else if(!prop.getValues().isEmpty()) { // mono-valued
+ // property and the
+ // valu exists
+ editMe(prop, prop.getValues().get(0));
+ } else {// monovalued property, the value doesn't exist
+ editMe(prop, null);
+ }
+ tree.refresh(selectedElement);
+ }
+ return;
+ }
+
+ // pops-up a dialog window where users can select the additionnal
+ // stereotypes to apply
+ // it needs the metaclass information...
+ // for this, entry Proxy should be a Palette entry proxy
+ if(!(entryProxy instanceof IPaletteAspectToolEntryProxy)) {
+ return;
+ }
+
+ PaletteEntry entry = ((IPaletteAspectToolEntryProxy)entryProxy).getEntry();
+ if(!(entry instanceof ToolEntry)) {
+ return;
+ }
+
+ // this is a PaletteAspectToolEntryProxy
+ // try to find the metaclass on which the element is working
+ EClass metaClass = PaletteUtil.getToolMetaclass((ToolEntry)entry);
+
+ if(metaClass == null) {
+ Activator.log.error("Impossible to find metaclass", null); //$NON-NLS-1$
+ return;
+ }
+
+ // retrieve the original stereotype list from the qualified names
+ List<Stereotype> stereotypeList = config.getUMLStereotypes();// retrieveStereotypesFromQualifiedNames();
+
+ // we have all applied profiles, the list of already applied
+ // stereotypes, the metaclass of the created element...
+ // just have to open a selection dialog
+ final CheckedTreeSelectionDialog selectionDialog = new CheckedTreeSelectionDialog(DisplayUtils.getDisplay().getActiveShell(), editorLabelProvider, new ProfileContentProvider(metaClass));
+ selectionDialog.setTitle(Messages.StereotypePostAction_StereotypeSelectionTitle);
+ selectionDialog.setMessage(Messages.StereotypePostAction_StereotypeSelectionMessage);
+ selectionDialog.setContainerMode(true);
+ selectionDialog.setInitialElementSelections(stereotypeList);
+ selectionDialog.setInput(config.getAppliedProfiles());
+ selectionDialog.setExpandedElements(config.getAppliedProfiles().toArray());
+
+ ViewerComparator comparator = new ViewerComparator();
+ selectionDialog.setComparator(comparator);
+
+ if(CheckedTreeSelectionDialog.OK == selectionDialog.open()) {
+ // update the list of stereotype to apply
+ Object[] result = selectionDialog.getResult();
+ ArrayList<String> stereotypesToApply = new ArrayList<String>();
+ for(int i = 0; i < result.length; i++) {
+ if(result[i] instanceof Stereotype) {
+ stereotypesToApply.add(((Stereotype)result[i]).getQualifiedName());
+
+ }
+ }
+ config.setStereotypesRepresentations(stereotypesToApply);
+ // it's not possible to use refresh or update here!
+ updateStereotypeViewer();
+ }
+
+ }
+
+ /**
+ * Action done when the remove button is pressed
+ *
+ * @param viewer
+ * the viewer on which the remove action is applied
+ */
+ protected void performRemoveAction(TreeViewer viewer) {
+
+ ITreeSelection selection = (ITreeSelection)viewer.getSelection();
+ if(selection != null) {
+ List<?> selectedElements = ((TreeSelection)selection).toList();
+ if(sameLevelForFullSelection(selection)) {
+ // all the element have the same type
+ if(selection.getFirstElement() instanceof StereotypeRepresentation) {
+ for(Object object : selectedElements) {
+ if(object instanceof StereotypeRepresentation) {
+ config.removeStereotype((StereotypeRepresentation)object);
+ }
+ }
+
+ } else if(selection.getFirstElement() instanceof PropertyRepresentation) {
+ // we delete the value for mono-valued property
+ for(Object object : selectedElements) {
+ if(object instanceof PropertyRepresentation) {
+ if(!((PropertyRepresentation)object).getUMLProperty().isMultivalued()) {
+ ((PropertyRepresentation)object).getValues().remove(0);
+ }
+ }
+ }
+ } else if(selection.getFirstElement() instanceof Value) {
+ // we remove value from a multivalued property
+ for(Object object : selectedElements) {
+ if(object instanceof Value) {
+ ((Value)object).getPropertyRepresentation().removeValue((Value)object);
+ }
+ }
+ }
+ viewer.refresh();
+ }
+ }
+ }
+
+ /**
+ * Action to do when the F2 key is pressed
+ * <ul>
+ * <li>open a CellEditor for the PrimitiveType and DataType</li>
+ * <li>open a popup editor for others types</li>
+ * </ul>
+ *
+ * @param viewer
+ * the viewer on which the F2 action is applied
+ */
+ protected void performF2Action(TreeViewer viewer) {
+
+ TreeSelection selection = (TreeSelection)viewer.getSelection();
+ if((selection != null) && (selection.size() == 1)) {
+ Object objectToEdit = selection.getFirstElement();
+ if(objectToEdit instanceof PropertyRepresentation) {
+ Property prop = ((PropertyRepresentation)objectToEdit).getUMLProperty();
+ if(prop.isMultivalued() == false) {
+ if((prop.getType() instanceof PrimitiveType) || (prop.getType() instanceof DataType)) {
+ viewer.editElement(prop, 0);
+ } else {
+ // TODO
+ }
+ }
+ } else if(objectToEdit instanceof Value) {
+ PropertyRepresentation propRep = ((Value)objectToEdit).getPropertyRepresentation();
+ Type type = propRep.getType();
+ if(type != null) {
+ if(type instanceof PrimitiveType || type instanceof DataType) {
+ viewer.editElement(objectToEdit, 0);
+
+ // the refresh is do by the cellEditor! (if the resfresh
+ // is do here, there is a bug!)
+ // viewer.refresh(property);
+ } else {// popupEditor
+ editMe(propRep, (Value)objectToEdit);
+ viewer.refresh(propRep);
+ }
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Action done when a DoubleClick is received by the tree
+ *
+ * @param viewer
+ * the viewer on which the DoubleClick action is applied
+ */
+ protected void performDoubleClickAction(TreeViewer viewer) {
+
+ TreeSelection selection = (TreeSelection)viewer.getSelection();
+ if(selection != null && selection.size() == 1) {
+ Object selectedObject = selection.getFirstElement();
+ if(selectedObject instanceof StereotypeRepresentation) {
+ // we expand or collapse the node
+ viewer.setExpandedState(selectedObject, !viewer.getExpandedState(selectedObject));
+ } else if(selectedObject instanceof PropertyRepresentation) {
+ Property prop = ((PropertyRepresentation)selectedObject).getUMLProperty();
+ if(prop.isMultivalued()) {
+ // we expand or collapse the node
+ viewer.setExpandedState(selectedObject, !viewer.getExpandedState(selectedObject));
+ } else {
+ // we edit a value
+ if(((PropertyRepresentation)selectedObject).getValues().isEmpty()) {
+ editMe((PropertyRepresentation)selectedObject, null);
+ } else {
+ editMe((PropertyRepresentation)selectedObject, ((PropertyRepresentation)selectedObject).getValues().get(0));
+ }
+
+ viewer.update(selectedObject, null);
+ }
+ } else if(selectedObject instanceof Value) {
+ editMe(((Value)selectedObject).getPropertyRepresentation(), (Value)selectedObject);
+ viewer.refresh(selectedObject);
+ }
+ }
+ }
+
+ /**
+ * Action done when the user does a CTRL^N on the tree
+ *
+ * @param e
+ * the KeyEvent
+ * @param viewer
+ * the TreeViewer in which we add something
+ */
+ protected void performCTRL_N_Action(KeyEvent e, TreeViewer viewer) {
+
+ TreeSelection selection = (TreeSelection)viewer.getSelection();
+ if(selection != null && selection.size() == 1) {
+ Object selectedObject = selection.getFirstElement();
+ if(selectedObject != null) {
+ if(selectedObject instanceof PropertyRepresentation) {
+ Property property = ((PropertyRepresentation)selectedObject).getUMLProperty();
+ if(property.isMultivalued()) {
+ // can we add a new value?
+ int upperMultiplicity = property.getUpper();
+ ArrayList<Value> values = ((PropertyRepresentation)selectedObject).getValues();
+ if(upperMultiplicity == -1 || values.size() < upperMultiplicity) {
+ editMe((PropertyRepresentation)selectedObject, null);
+ } else if(values.size() == 0) {
+ editMe((PropertyRepresentation)selectedObject, null);
+ }
+ viewer.refresh(selectedObject);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Set the {@link Button#setEnabled(boolean)} parameter to true or false for
+ * the buttons following the selected element in the {@link StereotypePostAction#stereotypeViewer}
+ * <ul>
+ * <li> {@link StereotypePostAction#addButton}</li>
+ * <li> {@link StereotypePostAction#removeButton}</li>
+ * <li> {@link StereotypePostAction#upButton}</li>
+ * <li> {@link StereotypePostAction#downButton}</li>
+ * </ul>
+ *
+ * @param event
+ * the SelectionChangeEvent
+ */
+ protected void performSelectionChange(SelectionChangedEvent event) {
+ ITreeSelection selection = (ITreeSelection)event.getSelection();
+ int selectionSize = selection.size();
+ if((selectionSize == 0) || !(sameLevelForFullSelection(selection))) {
+ addButton.setEnabled(true);
+ removeButton.setEnabled(false);
+ upButton.setEnabled(false);
+ downButton.setEnabled(false);
+ } else if(selectionSize == 1) {
+ Object selectedElement = selection.getFirstElement();
+ // removeButton state
+ if(selectedElement instanceof StereotypeRepresentation) {
+ removeButton.setEnabled(true);
+ } else if(selectedElement instanceof PropertyRepresentation) {
+ if(((PropertyRepresentation)selectedElement).getUpperMultiplicity() == 1) {
+ removeButton.setEnabled(true);
+ } else {
+ removeButton.setEnabled(false);
+ }
+ } else if(selectedElement instanceof Value) {
+ removeButton.setEnabled(true);
+
+ }
+
+ // addButton state
+ if(selectedElement instanceof StereotypeRepresentation) {
+ addButton.setEnabled(true);
+ } else if(selectedElement instanceof PropertyRepresentation) {
+ ArrayList<Value> values = ((PropertyRepresentation)selectedElement).getValues();
+ Property prop = ((PropertyRepresentation)selectedElement).getUMLProperty();
+ if(!prop.isMultivalued()) {
+ if(values.size() == 0) {
+ addButton.setEnabled(true);
+ } else {
+ addButton.setEnabled(false);
+ }
+ } else {// multi-valued property}
+ int upper = prop.getUpper();
+ if(upper == -1) {
+ addButton.setEnabled(true);
+ } else if(values.size() < upper) {
+ addButton.setEnabled(true);
+ } else {
+ addButton.setEnabled(false);
+ }
+ }
+ } else if(selectedElement instanceof Value) {
+ addButton.setEnabled(false);
+ }
+ // upButton and downButton states
+ if(selectedElement instanceof StereotypeRepresentation) {
+ int index = config.getStereotypesRepresentations().indexOf(selectedElement);
+ if(config.getStereotypesRepresentations().size() == 1) {
+ downButton.setEnabled(false);
+ upButton.setEnabled(false);
+ } else if(index == 0) {
+ downButton.setEnabled(true);
+ upButton.setEnabled(false);
+ } else if(index == config.getStereotypesRepresentations().size() - 1) {
+ downButton.setEnabled(false);
+ upButton.setEnabled(true);
+ } else {
+ downButton.setEnabled(true);
+ upButton.setEnabled(true);
+ }
+ } else if(selectedElement instanceof PropertyRepresentation) {
+ downButton.setEnabled(false);
+ upButton.setEnabled(false);
+ } else if(selectedElement instanceof Value) {
+ ArrayList<Value> valuesList = ((Value)selectedElement).getPropertyRepresentation().getValues();
+ int index = valuesList.indexOf(selectedElement);
+ if(valuesList.size() == 1) {
+ upButton.setEnabled(false);
+ downButton.setEnabled(false);
+ } else if(index == 0) {
+ upButton.setEnabled(false);
+ downButton.setEnabled(true);
+ } else if(index == valuesList.size() - 1) {
+ upButton.setEnabled(true);
+ downButton.setEnabled(false);
+ } else {
+ upButton.setEnabled(true);
+ downButton.setEnabled(true);
+ }
+ }
+
+ } else {// all the elements are from the same level
+
+ List<?> selectedElements = ((TreeSelection)selection).toList();
+ if(selection.getFirstElement() instanceof StereotypeRepresentation) {
+ removeButton.setEnabled(true);
+ upButton.setEnabled(false);
+ downButton.setEnabled(false);
+ addButton.setEnabled(true);
+ } else
+
+ if(selection.getFirstElement() instanceof Value) {
+ removeButton.setEnabled(true);
+ upButton.setEnabled(false);
+ downButton.setEnabled(false);
+ addButton.setEnabled(false);
+ }
+ }
+ }
+
+ /**
+ * move the selected element in stereotypeViewer following shiftValue
+ *
+ *
+ *
+ * @param shiftValue
+ * shiftValue can take the values :
+ * <ul>
+ * <li>{@link StereotypePostAction#MOVE_UP}</li>
+ * <li>{@link StereotypePostAction#MOVE_DOWN}</li>
+ * </ul>
+ * @param viewer
+ * the TreeViewer in which we move elements
+ *
+ */
+ protected void moveElement(String shiftValue, TreeViewer viewer) {
+
+ TreeSelection selection = (TreeSelection)viewer.getSelection();
+ if(selection != null && selection.size() == 1) {
+ Object selectedElement = selection.getFirstElement();
+ if(selectedElement instanceof Value) {
+
+ /** it's a property value */
+ exchangeTwoValues(((Value)selectedElement).getPropertyRepresentation().getValues(), selectedElement, shiftValue);
+
+ viewer.refresh(((Value)selectedElement).getPropertyRepresentation());
+
+ } else if(selectedElement instanceof StereotypeRepresentation) {
+ /** it's a stereotype */
+ exchangeTwoValues(config.getStereotypesRepresentations(), selectedElement, shiftValue);
+ viewer.refresh();
+ }
+ }
+ }
+
+ /**
+ * Exchange the selectedElement with its neighbor, in arrayList, up or down
+ * following shiftValue
+ *
+ *
+ * @param arrayList
+ * the ArrayList containing the elements to move
+ * @param selectedElement
+ * the element to move
+ * @param shiftValue
+ * shiftValue can take the values :
+ * <ul>
+ * <li>{@link StereotypePostAction#MOVE_UP}</li>
+ * <li>{@link StereotypePostAction#MOVE_DOWN}</li>
+ * </ul>
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ protected void exchangeTwoValues(ArrayList arrayList, Object selectedElement, String shiftValue) {
+ int index = getIndexOf(arrayList, selectedElement);
+ /**
+ * is it possible to move the objects ?
+ */
+ if(arrayList == null || arrayList.size() < 2) {
+ // the list is to small
+ return;
+ }
+ if((shiftValue.equals(MOVE_UP) && index == 0) || (shiftValue.equals(MOVE_DOWN) && arrayList.size() == (index + 1))) {
+ // the selected element is already the first or the last
+ return;
+ }
+
+ if(shiftValue.equals(MOVE_DOWN)) {
+ arrayList.set(index, arrayList.get(index + 1));
+ arrayList.set(index + 1, selectedElement);
+
+ } else if(shiftValue.equals(MOVE_UP)) {
+ arrayList.set(index, arrayList.get(index - 1));
+ arrayList.set(index - 1, selectedElement);
+ }
+ }
+
+ /**
+ * test if all the selected element in the selection are fron the same level
+ *
+ * @param selection
+ * @return <ul>
+ * <li>{@code true} if all the element are from the same level in the tree</li>
+ * <li>{@code false if not}</li>
+ * </ul>
+ *
+ */
+ protected boolean sameLevelForFullSelection(ITreeSelection selection) {
+ // ITreeSelection selection =
+ // (ITreeSelection)stereotypesViewer.getSelection();
+ // we do the delete action, only if all the elements have the same level
+ List<?> selectedElements = ((TreeSelection)selection).toList();
+ if(!selectedElements.isEmpty()) {
+ TreePath[] path = selection.getPathsFor(selectedElements.get(0));
+ if(path != null) {
+ // the level for the first selected Element
+ int level = path[0].getSegmentCount();
+ for(Object object : selectedElements) {
+ path = selection.getPathsFor(object);
+ if(level != path[0].getSegmentCount()) {
+ /**
+ * the selection is a mixed between different types of
+ * elements
+ */
+ return false;
+ }
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns the list of stereotypes applied by this action
+ *
+ * @return the list of stereotypes applied by this action
+ */
+ public List<String> getStereotypesToApply() {
+ return config.getStereotypesToApplyQN();
+ }
+
+ /**
+ * This class provides the methods for displaying the stereotypeViewer's
+ * column. This class gives the correct Label and it's {@link Image} to
+ * display for each element
+ *
+ *
+ */
+ protected class EditorLabelProvider extends CellLabelProvider implements ILabelProvider {
+
+ /**
+ * @see org.eclipse.jface.viewers.CellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell)
+ *
+ * @param cell
+ */
+
+ @Override
+ public void update(ViewerCell cell) {
+ cell.setText(getText(cell.getElement()));
+ cell.setImage(getImage(cell.getElement()));
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getText(Object element) {
+ if(element instanceof Profile) {
+ return ((Profile)element).getLabel();
+ } else if(element instanceof Stereotype) {
+ return ((Stereotype)element).getLabel();
+ } else if(element instanceof StereotypeRepresentation) {
+ return ((StereotypeRepresentation)element).getStereotypeQualifiedName();
+ } else if(element instanceof Value) {
+ return ((Value)element).getValue();
+ } else if(element instanceof PropertyRepresentation) {
+ return ((PropertyRepresentation)element).getLabel();
+ }
+ return element.toString();
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+
+ public Image getImage(Object element) {
+ if(element instanceof StereotypeRepresentation) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_STEREOTYPE);
+ } else if(element instanceof PropertyRepresentation) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_PROPERTY);
+ } else if(element instanceof Value) {
+ Property property = ((Value)element).getPropertyRepresentation().getUMLProperty();
+ Type type = property.getType();
+ if(type != null) {
+ if(type instanceof PrimitiveType) {
+ String typeName = type.getQualifiedName();
+ // property is a boolean property
+
+ if(UMLPrimitiveTypes_BOOLEAN.equals(typeName)) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_LITERALBOOLEAN);
+
+ // property is a String
+ } else if(UMLPrimitiveTypes_STRING.equals(typeName)) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_LITERALSTRING);
+
+ // property is an Integer
+ } else if(UMLPrimitiveTypes_INTEGER.equals(typeName)) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_LITERALINTEGER);
+
+ // property is an unlimitedNatural
+ } else if(UMLPrimitiveTypes_REAL.equals(typeName)) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_LITERALREAL);
+
+ // property is an unlimitedNatural
+ } else if(UMLPrimitiveTypes_UNLIMITED_NATURAL.equals(typeName)) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_LITERALUNLIMITEDNATURAL);
+ // property is a user primitive Type
+ } else {
+ // never used!
+ // newVTO = new
+ // UserPrimitiveTypeValueTreeObject(parent,
+ // newValue, domain);
+ }
+
+ // property is a Metaclass property
+ } else if(Util.isMetaclass(type)) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_METACLASS);
+
+ // property is an Enumeration
+ } else if(type instanceof org.eclipse.uml2.uml.Enumeration) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_ENUMERATION);
+
+ // property is a DataType
+ } else if(type instanceof org.eclipse.uml2.uml.DataType) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_DATATYPE);
+
+ // property is a Stereotype
+ } else if(type instanceof Stereotype) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_STEREOTYPE);
+
+ // property is a composite class
+ } else if((type instanceof org.eclipse.uml2.uml.Class) && !(type instanceof Stereotype) && property.isMultivalued()) {
+ // TODO
+
+ }
+ }
+ } else if(element instanceof Profile) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_PROFILE);
+ } else if(element instanceof Stereotype) {// it's a stereotype
+ return Activator.getPluginIconImage(Activator.ID, ICON_STEREOTYPE);
+ }
+
+ return Activator.getPluginIconImage(Activator.ID, ICON_UNKNOWN);
+ }
+ }
+
+ /**
+ * Content provider for the stereotype viewer
+ */
+ protected class StereotypeContentProvider implements ITreeContentProvider {
+
+ /**
+ * @{inheritDoc
+ */
+ public Object[] getChildren(Object parentElement) {
+
+ if(parentElement instanceof List<?>) {
+ return ((List<?>)parentElement).toArray();
+ } else if(parentElement instanceof StereotypeRepresentation) {
+ return ((StereotypeRepresentation)parentElement).getPropertyRepresentations().toArray();
+ } else if(parentElement instanceof PropertyRepresentation) {
+ if(((PropertyRepresentation)parentElement).getUpperMultiplicity() != 1 && ((PropertyRepresentation)parentElement).getValues().size() != 0) {
+ return ((PropertyRepresentation)parentElement).getValues().toArray();
+ }
+ }
+ return new Object[0];
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Object getParent(Object element) {
+ if(element instanceof Value) {
+ return ((Value)element).getPropertyRepresentation();
+ } else if(element instanceof PropertyRepresentation) {
+ return ((PropertyRepresentation)element).getStereotypeRepresentation();
+ }
+ return null;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean hasChildren(Object element) {
+ return getChildren(element) != null && (getChildren(element).length > 0);
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void dispose() {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+ }
+
+ /**
+ * Content provider for the selection dialog
+ */
+ protected class ProfileContentProvider implements ITreeContentProvider {
+
+ /** metaclass of the element created by the tool */
+ final protected EClass metaclass;
+
+ /**
+ * Constructor.
+ *
+ * @param metaclass
+ * the metaclass on which stereotypes can be applied
+ */
+ public ProfileContentProvider(EClass metaclass) {
+ this.metaclass = metaclass;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Object[] getChildren(Object parentElement) {
+ List<org.eclipse.uml2.uml.Element> children = new ArrayList<org.eclipse.uml2.uml.Element>();
+ if(parentElement instanceof Profile) {
+ for(Stereotype stereotype : ((Profile)parentElement).getOwnedStereotypes()) {
+ // check applicability
+ boolean isValid = false;
+ List<Class> metaclasses = stereotype.getAllExtendedMetaclasses();
+ for(Class stMetaclass : metaclasses) {
+ java.lang.Class<? extends Class> metaclassClass = stMetaclass.getClass();
+ if(metaclassClass != null) {
+ EClassifier metaClassifier = UMLPackage.eINSTANCE.getEClassifier(stMetaclass.getName());
+ if(((EClass)metaClassifier).isSuperTypeOf(metaclass)) {
+ isValid = true;
+ }
+ }
+ }
+ if(isValid) {
+ children.add(stereotype);
+ }
+ }
+ }
+ return children.toArray();
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Object getParent(Object element) {
+ if(element instanceof Profile) {
+ return ((Profile)element).getOwner();
+ } else if(element instanceof Stereotype) {
+ return ((Stereotype)element).getProfile();
+ }
+ return null;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public boolean hasChildren(Object element) {
+ return (element instanceof Profile);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public Object[] getElements(Object inputElement) {
+ if(inputElement instanceof List<?>) {
+ return ((List<?>)inputElement).toArray();
+ }
+ return new Object[0];
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void dispose() {
+
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+
+ }
+
+ }
+
+ /**
+ * Give the correct editor to a property following the property type. Fill
+ * the hashmaps with the new value
+ * <ul>
+ * <li>if {@code value==null}, we add a value to a multi-valued property</li>
+ * <li>if {@code value!=null}, we modify a value</li>
+ * </ul>
+ *
+ * @param property
+ * @param value
+ */
+ public void editMe(PropertyRepresentation propRepresentation, Value valueToEdit) {
+
+ Type type = propRepresentation.getType();
+ Property property = propRepresentation.getUMLProperty();
+ String value = null;
+ // property is a a primitive type
+ if(type instanceof PrimitiveType) {
+ String typeName = type.getQualifiedName();
+ // property is a boolean property
+ if(UMLPrimitiveTypes_BOOLEAN.equals(typeName)) {
+ value = PropertyEditors.BooleanEditor(property, valueToEdit);
+ // property is a String
+
+ } else if(UMLPrimitiveTypes_STRING.equals(typeName)) {
+ value = PropertyEditors.StringEditor(property, valueToEdit);
+ // property is a real
+ } else if(UMLPrimitiveTypes_REAL.equals(typeName)) {
+ value = PropertyEditors.RealEditor(property, valueToEdit);
+ /** property is a user primitive Type */
+ } else if(UMLPrimitiveTypes_INTEGER.equals(typeName)) {
+ value = PropertyEditors.IntegerEditor(property, valueToEdit);
+
+ // property is an unlimitedNatural
+ } else if(UMLPrimitiveTypes_UNLIMITED_NATURAL.equals(typeName)) {
+
+ value = PropertyEditors.UnlimitedNaturalEditor(property, valueToEdit);
+
+ /** property is a user primitive Type */
+ } else {
+ // never used!
+ // newVTO = new UserPrimitiveTypeValueTreeObject(parent,
+ // newValue, domain);
+ }
+
+ // property is a Metaclass property
+ } else if(Util.isMetaclass(type)) {
+ value = PropertyEditors.MetaclassEditor(property, valueToEdit, config.getAppliedProfiles());
+
+ // property is an Enumeration
+ } else if(type instanceof org.eclipse.uml2.uml.Enumeration) {
+ value = PropertyEditors.EnumerationEditor(property, valueToEdit);
+
+ // property is a DataType
+ } else if(type instanceof org.eclipse.uml2.uml.DataType) {
+
+ value = PropertyEditors.DataTypeEditor(property, valueToEdit);
+
+ // property is a Stereotype
+ } else if(type instanceof Stereotype) {
+ value = PropertyEditors.StereotypeEditor(property, valueToEdit, config.getAppliedProfiles());
+
+ // property is a composite class
+ } else if((type instanceof org.eclipse.uml2.uml.Class) && !(type instanceof Stereotype) && property.isMultivalued()) {
+ value = PropertyEditors.CompositeClassEditor(property, valueToEdit);
+ } else {
+ Activator.log.error("Impossible to find a correct editor for the property" + property, null); //$NON-NLS-1$
+ return;
+ }
+
+ if(value == null && valueToEdit == null) {
+ // nothing to do
+ return;
+ } else if(value == null && valueToEdit != null) {
+ // we delete a value
+ valueToEdit.getPropertyRepresentation().getValues().remove(valueToEdit);
+ } else if(value != null && valueToEdit == null) {
+ // we add a value
+ propRepresentation.addValue(new Value(value));
+ } else if(value != null && valueToEdit != null) {
+ // we change a value
+ valueToEdit.setValue(value);
+ }
+
+ }
+
+ /**
+ * search the object in the ArrayList list, using == and not the equals
+ * method
+ *
+ * @param list
+ * @param obj
+ * @return return the index of the object or -1 if it doesn't exist in the
+ * list
+ */
+ public int getIndexOf(ArrayList<?> list, Object obj) {
+ int index = -1;
+ for(int i = 0; i < list.size(); i++) {
+ if(list.get(i) == obj) {
+ index = i;
+ }
+ }
+ return index;
+ }
+
+ /**
+ * save the expanded Nodes
+ */
+ protected void saveExpandedNode() {
+ expandedElements = stereotypesViewer.getExpandedElements();
+ }
+
+ /**
+ * restore the expanded nodes
+ */
+ protected void restoreExpandedNode() {
+ if(expandedElements != null) {
+ stereotypesViewer.setExpandedElements(expandedElements);
+ expandedElements = null;
+ }
+ }
+
+ /**
+ * Class giving cell editors for the {@link stereotypesViewer} and for the {@link RuntimePropertiesDialog#tree}
+ */
+ public class AttributeEditingSupport extends EditingSupport {
+
+ /** proposals for boolean */
+ protected final String[] booleanProposals = new String[]{ "", "true", "false" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ protected TreeViewer treeViewer = null;
+
+ /**
+ * Constructor.
+ *
+ * @param viewer
+ * viewer in which editors will open
+ */
+ public AttributeEditingSupport(ColumnViewer viewer) {
+ super(viewer);
+ this.treeViewer = (TreeViewer)viewer;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected boolean canEdit(Object element) {
+ return true;
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ Type type = null;
+ CellEditor editor = null;
+ if(element instanceof Value) {
+ type = ((Value)element).getPropertyRepresentation().getType();
+ }
+ if(type != null) {
+ if(type instanceof PrimitiveType) {
+ String typeName = type.getQualifiedName();
+
+ // property is a boolean property
+ if(UMLPrimitiveTypes_BOOLEAN.equals(typeName)) {
+ editor = createBooleanEditor(treeViewer.getTree());
+
+ // property is a String
+ } else if(UMLPrimitiveTypes_STRING.equals(typeName)) {
+ editor = new TextCellEditor(treeViewer.getTree());
+
+ // property is an Integer
+ } else if(UMLPrimitiveTypes_INTEGER.equals(typeName)) {
+ editor = new TextCellEditor(treeViewer.getTree());
+
+ // property is an unlimitedNatural
+ } else if(UMLPrimitiveTypes_UNLIMITED_NATURAL.equals(typeName)) {
+ editor = new TextCellEditor(treeViewer.getTree());
+
+ // property is a user primitive Type
+ } else {
+ // never used!
+ // newVTO = new UserPrimitiveTypeValueTreeObject(parent,
+ // newValue, domain);
+ }
+
+ }
+ }
+ return editor;
+
+ }
+
+ /**
+ * Creates and return a combobox cell editor for a boolean type
+ *
+ * @param feature
+ * the feature to edit
+ * @return the newly created combo box cell editor
+ */
+ protected CellEditor createBooleanEditor(Composite parent) {
+ return new ComboBoxCellEditor(parent, booleanProposals, SWT.READ_ONLY);
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ @Override
+ protected Object getValue(Object element) {
+
+ if(element instanceof Value) {
+ Property prop = ((Value)element).getPropertyRepresentation().getUMLProperty();
+ if(prop.getType() != null) {
+ if(prop.getType().getQualifiedName().equals(UMLPrimitiveTypes_BOOLEAN)) {
+ for(int index = 0; index < booleanProposals.length; index++) {
+ if(booleanProposals[index].equals(element.toString())) {
+ return index;
+ }
+ }
+ return 0;
+ }
+ }
+ }
+ return element.toString();
+ }
+
+ /**
+ * we use the Cell Editor only to replace a value.
+ */
+ @Override
+ protected void setValue(Object oldValue, Object newValue) {
+ // property can't be null, because, we change a value, we never
+ // create a new value
+ if(!"".equals(newValue)) { //$NON-NLS-1$
+ if(oldValue instanceof Value) {
+ Property property = ((Value)oldValue).getPropertyRepresentation().getUMLProperty();
+ if(property.getType() != null) {
+ if(property.getType() instanceof PrimitiveType) {
+
+ String typeName = property.getType().getQualifiedName();
+ if(UMLPrimitiveTypes_BOOLEAN.equals(typeName)) {
+ setBooleanValue(oldValue, newValue);
+ } else {
+ ((Value)oldValue).setValue((String)newValue);
+ }
+ } else {
+ ((Value)oldValue).setValue((String)newValue);
+ }
+ }
+ treeViewer.refresh(oldValue);
+
+ }
+ }
+ }
+
+ /**
+ * Sets the new boolean value on the given element.
+ *
+ * @param element
+ * the model element
+ * @param value
+ * the new value
+ */
+ protected void setBooleanValue(Object oldValue, Object newValue) {
+ if(newValue == null || newValue.equals(0)) {
+ ((Value)oldValue).getPropertyRepresentation().getValues().remove(oldValue);
+ } else if(newValue.equals(1)) {
+ ((Value)oldValue).setValue(booleanProposals[1]);
+ } else if(newValue.equals(2)) {
+ ((Value)oldValue).setValue(booleanProposals[2]);
+ } else {
+ Activator.log.error("Impossible to set boolean value " + newValue, null); //$NON-NLS-1$
+ }
+ }
+
+ }
+
+ /**
+ * This class provides a {@link CheckboxCellEditor} for the {@link StereotypePostAction#runtimeColumn}
+ *
+ *
+ */
+ protected class RuntimeEditingSupport extends EditingSupport {
+
+ /** editor */
+ private final CellEditor editor;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param viewer
+ * viewer in which editors will open
+ */
+ public RuntimeEditingSupport(ColumnViewer viewer) {
+ super(viewer);
+ editor = new CheckboxCellEditor(null, SWT.NONE);
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.EditingSupport#getCellEditor(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ @Override
+ protected CellEditor getCellEditor(Object element) {
+ return editor;
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.EditingSupport#canEdit(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ @Override
+ protected boolean canEdit(Object element) {
+ if(element instanceof PropertyRepresentation) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.EditingSupport#getValue(java.lang.Object)
+ *
+ * @param element
+ * @return
+ */
+ @Override
+ protected Object getValue(Object element) {
+ if(element instanceof PropertyRepresentation) {
+ return ((PropertyRepresentation)element).isRuntime();
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.viewers.EditingSupport#setValue(java.lang.Object, java.lang.Object)
+ *
+ * @param element
+ * @param value
+ */
+ @Override
+ protected void setValue(Object element, Object value) {
+ if(element instanceof PropertyRepresentation) {
+ ((PropertyRepresentation)element).setRuntime((Boolean)value);
+ stereotypesViewer.update(element, null);
+ }
+ }
+ }
+
+ /**
+ * This class provides the methods for displaying the stereotypeViewer's
+ * column. This class gives the correct Label and it's {@link Image} to
+ * display for each element
+ *
+ */
+ protected class RuntimeLabelProvider extends CellLabelProvider implements ILabelProvider {
+
+ /**
+ * @see org.eclipse.jface.viewers.CellLabelProvider#update(org.eclipse.jface.viewers.ViewerCell)
+ *
+ * @param cell
+ */
+
+ @Override
+ public void update(ViewerCell cell) {
+ cell.setText(getText(cell.getElement()));
+ cell.setImage(getImage(cell.getElement()));
+ }
+
+ /**
+ * @{inheritDoc
+ */
+ public String getText(Object element) {
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ *
+ * @param element
+ * @return the image corresponding to the status (define or not at
+ * runtime)
+ */
+
+ public Image getImage(Object element) {
+ if(element instanceof PropertyRepresentation) {
+ if(((PropertyRepresentation)element).isRuntime()) {
+ return Activator.getPluginIconImage(Activator.ID, ICON_CHECKED);
+ }
+ return Activator.getPluginIconImage(Activator.ID, ICON_UNCHECKED);
+
+ }
+ return null;
+ }
+ }
+
+ /**
+ * This method does the action to define the properties defined at runtime,
+ * that's to say, open a dialog to propose editing the properties defined
+ * during the palette customisation
+ *
+ * @param config
+ * the configuration which contains all the applied stereotypes
+ * with properties and values
+ * @param editPart
+ * the edit
+ */
+ protected void defineRuntimeProperties(Configuration config) {
+
+ /*
+ * we copy the stereotype with runtime properties we copy the runtime
+ * properties (note that the values aren't not copied)
+ *
+ * so steWithPropToEdit contains only stereotypes with only their
+ * runtime properties.
+ */
+
+ List<StereotypeRepresentation> steWithPropToEdit = new ArrayList<StereotypeRepresentation>();
+ for(StereotypeRepresentation ste : config.getStereotypesRepresentations()) {
+ if(ste.hasRuntimeProperties()) {
+ StereotypeRepresentation newSte = new StereotypeRepresentation(ste);
+ for(PropertyRepresentation propRep : ste.getRuntimeProperties()) {
+ PropertyRepresentation prop = new PropertyRepresentation(propRep);
+ newSte.addProperty(prop);
+ }
+ steWithPropToEdit.add(newSte);
+ }
+ }
+
+ RuntimePropertiesDialog dialog = new RuntimePropertiesDialog(new Shell(), steWithPropToEdit);
+ dialog.open();
+
+ }
+
+ /**
+ *
+ * This class provides a Dialog to define the properties values during the
+ * element creation
+ *
+ */
+ protected class RuntimePropertiesDialog extends Dialog {
+
+ /** the dialog title */
+ private String title = null;
+
+ /** the dialog message */
+ private String message = null;
+
+ /** the viewer */
+ private TreeViewer tree = null;
+
+ /**
+ * the list containing the {@link StereotypeRepresentation} with the
+ * runtime roperties
+ */
+ private List<StereotypeRepresentation> stereotypesRep;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * @param stereotypesList
+ */
+
+ public RuntimePropertiesDialog(Shell parent, List<StereotypeRepresentation> steWithPropToEdit) {
+ super(parent);
+ this.title = Messages.StereotypePostAction_EditRuntimePropertiesTitle;
+ this.message = Messages.StereotypePostAction_EditRuntimePropertiesMessage;
+ this.stereotypesRep = steWithPropToEdit;
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ *
+ * @param shell
+ */
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ if(title != null) {
+ shell.setText(title);
+ }
+
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ * we remove the CANCEL Button
+ * @param parent
+ */
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * @return
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ // create composite
+ Composite composite = (Composite)super.createDialogArea(parent);
+ GridLayout layout = new GridLayout(5, false);
+ composite.setLayout(layout);
+ if(message != null) {
+ Label titleLabel = new Label(composite, SWT.WRAP);
+ titleLabel.setText(message);
+ GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
+ titleLabel.setLayoutData(data);
+ }
+
+ downButton = new Button(composite, SWT.NONE);
+ downButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_DOWN));
+ downButton.setEnabled(false);
+ downButton.addMouseListener(new MouseListener() {
+
+ public void mouseUp(MouseEvent e) {
+ moveElement(MOVE_DOWN, tree);
+ runtimeSelectionHasChange();
+ }
+
+ public void mouseDown(MouseEvent e) {
+ }
+
+ public void mouseDoubleClick(MouseEvent e) {
+ }
+ });
+
+ upButton = new Button(composite, SWT.NONE);
+ upButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_UP));
+ upButton.setEnabled(false);
+ upButton.addMouseListener(new MouseListener() {
+
+ public void mouseUp(MouseEvent e) {
+ moveElement(MOVE_UP, tree);
+ runtimeSelectionHasChange();
+ }
+
+ public void mouseDown(MouseEvent e) {
+ }
+
+ public void mouseDoubleClick(MouseEvent e) {
+
+ }
+ });
+
+ addButton = new Button(composite, SWT.NONE);
+ addButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_ADD));
+ addButton.setEnabled(false);
+ addButton.addMouseListener(new MouseListener() {
+
+ public void mouseUp(MouseEvent e) {
+ // performedAddButtonRuntime(e);
+ performAddButtonPressed(tree);
+ tree.refresh();
+ runtimeSelectionHasChange();
+ }
+
+ public void mouseDown(MouseEvent e) {
+
+ }
+
+ public void mouseDoubleClick(MouseEvent e) {
+
+ }
+ });
+
+ removeButton = new Button(composite, SWT.NONE);
+ removeButton.setImage(Activator.getPluginIconImage(Activator.ID, ICONS_REMOVE));
+ removeButton.setEnabled(false);
+ removeButton.addMouseListener(new MouseListener() {
+
+ public void mouseUp(MouseEvent e) {
+ performRemoveAction(tree);
+ runtimeSelectionHasChange();
+ }
+
+ public void mouseDown(MouseEvent e) {
+
+ }
+
+ public void mouseDoubleClick(MouseEvent e) {
+
+ }
+ });
+
+ // create the tree
+ tree = new TreeViewer(parent, SWT.BORDER | SWT.MULTI);
+ // tree.setContentProvider(new
+ // RuntimePropertiesStereotypeContentProvider());
+ tree.setContentProvider(new StereotypeContentProvider());
+ tree.getControl().setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+ createColumn(tree);
+ tree.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ performSelectionChangeRuntime(event);
+ }
+ });
+
+ tree.addDoubleClickListener(new IDoubleClickListener() {
+
+ public void doubleClick(DoubleClickEvent event) {
+
+ performDoubleClickAction(tree);
+ runtimeSelectionHasChange();
+ }
+
+ });
+
+ tree.getControl().addKeyListener(new KeyListener() {
+
+ public void keyReleased(KeyEvent e) {
+
+ }
+
+ public void keyPressed(KeyEvent e) {
+
+ if(e.keyCode == SWT.F2) {
+ performF2Action(tree);
+ } else if(e.character == SWT.DEL) {
+ performRemoveAction(tree);
+ } else if(e.stateMask == SWT.CTRL && e.keyCode == 110) {// e.character=='N'
+ // doesn't
+ // work
+ // on
+ // my
+ // computer
+ performCTRL_N_Action(e, tree);
+ }
+ runtimeSelectionHasChange();
+ }
+
+ });
+ updateTreeViewer();
+ tree.expandAll();
+ return composite;
+ }
+
+ /**
+ * create the column for the given
+ *
+ * @param viewer
+ */
+ protected void createColumn(TreeViewer viewer) {
+ final TreeViewerColumn stereotypeColumn = new TreeViewerColumn(viewer, SWT.FILL);
+ stereotypeColumn.getColumn().setResizable(true);
+ stereotypeColumn.getColumn().setWidth(400);
+ stereotypeColumn.setLabelProvider(editorLabelProvider);
+ stereotypeColumn.setEditingSupport(new AttributeEditingSupport(viewer));
+ }
+
+ /**
+ * update the TreevViewer
+ */
+ private void updateTreeViewer() {
+ tree.setInput(stereotypesRep);
+ runtimeSelectionHasChange();
+ }
+
+ /**
+ * use to force the buttons's update
+ */
+ private void runtimeSelectionHasChange() {
+ performSelectionChangeRuntime(new SelectionChangedEvent(this.tree, tree.getSelection()));
+ }
+
+ /**
+ * this function updates the buttons status
+ *
+ * @param event
+ */
+ protected void performSelectionChangeRuntime(SelectionChangedEvent event) {
+
+ ITreeSelection selection = (ITreeSelection)event.getSelection();
+ int selectionSize = selection.size();
+ if((selectionSize == 0) || !(sameLevelForFullSelection(selection))) {
+ addButton.setEnabled(true);
+ removeButton.setEnabled(false);
+ upButton.setEnabled(false);
+ downButton.setEnabled(false);
+ } else if(selectionSize == 1) {
+ Object selectedElement = selection.getFirstElement();
+ // removeButton state
+ if(selectedElement instanceof StereotypeRepresentation) {
+ removeButton.setEnabled(false);
+ } else if(selectedElement instanceof PropertyRepresentation) {
+ if(((PropertyRepresentation)selectedElement).getUpperMultiplicity() == 1) {
+ removeButton.setEnabled(true);
+ } else {
+ removeButton.setEnabled(false);
+ }
+ } else if(selectedElement instanceof Value) {
+ removeButton.setEnabled(true);
+
+ }
+
+ // addButton state
+ if(selectedElement instanceof StereotypeRepresentation) {
+ addButton.setEnabled(false);
+ } else if(selectedElement instanceof PropertyRepresentation) {
+ ArrayList<Value> values = ((PropertyRepresentation)selectedElement).getValues();
+ Property prop = ((PropertyRepresentation)selectedElement).getUMLProperty();
+ if(!prop.isMultivalued()) {
+ if(values.size() == 0) {
+ addButton.setEnabled(true);
+ } else {
+ addButton.setEnabled(false);
+ }
+ } else {// multi-valued property}
+ int upper = prop.getUpper();
+ if(upper == -1) {
+ addButton.setEnabled(true);
+ } else if(values.size() < upper) {
+ addButton.setEnabled(true);
+ } else {
+ addButton.setEnabled(false);
+ }
+ }
+ } else if(selectedElement instanceof Value) {
+ addButton.setEnabled(false);
+ }
+ // upButton and downButton states
+ if(selectedElement instanceof StereotypeRepresentation) {
+ int index = stereotypesRep.indexOf(selectedElement);
+ if(config.getStereotypesRepresentations().size() == 1) {
+ downButton.setEnabled(false);
+ upButton.setEnabled(false);
+ } else if(index == 0) {
+ downButton.setEnabled(true);
+ upButton.setEnabled(false);
+ } else if(index == stereotypesRep.indexOf(selectedElement) - 1) {
+ downButton.setEnabled(false);
+ upButton.setEnabled(true);
+ } else {
+ downButton.setEnabled(true);
+ upButton.setEnabled(true);
+ }
+ } else if(selectedElement instanceof PropertyRepresentation) {
+ downButton.setEnabled(false);
+ upButton.setEnabled(false);
+ } else if(selectedElement instanceof Value) {
+ ArrayList<Value> valuesList = ((Value)selectedElement).getPropertyRepresentation().getValues();
+ int index = valuesList.indexOf(selectedElement);
+ if(valuesList.size() == 1) {
+ upButton.setEnabled(false);
+ downButton.setEnabled(false);
+ } else if(index == 0) {
+ upButton.setEnabled(false);
+ downButton.setEnabled(true);
+ } else if(index == valuesList.size() - 1) {
+ upButton.setEnabled(true);
+ downButton.setEnabled(false);
+ } else {
+ upButton.setEnabled(true);
+ downButton.setEnabled(true);
+ }
+ }
+
+ } else {// all the elements are from the same level
+
+ if(selection.getFirstElement() instanceof StereotypeRepresentation) {
+ removeButton.setEnabled(true);
+ upButton.setEnabled(false);
+ downButton.setEnabled(false);
+ addButton.setEnabled(true);
+ } else
+
+ if(selection.getFirstElement() instanceof Value) {
+ removeButton.setEnabled(true);
+ upButton.setEnabled(false);
+ downButton.setEnabled(false);
+ addButton.setEnabled(false);
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeRepresentation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeRepresentation.java
index ddb9cea51be..03671dd7462 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeRepresentation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/StereotypeRepresentation.java
@@ -1,185 +1,185 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import java.util.ArrayList;
-
-import org.eclipse.uml2.uml.Stereotype;
-
-/**
- *
- * This class is used to represent a {@link org.eclipse.uml2.uml.Stereotype}
- *
- */
-public class StereotypeRepresentation {
-
- /**
- * the stereotype qualified name
- */
- private String stereotypeQualifiedName;
-
- /**
- * the properties owned by the stereotype
- */
- private ArrayList<PropertyRepresentation> properties;
-
- /**
- * the UML stereotype represented by this class
- */
- private Stereotype stereotype;
-
- /**
- *
- * Constructor.
- *
- * @param qualifiedName
- */
- public StereotypeRepresentation(String qualifiedName) {
- this.stereotypeQualifiedName = qualifiedName;
- properties = new ArrayList<PropertyRepresentation>();
- this.setUMLStereotype(null);
- }
-
- /**
- *
- * Constructor. Note : the properties are neither copied nor duplicated
- *
- * @param ste
- * the {@link StereotypeRepresentation} uses to instantiate a new {@link StereotypeRepresentation}
- */
- public StereotypeRepresentation(StereotypeRepresentation ste) {
- this.stereotypeQualifiedName = ste.getStereotypeQualifiedName();
- properties = new ArrayList<PropertyRepresentation>();
- setUMLStereotype(ste.getUMLStereotype());
- }
-
- /**
- * Adds a property to this stereotype This method fills the field {@link StereotypeRepresentation} in the property
- *
- * @param property
- * the property to add
- */
- public void addProperty(PropertyRepresentation property) {
- property.setStereotype(this);
- properties.add(property);
- }
-
- /**
- * Returns all the {@link PropertyRepresentation} owned by this stereotype
- *
- * @return all the {@link PropertyRepresentation} owned by this stereotype
- */
- public ArrayList<PropertyRepresentation> getPropertyRepresentations() {
- return properties;
- }
-
- /**
- * Returns all the properties containing values owned by this stereotype
- *
- * @return all the properties containing values owned by this stereotype
- */
- public ArrayList<PropertyRepresentation> getPropertiesWithValues() {
- ArrayList<PropertyRepresentation> propertiesToSave = new ArrayList<PropertyRepresentation>();
- for(PropertyRepresentation prop : properties) {
- if(prop.hasValues()) {
- propertiesToSave.add(prop);
- }
- }
- return propertiesToSave;
- }
-
- /**
- * Setter for {@link #stereotypeQualifiedName}
- *
- * @return the stereotype qualified name
- */
- public String getStereotypeQualifiedName() {
- return stereotypeQualifiedName;
- }
-
- /**
- * Returns the {@link PropertyRepresentation} corresponding the parameters
- *
- * @param stereotypeQualifiedName
- * the stereotype qualified name
- * @param propertyQualifiedName
- * the property qualified name
- * @return <ul>
- * <li>the corresponding {@link PropertyRepresentation}</li>
- * <li>{@code null} if the corresponding property was not found</li>
- * </ul>
- */
- public PropertyRepresentation getPropertyRepresentation(String stereotypeQualifiedName, String propertyQualifiedName) {
- for(PropertyRepresentation prop : properties) {
- if(prop.getPropertyId().equals(stereotypeQualifiedName + PropertyRepresentation.separator + propertyQualifiedName)) {
- return prop;
- }
- }
- return null;
- }
-
- /**
- * Returns the {@link PropertyRepresentation} which need to be defined at
- * runtime
- *
- * @return the {@link PropertyRepresentation} which need to be defined at
- * runtime
- */
- public ArrayList<PropertyRepresentation> getRuntimeProperties() {
- ArrayList<PropertyRepresentation> propertiesToSave = new ArrayList<PropertyRepresentation>();
- for(PropertyRepresentation prop : properties) {
- if(prop.isRuntime()) {
- propertiesToSave.add(prop);
- }
- }
- return propertiesToSave;
- }
-
- /**
- * Setter for {@link #stereotype}
- *
- * @param stereotype
- */
- public void setUMLStereotype(Stereotype stereotype) {
- this.stereotype = stereotype;
- }
-
- /**
- * Getter for {@link #stereotype}
- *
- * @return {@link #stereotype}
- */
- public Stereotype getUMLStereotype() {
-
- org.eclipse.core.runtime.Assert.isNotNull(stereotype, "Stereotype has not been set!"); //$NON-NLS-1$
- return stereotype;
- }
-
- /**
- *
- * @return <ul>
- * <li> {@code true} if there is runtime properties in this stereotype
- * <li> {@code false} if not</li>
- * </ul>
- */
- public boolean hasRuntimeProperties() {
- for(PropertyRepresentation prop : properties) {
- if(prop.isRuntime()) {
- return true;
- }
- }
- return false;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import java.util.ArrayList;
+
+import org.eclipse.uml2.uml.Stereotype;
+
+/**
+ *
+ * This class is used to represent a {@link org.eclipse.uml2.uml.Stereotype}
+ *
+ */
+public class StereotypeRepresentation {
+
+ /**
+ * the stereotype qualified name
+ */
+ private String stereotypeQualifiedName;
+
+ /**
+ * the properties owned by the stereotype
+ */
+ private ArrayList<PropertyRepresentation> properties;
+
+ /**
+ * the UML stereotype represented by this class
+ */
+ private Stereotype stereotype;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param qualifiedName
+ */
+ public StereotypeRepresentation(String qualifiedName) {
+ this.stereotypeQualifiedName = qualifiedName;
+ properties = new ArrayList<PropertyRepresentation>();
+ this.setUMLStereotype(null);
+ }
+
+ /**
+ *
+ * Constructor. Note : the properties are neither copied nor duplicated
+ *
+ * @param ste
+ * the {@link StereotypeRepresentation} uses to instantiate a new {@link StereotypeRepresentation}
+ */
+ public StereotypeRepresentation(StereotypeRepresentation ste) {
+ this.stereotypeQualifiedName = ste.getStereotypeQualifiedName();
+ properties = new ArrayList<PropertyRepresentation>();
+ setUMLStereotype(ste.getUMLStereotype());
+ }
+
+ /**
+ * Adds a property to this stereotype This method fills the field {@link StereotypeRepresentation} in the property
+ *
+ * @param property
+ * the property to add
+ */
+ public void addProperty(PropertyRepresentation property) {
+ property.setStereotype(this);
+ properties.add(property);
+ }
+
+ /**
+ * Returns all the {@link PropertyRepresentation} owned by this stereotype
+ *
+ * @return all the {@link PropertyRepresentation} owned by this stereotype
+ */
+ public ArrayList<PropertyRepresentation> getPropertyRepresentations() {
+ return properties;
+ }
+
+ /**
+ * Returns all the properties containing values owned by this stereotype
+ *
+ * @return all the properties containing values owned by this stereotype
+ */
+ public ArrayList<PropertyRepresentation> getPropertiesWithValues() {
+ ArrayList<PropertyRepresentation> propertiesToSave = new ArrayList<PropertyRepresentation>();
+ for(PropertyRepresentation prop : properties) {
+ if(prop.hasValues()) {
+ propertiesToSave.add(prop);
+ }
+ }
+ return propertiesToSave;
+ }
+
+ /**
+ * Setter for {@link #stereotypeQualifiedName}
+ *
+ * @return the stereotype qualified name
+ */
+ public String getStereotypeQualifiedName() {
+ return stereotypeQualifiedName;
+ }
+
+ /**
+ * Returns the {@link PropertyRepresentation} corresponding the parameters
+ *
+ * @param stereotypeQualifiedName
+ * the stereotype qualified name
+ * @param propertyQualifiedName
+ * the property qualified name
+ * @return <ul>
+ * <li>the corresponding {@link PropertyRepresentation}</li>
+ * <li>{@code null} if the corresponding property was not found</li>
+ * </ul>
+ */
+ public PropertyRepresentation getPropertyRepresentation(String stereotypeQualifiedName, String propertyQualifiedName) {
+ for(PropertyRepresentation prop : properties) {
+ if(prop.getPropertyId().equals(stereotypeQualifiedName + PropertyRepresentation.separator + propertyQualifiedName)) {
+ return prop;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the {@link PropertyRepresentation} which need to be defined at
+ * runtime
+ *
+ * @return the {@link PropertyRepresentation} which need to be defined at
+ * runtime
+ */
+ public ArrayList<PropertyRepresentation> getRuntimeProperties() {
+ ArrayList<PropertyRepresentation> propertiesToSave = new ArrayList<PropertyRepresentation>();
+ for(PropertyRepresentation prop : properties) {
+ if(prop.isRuntime()) {
+ propertiesToSave.add(prop);
+ }
+ }
+ return propertiesToSave;
+ }
+
+ /**
+ * Setter for {@link #stereotype}
+ *
+ * @param stereotype
+ */
+ public void setUMLStereotype(Stereotype stereotype) {
+ this.stereotype = stereotype;
+ }
+
+ /**
+ * Getter for {@link #stereotype}
+ *
+ * @return {@link #stereotype}
+ */
+ public Stereotype getUMLStereotype() {
+
+ org.eclipse.core.runtime.Assert.isNotNull(stereotype, "Stereotype has not been set!"); //$NON-NLS-1$
+ return stereotype;
+ }
+
+ /**
+ *
+ * @return <ul>
+ * <li> {@code true} if there is runtime properties in this stereotype
+ * <li> {@code false} if not</li>
+ * </ul>
+ */
+ public boolean hasRuntimeProperties() {
+ for(PropertyRepresentation prop : properties) {
+ if(prop.isRuntime()) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Value.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Value.java
index f09da965f38..d077293b642 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Value.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/service/palette/Value.java
@@ -1,102 +1,102 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.service.palette;
-
-import org.eclipse.core.runtime.Assert;
-
-/**
- *
- * This class is used to represent a {@link org.eclipse.uml2.uml.Property} value
- *
- */
-public class Value {
-
- /** the property owned this value */
- private PropertyRepresentation property = null;
-
- /** the value represented by a string */
- private String value;
-
- /**
- *
- * Constructor.
- *
- * @param value
- *
- */
- public Value(String value) {
- Assert.isNotNull(value);
- this.value = value;
- }
-
- /**
- *
- * Constructor. Note : the field {@link PropertyRepresentation} is not
- * copied
- *
- * @param val
- * The {@link Value} used to instantiate a new {@value}
- */
- public Value(Value val) {
- Assert.isNotNull(val);
- this.value = val.getValue();
- }
-
- /**
- *
- * @see java.lang.Object#toString()
- *
- * @return
- */
- public String toString() {
- return getValue();
- }
-
- /**
- * Getter for {@link #property}
- *
- * @return the property owning this value
- */
- public PropertyRepresentation getPropertyRepresentation() {
- Assert.isNotNull(property);
- return property;
- }
-
- /**
- * Returns the string representing this value
- *
- * @return the string representing this value
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Set the property owned this value (called by {@link PropertyRepresentation#addValue(Value)})
- *
- * @param property
- */
- public void setPropertyRepresentation(PropertyRepresentation property) {
- this.property = property;
- }
-
- /**
- * Set a new value to this value
- *
- * @param newValue
- */
- public void setValue(String newValue) {
- this.value = newValue;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.service.palette;
+
+import org.eclipse.core.runtime.Assert;
+
+/**
+ *
+ * This class is used to represent a {@link org.eclipse.uml2.uml.Property} value
+ *
+ */
+public class Value {
+
+ /** the property owned this value */
+ private PropertyRepresentation property = null;
+
+ /** the value represented by a string */
+ private String value;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param value
+ *
+ */
+ public Value(String value) {
+ Assert.isNotNull(value);
+ this.value = value;
+ }
+
+ /**
+ *
+ * Constructor. Note : the field {@link PropertyRepresentation} is not
+ * copied
+ *
+ * @param val
+ * The {@link Value} used to instantiate a new {@value}
+ */
+ public Value(Value val) {
+ Assert.isNotNull(val);
+ this.value = val.getValue();
+ }
+
+ /**
+ *
+ * @see java.lang.Object#toString()
+ *
+ * @return
+ */
+ public String toString() {
+ return getValue();
+ }
+
+ /**
+ * Getter for {@link #property}
+ *
+ * @return the property owning this value
+ */
+ public PropertyRepresentation getPropertyRepresentation() {
+ Assert.isNotNull(property);
+ return property;
+ }
+
+ /**
+ * Returns the string representing this value
+ *
+ * @return the string representing this value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Set the property owned this value (called by {@link PropertyRepresentation#addValue(Value)})
+ *
+ * @param property
+ */
+ public void setPropertyRepresentation(PropertyRepresentation property) {
+ this.property = property;
+ }
+
+ /**
+ * Set a new value to this value
+ *
+ * @param newValue
+ */
+ public void setValue(String newValue) {
+ this.value = newValue;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySection.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySection.java
index 5f47e6e2773..fceb297b792 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySection.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySection.java
@@ -1,141 +1,141 @@
-/*****************************************************************************
- * Copyright (c) 2009 ATOS ORIGIN.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.sheet;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.IPropertySource;
-import org.eclipse.ui.views.properties.IPropertySourceProvider;
-
-/**
- * Property Section in charge of the Advanced property view
- */
-public class UMLPropertySection extends AdvancedPropertySection implements IPropertySourceProvider {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.ui.views.properties.IPropertySourceProvider#getPropertySource
- * (java.lang.Object)
- */
- public IPropertySource getPropertySource(Object object) {
- if(object instanceof IPropertySource) {
- return (IPropertySource)object;
- }
- AdapterFactory af = getAdapterFactory(object);
- if(af != null) {
- IItemPropertySource ips = (IItemPropertySource)af.adapt(object, IItemPropertySource.class);
- if(ips != null) {
- return new UMLPropertySource(object, ips);
- }
- }
- if(object instanceof IAdaptable) {
- return (IPropertySource)((IAdaptable)object).getAdapter(IPropertySource.class);
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.gmf.runtime.diagram.ui.properties.sections.
- * AdvancedPropertySection# getPropertySourceProvider()
- */
- protected IPropertySourceProvider getPropertySourceProvider() {
- return this;
- }
-
- /**
- * Modify/unwrap selection.
- *
- */
- protected Object transformSelection(Object selected) {
- if(selected == null) {
- return null;
- }
- if(selected instanceof IAdaptable && ((IAdaptable)selected).getAdapter(IPropertySource.class) != null) {
- return ((IAdaptable)selected).getAdapter(IPropertySource.class);
- }
- if(selected instanceof EditPart) {
- Object model = ((EditPart)selected).getModel();
- return model instanceof View ? ((View)model).getElement() : null;
- }
- if(selected instanceof View) {
- return ((View)selected).getElement();
- }
- if(selected instanceof IAdaptable) {
- View view = (View)((IAdaptable)selected).getAdapter(View.class);
- if(view != null) {
- return view.getElement();
- }
- EObject elem = (EObject)((IAdaptable)selected).getAdapter(EObject.class);
- return elem;
- }
- return selected;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.
- * AdvancedPropertySection#setInput(org .eclipse.ui.IWorkbenchPart,
- * org.eclipse.jface.viewers.ISelection)
- */
- public void setInput(IWorkbenchPart part, ISelection selection) {
- if(selection.isEmpty() || false == selection instanceof StructuredSelection) {
- super.setInput(part, selection);
- return;
- }
- final StructuredSelection structuredSelection = ((StructuredSelection)selection);
- ArrayList transformedSelection = new ArrayList(structuredSelection.size());
- for(Iterator it = structuredSelection.iterator(); it.hasNext();) {
- Object r = transformSelection(it.next());
- if(r != null) {
- transformedSelection.add(r);
- }
- }
- super.setInput(part, new StructuredSelection(transformedSelection));
- }
-
- /**
- * Get the adapterFactory of the given object
- *
- * @param Object
- * @return the adapter factory
- */
- protected AdapterFactory getAdapterFactory(Object object) {
- if(getEditingDomain() instanceof AdapterFactoryEditingDomain) {
- return ((AdapterFactoryEditingDomain)getEditingDomain()).getAdapterFactory();
- }
- TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(object);
- if(editingDomain != null) {
- return ((AdapterFactoryEditingDomain)editingDomain).getAdapterFactory();
- }
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2009 ATOS ORIGIN.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.sheet;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySection;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.eclipse.ui.views.properties.IPropertySourceProvider;
+
+/**
+ * Property Section in charge of the Advanced property view
+ */
+public class UMLPropertySection extends AdvancedPropertySection implements IPropertySourceProvider {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.ui.views.properties.IPropertySourceProvider#getPropertySource
+ * (java.lang.Object)
+ */
+ public IPropertySource getPropertySource(Object object) {
+ if(object instanceof IPropertySource) {
+ return (IPropertySource)object;
+ }
+ AdapterFactory af = getAdapterFactory(object);
+ if(af != null) {
+ IItemPropertySource ips = (IItemPropertySource)af.adapt(object, IItemPropertySource.class);
+ if(ips != null) {
+ return new UMLPropertySource(object, ips);
+ }
+ }
+ if(object instanceof IAdaptable) {
+ return (IPropertySource)((IAdaptable)object).getAdapter(IPropertySource.class);
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.gmf.runtime.diagram.ui.properties.sections.
+ * AdvancedPropertySection# getPropertySourceProvider()
+ */
+ protected IPropertySourceProvider getPropertySourceProvider() {
+ return this;
+ }
+
+ /**
+ * Modify/unwrap selection.
+ *
+ */
+ protected Object transformSelection(Object selected) {
+ if(selected == null) {
+ return null;
+ }
+ if(selected instanceof IAdaptable && ((IAdaptable)selected).getAdapter(IPropertySource.class) != null) {
+ return ((IAdaptable)selected).getAdapter(IPropertySource.class);
+ }
+ if(selected instanceof EditPart) {
+ Object model = ((EditPart)selected).getModel();
+ return model instanceof View ? ((View)model).getElement() : null;
+ }
+ if(selected instanceof View) {
+ return ((View)selected).getElement();
+ }
+ if(selected instanceof IAdaptable) {
+ View view = (View)((IAdaptable)selected).getAdapter(View.class);
+ if(view != null) {
+ return view.getElement();
+ }
+ EObject elem = (EObject)((IAdaptable)selected).getAdapter(EObject.class);
+ return elem;
+ }
+ return selected;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.
+ * AdvancedPropertySection#setInput(org .eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void setInput(IWorkbenchPart part, ISelection selection) {
+ if(selection.isEmpty() || false == selection instanceof StructuredSelection) {
+ super.setInput(part, selection);
+ return;
+ }
+ final StructuredSelection structuredSelection = ((StructuredSelection)selection);
+ ArrayList transformedSelection = new ArrayList(structuredSelection.size());
+ for(Iterator it = structuredSelection.iterator(); it.hasNext();) {
+ Object r = transformSelection(it.next());
+ if(r != null) {
+ transformedSelection.add(r);
+ }
+ }
+ super.setInput(part, new StructuredSelection(transformedSelection));
+ }
+
+ /**
+ * Get the adapterFactory of the given object
+ *
+ * @param Object
+ * @return the adapter factory
+ */
+ protected AdapterFactory getAdapterFactory(Object object) {
+ if(getEditingDomain() instanceof AdapterFactoryEditingDomain) {
+ return ((AdapterFactoryEditingDomain)getEditingDomain()).getAdapterFactory();
+ }
+ TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(object);
+ if(editingDomain != null) {
+ return ((AdapterFactoryEditingDomain)editingDomain).getAdapterFactory();
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java
index b274f4a1dd3..e9fdf2df3f7 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/sheet/UMLPropertySource.java
@@ -1,163 +1,163 @@
-/*****************************************************************************
- * 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:
- * Thibault Landre (Atos Origin) - Initial API and implementation
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.sheet;
-
-import java.util.Collection;
-import java.util.LinkedList;
-
-import org.eclipse.emf.common.ui.celleditor.ExtendedDialogCellEditor;
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.ENamedElement;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.ui.provider.PropertyDescriptor;
-import org.eclipse.emf.edit.ui.provider.PropertySource;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-import org.eclipse.ui.views.properties.IPropertyDescriptor;
-
-/**
- * A specific property source for Papyrus. It replaces the combo used to choose
- * a single reference by a {@link ElementListSelectionDialog}
- *
- */
-public class UMLPropertySource extends PropertySource {
-
- /**
- * @param object
- * @param ips
- */
- public UMLPropertySource(Object object, IItemPropertySource ips) {
- super(object, ips);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.emf.edit.ui.provider.PropertySource#createPropertyDescriptor
- * (org.eclipse.emf.edit.provider.IItemPropertyDescriptor)
- */
- @Override
- protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
- return new CustomPropertyDescriptor(object, itemPropertyDescriptor);
- }
-
- /**
- * A custom property descriptor. It replaces the Combo by the {@link ElementListSelectionDialog}
- */
- private class CustomPropertyDescriptor extends PropertyDescriptor {
-
- public CustomPropertyDescriptor(Object object, IItemPropertyDescriptor itemPropertyDescriptor) {
- super(object, itemPropertyDescriptor);
- }
-
- @Override
- public CellEditor createPropertyEditor(Composite composite) {
- if(!itemPropertyDescriptor.canSetProperty(object)) {
- return null;
- }
-
- CellEditor result = null;
- final Object genericFeature = itemPropertyDescriptor.getFeature(object);
-
- // If it is a single reference
- if(genericFeature instanceof EReference && !((EReference)genericFeature).isMany()) {
- final ILabelProvider editLabelProvider = getEditLabelProvider();
- result = new ExtendedDialogCellEditor(composite, editLabelProvider) {
-
- @Override
- protected Object openDialogBox(Control cellEditorWindow) {
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(cellEditorWindow.getShell(), editLabelProvider);
-
- dialog.setTitle("Element Selection");
- dialog.setMessage("Select a String (* = any string, ? = any char):");
-
- LinkedList<Object> result = new LinkedList<Object>();
- Collection<?> collection = itemPropertyDescriptor.getChoiceOfValues(object);
- result.add(""); // empty element enables to assign a null value
- if ((genericFeature instanceof ENamedElement) && ((ENamedElement) genericFeature).getName().equals("classifierBehavior")) {
- // filter in case of classifierBehavior, see bug 343123
- // TODO: this rather generic function is probably not the right place to do the filtering. Also need to support filtering for other
- // attributes
- Collection<?> all = itemPropertyDescriptor.getChoiceOfValues(object);
- result.addAll(filterOwned(object, collection));
- }
- else {
- result.addAll(collection);
- }
- result.remove(null);
-
- dialog.setElements(result.toArray());
-
- Object toReturn = null;
- if(dialog.open() == Dialog.OK) {
- toReturn = dialog.getFirstResult();
- if("".equals(toReturn)) {
- toReturn = itemPropertyDescriptor.getPropertyValue(null);
- }
- } else {
- toReturn = itemPropertyDescriptor.getPropertyValue(object);
- }
- return toReturn;
- }
- };
- } else {
- result = super.createPropertyEditor(composite);
- }
- return result;
- }
- }
-
- /**
- * Filter available choice: only show owned elements which are owned by the passed parent
- * See bug 343123
- *
- * @param parent a parent
- * @param in a collection of elements
- * @return a filtered collection containing only owned elements
- */
- public static Collection<?> filterOwned(Object parent, Collection<?> in) {
- EList<EObject> list = new BasicEList<EObject>();
- for (Object obj : in) {
- if (obj instanceof EObject) {
- if (isOwned(parent, (EObject) obj)) {
- list.add((EObject) obj);
- }
- }
- }
- return list;
- }
-
- /**
- * Check whether a child belongs to the given parent, i.e. is owned by it.
- * @param parent a parent
- * @param child a child
- * @return true, if owned
- */
- public static boolean isOwned (Object parent, EObject child) {
- child = child.eContainer();
- while (child != null) {
- if (child == parent) return true;
- child = child.eContainer();
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 ATOS ORIGIN.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Thibault Landre (Atos Origin) - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.sheet;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.eclipse.emf.common.ui.celleditor.ExtendedDialogCellEditor;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.ui.provider.PropertyDescriptor;
+import org.eclipse.emf.edit.ui.provider.PropertySource;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.dialogs.ElementListSelectionDialog;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+
+/**
+ * A specific property source for Papyrus. It replaces the combo used to choose
+ * a single reference by a {@link ElementListSelectionDialog}
+ *
+ */
+public class UMLPropertySource extends PropertySource {
+
+ /**
+ * @param object
+ * @param ips
+ */
+ public UMLPropertySource(Object object, IItemPropertySource ips) {
+ super(object, ips);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.emf.edit.ui.provider.PropertySource#createPropertyDescriptor
+ * (org.eclipse.emf.edit.provider.IItemPropertyDescriptor)
+ */
+ @Override
+ protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
+ return new CustomPropertyDescriptor(object, itemPropertyDescriptor);
+ }
+
+ /**
+ * A custom property descriptor. It replaces the Combo by the {@link ElementListSelectionDialog}
+ */
+ private class CustomPropertyDescriptor extends PropertyDescriptor {
+
+ public CustomPropertyDescriptor(Object object, IItemPropertyDescriptor itemPropertyDescriptor) {
+ super(object, itemPropertyDescriptor);
+ }
+
+ @Override
+ public CellEditor createPropertyEditor(Composite composite) {
+ if(!itemPropertyDescriptor.canSetProperty(object)) {
+ return null;
+ }
+
+ CellEditor result = null;
+ final Object genericFeature = itemPropertyDescriptor.getFeature(object);
+
+ // If it is a single reference
+ if(genericFeature instanceof EReference && !((EReference)genericFeature).isMany()) {
+ final ILabelProvider editLabelProvider = getEditLabelProvider();
+ result = new ExtendedDialogCellEditor(composite, editLabelProvider) {
+
+ @Override
+ protected Object openDialogBox(Control cellEditorWindow) {
+ ElementListSelectionDialog dialog = new ElementListSelectionDialog(cellEditorWindow.getShell(), editLabelProvider);
+
+ dialog.setTitle("Element Selection");
+ dialog.setMessage("Select a String (* = any string, ? = any char):");
+
+ LinkedList<Object> result = new LinkedList<Object>();
+ Collection<?> collection = itemPropertyDescriptor.getChoiceOfValues(object);
+ result.add(""); // empty element enables to assign a null value
+ if ((genericFeature instanceof ENamedElement) && ((ENamedElement) genericFeature).getName().equals("classifierBehavior")) {
+ // filter in case of classifierBehavior, see bug 343123
+ // TODO: this rather generic function is probably not the right place to do the filtering. Also need to support filtering for other
+ // attributes
+ Collection<?> all = itemPropertyDescriptor.getChoiceOfValues(object);
+ result.addAll(filterOwned(object, collection));
+ }
+ else {
+ result.addAll(collection);
+ }
+ result.remove(null);
+
+ dialog.setElements(result.toArray());
+
+ Object toReturn = null;
+ if(dialog.open() == Dialog.OK) {
+ toReturn = dialog.getFirstResult();
+ if("".equals(toReturn)) {
+ toReturn = itemPropertyDescriptor.getPropertyValue(null);
+ }
+ } else {
+ toReturn = itemPropertyDescriptor.getPropertyValue(object);
+ }
+ return toReturn;
+ }
+ };
+ } else {
+ result = super.createPropertyEditor(composite);
+ }
+ return result;
+ }
+ }
+
+ /**
+ * Filter available choice: only show owned elements which are owned by the passed parent
+ * See bug 343123
+ *
+ * @param parent a parent
+ * @param in a collection of elements
+ * @return a filtered collection containing only owned elements
+ */
+ public static Collection<?> filterOwned(Object parent, Collection<?> in) {
+ EList<EObject> list = new BasicEList<EObject>();
+ for (Object obj : in) {
+ if (obj instanceof EObject) {
+ if (isOwned(parent, (EObject) obj)) {
+ list.add((EObject) obj);
+ }
+ }
+ }
+ return list;
+ }
+
+ /**
+ * Check whether a child belongs to the given parent, i.e. is owned by it.
+ * @param parent a parent
+ * @param child a child
+ * @return true, if owned
+ */
+ public static boolean isOwned (Object parent, EObject child) {
+ child = child.eContainer();
+ while (child != null) {
+ if (child == parent) return true;
+ child = child.eContainer();
+ }
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/AbstractChooseElement.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/AbstractChooseElement.java
index f0380350b31..f50c741e4bb 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/AbstractChooseElement.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/AbstractChooseElement.java
@@ -1,101 +1,101 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.FilteredTree;
-import org.eclipse.ui.dialogs.PatternFilter;
-/**
- * DO not modify manually, this class was generated by a visual editor
- *
- */
-public class AbstractChooseElement extends Dialog {
-
- protected Object result;
-
- protected Shell shlChooseElement;
- protected FilteredTree filtercontrol=null;
-
- protected Button btnSelect;
-
- protected Button btnCancel;
-
- /**
- * Create the dialog.
- * @param parent
- * @param style
- */
- public AbstractChooseElement(Shell parent, int style) {
- super(parent, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
- setText("SWT Dialog");
- }
-
- /**
- * Open the dialog.
- * @return the result
- */
- public Object open() {
- createContents();
- shlChooseElement.open();
- shlChooseElement.layout();
- Display display = getParent().getDisplay();
- while(!shlChooseElement.isDisposed()) {
- if(!display.readAndDispatch()) {
- display.sleep();
- }
- }
- return result;
- }
-
- /**
- * Create contents of the dialog.
- */
- protected void createContents() {
- org.eclipse.swt.graphics.Rectangle rect=Display.getDefault().getBounds();
-
- shlChooseElement = new Shell(getParent(), getStyle());
- shlChooseElement.setSize(450, 300);
- shlChooseElement.setText("Choose element");
- shlChooseElement.setLayout(new FillLayout(SWT.HORIZONTAL));
- shlChooseElement.setLocation(new Point(rect.x+(rect.width/2), rect.y+(rect.height/2)-shlChooseElement.getSize().y));
- Composite contentComposite = new Composite(shlChooseElement, SWT.NONE);
- contentComposite.setLayout(null);
-
- btnSelect = new Button(contentComposite, SWT.NONE);
-
- btnSelect.setBounds(353, 235, 68, 23);
- btnSelect.setText("Select");
-
- btnCancel = new Button(contentComposite, SWT.NONE);
- btnCancel.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- }
- });
- btnCancel.setBounds(262, 235, 68, 23);
- btnCancel.setText("Cancel");
-
- filtercontrol =new FilteredTree(contentComposite, SWT.BORDER, new PatternFilter(), true);
- filtercontrol.setBounds(10, 10, 424, 219);
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.FilteredTree;
+import org.eclipse.ui.dialogs.PatternFilter;
+/**
+ * DO not modify manually, this class was generated by a visual editor
+ *
+ */
+public class AbstractChooseElement extends Dialog {
+
+ protected Object result;
+
+ protected Shell shlChooseElement;
+ protected FilteredTree filtercontrol=null;
+
+ protected Button btnSelect;
+
+ protected Button btnCancel;
+
+ /**
+ * Create the dialog.
+ * @param parent
+ * @param style
+ */
+ public AbstractChooseElement(Shell parent, int style) {
+ super(parent, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL);
+ setText("SWT Dialog");
+ }
+
+ /**
+ * Open the dialog.
+ * @return the result
+ */
+ public Object open() {
+ createContents();
+ shlChooseElement.open();
+ shlChooseElement.layout();
+ Display display = getParent().getDisplay();
+ while(!shlChooseElement.isDisposed()) {
+ if(!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Create contents of the dialog.
+ */
+ protected void createContents() {
+ org.eclipse.swt.graphics.Rectangle rect=Display.getDefault().getBounds();
+
+ shlChooseElement = new Shell(getParent(), getStyle());
+ shlChooseElement.setSize(450, 300);
+ shlChooseElement.setText("Choose element");
+ shlChooseElement.setLayout(new FillLayout(SWT.HORIZONTAL));
+ shlChooseElement.setLocation(new Point(rect.x+(rect.width/2), rect.y+(rect.height/2)-shlChooseElement.getSize().y));
+ Composite contentComposite = new Composite(shlChooseElement, SWT.NONE);
+ contentComposite.setLayout(null);
+
+ btnSelect = new Button(contentComposite, SWT.NONE);
+
+ btnSelect.setBounds(353, 235, 68, 23);
+ btnSelect.setText("Select");
+
+ btnCancel = new Button(contentComposite, SWT.NONE);
+ btnCancel.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ }
+ });
+ btnCancel.setBounds(262, 235, 68, 23);
+ btnCancel.setText("Cancel");
+
+ filtercontrol =new FilteredTree(contentComposite, SWT.BORDER, new PatternFilter(), true);
+ filtercontrol.setBounds(10, 10, 424, 219);
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboDialogWithMessage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboDialogWithMessage.java
index ac93d350895..d7b7b328c47 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboDialogWithMessage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboDialogWithMessage.java
@@ -1,111 +1,111 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * this class provides a combo, with a warning message when the list is empty
- */
-public class ComboDialogWithMessage extends ComboInputDialog {
-
- /**
- * Error message label widget.
- */
- private CLabel warningMessageText;
-
- /**
- * Error message string.
- */
- private String warningMessage;
-
- /**
- * the warning icon
- */
- private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
-
- protected ComboDialogWithMessage(Shell parentShell, String title, String message, String initialValue, String[] elementsList, String warningMessage) {
- super(parentShell, title, message, initialValue, elementsList);
- this.warningMessage = warningMessage;
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.ui.dialogs.InputDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- *
- * @param parent
- * @return
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- // create composite
- Composite composite = (Composite)super.createDialogArea(parent);
- if(getElementList() == null || (getElementList().length == 1 && getElementList()[0].equals(""))) { //$NON-NLS-1$
- warningMessageText = new CLabel(composite, SWT.READ_ONLY | SWT.WRAP);
- warningMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
- warningMessageText.setBackground(warningMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- // Set the error message text
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
- setWarningMessage(warningMessage);
- }
- applyDialogFont(composite);
- return composite;
- }
-
- /**
- * Set the warning message
- *
- * @param warningMessage
- */
- public void setWarningMessage(String warningMessage) {
- this.warningMessage = warningMessage;
- if((warningMessageText != null) && !warningMessageText.isDisposed()) {
- Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
- warningMessageText.setImage(warningMessage == null ? null : errorImage);
- warningMessageText.setText(warningMessage == null ? "" : warningMessage); //$NON-NLS-1$
- warningMessageText.getParent().update();
- // Access the ok button by id, in case clients have overridden
- // button creation.
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
-
- Control button = getButton(IDialogConstants.OK_ID);
- if(button != null) {
- button.setEnabled(warningMessage == null);
- }
- }
- }
-
- /**
- * Returns the style bits that should be used for the input text field.
- * Defaults to a single line entry. Subclasses may override.
- *
- * @return the integer style bits that should be used when creating the
- * input text
- *
- * @since 3.4
- */
- protected int getInputTextStyle() {
- return SWT.SINGLE | SWT.BORDER;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ *
+ * this class provides a combo, with a warning message when the list is empty
+ */
+public class ComboDialogWithMessage extends ComboInputDialog {
+
+ /**
+ * Error message label widget.
+ */
+ private CLabel warningMessageText;
+
+ /**
+ * Error message string.
+ */
+ private String warningMessage;
+
+ /**
+ * the warning icon
+ */
+ private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
+
+ protected ComboDialogWithMessage(Shell parentShell, String title, String message, String initialValue, String[] elementsList, String warningMessage) {
+ super(parentShell, title, message, initialValue, elementsList);
+ this.warningMessage = warningMessage;
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.ui.dialogs.InputDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * @return
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ // create composite
+ Composite composite = (Composite)super.createDialogArea(parent);
+ if(getElementList() == null || (getElementList().length == 1 && getElementList()[0].equals(""))) { //$NON-NLS-1$
+ warningMessageText = new CLabel(composite, SWT.READ_ONLY | SWT.WRAP);
+ warningMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+ warningMessageText.setBackground(warningMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ // Set the error message text
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
+ setWarningMessage(warningMessage);
+ }
+ applyDialogFont(composite);
+ return composite;
+ }
+
+ /**
+ * Set the warning message
+ *
+ * @param warningMessage
+ */
+ public void setWarningMessage(String warningMessage) {
+ this.warningMessage = warningMessage;
+ if((warningMessageText != null) && !warningMessageText.isDisposed()) {
+ Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
+ warningMessageText.setImage(warningMessage == null ? null : errorImage);
+ warningMessageText.setText(warningMessage == null ? "" : warningMessage); //$NON-NLS-1$
+ warningMessageText.getParent().update();
+ // Access the ok button by id, in case clients have overridden
+ // button creation.
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
+
+ Control button = getButton(IDialogConstants.OK_ID);
+ if(button != null) {
+ button.setEnabled(warningMessage == null);
+ }
+ }
+ }
+
+ /**
+ * Returns the style bits that should be used for the input text field.
+ * Defaults to a single line entry. Subclasses may override.
+ *
+ * @return the integer style bits that should be used when creating the
+ * input text
+ *
+ * @since 3.4
+ */
+ protected int getInputTextStyle() {
+ return SWT.SINGLE | SWT.BORDER;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboInputDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboInputDialog.java
index 4e8db2c785e..f91342bc80b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboInputDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ComboInputDialog.java
@@ -1,103 +1,103 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * this class allows to have a list to choose one element!
- *
- */
-public class ComboInputDialog extends InputDialog {
-
- /**
- * index of selection
- */
- private int indexOfSelection = 0;
-
- /**
- * The combo.
- */
- protected Combo combo;
-
- /**
- * The elements list.
- */
- protected String[] elementsList = null;
-
- /**
- * Constructor.
- *
- * @param parentShell
- */
- protected ComboInputDialog(Shell parentShell, String title, String message, String initialValue, String[] elementsList) {
- super(parentShell, title, message, initialValue);
- this.elementsList = elementsList;
- }
-
- /**
- * Ok pressed.
- */
- @Override
- protected void okPressed() {
- setValue(elementsList[combo.getSelectionIndex()]);
- indexOfSelection = combo.getSelectionIndex();
- super.okPressed();
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.ui.dialogs.InputDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- *
- * @param parent
- * @return
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite comp = (Composite)super.createDialogArea(parent);
- combo = new Combo(comp, SWT.READ_ONLY);// with READ_ONLY, we can't edit
- // the selection!
- if(elementsList == null) {
- combo.setItems(new String[]{ "" }); //$NON-NLS-1$
- } else {
- combo.setItems(elementsList);
- }
- // the width of the list depends of the windows size and note of the
- // element from elementsList
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- combo.setLayoutData(data);
- return comp;
- }
-
- /**
- *
- * @return indexOfSelection
- */
- public int getIndexOfSelection() {
- return this.indexOfSelection;
- }
-
- /**
- *
- * @return
- */
- protected String[] getElementList() {
- return this.elementsList;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * this class allows to have a list to choose one element!
+ *
+ */
+public class ComboInputDialog extends InputDialog {
+
+ /**
+ * index of selection
+ */
+ private int indexOfSelection = 0;
+
+ /**
+ * The combo.
+ */
+ protected Combo combo;
+
+ /**
+ * The elements list.
+ */
+ protected String[] elementsList = null;
+
+ /**
+ * Constructor.
+ *
+ * @param parentShell
+ */
+ protected ComboInputDialog(Shell parentShell, String title, String message, String initialValue, String[] elementsList) {
+ super(parentShell, title, message, initialValue);
+ this.elementsList = elementsList;
+ }
+
+ /**
+ * Ok pressed.
+ */
+ @Override
+ protected void okPressed() {
+ setValue(elementsList[combo.getSelectionIndex()]);
+ indexOfSelection = combo.getSelectionIndex();
+ super.okPressed();
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.ui.dialogs.InputDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * @return
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite comp = (Composite)super.createDialogArea(parent);
+ combo = new Combo(comp, SWT.READ_ONLY);// with READ_ONLY, we can't edit
+ // the selection!
+ if(elementsList == null) {
+ combo.setItems(new String[]{ "" }); //$NON-NLS-1$
+ } else {
+ combo.setItems(elementsList);
+ }
+ // the width of the list depends of the windows size and note of the
+ // element from elementsList
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
+ combo.setLayoutData(data);
+ return comp;
+ }
+
+ /**
+ *
+ * @return indexOfSelection
+ */
+ public int getIndexOfSelection() {
+ return this.indexOfSelection;
+ }
+
+ /**
+ *
+ * @return
+ */
+ protected String[] getElementList() {
+ return this.elementsList;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ElementChooseDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ElementChooseDialog.java
index 657174262eb..cb4f17e5a61 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ElementChooseDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/ElementChooseDialog.java
@@ -1,206 +1,206 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.ParameterableElement;
-
-/**
- * this classs is used to display a ui in order to look for a kind of element, with a treeviewer
- *
- */
-public class ElementChooseDialog extends AbstractChooseElement {
-
- /** The adapter factory. */
- protected AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- /** The tree viewer. */
- protected TreeViewer treeViewer;
- /** the root element*/
- protected Element context;
- /** the selected element**/
- protected Element selectedElement=null;
- /** the kind of element that we do not want to select**/
- protected List<EClass> notWanted=new ArrayList<EClass>();
-
- /** the kind of element that we look for**/
- private EClass elementtype;
-
-/**
- *
- * @return the selected element
- */
- public Element getSelectedElement() {
- return selectedElement;
- }
- /**
- *
- * create the dialog box
- *
- * @param parent the parent shell
- * @param style the style of the dialog box
- * @param context the root element where we look for
- * @param elementtype the kind of element that we look for
- */
- public ElementChooseDialog(Shell parent, int style, Element context,EClass elementtype) {
- super(parent, style);
- this.context=context;
- this.elementtype=elementtype;
- this.notWanted=new ArrayList<EClass>();
- }
- /**
- *
- * Create the dialobox
- *
- * @param parent the parent shell
- * @param style the style of the dialog box
- * @param context the root element where we look for
- * @param elementtype the kind of element that we look for
- * @param notWanted the list of element that we do not want to select (list of subclasses of elementtype) cannot be null
- */
- public ElementChooseDialog(Shell parent, int style, Element context,EClass elementtype,List<EClass> notWanted) {
- super(parent, style);
- this.context=context;
- this.elementtype=elementtype;
- assert(notWanted!=null);
- this.notWanted=notWanted;
- }
-
- @Override
- protected void createContents() {
- // TODO Auto-generated method stub
- super.createContents();
- // intall tree with uml element
- treeViewer = filtercontrol.getViewer();
- treeViewer.setUseHashlookup(true);
-
- //inner class of filter.
- //display a parent if its childreen can be choosen
- treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- ViewerFilter filter= new ViewerFilter() {
-
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof EObject){//it contains nothing
- EObject eObject=(EObject)element;
- if(eObject.eContents().size()==0){
- return isSelectableEobject(eObject);
- }
- else{ //it contains something so we have to test children before
- boolean result=false;
- if(isSelectableEobject(eObject)){
- return true;
- }
-
- Iterator<EObject>iter=eObject.eAllContents();
- while(iter.hasNext()){
- EObject subEObject= iter.next();
- boolean contains=select(viewer,eObject,subEObject);
- result=result||contains;
- }
- return result;
-
-
- }
- }
- return false;
- }
- };
- ViewerFilter[] filters={filter};
- treeViewer.setFilters(filters);
-
- treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
- treeViewer.setInput(context);
-
-
- treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- Object selection = ((IStructuredSelection)filtercontrol.getViewer().getSelection()).getFirstElement();
- if(selection instanceof EObject ) {
- if(isSelectableEobject(((EObject)selection))){
- btnSelect.setEnabled(true);
- result = (ParameterableElement)selection;
- selectedElement= (ParameterableElement)selection;
- }
- else{
- btnSelect.setEnabled(false);
- result = null;
- selectedElement= null;
- }
- }
-
- }
- });
- btnSelect.addMouseListener(new MouseListener() {
-
- public void mouseUp(MouseEvent e) {
- getParent().close();
- }
-
- public void mouseDown(MouseEvent e) {}
- public void mouseDoubleClick(MouseEvent e) {}
- });
-
- btnCancel.addMouseListener(new MouseListener() {
-
- public void mouseUp(MouseEvent e) {
- result=null;
- selectedElement=null;
- getParent().close();
- }
-
- public void mouseDown(MouseEvent e) {}
- public void mouseDoubleClick(MouseEvent e) {}
- });
- }
-
- /**
- *
- * @param eObject that we want to test
- * @return true if the eobject can be choosen, ie this is an instance of elementType and not instance of all type contained into notWanted
- */
- protected boolean isSelectableEobject(EObject eObject){
- if(elementtype.isSuperTypeOf(eObject.eClass())){
- if(notWanted.size()>0){
- Iterator<EClass> iternotwanted= notWanted.iterator();
- while( iternotwanted.hasNext()){
- if(iternotwanted.next().isSuperTypeOf(eObject.eClass())){
- return false;
- }
- }
- }
- return true;
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ */
+package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.ParameterableElement;
+
+/**
+ * this classs is used to display a ui in order to look for a kind of element, with a treeviewer
+ *
+ */
+public class ElementChooseDialog extends AbstractChooseElement {
+
+ /** The adapter factory. */
+ protected AdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+
+ /** The tree viewer. */
+ protected TreeViewer treeViewer;
+ /** the root element*/
+ protected Element context;
+ /** the selected element**/
+ protected Element selectedElement=null;
+ /** the kind of element that we do not want to select**/
+ protected List<EClass> notWanted=new ArrayList<EClass>();
+
+ /** the kind of element that we look for**/
+ private EClass elementtype;
+
+/**
+ *
+ * @return the selected element
+ */
+ public Element getSelectedElement() {
+ return selectedElement;
+ }
+ /**
+ *
+ * create the dialog box
+ *
+ * @param parent the parent shell
+ * @param style the style of the dialog box
+ * @param context the root element where we look for
+ * @param elementtype the kind of element that we look for
+ */
+ public ElementChooseDialog(Shell parent, int style, Element context,EClass elementtype) {
+ super(parent, style);
+ this.context=context;
+ this.elementtype=elementtype;
+ this.notWanted=new ArrayList<EClass>();
+ }
+ /**
+ *
+ * Create the dialobox
+ *
+ * @param parent the parent shell
+ * @param style the style of the dialog box
+ * @param context the root element where we look for
+ * @param elementtype the kind of element that we look for
+ * @param notWanted the list of element that we do not want to select (list of subclasses of elementtype) cannot be null
+ */
+ public ElementChooseDialog(Shell parent, int style, Element context,EClass elementtype,List<EClass> notWanted) {
+ super(parent, style);
+ this.context=context;
+ this.elementtype=elementtype;
+ assert(notWanted!=null);
+ this.notWanted=notWanted;
+ }
+
+ @Override
+ protected void createContents() {
+ // TODO Auto-generated method stub
+ super.createContents();
+ // intall tree with uml element
+ treeViewer = filtercontrol.getViewer();
+ treeViewer.setUseHashlookup(true);
+
+ //inner class of filter.
+ //display a parent if its childreen can be choosen
+ treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
+ ViewerFilter filter= new ViewerFilter() {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof EObject){//it contains nothing
+ EObject eObject=(EObject)element;
+ if(eObject.eContents().size()==0){
+ return isSelectableEobject(eObject);
+ }
+ else{ //it contains something so we have to test children before
+ boolean result=false;
+ if(isSelectableEobject(eObject)){
+ return true;
+ }
+
+ Iterator<EObject>iter=eObject.eAllContents();
+ while(iter.hasNext()){
+ EObject subEObject= iter.next();
+ boolean contains=select(viewer,eObject,subEObject);
+ result=result||contains;
+ }
+ return result;
+
+
+ }
+ }
+ return false;
+ }
+ };
+ ViewerFilter[] filters={filter};
+ treeViewer.setFilters(filters);
+
+ treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
+ treeViewer.setInput(context);
+
+
+ treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+ public void selectionChanged(SelectionChangedEvent event) {
+ Object selection = ((IStructuredSelection)filtercontrol.getViewer().getSelection()).getFirstElement();
+ if(selection instanceof EObject ) {
+ if(isSelectableEobject(((EObject)selection))){
+ btnSelect.setEnabled(true);
+ result = (ParameterableElement)selection;
+ selectedElement= (ParameterableElement)selection;
+ }
+ else{
+ btnSelect.setEnabled(false);
+ result = null;
+ selectedElement= null;
+ }
+ }
+
+ }
+ });
+ btnSelect.addMouseListener(new MouseListener() {
+
+ public void mouseUp(MouseEvent e) {
+ getParent().close();
+ }
+
+ public void mouseDown(MouseEvent e) {}
+ public void mouseDoubleClick(MouseEvent e) {}
+ });
+
+ btnCancel.addMouseListener(new MouseListener() {
+
+ public void mouseUp(MouseEvent e) {
+ result=null;
+ selectedElement=null;
+ getParent().close();
+ }
+
+ public void mouseDown(MouseEvent e) {}
+ public void mouseDoubleClick(MouseEvent e) {}
+ });
+ }
+
+ /**
+ *
+ * @param eObject that we want to test
+ * @return true if the eobject can be choosen, ie this is an instance of elementType and not instance of all type contained into notWanted
+ */
+ protected boolean isSelectableEobject(EObject eObject){
+ if(elementtype.isSuperTypeOf(eObject.eClass())){
+ if(notWanted.size()>0){
+ Iterator<EClass> iternotwanted= notWanted.iterator();
+ while( iternotwanted.hasNext()){
+ if(iternotwanted.next().isSuperTypeOf(eObject.eClass())){
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialog.java
index e9f32bc9573..2077090af82 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialog.java
@@ -1,114 +1,114 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-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.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This class provides a Window with :
- * <ul>
- * <li>a title</li>
- * <li>a message</li>
- * <li>an OK button</li>
- * <li>a Cancel button</li>
- * </ul>
- */
-public class InputDialog extends Dialog {
-
- /** The title of the dialog. */
-
- private final String title;
-
- /** The message to display, or <code>null</code> if none. */
-
- private final String message;
-
- /** The initial value. */
-
- protected String initialValue = ""; //$NON-NLS-1$
-
- private String value = ""; //$NON-NLS-1$
-
- /**
- * Constructor.
- *
- * @param parentShell
- * @param initialValue
- */
- public InputDialog(Shell parentShell, String title, String message, String initialValue) {
- super(parentShell);
- this.title = title;
- this.message = message;
- if(initialValue != null) {
-
- this.initialValue = initialValue;
- this.value = initialValue;
- }
- }
-
- /**
- * Gets the value.
- *
- * @return the value
- */
- public String getValue() {
- return value;
- }
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- if(title != null) {
- shell.setText(title);
- }
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- *
- * @param parent
- * @return
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite)super.createDialogArea(parent);
-
- if(message != null) {
- Label label = new Label(composite, SWT.WRAP);
- label.setText(message);
- GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
- label.setLayoutData(data);
- label.setFont(parent.getFont());
- }
- return composite;
- }
-
- /**
- * Set the value
- *
- * @param newValue
- */
- protected void setValue(String newValue) {
- this.value = newValue;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+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.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * This class provides a Window with :
+ * <ul>
+ * <li>a title</li>
+ * <li>a message</li>
+ * <li>an OK button</li>
+ * <li>a Cancel button</li>
+ * </ul>
+ */
+public class InputDialog extends Dialog {
+
+ /** The title of the dialog. */
+
+ private final String title;
+
+ /** The message to display, or <code>null</code> if none. */
+
+ private final String message;
+
+ /** The initial value. */
+
+ protected String initialValue = ""; //$NON-NLS-1$
+
+ private String value = ""; //$NON-NLS-1$
+
+ /**
+ * Constructor.
+ *
+ * @param parentShell
+ * @param initialValue
+ */
+ public InputDialog(Shell parentShell, String title, String message, String initialValue) {
+ super(parentShell);
+ this.title = title;
+ this.message = message;
+ if(initialValue != null) {
+
+ this.initialValue = initialValue;
+ this.value = initialValue;
+ }
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ if(title != null) {
+ shell.setText(title);
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * @return
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite composite = (Composite)super.createDialogArea(parent);
+
+ if(message != null) {
+ Label label = new Label(composite, SWT.WRAP);
+ label.setText(message);
+ GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+ label.setLayoutData(data);
+ label.setFont(parent.getFont());
+ }
+ return composite;
+ }
+
+ /**
+ * Set the value
+ *
+ * @param newValue
+ */
+ protected void setValue(String newValue) {
+ this.value = newValue;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialogMessage.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialogMessage.java
index 177f7409396..03be2bdb0de 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialogMessage.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/InputDialogMessage.java
@@ -1,190 +1,190 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
-
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Image;
-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.swt.widgets.Text;
-
-/**
- * This class provides a text area, with a validator to edit a text
- */
-public class InputDialogMessage extends InputDialog {
-
- /** the warning icon */
- private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
-
- /** Input text widget. */
-
- private Text text;
-
- /** Error message label widget. */
- private CLabel warningMessageText;
-
- /** Error message string. */
-
- private String warningMessage;
-
- /** Input Validator, can be null */
- private final IInputValidator validator;
-
- /**
- * Constructor.
- *
- * @param parentShell
- */
- protected InputDialogMessage(Shell parentShell, String dialogTitle, String errorMessage, String initialValue, IInputValidator validator) {
- super(parentShell, dialogTitle, errorMessage, initialValue);
- this.validator = validator;
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- *
- */
- @Override
- protected void okPressed() {
- setValue(text.getText());
- super.okPressed();
- }
-
- /**
- *
- * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- *
- * @param parent
- */
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- text.setFocus();
- if(getValue() != null) {
- text.setText(getValue());
- text.selectAll();
- }
- }
-
- /**
- *
- * @see org.eclipse.papyrus.uml.diagram.common.ui.dialogs.InputDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- *
- * @param parent
- * @return
- */
- @Override
- protected Control createDialogArea(Composite parent) {
- // create composite
- Composite composite = (Composite)super.createDialogArea(parent);
-
- text = new Text(composite, getInputTextStyle());
- text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
- text.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- validateInput();
- }
- });
- warningMessageText = new CLabel(composite, SWT.READ_ONLY | SWT.WRAP);
- warningMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
- warningMessageText.setBackground(warningMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- // Set the error message text
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
- setWarningMessage(warningMessage);
-
- applyDialogFont(composite);
- return composite;
- }
-
- /**
- * Returns the text area.
- *
- * @return the text area
- */
- protected Text getText() {
- return text;
- }
-
- /**
- * Returns the validator.
- *
- * @return the validator
- */
- protected IInputValidator getValidator() {
- return validator;
- }
-
- /**
- * Validates the input.
- * <p>
- * The default implementation of this framework method delegates the request to the supplied input validator object; if it finds the input
- * invalid, the error message is displayed in the dialog's message line. This hook method is called whenever the text changes in the input field.
- * </p>
- */
- protected void validateInput() {
- String errorMessage = null;
- if(validator != null) {
- errorMessage = validator.isValid(text.getText());
- }
- // Bug 16256: important not to treat "" (blank error) the same as null
- // (no error)
- setWarningMessage(errorMessage);
- }
-
- /**
- * Set the warning message
- *
- * @param errorMessage
- */
- public void setWarningMessage(String errorMessage) {
- this.warningMessage = errorMessage;
- if((warningMessageText != null) && !warningMessageText.isDisposed()) {
- Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
- warningMessageText.setImage(errorMessage == null ? null : errorImage);
- warningMessageText.setText(errorMessage == null ? "" : errorMessage); //$NON-NLS-1$
- warningMessageText.getParent().update();
- // Access the ok button by id, in case clients have overridden
- // button creation.
- // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
-
- // Control button = getButton(IDialogConstants.OK_ID);
- // if(button != null) {
- // button.setEnabled(errorMessage == null);
- // }
- }
- }
-
- /**
- * Returns the style bits that should be used for the input text field.
- * Defaults to a single line entry. Subclasses may override.
- *
- * @return the integer style bits that should be used when creating the
- * input text
- *
- * @since 3.4
- */
- protected int getInputTextStyle() {
- return SWT.SINGLE | SWT.BORDER;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
+
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Image;
+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.swt.widgets.Text;
+
+/**
+ * This class provides a text area, with a validator to edit a text
+ */
+public class InputDialogMessage extends InputDialog {
+
+ /** the warning icon */
+ private static final String ICON_WARNING = "/icons/warning.gif"; //$NON-NLS-1$
+
+ /** Input text widget. */
+
+ private Text text;
+
+ /** Error message label widget. */
+ private CLabel warningMessageText;
+
+ /** Error message string. */
+
+ private String warningMessage;
+
+ /** Input Validator, can be null */
+ private final IInputValidator validator;
+
+ /**
+ * Constructor.
+ *
+ * @param parentShell
+ */
+ protected InputDialogMessage(Shell parentShell, String dialogTitle, String errorMessage, String initialValue, IInputValidator validator) {
+ super(parentShell, dialogTitle, errorMessage, initialValue);
+ this.validator = validator;
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ *
+ */
+ @Override
+ protected void okPressed() {
+ setValue(text.getText());
+ super.okPressed();
+ }
+
+ /**
+ *
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ */
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ super.createButtonsForButtonBar(parent);
+ text.setFocus();
+ if(getValue() != null) {
+ text.setText(getValue());
+ text.selectAll();
+ }
+ }
+
+ /**
+ *
+ * @see org.eclipse.papyrus.uml.diagram.common.ui.dialogs.InputDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ *
+ * @param parent
+ * @return
+ */
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ // create composite
+ Composite composite = (Composite)super.createDialogArea(parent);
+
+ text = new Text(composite, getInputTextStyle());
+ text.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+ text.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ validateInput();
+ }
+ });
+ warningMessageText = new CLabel(composite, SWT.READ_ONLY | SWT.WRAP);
+ warningMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+ warningMessageText.setBackground(warningMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ // Set the error message text
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
+ setWarningMessage(warningMessage);
+
+ applyDialogFont(composite);
+ return composite;
+ }
+
+ /**
+ * Returns the text area.
+ *
+ * @return the text area
+ */
+ protected Text getText() {
+ return text;
+ }
+
+ /**
+ * Returns the validator.
+ *
+ * @return the validator
+ */
+ protected IInputValidator getValidator() {
+ return validator;
+ }
+
+ /**
+ * Validates the input.
+ * <p>
+ * The default implementation of this framework method delegates the request to the supplied input validator object; if it finds the input
+ * invalid, the error message is displayed in the dialog's message line. This hook method is called whenever the text changes in the input field.
+ * </p>
+ */
+ protected void validateInput() {
+ String errorMessage = null;
+ if(validator != null) {
+ errorMessage = validator.isValid(text.getText());
+ }
+ // Bug 16256: important not to treat "" (blank error) the same as null
+ // (no error)
+ setWarningMessage(errorMessage);
+ }
+
+ /**
+ * Set the warning message
+ *
+ * @param errorMessage
+ */
+ public void setWarningMessage(String errorMessage) {
+ this.warningMessage = errorMessage;
+ if((warningMessageText != null) && !warningMessageText.isDisposed()) {
+ Image errorImage = Activator.getPluginIconImage(Activator.ID, ICON_WARNING);
+ warningMessageText.setImage(errorMessage == null ? null : errorImage);
+ warningMessageText.setText(errorMessage == null ? "" : errorMessage); //$NON-NLS-1$
+ warningMessageText.getParent().update();
+ // Access the ok button by id, in case clients have overridden
+ // button creation.
+ // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=113643
+
+ // Control button = getButton(IDialogConstants.OK_ID);
+ // if(button != null) {
+ // button.setEnabled(errorMessage == null);
+ // }
+ }
+ }
+
+ /**
+ * Returns the style bits that should be used for the input text field.
+ * Defaults to a single line entry. Subclasses may override.
+ *
+ * @return the integer style bits that should be used when creating the
+ * input text
+ *
+ * @since 3.4
+ */
+ protected int getInputTextStyle() {
+ return SWT.SINGLE | SWT.BORDER;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/PropertyEditors.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/PropertyEditors.java
index 644a01f7fab..c1225d97286 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/PropertyEditors.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/dialogs/PropertyEditors.java
@@ -1,504 +1,504 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.papyrus.infra.widgets.validator.IntegerInputValidator;
-import org.eclipse.papyrus.infra.widgets.validator.RealInputValidator;
-import org.eclipse.papyrus.infra.widgets.validator.UnlimitedNaturalInputValidator;
-import org.eclipse.papyrus.uml.diagram.common.Messages;
-import org.eclipse.papyrus.uml.diagram.common.util.Util;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.uml2.common.util.UML2Util;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Enumeration;
-import org.eclipse.uml2.uml.EnumerationLiteral;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * this class provides editor for different types of properties
- */
-public class PropertyEditors {
-
- /**
- * Editor's Titles
- */
- /** IntegerEditor Title */
- public static final String IntegerEditor_Title = Messages.PropertyEditors_IntegerTitle;
-
- /** IntegerEditor Title */
- public static final String RealEditor_Title = Messages.PropertyEditors_RealTitle;
-
-
- /** UnlimitedNaturalEditor Title */
- public static final String UnlimitedNaturalEditor_Title = Messages.PropertyEditors_UnlimitedNaturalTitle;
-
- /** StringEditor Title */
- public static final String StringEditor_Title = Messages.PropertyEditors_StringTitle;
-
- /** BooleanEditor Title */
- public static final String BooleanEditor_Title = Messages.PropertyEditors_BooleanTitle;
-
- /** EnumerationEditor Title */
- public static final String EnumerationLiteralEditor_Title = Messages.PropertyEditors_EnumerationLiteralTitle;
-
- /** StereotypeEditor Title */
- private static final String StereotypeEditor_Title = Messages.PropertyEditors_StereotypeTitle;
-
- /** MetaclassEditor Title */
- private static final String MetaclassEditor_Title = Messages.PropertyEditors_MetaclassTitle;
-
- /** DataTypeEditor Title */
- private static final String DataTypeEditor_Title = Messages.PropertyEditors_DataTypeTitle;
-
- /*
- * Messages for editors
- */
- /** the "Value" String */
- public static final String Value = Messages.PropertyEditors_Value;
-
- /** the "Choice" String */
- public static final String Choice = Messages.PropertyEditors_Choice;
-
- /*
- * warning messages
- */
- /** warning message for metaclass editor */
- public static final String MetaclassEditor_WarningMessage = Messages.PropertyEditors_NoFoundElementMetaclass;
-
- /** warning message for stereotype editor */
- public static final String StereotypeEditor_WarningMessage = Messages.PropertyEditors_NoFoundElementStereotype;
-
- /** prefix for the uml elements */
- public static final String UML_PREFIX = "org.eclipse.uml2.uml."; //$NON-NLS-1$
-
- /** the UML elements who aren't NamedElement */
- static String unNamedElements[] = new String[]{ "ActivityGroup", "Clause", "Comment", "ExceptionHandler", "Image", "LinkEndData", "MultiplicityElement", "ParameterableElement", "QualifierValue", "Relationship", "Slot", "TemplateableElement", "TemplateParameter", "TemplateParameterSubstitution", "TemplateableParameterSubsitution", }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$ //$NON-NLS-14$ //$NON-NLS-15$
-
- // TODO : we doesn't know edit a property if the initial value is a property
- // need implements this functionality is editors
- /**
- * Editor for the Type Integer.
- *
- * @param property
- * : the property to edit
- * @param oldValue
- * : the property value to modify (can be null)
- *
- * @return String : null if nothing is written
- *
- */
- public static String IntegerEditor(Property property, Object oldValue) {
- String value = null;
- String initialValue = findInitialValue(property, oldValue);
- InputDialogMessage dialog = new InputDialogMessage(new Shell(), IntegerEditor_Title, Value, initialValue, new IntegerInputValidator());
- if(dialog.open() != InputDialogMessage.CANCEL) {
- if(!"".equals(dialog.getValue())) { //$NON-NLS-1$
- value = dialog.getValue();
- }
- } else {
- value = oldValue.toString();
- }
- return value;
- }
-
- /**
- * Editor for the Type Integer.
- *
- * @param property
- * : the property to edit
- * @param oldValue
- * : the property value to modify (can be null)
- *
- * @return String : null if nothing is written
- *
- */
- public static String RealEditor(Property property, Object oldValue) {
- String value = null;
- String initialValue = findInitialValue(property, oldValue);
- InputDialogMessage dialog = new InputDialogMessage(new Shell(), RealEditor_Title, Value, initialValue, new RealInputValidator());
- if(dialog.open() != InputDialogMessage.CANCEL) {
- if(!"".equals(dialog.getValue())) { //$NON-NLS-1$
- value = dialog.getValue();
- }
- } else {
- value = oldValue.toString();
- }
- return value;
- }
-
- /**
- *
- * @param property
- * (the property to edit)
- * @param oldValue
- * (can be null)
- * @return the inital value for the property
- */
- private static String findInitialValue(Property property, Object oldValue) {
- String initialValue = null;
- if(oldValue != null) {
- initialValue = oldValue.toString();
- } else if(property.isSetDefault()) {
- initialValue = property.getDefault();
- }
- return initialValue;
- }
-
- /**
- * Editor for the Type UnlimitedNatural.
- *
- * @param property
- * : the property to edit
- * @param oldValue
- * : the property value to modify (can be null)
- *
- * @return String : null if nothing is written
- *
- */
- public static String UnlimitedNaturalEditor(Property property, Object oldValue) {
- String value = null;
- String initialValue = findInitialValue(property, oldValue);
- InputDialogMessage dialog = new InputDialogMessage(new Shell(), UnlimitedNaturalEditor_Title, Value, initialValue, new UnlimitedNaturalInputValidator());
- if(dialog.open() != InputDialogMessage.CANCEL) {
- if(!"".equals(dialog.getValue())) { //$NON-NLS-1$
- value = dialog.getValue();
- }
- } else {
- if(value != null) {
- value = oldValue.toString();
- }
- }
- return value;
- }
-
- /**
- * Editor for the Type String.
- *
- * @param property
- * : the property to edit
- * @param oldValue
- * : the property value to modify (can be null)
- *
- * @return String : null if nothing written
- */
- public static String StringEditor(Property property, Object oldValue) {
- String value = null;
- String initialValue = findInitialValue(property, oldValue);
- InputDialogMessage dialog = new InputDialogMessage(new Shell(), StringEditor_Title, Value, initialValue, null);
- if(dialog.open() != InputDialogMessage.CANCEL) {
- value = new String(dialog.getValue());
- if(value.equals("")) { //$NON-NLS-1$
- value = null;
- }
- } else {
- if(oldValue != null) {
- return oldValue.toString();
- }
- }
- return value;
-
- }
-
- /**
- * Editor for the type DataType
- *
- * @param property
- * : the property to edit
- * @param oldValue
- * : the property value to modify (can be null)
- * @return
- */
- public static String DataTypeEditor(Property property, Object oldValue) {
- String value = null;
- String initialValue = null;
- if(oldValue != null) { // we are modifying an existing value
- initialValue = oldValue.toString();
- } else if(property.isSetDefault()) {
- initialValue = property.getDefault();
- }
-
- InputDialogMessage dialog = new InputDialogMessage(new Shell(), DataTypeEditor_Title, Value, initialValue, null);
- if(dialog.open() != InputDialogMessage.CANCEL) {
- if(!"".equals(dialog.getValue())) { //$NON-NLS-1$
- value = dialog.getValue();
- }
- } else {
- if(oldValue != null) {
- value = oldValue.toString();
- }
- }
- return value;
- }
-
- /**
- * Editor for the Type Boolean.
- *
- * @param property
- * : the property to edit
- * @param oldValue
- * : the property value to modify (can be null)
- *
- * @return boolean : null if nothing is selected
- *
- */
- public static String BooleanEditor(Property property, Object oldValue) {
- String[] listOfChoice;
- String value = null;
- if(property.getLower() > 0) {
- listOfChoice = new String[]{ Boolean.FALSE.toString(), Boolean.TRUE.toString() };
- } else {
-
- listOfChoice = new String[]{ "", Boolean.FALSE.toString(), Boolean.TRUE.toString() }; //$NON-NLS-1$
- }
- String initialValue = findInitialValue(property, oldValue);
-
- ComboInputDialog dialog = new ComboInputDialog(new Shell(), BooleanEditor_Title, Choice, initialValue, listOfChoice);
- if(dialog.open() != ComboInputDialog.CANCEL) {
- int selection = dialog.getIndexOfSelection();
- if(listOfChoice[selection] != "") { //$NON-NLS-1$
- value = listOfChoice[selection];
- }
- } else if(oldValue != null) {
- value = oldValue.toString();
- }
- return value;
- }
-
- /**
- * Editor for the Type EnumerationLiteral.
- *
- * @param property
- * : the property to edit
- * @param oldValue
- * : the property value to modify (can be null)
- *
- * @return EnumerationLiteral : null if nothing is selected
- *
- */
- public static String EnumerationEditor(Property property, Object oldValue) {
- EList<EnumerationLiteral> literals = ((Enumeration)property.getType()).getOwnedLiterals();
- String initialValue = findInitialValue(property, oldValue);
- String value = null;
- String[] listOfChoice;
-
- if(property.getLower() > 0) {
- listOfChoice = new String[literals.size()];
- for(int i = 0; i < listOfChoice.length; i++) {
- listOfChoice[i] = literals.get(i).getName();
- }
- } else {
- listOfChoice = new String[literals.size() + 1];
- listOfChoice[0] = ""; //$NON-NLS-1$
- for(int i = 1; i < listOfChoice.length; i++) {
- listOfChoice[i] = literals.get(i - 1).getName();
- }
- }
-
- ComboInputDialog dialog = new ComboInputDialog(new Shell(), EnumerationLiteralEditor_Title, Choice, initialValue, listOfChoice);
- if(dialog.open() != ComboInputDialog.CANCEL) {
- int selection = dialog.getIndexOfSelection();
- if(listOfChoice[selection] != "") { //$NON-NLS-1$
- value = listOfChoice[selection].toString();
- }
- } else if(oldValue != null) {
- value = oldValue.toString();
- }
- return value;
- }
-
- /**
- * Editor for the type Class, when the property is composite
- *
- * @param property
- * @param oldValue
- * @return
- */
- public static String CompositeClassEditor(Property property, Object oldValue) {
- // TODO
- // we cannot do it!
- return oldValue.toString();
- }
-
- /**
- * Editor for the type DataType
- *
- * @param property
- * @param oldValue
- * @param appliedProfiles
- * @return
- */
- public static String StereotypeEditor(Property property, Object oldValue, List<Profile> appliedProfiles) {
- Type type = property.getType();
- String returnedValue = null;
- ArrayList<Object> stereotypedElement = new ArrayList<Object>();
- String initialValue = findInitialValue(property, oldValue);
- String[] proposals = null;
-
- if(type != null) {
- /*
- * we research all the elements stereotyped with type!
- */
- for(Profile profile : appliedProfiles) {
- stereotypedElement.addAll(Util.getInstancesFilteredByType(profile, null, (Stereotype)type));
- }
-
- if(property.getLower() > 0) {
- proposals = new String[stereotypedElement.size()];
- for(int i = 0; i < stereotypedElement.size(); i++) {
- if((stereotypedElement.get(i)) instanceof NamedElement) {
- proposals[i] = ((NamedElement)stereotypedElement.get(i)).getQualifiedName();
- } else {
- // TODO need a solution!
- // String label =
- // ((Element)stereotypedElement.get(i)).toString();
- // proposals[i + 1] = label;
- // //we don't obtain the ID from the XMI!
- // UML2Util.getXMIIdentifier((InternalEObject)(((Element)stereotypedElement.get(i))));
- }
- }
- } else {
- proposals = new String[stereotypedElement.size() + 1];
- proposals[0] = ""; //$NON-NLS-1$
- for(int i = 1; i < proposals.length; i++) {
- if((stereotypedElement.get(i - 1)) instanceof NamedElement) {
- proposals[i] = ((NamedElement)stereotypedElement.get(i - 1)).getQualifiedName();
- } else {
- // TODO need a solution!
- // String label =
- // ((Element)stereotypedElement.get(i)).toString();
- // proposals[i + 1] = label;
- // //we don't obtain the ID from the XMI!
- // UML2Util.getXMIIdentifier((InternalEObject)(((Element)stereotypedElement.get(i))));
- }
- }
- }
-
- ComboDialogWithMessage dialog = new ComboDialogWithMessage(new Shell(), StereotypeEditor_Title, Choice, initialValue, proposals, StereotypeEditor_WarningMessage);
- if(dialog.open() != ComboInputDialog.CANCEL) {
- int selection = dialog.getIndexOfSelection();
- if(proposals[selection] != "") { //$NON-NLS-1$
- returnedValue = dialog.getValue();
- }
-
- } else if(oldValue != null) {
- returnedValue = oldValue.toString();
- }
-
- }
- return returnedValue;
- }
-
- /**
- * Editor for the type Metaclass
- *
- * @param property
- * @param oldValue
- * @param appliedProfiles
- * @return
- */
- public static String MetaclassEditor(Property property, Object oldValue, List<Profile> appliedProfiles) {
-
- /*
- * 1/ find the interesting elements 2/ check if they are problematic 3/
- * create the proposals
- */
- Type type = property.getType();
- String returnedValue = null;
-
- ArrayList<String> problematicMetaclasses = new ArrayList<String>(Arrays.asList(unNamedElements));
- if(type != null && !problematicMetaclasses.contains(((org.eclipse.uml2.uml.Class)type).getName())) {
- String[] proposals;
- ArrayList<Object> metaclassElement = new ArrayList<Object>();
- String initialValue = findInitialValue(property, oldValue);
-
- /*
- * we research all the representation of the metaclass
- */
- String metaclassName = ((org.eclipse.uml2.uml.Class)type).getName();
-
- // Try to retrieve type of the metaclass
- java.lang.Class metaType = null;
- try {
- metaType = java.lang.Class.forName("org.eclipse.uml2.uml." + metaclassName); //$NON-NLS-1$
- } catch (Exception e) {
- e.printStackTrace();
- }
- for(Profile profile : appliedProfiles) {
- metaclassElement.addAll(Util.getInstancesFilteredByType(profile, metaType, null));
- }
-
- /*
- * we create the list of proposals
- */
- if(property.getLower() == 0) {
- proposals = new String[metaclassElement.size() + 1];
- proposals[0] = ""; //$NON-NLS-1$
- for(int i = 0; i < metaclassElement.size(); i++) {
- if(metaclassElement.get(i) instanceof NamedElement) {
- proposals[i + 1] = ((NamedElement)metaclassElement.get(i)).getQualifiedName();
-
- } else {
- // TODO need a solution!
- String label = ((Element)metaclassElement.get(i)).toString();
- proposals[i + 1] = label;
- // we don't obtain the ID from the XMI!
- UML2Util.getXMIIdentifier((InternalEObject)(((Element)metaclassElement.get(i))));
- }
- }
- } else {
- proposals = new String[metaclassElement.size()];
- for(int i = 0; i < metaclassElement.size(); i++) {
- if(metaclassElement.get(i) instanceof NamedElement) {
- proposals[i] = ((NamedElement)metaclassElement.get(i)).getQualifiedName();
-
- } else {
- // TODO need a solution!
- String label = ((Element)metaclassElement.get(i)).toString();
- proposals[i] = label;
- // We don't obtain the ID from the XMI
- UML2Util.getXMIIdentifier((InternalEObject)(((Element)metaclassElement.get(i))));
-
- }
- }
- }
- /*
- * the message dialog
- */
- ComboDialogWithMessage dialog = new ComboDialogWithMessage(new Shell(), MetaclassEditor_Title, Choice, initialValue, proposals, MetaclassEditor_WarningMessage);
- if(dialog.open() != ComboInputDialog.CANCEL) {
- int selection = dialog.getIndexOfSelection();
- if(proposals[selection] != "") { //$NON-NLS-1$
-
- returnedValue = dialog.getValue();
- }
- } else if(oldValue != null) {
- returnedValue = oldValue.toString();
- }
- }
- return returnedValue;
- }
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ui.dialogs;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.papyrus.infra.widgets.validator.IntegerInputValidator;
+import org.eclipse.papyrus.infra.widgets.validator.RealInputValidator;
+import org.eclipse.papyrus.infra.widgets.validator.UnlimitedNaturalInputValidator;
+import org.eclipse.papyrus.uml.diagram.common.Messages;
+import org.eclipse.papyrus.uml.diagram.common.util.Util;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.uml2.common.util.UML2Util;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * this class provides editor for different types of properties
+ */
+public class PropertyEditors {
+
+ /**
+ * Editor's Titles
+ */
+ /** IntegerEditor Title */
+ public static final String IntegerEditor_Title = Messages.PropertyEditors_IntegerTitle;
+
+ /** IntegerEditor Title */
+ public static final String RealEditor_Title = Messages.PropertyEditors_RealTitle;
+
+
+ /** UnlimitedNaturalEditor Title */
+ public static final String UnlimitedNaturalEditor_Title = Messages.PropertyEditors_UnlimitedNaturalTitle;
+
+ /** StringEditor Title */
+ public static final String StringEditor_Title = Messages.PropertyEditors_StringTitle;
+
+ /** BooleanEditor Title */
+ public static final String BooleanEditor_Title = Messages.PropertyEditors_BooleanTitle;
+
+ /** EnumerationEditor Title */
+ public static final String EnumerationLiteralEditor_Title = Messages.PropertyEditors_EnumerationLiteralTitle;
+
+ /** StereotypeEditor Title */
+ private static final String StereotypeEditor_Title = Messages.PropertyEditors_StereotypeTitle;
+
+ /** MetaclassEditor Title */
+ private static final String MetaclassEditor_Title = Messages.PropertyEditors_MetaclassTitle;
+
+ /** DataTypeEditor Title */
+ private static final String DataTypeEditor_Title = Messages.PropertyEditors_DataTypeTitle;
+
+ /*
+ * Messages for editors
+ */
+ /** the "Value" String */
+ public static final String Value = Messages.PropertyEditors_Value;
+
+ /** the "Choice" String */
+ public static final String Choice = Messages.PropertyEditors_Choice;
+
+ /*
+ * warning messages
+ */
+ /** warning message for metaclass editor */
+ public static final String MetaclassEditor_WarningMessage = Messages.PropertyEditors_NoFoundElementMetaclass;
+
+ /** warning message for stereotype editor */
+ public static final String StereotypeEditor_WarningMessage = Messages.PropertyEditors_NoFoundElementStereotype;
+
+ /** prefix for the uml elements */
+ public static final String UML_PREFIX = "org.eclipse.uml2.uml."; //$NON-NLS-1$
+
+ /** the UML elements who aren't NamedElement */
+ static String unNamedElements[] = new String[]{ "ActivityGroup", "Clause", "Comment", "ExceptionHandler", "Image", "LinkEndData", "MultiplicityElement", "ParameterableElement", "QualifierValue", "Relationship", "Slot", "TemplateableElement", "TemplateParameter", "TemplateParameterSubstitution", "TemplateableParameterSubsitution", }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$ //$NON-NLS-14$ //$NON-NLS-15$
+
+ // TODO : we doesn't know edit a property if the initial value is a property
+ // need implements this functionality is editors
+ /**
+ * Editor for the Type Integer.
+ *
+ * @param property
+ * : the property to edit
+ * @param oldValue
+ * : the property value to modify (can be null)
+ *
+ * @return String : null if nothing is written
+ *
+ */
+ public static String IntegerEditor(Property property, Object oldValue) {
+ String value = null;
+ String initialValue = findInitialValue(property, oldValue);
+ InputDialogMessage dialog = new InputDialogMessage(new Shell(), IntegerEditor_Title, Value, initialValue, new IntegerInputValidator());
+ if(dialog.open() != InputDialogMessage.CANCEL) {
+ if(!"".equals(dialog.getValue())) { //$NON-NLS-1$
+ value = dialog.getValue();
+ }
+ } else {
+ value = oldValue.toString();
+ }
+ return value;
+ }
+
+ /**
+ * Editor for the Type Integer.
+ *
+ * @param property
+ * : the property to edit
+ * @param oldValue
+ * : the property value to modify (can be null)
+ *
+ * @return String : null if nothing is written
+ *
+ */
+ public static String RealEditor(Property property, Object oldValue) {
+ String value = null;
+ String initialValue = findInitialValue(property, oldValue);
+ InputDialogMessage dialog = new InputDialogMessage(new Shell(), RealEditor_Title, Value, initialValue, new RealInputValidator());
+ if(dialog.open() != InputDialogMessage.CANCEL) {
+ if(!"".equals(dialog.getValue())) { //$NON-NLS-1$
+ value = dialog.getValue();
+ }
+ } else {
+ value = oldValue.toString();
+ }
+ return value;
+ }
+
+ /**
+ *
+ * @param property
+ * (the property to edit)
+ * @param oldValue
+ * (can be null)
+ * @return the inital value for the property
+ */
+ private static String findInitialValue(Property property, Object oldValue) {
+ String initialValue = null;
+ if(oldValue != null) {
+ initialValue = oldValue.toString();
+ } else if(property.isSetDefault()) {
+ initialValue = property.getDefault();
+ }
+ return initialValue;
+ }
+
+ /**
+ * Editor for the Type UnlimitedNatural.
+ *
+ * @param property
+ * : the property to edit
+ * @param oldValue
+ * : the property value to modify (can be null)
+ *
+ * @return String : null if nothing is written
+ *
+ */
+ public static String UnlimitedNaturalEditor(Property property, Object oldValue) {
+ String value = null;
+ String initialValue = findInitialValue(property, oldValue);
+ InputDialogMessage dialog = new InputDialogMessage(new Shell(), UnlimitedNaturalEditor_Title, Value, initialValue, new UnlimitedNaturalInputValidator());
+ if(dialog.open() != InputDialogMessage.CANCEL) {
+ if(!"".equals(dialog.getValue())) { //$NON-NLS-1$
+ value = dialog.getValue();
+ }
+ } else {
+ if(value != null) {
+ value = oldValue.toString();
+ }
+ }
+ return value;
+ }
+
+ /**
+ * Editor for the Type String.
+ *
+ * @param property
+ * : the property to edit
+ * @param oldValue
+ * : the property value to modify (can be null)
+ *
+ * @return String : null if nothing written
+ */
+ public static String StringEditor(Property property, Object oldValue) {
+ String value = null;
+ String initialValue = findInitialValue(property, oldValue);
+ InputDialogMessage dialog = new InputDialogMessage(new Shell(), StringEditor_Title, Value, initialValue, null);
+ if(dialog.open() != InputDialogMessage.CANCEL) {
+ value = new String(dialog.getValue());
+ if(value.equals("")) { //$NON-NLS-1$
+ value = null;
+ }
+ } else {
+ if(oldValue != null) {
+ return oldValue.toString();
+ }
+ }
+ return value;
+
+ }
+
+ /**
+ * Editor for the type DataType
+ *
+ * @param property
+ * : the property to edit
+ * @param oldValue
+ * : the property value to modify (can be null)
+ * @return
+ */
+ public static String DataTypeEditor(Property property, Object oldValue) {
+ String value = null;
+ String initialValue = null;
+ if(oldValue != null) { // we are modifying an existing value
+ initialValue = oldValue.toString();
+ } else if(property.isSetDefault()) {
+ initialValue = property.getDefault();
+ }
+
+ InputDialogMessage dialog = new InputDialogMessage(new Shell(), DataTypeEditor_Title, Value, initialValue, null);
+ if(dialog.open() != InputDialogMessage.CANCEL) {
+ if(!"".equals(dialog.getValue())) { //$NON-NLS-1$
+ value = dialog.getValue();
+ }
+ } else {
+ if(oldValue != null) {
+ value = oldValue.toString();
+ }
+ }
+ return value;
+ }
+
+ /**
+ * Editor for the Type Boolean.
+ *
+ * @param property
+ * : the property to edit
+ * @param oldValue
+ * : the property value to modify (can be null)
+ *
+ * @return boolean : null if nothing is selected
+ *
+ */
+ public static String BooleanEditor(Property property, Object oldValue) {
+ String[] listOfChoice;
+ String value = null;
+ if(property.getLower() > 0) {
+ listOfChoice = new String[]{ Boolean.FALSE.toString(), Boolean.TRUE.toString() };
+ } else {
+
+ listOfChoice = new String[]{ "", Boolean.FALSE.toString(), Boolean.TRUE.toString() }; //$NON-NLS-1$
+ }
+ String initialValue = findInitialValue(property, oldValue);
+
+ ComboInputDialog dialog = new ComboInputDialog(new Shell(), BooleanEditor_Title, Choice, initialValue, listOfChoice);
+ if(dialog.open() != ComboInputDialog.CANCEL) {
+ int selection = dialog.getIndexOfSelection();
+ if(listOfChoice[selection] != "") { //$NON-NLS-1$
+ value = listOfChoice[selection];
+ }
+ } else if(oldValue != null) {
+ value = oldValue.toString();
+ }
+ return value;
+ }
+
+ /**
+ * Editor for the Type EnumerationLiteral.
+ *
+ * @param property
+ * : the property to edit
+ * @param oldValue
+ * : the property value to modify (can be null)
+ *
+ * @return EnumerationLiteral : null if nothing is selected
+ *
+ */
+ public static String EnumerationEditor(Property property, Object oldValue) {
+ EList<EnumerationLiteral> literals = ((Enumeration)property.getType()).getOwnedLiterals();
+ String initialValue = findInitialValue(property, oldValue);
+ String value = null;
+ String[] listOfChoice;
+
+ if(property.getLower() > 0) {
+ listOfChoice = new String[literals.size()];
+ for(int i = 0; i < listOfChoice.length; i++) {
+ listOfChoice[i] = literals.get(i).getName();
+ }
+ } else {
+ listOfChoice = new String[literals.size() + 1];
+ listOfChoice[0] = ""; //$NON-NLS-1$
+ for(int i = 1; i < listOfChoice.length; i++) {
+ listOfChoice[i] = literals.get(i - 1).getName();
+ }
+ }
+
+ ComboInputDialog dialog = new ComboInputDialog(new Shell(), EnumerationLiteralEditor_Title, Choice, initialValue, listOfChoice);
+ if(dialog.open() != ComboInputDialog.CANCEL) {
+ int selection = dialog.getIndexOfSelection();
+ if(listOfChoice[selection] != "") { //$NON-NLS-1$
+ value = listOfChoice[selection].toString();
+ }
+ } else if(oldValue != null) {
+ value = oldValue.toString();
+ }
+ return value;
+ }
+
+ /**
+ * Editor for the type Class, when the property is composite
+ *
+ * @param property
+ * @param oldValue
+ * @return
+ */
+ public static String CompositeClassEditor(Property property, Object oldValue) {
+ // TODO
+ // we cannot do it!
+ return oldValue.toString();
+ }
+
+ /**
+ * Editor for the type DataType
+ *
+ * @param property
+ * @param oldValue
+ * @param appliedProfiles
+ * @return
+ */
+ public static String StereotypeEditor(Property property, Object oldValue, List<Profile> appliedProfiles) {
+ Type type = property.getType();
+ String returnedValue = null;
+ ArrayList<Object> stereotypedElement = new ArrayList<Object>();
+ String initialValue = findInitialValue(property, oldValue);
+ String[] proposals = null;
+
+ if(type != null) {
+ /*
+ * we research all the elements stereotyped with type!
+ */
+ for(Profile profile : appliedProfiles) {
+ stereotypedElement.addAll(Util.getInstancesFilteredByType(profile, null, (Stereotype)type));
+ }
+
+ if(property.getLower() > 0) {
+ proposals = new String[stereotypedElement.size()];
+ for(int i = 0; i < stereotypedElement.size(); i++) {
+ if((stereotypedElement.get(i)) instanceof NamedElement) {
+ proposals[i] = ((NamedElement)stereotypedElement.get(i)).getQualifiedName();
+ } else {
+ // TODO need a solution!
+ // String label =
+ // ((Element)stereotypedElement.get(i)).toString();
+ // proposals[i + 1] = label;
+ // //we don't obtain the ID from the XMI!
+ // UML2Util.getXMIIdentifier((InternalEObject)(((Element)stereotypedElement.get(i))));
+ }
+ }
+ } else {
+ proposals = new String[stereotypedElement.size() + 1];
+ proposals[0] = ""; //$NON-NLS-1$
+ for(int i = 1; i < proposals.length; i++) {
+ if((stereotypedElement.get(i - 1)) instanceof NamedElement) {
+ proposals[i] = ((NamedElement)stereotypedElement.get(i - 1)).getQualifiedName();
+ } else {
+ // TODO need a solution!
+ // String label =
+ // ((Element)stereotypedElement.get(i)).toString();
+ // proposals[i + 1] = label;
+ // //we don't obtain the ID from the XMI!
+ // UML2Util.getXMIIdentifier((InternalEObject)(((Element)stereotypedElement.get(i))));
+ }
+ }
+ }
+
+ ComboDialogWithMessage dialog = new ComboDialogWithMessage(new Shell(), StereotypeEditor_Title, Choice, initialValue, proposals, StereotypeEditor_WarningMessage);
+ if(dialog.open() != ComboInputDialog.CANCEL) {
+ int selection = dialog.getIndexOfSelection();
+ if(proposals[selection] != "") { //$NON-NLS-1$
+ returnedValue = dialog.getValue();
+ }
+
+ } else if(oldValue != null) {
+ returnedValue = oldValue.toString();
+ }
+
+ }
+ return returnedValue;
+ }
+
+ /**
+ * Editor for the type Metaclass
+ *
+ * @param property
+ * @param oldValue
+ * @param appliedProfiles
+ * @return
+ */
+ public static String MetaclassEditor(Property property, Object oldValue, List<Profile> appliedProfiles) {
+
+ /*
+ * 1/ find the interesting elements 2/ check if they are problematic 3/
+ * create the proposals
+ */
+ Type type = property.getType();
+ String returnedValue = null;
+
+ ArrayList<String> problematicMetaclasses = new ArrayList<String>(Arrays.asList(unNamedElements));
+ if(type != null && !problematicMetaclasses.contains(((org.eclipse.uml2.uml.Class)type).getName())) {
+ String[] proposals;
+ ArrayList<Object> metaclassElement = new ArrayList<Object>();
+ String initialValue = findInitialValue(property, oldValue);
+
+ /*
+ * we research all the representation of the metaclass
+ */
+ String metaclassName = ((org.eclipse.uml2.uml.Class)type).getName();
+
+ // Try to retrieve type of the metaclass
+ java.lang.Class metaType = null;
+ try {
+ metaType = java.lang.Class.forName("org.eclipse.uml2.uml." + metaclassName); //$NON-NLS-1$
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ for(Profile profile : appliedProfiles) {
+ metaclassElement.addAll(Util.getInstancesFilteredByType(profile, metaType, null));
+ }
+
+ /*
+ * we create the list of proposals
+ */
+ if(property.getLower() == 0) {
+ proposals = new String[metaclassElement.size() + 1];
+ proposals[0] = ""; //$NON-NLS-1$
+ for(int i = 0; i < metaclassElement.size(); i++) {
+ if(metaclassElement.get(i) instanceof NamedElement) {
+ proposals[i + 1] = ((NamedElement)metaclassElement.get(i)).getQualifiedName();
+
+ } else {
+ // TODO need a solution!
+ String label = ((Element)metaclassElement.get(i)).toString();
+ proposals[i + 1] = label;
+ // we don't obtain the ID from the XMI!
+ UML2Util.getXMIIdentifier((InternalEObject)(((Element)metaclassElement.get(i))));
+ }
+ }
+ } else {
+ proposals = new String[metaclassElement.size()];
+ for(int i = 0; i < metaclassElement.size(); i++) {
+ if(metaclassElement.get(i) instanceof NamedElement) {
+ proposals[i] = ((NamedElement)metaclassElement.get(i)).getQualifiedName();
+
+ } else {
+ // TODO need a solution!
+ String label = ((Element)metaclassElement.get(i)).toString();
+ proposals[i] = label;
+ // We don't obtain the ID from the XMI
+ UML2Util.getXMIIdentifier((InternalEObject)(((Element)metaclassElement.get(i))));
+
+ }
+ }
+ }
+ /*
+ * the message dialog
+ */
+ ComboDialogWithMessage dialog = new ComboDialogWithMessage(new Shell(), MetaclassEditor_Title, Choice, initialValue, proposals, MetaclassEditor_WarningMessage);
+ if(dialog.open() != ComboInputDialog.CANCEL) {
+ int selection = dialog.getIndexOfSelection();
+ if(proposals[selection] != "") { //$NON-NLS-1$
+
+ returnedValue = dialog.getValue();
+ }
+ } else if(oldValue != null) {
+ returnedValue = oldValue.toString();
+ }
+ }
+ return returnedValue;
+ }
+
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/CustomPopupDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/CustomPopupDialog.java
index 92d69f1a886..2fabaa92aa2 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/CustomPopupDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/CustomPopupDialog.java
@@ -1,182 +1,182 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ui.helper;
-
-import java.util.Collection;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.PopupDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * The Class CustomPopupDialog.
- */
-abstract public class CustomPopupDialog extends PopupDialog {
-
- /** The anchor. */
- private Point fAnchor;
-
- /** The composite. */
- protected Composite composite;
-
- /** The toolkit. */
- protected FormToolkit toolkit;
-
- /** The title. */
- private String title;
-
- /** The form head. */
- protected ScrolledForm formHead;
-
- /**
- * The Class CloseAction.
- */
- private class CloseAction extends Action {
-
- /**
- * {@inheritDoc}
- */
- public ImageDescriptor getImageDescriptor() {
- return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE);
- }
-
- /**
- * {@inheritDoc}
- */
- public void run() {
- close();
- }
- }
-
- /**
- * Instantiates a new custom popup dialog.
- *
- * @param parent
- * the parent
- * @param point
- * the point
- * @param title
- * the title
- */
- public CustomPopupDialog(Shell parent, Point point, String title) {
- super(parent, SWT.NONE, true, true, false, false, false, null, null);
- this.fAnchor = point;
- this.toolkit = new FormToolkit(Display.getDefault());
- this.title = title;
- }
-
- /**
- * {@inheritDoc}
- */
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- }
-
- /**
- * {@inheritDoc}
- */
- protected Control createContents(Composite parent) {
- getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
- initializeBounds();
- return createDialogArea(parent);
- }
-
- /**
- * {@inheritDoc}
- */
- protected Control createDialogArea(Composite parent) {
- this.composite = (Composite)super.createDialogArea(parent);
- composite.setLayout(new FillLayout());
- formHead = toolkit.createScrolledForm(composite);
- toolkit.decorateFormHeading(formHead.getForm());
-
- // set title and image
- formHead.setText(title);
-
- // add a Close button to the toolbar
-
- Collection<Action> actions = getActions();
- for(Action action : actions) {
- formHead.getToolBarManager().add(action);
- }
- formHead.getToolBarManager().add(new CloseAction());
- formHead.getToolBarManager().update(true);
-
- FillLayout layout = new FillLayout(SWT.VERTICAL);
- layout.marginHeight = 5;
- layout.marginWidth = 5;
- formHead.getBody().setLayout(layout);
- createSubsection();
-
- parent.pack();
- return composite;
- }
-
- /**
- * Gets the actions.
- *
- * @return the actions
- */
- abstract protected Collection<Action> getActions();
-
- /**
- * Creates the subsection.
- */
- abstract protected void createSubsection();
-
- /**
- * {@inheritDoc}
- */
- protected Point getInitialLocation(Point size) {
- if(fAnchor == null) {
- return super.getInitialLocation(size);
- }
- Point point = fAnchor;
- Rectangle monitor = getShell().getMonitor().getClientArea();
- if(monitor.width < point.x + size.x) {
- point.x = Math.max(0, point.x - size.x);
- }
- if(monitor.height < point.y + size.y) {
- point.y = Math.max(0, point.y - size.y);
- }
- return point;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean close() {
- if(toolkit != null)
- toolkit.dispose();
- toolkit = null;
- return super.close();
- }
-
- /**
- * {@inheritDoc}
- */
- protected Control getFocusControl() {
- return this.composite;
- }
-
-}
+/*****************************************************************************
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ui.helper;
+
+import java.util.Collection;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.PopupDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * The Class CustomPopupDialog.
+ */
+abstract public class CustomPopupDialog extends PopupDialog {
+
+ /** The anchor. */
+ private Point fAnchor;
+
+ /** The composite. */
+ protected Composite composite;
+
+ /** The toolkit. */
+ protected FormToolkit toolkit;
+
+ /** The title. */
+ private String title;
+
+ /** The form head. */
+ protected ScrolledForm formHead;
+
+ /**
+ * The Class CloseAction.
+ */
+ private class CloseAction extends Action {
+
+ /**
+ * {@inheritDoc}
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run() {
+ close();
+ }
+ }
+
+ /**
+ * Instantiates a new custom popup dialog.
+ *
+ * @param parent
+ * the parent
+ * @param point
+ * the point
+ * @param title
+ * the title
+ */
+ public CustomPopupDialog(Shell parent, Point point, String title) {
+ super(parent, SWT.NONE, true, true, false, false, false, null, null);
+ this.fAnchor = point;
+ this.toolkit = new FormToolkit(Display.getDefault());
+ this.title = title;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void configureShell(Shell shell) {
+ super.configureShell(shell);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Control createContents(Composite parent) {
+ getShell().setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
+ initializeBounds();
+ return createDialogArea(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Control createDialogArea(Composite parent) {
+ this.composite = (Composite)super.createDialogArea(parent);
+ composite.setLayout(new FillLayout());
+ formHead = toolkit.createScrolledForm(composite);
+ toolkit.decorateFormHeading(formHead.getForm());
+
+ // set title and image
+ formHead.setText(title);
+
+ // add a Close button to the toolbar
+
+ Collection<Action> actions = getActions();
+ for(Action action : actions) {
+ formHead.getToolBarManager().add(action);
+ }
+ formHead.getToolBarManager().add(new CloseAction());
+ formHead.getToolBarManager().update(true);
+
+ FillLayout layout = new FillLayout(SWT.VERTICAL);
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+ formHead.getBody().setLayout(layout);
+ createSubsection();
+
+ parent.pack();
+ return composite;
+ }
+
+ /**
+ * Gets the actions.
+ *
+ * @return the actions
+ */
+ abstract protected Collection<Action> getActions();
+
+ /**
+ * Creates the subsection.
+ */
+ abstract protected void createSubsection();
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Point getInitialLocation(Point size) {
+ if(fAnchor == null) {
+ return super.getInitialLocation(size);
+ }
+ Point point = fAnchor;
+ Rectangle monitor = getShell().getMonitor().getClientArea();
+ if(monitor.width < point.x + size.x) {
+ point.x = Math.max(0, point.x - size.x);
+ }
+ if(monitor.height < point.y + size.y) {
+ point.y = Math.max(0, point.y - size.y);
+ }
+ return point;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean close() {
+ if(toolkit != null)
+ toolkit.dispose();
+ toolkit = null;
+ return super.close();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Control getFocusControl() {
+ return this.composite;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpComponentFactory.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpComponentFactory.java
index e6d36806462..d7db88109b0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpComponentFactory.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpComponentFactory.java
@@ -1,120 +1,120 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ui.helper;
-
-import java.io.IOException;
-
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ImageHyperlink;
-
-/**
- * A factory for creating HelpComponent object.
- */
-public class HelpComponentFactory {
-
- /** The image. */
- public static Image image = null;
-
- // Load only one time the help icon
- static {
- try {
- image = new Image(Display.getDefault(), Activator.getDefault().getBundle().getResource("icons/help/help_contents-1.gif").openStream());
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Creates help component that insert a new hyperlink icon to display
- * additional help description if tooltip is null, default value is "Help"
- *
- * ParseTags parameter must be used if you want to define rich text content
- * for the helpText. For example use <form> tag to format your text
- *
- * @param parent
- * the parent
- * @param toolkit
- * the toolkit
- * @param helpText
- * the help text
- * @param pToolTip
- * the tool tip
- * @param parseTags
- * enables tags parsing on the description content
- * @return the hyperlink image
- */
- public static ImageHyperlink createHelpComponent(final Composite parent, FormToolkit toolkit, final String helpText, String pToolTip, final boolean parseTags) {
- ImageHyperlink helpImage = toolkit.createImageHyperlink(parent, SWT.NONE);
- helpImage.setImage(image);
- helpImage.setBackground(null);
- final String toolTip = (pToolTip == null) ? "Help" : pToolTip;
- helpImage.setToolTipText(toolTip);
- helpImage.addHyperlinkListener(new IHyperlinkListener() {
-
- // create the HelpDialog that displays the help description
- public void linkActivated(HyperlinkEvent e) {
- HelpDialog dialog = new HelpDialog(parent.getShell(), Display.getDefault().getCursorLocation(), toolTip, helpText, parseTags);
- dialog.open();
- }
-
- public void linkEntered(HyperlinkEvent e) {
- }
-
- public void linkExited(HyperlinkEvent e) {
- }
-
- });
- return helpImage;
- }
-
- /**
- * Creates a new HelpComponent object. ParseTags parameter must be used if
- * you want to define rich text content for the helpText. For example use
- * <form> tag to format your text
- *
- * @param parent
- * the parent
- * @param toolkit
- * the toolkit
- * @param helpText
- * the help text
- * @param parseTags
- * enables tags parsing on the description content
- * @return the image hyperlink
- */
- public static ImageHyperlink createHelpComponent(final Composite parent, FormToolkit toolkit, final String helpText, boolean parseTags) {
- return createHelpComponent(parent, toolkit, helpText, null, parseTags);
- }
-
- /**
- * Creates a new HelpComponent object. You must use method with parseTags
- * parameter if you want to define rich text content for the helpText
- *
- * @param parent
- * the parent
- * @param toolkit
- * the toolkit
- * @param helpText
- * the help text
- * @return the image hyperlink
- */
- public static ImageHyperlink createHelpComponent(final Composite parent, FormToolkit toolkit, final String helpText) {
- return createHelpComponent(parent, toolkit, helpText, null, false);
- }
-
-}
+/*****************************************************************************
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ui.helper;
+
+import java.io.IOException;
+
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ImageHyperlink;
+
+/**
+ * A factory for creating HelpComponent object.
+ */
+public class HelpComponentFactory {
+
+ /** The image. */
+ public static Image image = null;
+
+ // Load only one time the help icon
+ static {
+ try {
+ image = new Image(Display.getDefault(), Activator.getDefault().getBundle().getResource("icons/help/help_contents-1.gif").openStream());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Creates help component that insert a new hyperlink icon to display
+ * additional help description if tooltip is null, default value is "Help"
+ *
+ * ParseTags parameter must be used if you want to define rich text content
+ * for the helpText. For example use <form> tag to format your text
+ *
+ * @param parent
+ * the parent
+ * @param toolkit
+ * the toolkit
+ * @param helpText
+ * the help text
+ * @param pToolTip
+ * the tool tip
+ * @param parseTags
+ * enables tags parsing on the description content
+ * @return the hyperlink image
+ */
+ public static ImageHyperlink createHelpComponent(final Composite parent, FormToolkit toolkit, final String helpText, String pToolTip, final boolean parseTags) {
+ ImageHyperlink helpImage = toolkit.createImageHyperlink(parent, SWT.NONE);
+ helpImage.setImage(image);
+ helpImage.setBackground(null);
+ final String toolTip = (pToolTip == null) ? "Help" : pToolTip;
+ helpImage.setToolTipText(toolTip);
+ helpImage.addHyperlinkListener(new IHyperlinkListener() {
+
+ // create the HelpDialog that displays the help description
+ public void linkActivated(HyperlinkEvent e) {
+ HelpDialog dialog = new HelpDialog(parent.getShell(), Display.getDefault().getCursorLocation(), toolTip, helpText, parseTags);
+ dialog.open();
+ }
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ });
+ return helpImage;
+ }
+
+ /**
+ * Creates a new HelpComponent object. ParseTags parameter must be used if
+ * you want to define rich text content for the helpText. For example use
+ * <form> tag to format your text
+ *
+ * @param parent
+ * the parent
+ * @param toolkit
+ * the toolkit
+ * @param helpText
+ * the help text
+ * @param parseTags
+ * enables tags parsing on the description content
+ * @return the image hyperlink
+ */
+ public static ImageHyperlink createHelpComponent(final Composite parent, FormToolkit toolkit, final String helpText, boolean parseTags) {
+ return createHelpComponent(parent, toolkit, helpText, null, parseTags);
+ }
+
+ /**
+ * Creates a new HelpComponent object. You must use method with parseTags
+ * parameter if you want to define rich text content for the helpText
+ *
+ * @param parent
+ * the parent
+ * @param toolkit
+ * the toolkit
+ * @param helpText
+ * the help text
+ * @return the image hyperlink
+ */
+ public static ImageHyperlink createHelpComponent(final Composite parent, FormToolkit toolkit, final String helpText) {
+ return createHelpComponent(parent, toolkit, helpText, null, false);
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpDialog.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpDialog.java
index da8471acecf..81ed9f8909e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpDialog.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/ui/helper/HelpDialog.java
@@ -1,128 +1,128 @@
-/*****************************************************************************
- * 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
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.ui.helper;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.LinkedList;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.browser.IWebBrowser;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.FormText;
-
-/**
- * The Class HelpDialog.
- */
-public class HelpDialog extends CustomPopupDialog {
-
- /** The description. */
- private String description;
-
- /** if true, description content is parsed to perform tags */
- private boolean parseTags;
-
- /**
- * Instantiates a new help dialog. You must use constructor with parseTags
- * parameter if you want to define rich text content in your description
- *
- * @param parent
- * the parent
- * @param point
- * the point
- * @param title
- * the title
- * @param description
- * the description
- */
- public HelpDialog(Shell parent, Point point, String title, String description) {
- super(parent, point, title);
- this.description = description;
- this.parseTags = false;
- }
-
- /**
- * Instantiates a new help dialog. ParseTags parameter must be used if you
- * want to define rich text content for the description. For example use
- * <form> tag to format your text
- *
- * @param parent
- * the parent
- * @param point
- * the point
- * @param title
- * the title
- * @param description
- * the description
- * @param parseTags
- * enables tags parsing on the description content
- */
- public HelpDialog(Shell parent, Point point, String title, String description, boolean parseTags) {
- super(parent, point, title);
- this.description = description;
- this.parseTags = parseTags;
- }
-
- /**
- * @see org.topcased.doc2model.requirement.component.CustomPopupDialog#createSubsection()
- */
- @Override
- public void createSubsection() {
- // Set the description
- FormText text = toolkit.createFormText(formHead.getBody(), false);
- text.addHyperlinkListener(new IHyperlinkListener() {
-
- public void linkExited(HyperlinkEvent e) {
- }
-
- public void linkEntered(HyperlinkEvent e) {
- }
-
- public void linkActivated(HyperlinkEvent e) {
- try {
- IWebBrowser externalBrowser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
- externalBrowser.openURL(new URL((String)e.getHref()));
- } catch (PartInitException e1) {
- errorBrowser();
- e1.printStackTrace();
- } catch (MalformedURLException e1) {
- errorBrowser();
- e1.printStackTrace();
- } catch (NullPointerException e1) {
- errorBrowser();
- e1.printStackTrace();
- }
- }
-
- private void errorBrowser() {
- MessageDialog.openError(Display.getDefault().getActiveShell(), "Error", "The browser can't be opened");
- }
- });
- text.setText(description, parseTags, true);
- }
-
- /**
- * @see org.topcased.doc2model.requirement.component.CustomPopupDialog#getActions()
- */
- @Override
- protected Collection<Action> getActions() {
- return new LinkedList<Action>();
- }
-
-}
+/*****************************************************************************
+ * 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
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.ui.helper;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.LinkedList;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.FormText;
+
+/**
+ * The Class HelpDialog.
+ */
+public class HelpDialog extends CustomPopupDialog {
+
+ /** The description. */
+ private String description;
+
+ /** if true, description content is parsed to perform tags */
+ private boolean parseTags;
+
+ /**
+ * Instantiates a new help dialog. You must use constructor with parseTags
+ * parameter if you want to define rich text content in your description
+ *
+ * @param parent
+ * the parent
+ * @param point
+ * the point
+ * @param title
+ * the title
+ * @param description
+ * the description
+ */
+ public HelpDialog(Shell parent, Point point, String title, String description) {
+ super(parent, point, title);
+ this.description = description;
+ this.parseTags = false;
+ }
+
+ /**
+ * Instantiates a new help dialog. ParseTags parameter must be used if you
+ * want to define rich text content for the description. For example use
+ * <form> tag to format your text
+ *
+ * @param parent
+ * the parent
+ * @param point
+ * the point
+ * @param title
+ * the title
+ * @param description
+ * the description
+ * @param parseTags
+ * enables tags parsing on the description content
+ */
+ public HelpDialog(Shell parent, Point point, String title, String description, boolean parseTags) {
+ super(parent, point, title);
+ this.description = description;
+ this.parseTags = parseTags;
+ }
+
+ /**
+ * @see org.topcased.doc2model.requirement.component.CustomPopupDialog#createSubsection()
+ */
+ @Override
+ public void createSubsection() {
+ // Set the description
+ FormText text = toolkit.createFormText(formHead.getBody(), false);
+ text.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ IWebBrowser externalBrowser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
+ externalBrowser.openURL(new URL((String)e.getHref()));
+ } catch (PartInitException e1) {
+ errorBrowser();
+ e1.printStackTrace();
+ } catch (MalformedURLException e1) {
+ errorBrowser();
+ e1.printStackTrace();
+ } catch (NullPointerException e1) {
+ errorBrowser();
+ e1.printStackTrace();
+ }
+ }
+
+ private void errorBrowser() {
+ MessageDialog.openError(Display.getDefault().getActiveShell(), "Error", "The browser can't be opened");
+ }
+ });
+ text.setText(description, parseTags, true);
+ }
+
+ /**
+ * @see org.topcased.doc2model.requirement.component.CustomPopupDialog#getActions()
+ */
+ @Override
+ protected Collection<Action> getActions() {
+ return new LinkedList<Action>();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ColorManager.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ColorManager.java
index aae6b1d97ef..f08ea906e23 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ColorManager.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ColorManager.java
@@ -1,54 +1,54 @@
-/*******************************************************************************
- * Copyright (c) 2006 CEA List.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA List - initial API and implementation
- *******************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-
-/**
- *
- *
- * @author Patrick Tessier
- * @since 20 sept. 06
- *
- * this aclass manage all colors of Papyrus. It is forbidden in this
- * application to create a color. SymbolicName is "R"_"G"_"B" where "R"
- * "G" "B" are string that represent color (int)
- */
-public class ColorManager extends ColorRegistry {
-
- /**
- *
- */
- private static String separator = "_";
-
- /**
- * get Color from a RGB.
- *
- * @param rgb
- * the rGB thath wen want
- *
- * @return the color obtaine from the RGB
- */
-
- // @unused
- public Color get(RGB rgb) {
- String symbolicName = "" + rgb.red + separator + rgb.green + separator + rgb.blue;
- Color resultColor = super.get(symbolicName);
- if(resultColor == null) {
- super.put(symbolicName, rgb);
- resultColor = super.get(symbolicName);
- }
- return resultColor;
- }
-
-}
+/*******************************************************************************
+ * Copyright (c) 2006 CEA List.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA List - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+
+/**
+ *
+ *
+ * @author Patrick Tessier
+ * @since 20 sept. 06
+ *
+ * this aclass manage all colors of Papyrus. It is forbidden in this
+ * application to create a color. SymbolicName is "R"_"G"_"B" where "R"
+ * "G" "B" are string that represent color (int)
+ */
+public class ColorManager extends ColorRegistry {
+
+ /**
+ *
+ */
+ private static String separator = "_";
+
+ /**
+ * get Color from a RGB.
+ *
+ * @param rgb
+ * the rGB thath wen want
+ *
+ * @return the color obtaine from the RGB
+ */
+
+ // @unused
+ public Color get(RGB rgb) {
+ String symbolicName = "" + rgb.red + separator + rgb.green + separator + rgb.blue;
+ Color resultColor = super.get(symbolicName);
+ if(resultColor == null) {
+ super.put(symbolicName, rgb);
+ resultColor = super.get(symbolicName);
+ }
+ return resultColor;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentTitleRepresentation.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentTitleRepresentation.java
index 88e3bf80793..68bb560b80f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentTitleRepresentation.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentTitleRepresentation.java
@@ -1,77 +1,77 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * This class allows to represent the title of a compartment in a the Show/Hide
- * Compartment Action
- *
- *
- *
- */
-public class CompartmentTitleRepresentation {
-
- /**
- * the compartment view
- */
- private View view;
-
- /**
- * the editpart which owns the view
- */
- private EditPart parent;
-
- /**
- *
- * Constructor.
- *
- * @param parent
- * the parent editpart
- * @param view
- * the view
- */
- public CompartmentTitleRepresentation(EditPart parent, View view) {
- this.parent = parent;
- this.view = view;
- }
-
- /**
- *
- * @return <code>true</code> if the title of the compartment is displayed
- * and <code>false</code> if not
- */
- public boolean isTitleVisible() {
- return CompartmentUtils.isCompartmentTitleVisible(view);
- }
-
- /**
- *
- * @return the real object represented by this class
- */
- public Object getRealObject() {
- return view;
- }
-
- /**
- *
- * @return the parent editpart
- */
- public EditPart getParent() {
- return this.parent;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * This class allows to represent the title of a compartment in a the Show/Hide
+ * Compartment Action
+ *
+ *
+ *
+ */
+public class CompartmentTitleRepresentation {
+
+ /**
+ * the compartment view
+ */
+ private View view;
+
+ /**
+ * the editpart which owns the view
+ */
+ private EditPart parent;
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param parent
+ * the parent editpart
+ * @param view
+ * the view
+ */
+ public CompartmentTitleRepresentation(EditPart parent, View view) {
+ this.parent = parent;
+ this.view = view;
+ }
+
+ /**
+ *
+ * @return <code>true</code> if the title of the compartment is displayed
+ * and <code>false</code> if not
+ */
+ public boolean isTitleVisible() {
+ return CompartmentUtils.isCompartmentTitleVisible(view);
+ }
+
+ /**
+ *
+ * @return the real object represented by this class
+ */
+ public Object getRealObject() {
+ return view;
+ }
+
+ /**
+ *
+ * @return the parent editpart
+ */
+ public EditPart getParent() {
+ return this.parent;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentUtils.java
index 4da4ec71221..46347eaf43c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentUtils.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CompartmentUtils.java
@@ -1,209 +1,209 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-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.IResizableCompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPartService;
-import org.eclipse.gmf.runtime.notation.BasicCompartment;
-import org.eclipse.gmf.runtime.notation.DecorationNode;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.TitleStyle;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * This utils provides methods to manipulate compartments of the EditPart
- *
- *
- *
- */
-public class CompartmentUtils {
-
- private CompartmentUtils() {
-
- }
-
- /**
- * Returns all the compartments edit part of an EditPart
- *
- * @param editpart
- * an editpart
- * @param includeTitleCompartment
- * if <code>true</code> we return the title compartment too
- * @return all compartments of the EditPart
- */
- public static List<IResizableCompartmentEditPart> getAllCompartmentsEditPart(EditPart editpart, boolean includeTitleCompartment) {
- List<IResizableCompartmentEditPart> compartments = new ArrayList<IResizableCompartmentEditPart>();
-
- List<?> localChildren = editpart.getChildren();
- for(Object current : localChildren) {
- if(current instanceof IResizableCompartmentEditPart) {
- if(includeTitleCompartment) {
- compartments.add((IResizableCompartmentEditPart)current);
- } else {
- if(!(current instanceof ITextAwareEditPart)) {
- compartments.add((IResizableCompartmentEditPart)current);
- }
- }
- }
- }
- return compartments;
- }
-
- /**
- * Returns all the compartments of an EditPart
- *
- * @param editpart
- * an editpart
- * @param includeTitleCompartment
- * if <code>true</code> we return the title compartment too
- * @return all compartments of the EditPart
- */
- public static List<View> getAllCompartments(EditPart editpart, boolean includeTitleCompartment) {
- List<View> compartments = new ArrayList<View>();
- View notationView = ((GraphicalEditPart)editpart).getNotationView();
- //before it looks for persistedChildren
- //because we want to see compartment of stereotypes that are volatile
- //wee have replace it by getChildreen
- //List<?> graphicalChildren = notationView.getPersistedChildren();
- List<?> graphicalChildren = notationView.getChildren();
- String type = notationView.getType();
-
- for(Object child : graphicalChildren) {
- // Only add compartment
- if(child instanceof View && ((View)child).getType().equals(type)) {
- continue;
- }
- if(child instanceof BasicCompartment) {
- if(includeTitleCompartment) {
- compartments.add((View)child);
- } else {
- if(!isCompartmentName(editpart, (View)child)) {
- compartments.add((View)child);
- }
- }
- } else if(child instanceof DecorationNode) {
- if(includeTitleCompartment) {
- compartments.add((View)child);
- } else {
- if(!isCompartmentName(editpart, (View)child)) {
- compartments.add((View)child);
- }
- }
- }
- }
- return compartments;
- }
-
- /**
- * Returns all the displayed compartments for the EditPart
- *
- * @param editpart
- * an editpart
- * @param includeTitleCompartment
- * if <code>true</code> we return the title compartment too
- * @return all the displayed compartments for the EditPart
- */
- public static List<View> getAllVisibleCompartments(EditPart editpart, boolean includeTitleCompartment) {
- List<View> visibleCompartments = new ArrayList<View>();
- List<?> localChildren = editpart.getChildren();
- for(Object current : localChildren) {
- if(current instanceof CompartmentEditPart) {
- if(includeTitleCompartment) {
- visibleCompartments.add(((View)((CompartmentEditPart)current).getModel()));
- } else {
- if(!(current instanceof ITextAwareEditPart)) {
- visibleCompartments.add(((View)((CompartmentEditPart)current).getModel()));
- }
- }
- }
- }
- return visibleCompartments;
- }
-
- /**
- * Tests if a view is a compartment name
- *
- * @param editpart
- * the editpart
- * @param view
- * a view of this editpart
- * @return <code>true</code> if this view is compartment name
- */
- public static boolean isCompartmentName(EditPart editpart, View view) {
- IGraphicalEditPart gep = EditPartService.getInstance().createGraphicEditPart(view);
- if(gep instanceof ITextAwareEditPart) {
- return true;
- }
- return false;
- }
-
- /**
- *
- * @param editpart
- * an editpart
- * @return A list of {@link CompartmentTitleRepresentation} which represents
- * the visible titles of the compartments of the editpart
- */
- public static List<CompartmentTitleRepresentation> getAllVisibleCompartmentName(EditPart editpart) {
- List<View> allCompartments = getAllCompartments(editpart, false);
- List<CompartmentTitleRepresentation> visibleTitle = new ArrayList<CompartmentTitleRepresentation>();
- for(View current : allCompartments) {
- if(isCompartmentTitleVisible(current)) {
- visibleTitle.add(new CompartmentTitleRepresentation(editpart, current));
- }
- }
- return visibleTitle;
- }
-
- /**
- *
- * @param compartmentView
- * a view of a compartment
- * @return <code>true</code> if the title of the compartment is visible
- */
- public static boolean isCompartmentTitleVisible(View compartmentView) {
- TitleStyle style = (TitleStyle)compartmentView.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
- if(style != null && style.isShowTitle()) {
- return true;
- }
- return false;
- }
-
- /**
- *
- * @param representations
- * a list of {@link CompartmentTitleRepresentation}
- * @param view
- * a view
- * @return the {@link CompartmentTitleRepresentation} which represents the
- * view or <code>null</code> if not found
- */
- public static CompartmentTitleRepresentation getCompartmentTitleRepresentation(List<CompartmentTitleRepresentation> representations, View view) {
- for(CompartmentTitleRepresentation current : representations) {
- if(current.getRealObject().equals(view)) {
- return current;
- }
- }
- return null;
-
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+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.IResizableCompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPartService;
+import org.eclipse.gmf.runtime.notation.BasicCompartment;
+import org.eclipse.gmf.runtime.notation.DecorationNode;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.TitleStyle;
+import org.eclipse.gmf.runtime.notation.View;
+
+/**
+ * This utils provides methods to manipulate compartments of the EditPart
+ *
+ *
+ *
+ */
+public class CompartmentUtils {
+
+ private CompartmentUtils() {
+
+ }
+
+ /**
+ * Returns all the compartments edit part of an EditPart
+ *
+ * @param editpart
+ * an editpart
+ * @param includeTitleCompartment
+ * if <code>true</code> we return the title compartment too
+ * @return all compartments of the EditPart
+ */
+ public static List<IResizableCompartmentEditPart> getAllCompartmentsEditPart(EditPart editpart, boolean includeTitleCompartment) {
+ List<IResizableCompartmentEditPart> compartments = new ArrayList<IResizableCompartmentEditPart>();
+
+ List<?> localChildren = editpart.getChildren();
+ for(Object current : localChildren) {
+ if(current instanceof IResizableCompartmentEditPart) {
+ if(includeTitleCompartment) {
+ compartments.add((IResizableCompartmentEditPart)current);
+ } else {
+ if(!(current instanceof ITextAwareEditPart)) {
+ compartments.add((IResizableCompartmentEditPart)current);
+ }
+ }
+ }
+ }
+ return compartments;
+ }
+
+ /**
+ * Returns all the compartments of an EditPart
+ *
+ * @param editpart
+ * an editpart
+ * @param includeTitleCompartment
+ * if <code>true</code> we return the title compartment too
+ * @return all compartments of the EditPart
+ */
+ public static List<View> getAllCompartments(EditPart editpart, boolean includeTitleCompartment) {
+ List<View> compartments = new ArrayList<View>();
+ View notationView = ((GraphicalEditPart)editpart).getNotationView();
+ //before it looks for persistedChildren
+ //because we want to see compartment of stereotypes that are volatile
+ //wee have replace it by getChildreen
+ //List<?> graphicalChildren = notationView.getPersistedChildren();
+ List<?> graphicalChildren = notationView.getChildren();
+ String type = notationView.getType();
+
+ for(Object child : graphicalChildren) {
+ // Only add compartment
+ if(child instanceof View && ((View)child).getType().equals(type)) {
+ continue;
+ }
+ if(child instanceof BasicCompartment) {
+ if(includeTitleCompartment) {
+ compartments.add((View)child);
+ } else {
+ if(!isCompartmentName(editpart, (View)child)) {
+ compartments.add((View)child);
+ }
+ }
+ } else if(child instanceof DecorationNode) {
+ if(includeTitleCompartment) {
+ compartments.add((View)child);
+ } else {
+ if(!isCompartmentName(editpart, (View)child)) {
+ compartments.add((View)child);
+ }
+ }
+ }
+ }
+ return compartments;
+ }
+
+ /**
+ * Returns all the displayed compartments for the EditPart
+ *
+ * @param editpart
+ * an editpart
+ * @param includeTitleCompartment
+ * if <code>true</code> we return the title compartment too
+ * @return all the displayed compartments for the EditPart
+ */
+ public static List<View> getAllVisibleCompartments(EditPart editpart, boolean includeTitleCompartment) {
+ List<View> visibleCompartments = new ArrayList<View>();
+ List<?> localChildren = editpart.getChildren();
+ for(Object current : localChildren) {
+ if(current instanceof CompartmentEditPart) {
+ if(includeTitleCompartment) {
+ visibleCompartments.add(((View)((CompartmentEditPart)current).getModel()));
+ } else {
+ if(!(current instanceof ITextAwareEditPart)) {
+ visibleCompartments.add(((View)((CompartmentEditPart)current).getModel()));
+ }
+ }
+ }
+ }
+ return visibleCompartments;
+ }
+
+ /**
+ * Tests if a view is a compartment name
+ *
+ * @param editpart
+ * the editpart
+ * @param view
+ * a view of this editpart
+ * @return <code>true</code> if this view is compartment name
+ */
+ public static boolean isCompartmentName(EditPart editpart, View view) {
+ IGraphicalEditPart gep = EditPartService.getInstance().createGraphicEditPart(view);
+ if(gep instanceof ITextAwareEditPart) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ *
+ * @param editpart
+ * an editpart
+ * @return A list of {@link CompartmentTitleRepresentation} which represents
+ * the visible titles of the compartments of the editpart
+ */
+ public static List<CompartmentTitleRepresentation> getAllVisibleCompartmentName(EditPart editpart) {
+ List<View> allCompartments = getAllCompartments(editpart, false);
+ List<CompartmentTitleRepresentation> visibleTitle = new ArrayList<CompartmentTitleRepresentation>();
+ for(View current : allCompartments) {
+ if(isCompartmentTitleVisible(current)) {
+ visibleTitle.add(new CompartmentTitleRepresentation(editpart, current));
+ }
+ }
+ return visibleTitle;
+ }
+
+ /**
+ *
+ * @param compartmentView
+ * a view of a compartment
+ * @return <code>true</code> if the title of the compartment is visible
+ */
+ public static boolean isCompartmentTitleVisible(View compartmentView) {
+ TitleStyle style = (TitleStyle)compartmentView.getStyle(NotationPackage.eINSTANCE.getTitleStyle());
+ if(style != null && style.isShowTitle()) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ *
+ * @param representations
+ * a list of {@link CompartmentTitleRepresentation}
+ * @param view
+ * a view
+ * @return the {@link CompartmentTitleRepresentation} which represents the
+ * view or <code>null</code> if not found
+ */
+ public static CompartmentTitleRepresentation getCompartmentTitleRepresentation(List<CompartmentTitleRepresentation> representations, View view) {
+ for(CompartmentTitleRepresentation current : representations) {
+ if(current.getRealObject().equals(view)) {
+ return current;
+ }
+ }
+ return null;
+
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CrossReferencerUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CrossReferencerUtil.java
index 0a4576f6af9..d2af0165dd0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CrossReferencerUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/CrossReferencerUtil.java
@@ -1,88 +1,88 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.gmf.runtime.notation.View;
-
-public class CrossReferencerUtil {
-
- /**
- * Returns the {@link CrossReferenceAdapter} corresponding to an {@link EObject}
- *
- * @param element
- * the {@link EObject} element
- * @return the {@link CrossReferenceAdapter} corresponding to element
- */
- public static CrossReferenceAdapter getCrossReferenceAdapter(EObject element) {
-
- CrossReferenceAdapter crossReferenceAdapter = CrossReferenceAdapter.getExistingCrossReferenceAdapter(element);
- if(crossReferenceAdapter == null) {
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(element);
- if(domain != null) {
- crossReferenceAdapter = CrossReferenceAdapter.getCrossReferenceAdapter(domain.getResourceSet());
- }
- }
-
- return crossReferenceAdapter;
- }
-
- /**
- * <pre>
- * This method looks for any views (possibly filtered by a kind of diagram) that are currently
- * referencing the referencedObject.
- * </pre>
- *
- * @param referencedObject
- * @param diagramType
- * type of diagram containing the list of {@link View} (may be
- * null)
- * @return the list of {@link View} referencing the referencedObject
- */
- public static Set<View> getCrossReferencingViews(EObject referencedObject, String diagramType) {
-
- Set<View> referencingObjects = new HashSet<View>();
-
- CrossReferenceAdapter crossReferenceAdapter = CrossReferencerUtil.getCrossReferenceAdapter(referencedObject);
- if(crossReferenceAdapter != null) {
-
- // Retrieve all views referencing the referencedObject
- Iterator<?> views = crossReferenceAdapter.getInverseReferencers(referencedObject, NotationPackage.eINSTANCE.getView_Element(), NotationPackage.eINSTANCE.getView()).iterator();
- while(views.hasNext()) {
-
- View view = (View)views.next();
- if(diagramType != null) { // Filter to get only view from this
- // kind of diagram
-
- // Check if current view is owned by a diagram which type
- // conforms to diagramType
- if(diagramType.equals(view.getDiagram().getType())) {
- referencingObjects.add(view);
- }
-
- } else { // Return all views
- referencingObjects.add(view);
- }
- }
- }
- return referencingObjects;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.gmf.runtime.emf.core.util.CrossReferenceAdapter;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+
+public class CrossReferencerUtil {
+
+ /**
+ * Returns the {@link CrossReferenceAdapter} corresponding to an {@link EObject}
+ *
+ * @param element
+ * the {@link EObject} element
+ * @return the {@link CrossReferenceAdapter} corresponding to element
+ */
+ public static CrossReferenceAdapter getCrossReferenceAdapter(EObject element) {
+
+ CrossReferenceAdapter crossReferenceAdapter = CrossReferenceAdapter.getExistingCrossReferenceAdapter(element);
+ if(crossReferenceAdapter == null) {
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(element);
+ if(domain != null) {
+ crossReferenceAdapter = CrossReferenceAdapter.getCrossReferenceAdapter(domain.getResourceSet());
+ }
+ }
+
+ return crossReferenceAdapter;
+ }
+
+ /**
+ * <pre>
+ * This method looks for any views (possibly filtered by a kind of diagram) that are currently
+ * referencing the referencedObject.
+ * </pre>
+ *
+ * @param referencedObject
+ * @param diagramType
+ * type of diagram containing the list of {@link View} (may be
+ * null)
+ * @return the list of {@link View} referencing the referencedObject
+ */
+ public static Set<View> getCrossReferencingViews(EObject referencedObject, String diagramType) {
+
+ Set<View> referencingObjects = new HashSet<View>();
+
+ CrossReferenceAdapter crossReferenceAdapter = CrossReferencerUtil.getCrossReferenceAdapter(referencedObject);
+ if(crossReferenceAdapter != null) {
+
+ // Retrieve all views referencing the referencedObject
+ Iterator<?> views = crossReferenceAdapter.getInverseReferencers(referencedObject, NotationPackage.eINSTANCE.getView_Element(), NotationPackage.eINSTANCE.getView()).iterator();
+ while(views.hasNext()) {
+
+ View view = (View)views.next();
+ if(diagramType != null) { // Filter to get only view from this
+ // kind of diagram
+
+ // Check if current view is owned by a diagram which type
+ // conforms to diagramType
+ if(diagramType.equals(view.getDiagram().getType())) {
+ referencingObjects.add(view);
+ }
+
+ } else { // Return all views
+ referencingObjects.add(view);
+ }
+ }
+ }
+ return referencingObjects;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramCoreServiceUtils.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramCoreServiceUtils.java
index 0cc10ddb398..1fa0ff3c6f0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramCoreServiceUtils.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramCoreServiceUtils.java
@@ -1,121 +1,121 @@
-/*****************************************************************************
- * Copyright (c) 2010 LIFL & CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import static org.eclipse.papyrus.uml.diagram.common.Activator.log;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditDomain;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-/**
- * A set of utility methods to get the Services from the core.
- *
- * @author cedric dumoulin
- * @deprecated Use {@link ServiceUtilsForGMF}
- */
-@Deprecated
-public class DiagramCoreServiceUtils {
-
- /**
- * Get the {@link ServiceRegistry} from the {@link IDiagramEditDomain}.
- * This method can be used from EditParts and EditPolicies to retrieve the {@link ServicesRegistry}. <br>
- * The IDiagramEditDomain can be found :
- * <ul>
- * <li>EditParts - getDiagramEditDomain()</li>
- * <li>EditPolicies - getHost().getDiagramEditDomain()</li>
- * </ul>
- *
- * @param domain
- * or null if not found
- * @return
- */
- static ServicesRegistry getServiceRegistry(IDiagramEditDomain domain) {
-
- if(domain instanceof DiagramEditDomain) {
- IWorkbenchPart part = ((DiagramEditDomain)domain).getEditorPart().getEditorSite().getPart();
- if(part instanceof UmlGmfDiagramEditor) {
- return ((UmlGmfDiagramEditor)part).getServicesRegistry();
- }
- }
- return null;
-
- }
-
- /**
- * Get the {@link ServiceRegistry} from the {@link IDiagramEditDomain}.
- * This method can be used from EditParts and EditPolicies to retrieve the {@link ServicesRegistry}. <br>
- * The IDiagramEditDomain can be found :
- * <ul>
- * <li>EditParts - getDiagramEditDomain()</li>
- * <li>EditPolicies - getHost().getDiagramEditDomain()</li>
- * </ul>
- *
- * @param domain
- * or null if not found
- * @return
- */
- static ServicesRegistry getServiceRegistryChecked(IDiagramEditDomain domain) throws ServiceException {
-
- return ServiceUtilsForGMF.getInstance().getServiceRegistry(domain);
-
- // if(domain instanceof DiagramEditDomain) {
- // IWorkbenchPart part = ((DiagramEditDomain)domain).getEditorPart().getEditorSite().getPart();
- // if(part instanceof UmlGmfDiagramEditor) {
- // return ((UmlGmfDiagramEditor)part).getServicesRegistry();
- // }
- // }
- // throw new ServiceNotFoundException("Can't get the ServiceRegistry.");
-
- }
-
- /**
- * Gets the {@link TransactionalEditingDomain} registered in the {@link ServicesRegistry}.
- *
- * @param domain
- * @return
- */
- public static TransactionalEditingDomain getTransactionalEditingDomain(IDiagramEditDomain domain) {
-
-
- try {
- return getServiceRegistryChecked(domain).getService(TransactionalEditingDomain.class);
- } catch (IllegalStateException e) {
- // Registry can't be found, do nothing.
- } catch (ServiceException e) {
- log.error(e);
- }
- return null;
- }
-
- /**
- * Gets the {@link TransactionalEditingDomain} registered in the {@link ServicesRegistry}.
- *
- * @param domain
- * @return
- * @throws ServiceException
- * If the TransactionalEditingDomain can not be found.
- */
- public static TransactionalEditingDomain getTransactionalEditingDomainChecked(IDiagramEditDomain domain) throws ServiceException {
- return getServiceRegistryChecked(domain).getService(TransactionalEditingDomain.class);
- }
-
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 LIFL & CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import static org.eclipse.papyrus.uml.diagram.common.Activator.log;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditDomain;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
+import org.eclipse.ui.IWorkbenchPart;
+
+
+/**
+ * A set of utility methods to get the Services from the core.
+ *
+ * @author cedric dumoulin
+ * @deprecated Use {@link ServiceUtilsForGMF}
+ */
+@Deprecated
+public class DiagramCoreServiceUtils {
+
+ /**
+ * Get the {@link ServiceRegistry} from the {@link IDiagramEditDomain}.
+ * This method can be used from EditParts and EditPolicies to retrieve the {@link ServicesRegistry}. <br>
+ * The IDiagramEditDomain can be found :
+ * <ul>
+ * <li>EditParts - getDiagramEditDomain()</li>
+ * <li>EditPolicies - getHost().getDiagramEditDomain()</li>
+ * </ul>
+ *
+ * @param domain
+ * or null if not found
+ * @return
+ */
+ static ServicesRegistry getServiceRegistry(IDiagramEditDomain domain) {
+
+ if(domain instanceof DiagramEditDomain) {
+ IWorkbenchPart part = ((DiagramEditDomain)domain).getEditorPart().getEditorSite().getPart();
+ if(part instanceof UmlGmfDiagramEditor) {
+ return ((UmlGmfDiagramEditor)part).getServicesRegistry();
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ * Get the {@link ServiceRegistry} from the {@link IDiagramEditDomain}.
+ * This method can be used from EditParts and EditPolicies to retrieve the {@link ServicesRegistry}. <br>
+ * The IDiagramEditDomain can be found :
+ * <ul>
+ * <li>EditParts - getDiagramEditDomain()</li>
+ * <li>EditPolicies - getHost().getDiagramEditDomain()</li>
+ * </ul>
+ *
+ * @param domain
+ * or null if not found
+ * @return
+ */
+ static ServicesRegistry getServiceRegistryChecked(IDiagramEditDomain domain) throws ServiceException {
+
+ return ServiceUtilsForGMF.getInstance().getServiceRegistry(domain);
+
+ // if(domain instanceof DiagramEditDomain) {
+ // IWorkbenchPart part = ((DiagramEditDomain)domain).getEditorPart().getEditorSite().getPart();
+ // if(part instanceof UmlGmfDiagramEditor) {
+ // return ((UmlGmfDiagramEditor)part).getServicesRegistry();
+ // }
+ // }
+ // throw new ServiceNotFoundException("Can't get the ServiceRegistry.");
+
+ }
+
+ /**
+ * Gets the {@link TransactionalEditingDomain} registered in the {@link ServicesRegistry}.
+ *
+ * @param domain
+ * @return
+ */
+ public static TransactionalEditingDomain getTransactionalEditingDomain(IDiagramEditDomain domain) {
+
+
+ try {
+ return getServiceRegistryChecked(domain).getService(TransactionalEditingDomain.class);
+ } catch (IllegalStateException e) {
+ // Registry can't be found, do nothing.
+ } catch (ServiceException e) {
+ log.error(e);
+ }
+ return null;
+ }
+
+ /**
+ * Gets the {@link TransactionalEditingDomain} registered in the {@link ServicesRegistry}.
+ *
+ * @param domain
+ * @return
+ * @throws ServiceException
+ * If the TransactionalEditingDomain can not be found.
+ */
+ public static TransactionalEditingDomain getTransactionalEditingDomainChecked(IDiagramEditDomain domain) throws ServiceException {
+ return getServiceRegistryChecked(domain).getService(TransactionalEditingDomain.class);
+ }
+
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramTester.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramTester.java
index 8940b2c42c4..6f50d713be8 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramTester.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/DiagramTester.java
@@ -1,71 +1,71 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * This class provides a Tester to know if the current diagram is the wanted
- * diagram. Test is done using {@link Diagram#getType()}
- *
- *
- *
- */
-public class DiagramTester extends PropertyTester {
-
- /**
- * The property to test
- */
- private static final String DIAGRAM_ID = "diagramType";
-
- /**
- *
- * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
- *
- * @param receiver
- * @param property
- * @param args
- * @param expectedValue
- * @return
- */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if(DIAGRAM_ID.equals(property) && receiver instanceof IEditorPart) {
- return testDiagramType((IEditorPart)receiver, expectedValue);
- }
- return false;
- }
-
- /**
- * Test the type of the diagram
- *
- * @param iEditor
- * the current editor
- * @param expectedValue
- * the expected value : the wanted diagram type
- * @return <code>true</code> if the current diagram has the wanted type
- */
- protected boolean testDiagramType(IEditorPart iEditor, Object expectedValue) {
- UmlGmfDiagramEditor editor = (UmlGmfDiagramEditor)iEditor.getAdapter(UmlGmfDiagramEditor.class);
- if(editor != null) {
- Diagram diagram = MDTUtil.getDiagramFomEditor(editor);
- if(diagram != null) {
- return expectedValue.equals(diagram.getType());
- }
- }
- return false;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * This class provides a Tester to know if the current diagram is the wanted
+ * diagram. Test is done using {@link Diagram#getType()}
+ *
+ *
+ *
+ */
+public class DiagramTester extends PropertyTester {
+
+ /**
+ * The property to test
+ */
+ private static final String DIAGRAM_ID = "diagramType";
+
+ /**
+ *
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ *
+ * @param receiver
+ * @param property
+ * @param args
+ * @param expectedValue
+ * @return
+ */
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if(DIAGRAM_ID.equals(property) && receiver instanceof IEditorPart) {
+ return testDiagramType((IEditorPart)receiver, expectedValue);
+ }
+ return false;
+ }
+
+ /**
+ * Test the type of the diagram
+ *
+ * @param iEditor
+ * the current editor
+ * @param expectedValue
+ * the expected value : the wanted diagram type
+ * @return <code>true</code> if the current diagram has the wanted type
+ */
+ protected boolean testDiagramType(IEditorPart iEditor, Object expectedValue) {
+ UmlGmfDiagramEditor editor = (UmlGmfDiagramEditor)iEditor.getAdapter(UmlGmfDiagramEditor.class);
+ if(editor != null) {
+ Diagram diagram = MDTUtil.getDiagramFomEditor(editor);
+ if(diagram != null) {
+ return expectedValue.equals(diagram.getType());
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/FontManager.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/FontManager.java
index b5e09b00c5f..246e895ac9e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/FontManager.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/FontManager.java
@@ -1,52 +1,52 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import org.eclipse.jface.resource.FontRegistry;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-
-/**
- *
- *
- * @author Patrick Tessier
- * @since 21 sept. 06
- *
- * this class is a singletion to manage font in the papyrus Application.
- * It is forbidden to create a new font without use this class.
- */
-public class FontManager extends FontRegistry {
-
- /**
- * this class create a font from a fontdata.
- *
- * @param fontData
- *
- * @return the associated font
- */
- public Font get(FontData fontData[]) {
-
- String symbolicName = "";
- for(int i = 0; i < fontData.length; i++) {
- symbolicName = symbolicName + fontData[i];
- }
- Font font = super.get(symbolicName);
- if(font.equals(this.defaultFont())) {
- super.put(symbolicName, fontData);
- font = super.get(symbolicName);
- }
- return font;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import org.eclipse.jface.resource.FontRegistry;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+
+/**
+ *
+ *
+ * @author Patrick Tessier
+ * @since 21 sept. 06
+ *
+ * this class is a singletion to manage font in the papyrus Application.
+ * It is forbidden to create a new font without use this class.
+ */
+public class FontManager extends FontRegistry {
+
+ /**
+ * this class create a font from a fontdata.
+ *
+ * @param fontData
+ *
+ * @return the associated font
+ */
+ public Font get(FontData fontData[]) {
+
+ String symbolicName = "";
+ for(int i = 0; i < fontData.length; i++) {
+ symbolicName = symbolicName + fontData[i];
+ }
+ Font font = super.get(symbolicName);
+ if(font.equals(this.defaultFont())) {
+ super.put(symbolicName, fontData);
+ font = super.get(symbolicName);
+ }
+ return font;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/MessageDirection.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/MessageDirection.java
index ae157a97a05..483c81bbf5b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/MessageDirection.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/MessageDirection.java
@@ -1,37 +1,37 @@
-/*****************************************************************************
- * Copyright (c) 2009 CEA
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos Origin - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-/**
- * Enum for message direction (in or out)
- */
-public enum MessageDirection {
-
- IN("in"), OUT("out");
-
- private String name;
-
- private MessageDirection(String name) {
- this.name = name;
- }
-
- /**
- * Return the name of message direction
- *
- * @return The name
- */
- public String getName() {
- return name;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009 CEA
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+/**
+ * Enum for message direction (in or out)
+ */
+public enum MessageDirection {
+
+ IN("in"), OUT("out");
+
+ private String name;
+
+ private MessageDirection(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Return the name of message direction
+ *
+ * @return The name
+ */
+ public String getName() {
+ return name;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ServiceUtilsForGMF.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ServiceUtilsForGMF.java
index ed50af421d3..bbb2b4ce08f 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ServiceUtilsForGMF.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ServiceUtilsForGMF.java
@@ -1,80 +1,80 @@
-/*****************************************************************************
- * Copyright (c) 2010 LIFL & CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation
- *
- *****************************************************************************/
-
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
-import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditDomain;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServiceNotFoundException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.infra.core.utils.AbstractServiceUtils;
-import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Set of utility methods for accessing core Services. This methods are designed
- * to be used from code from Papyrus GMF diagrams.
- *
- *
- * @author cedric dumoulin
- *
- */
-public class ServiceUtilsForGMF extends AbstractServiceUtils<IDiagramEditDomain> {
-
- private final static ServiceUtilsForGMF instance = new ServiceUtilsForGMF();
-
- /**
- * Get the singleton instance of the class.
- *
- * @return
- */
- public static final ServiceUtilsForGMF getInstance() {
- return instance;
- }
-
- /**
- * Get the {@link ServicesRegistry} from an {@link IDiagramEditDomain}.
- * Throw an exception if the ServiceRegistry can't be found. <br>
- * This method get the ServiceRegistry from the IDiagramEditDomain
- * associated to an GMF EditPart. This IDiagramEditDomain can be obtained by
- * calling:
- * <ul>
- * <li>from EditParts - editpart.getDiagramEditDomain()</li>
- * <li>from EditPolicies - policy.getHost().getDiagramEditDomain()</li>
- * </ul>
- *
- * @see org.eclipse.papyrus.infra.core.utils.AbstractServiceUtils#getServiceRegistry(java.lang.Object)
- *
- * @param domain
- * The domain associated to an EditPart.
- * @return
- * @throws ServiceException
- * If an error occurs
- * @throws ServiceNotFoundException
- * If the ServiceRegistry can't be found from the domain
- */
- @Override
- public ServicesRegistry getServiceRegistry(IDiagramEditDomain domain) throws ServiceException {
- if(domain instanceof DiagramEditDomain) {
- IWorkbenchPart part = ((DiagramEditDomain)domain).getEditorPart().getEditorSite().getPart();
- if(part instanceof UmlGmfDiagramEditor) {
- return ((UmlGmfDiagramEditor)part).getServicesRegistry();
- }
- }
-
- throw new ServiceNotFoundException("Can't find ServiceRegistry from '" + domain + "'");
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 LIFL & CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Cedric Dumoulin (LIFL) cedric.dumoulin@lifl.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramEditDomain;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.services.ServiceNotFoundException;
+import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
+import org.eclipse.papyrus.infra.core.utils.AbstractServiceUtils;
+import org.eclipse.papyrus.uml.diagram.common.part.UmlGmfDiagramEditor;
+import org.eclipse.ui.IWorkbenchPart;
+
+/**
+ * Set of utility methods for accessing core Services. This methods are designed
+ * to be used from code from Papyrus GMF diagrams.
+ *
+ *
+ * @author cedric dumoulin
+ *
+ */
+public class ServiceUtilsForGMF extends AbstractServiceUtils<IDiagramEditDomain> {
+
+ private final static ServiceUtilsForGMF instance = new ServiceUtilsForGMF();
+
+ /**
+ * Get the singleton instance of the class.
+ *
+ * @return
+ */
+ public static final ServiceUtilsForGMF getInstance() {
+ return instance;
+ }
+
+ /**
+ * Get the {@link ServicesRegistry} from an {@link IDiagramEditDomain}.
+ * Throw an exception if the ServiceRegistry can't be found. <br>
+ * This method get the ServiceRegistry from the IDiagramEditDomain
+ * associated to an GMF EditPart. This IDiagramEditDomain can be obtained by
+ * calling:
+ * <ul>
+ * <li>from EditParts - editpart.getDiagramEditDomain()</li>
+ * <li>from EditPolicies - policy.getHost().getDiagramEditDomain()</li>
+ * </ul>
+ *
+ * @see org.eclipse.papyrus.infra.core.utils.AbstractServiceUtils#getServiceRegistry(java.lang.Object)
+ *
+ * @param domain
+ * The domain associated to an EditPart.
+ * @return
+ * @throws ServiceException
+ * If an error occurs
+ * @throws ServiceNotFoundException
+ * If the ServiceRegistry can't be found from the domain
+ */
+ @Override
+ public ServicesRegistry getServiceRegistry(IDiagramEditDomain domain) throws ServiceException {
+ if(domain instanceof DiagramEditDomain) {
+ IWorkbenchPart part = ((DiagramEditDomain)domain).getEditorPart().getEditorSite().getPart();
+ if(part instanceof UmlGmfDiagramEditor) {
+ return ((UmlGmfDiagramEditor)part).getServicesRegistry();
+ }
+ }
+
+ throw new ServiceNotFoundException("Can't find ServiceRegistry from '" + domain + "'");
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/StringComparator.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/StringComparator.java
index c0300022066..e74f6130e2b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/StringComparator.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/StringComparator.java
@@ -1,72 +1,72 @@
-/*****************************************************************************
- * Copyright (c) 2011 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import java.util.Comparator;
-
-/**
- * A String comparator
- *
- *
- *
- */
-public class StringComparator implements Comparator<String> {
-
- /** ignore the case */
- public static final int IGNORE_CASE = 1;
-
- /** don't ignore the case */
- public static final int NO_IGNORE_CASE = IGNORE_CASE + 1;
-
- /**
- * The comparator mode
- */
- private int mode = IGNORE_CASE;
-
- /**
- *
- * Constructor.
- *
- */
- public StringComparator() {
- this.mode = IGNORE_CASE;
- }
-
- /**
- *
- * Constructor.
- *
- * @param mode
- * the mode used to do the comparison
- */
- public StringComparator(int mode) {
- this.mode = (mode == NO_IGNORE_CASE) ? NO_IGNORE_CASE : IGNORE_CASE;
- }
-
- /**
- *
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- *
- * @param o1
- * @param o2
- * @return
- */
- public int compare(String o1, String o2) {
- if(IGNORE_CASE == this.mode) {
- return o1.toLowerCase().compareToIgnoreCase(o2.toLowerCase());
- }
- return o1.toLowerCase().compareTo(o2.toLowerCase());
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import java.util.Comparator;
+
+/**
+ * A String comparator
+ *
+ *
+ *
+ */
+public class StringComparator implements Comparator<String> {
+
+ /** ignore the case */
+ public static final int IGNORE_CASE = 1;
+
+ /** don't ignore the case */
+ public static final int NO_IGNORE_CASE = IGNORE_CASE + 1;
+
+ /**
+ * The comparator mode
+ */
+ private int mode = IGNORE_CASE;
+
+ /**
+ *
+ * Constructor.
+ *
+ */
+ public StringComparator() {
+ this.mode = IGNORE_CASE;
+ }
+
+ /**
+ *
+ * Constructor.
+ *
+ * @param mode
+ * the mode used to do the comparison
+ */
+ public StringComparator(int mode) {
+ this.mode = (mode == NO_IGNORE_CASE) ? NO_IGNORE_CASE : IGNORE_CASE;
+ }
+
+ /**
+ *
+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+ *
+ * @param o1
+ * @param o2
+ * @return
+ */
+ public int compare(String o1, String o2) {
+ if(IGNORE_CASE == this.mode) {
+ return o1.toLowerCase().compareToIgnoreCase(o2.toLowerCase());
+ }
+ return o1.toLowerCase().compareTo(o2.toLowerCase());
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/UMLSelectionTester.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/UMLSelectionTester.java
index 6e0ebaac637..18ea06545cc 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/UMLSelectionTester.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/UMLSelectionTester.java
@@ -1,100 +1,100 @@
-/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.resource.NotFoundException;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.utils.EditorUtils;
-import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
-import org.eclipse.papyrus.uml.diagram.common.Activator;
-import org.eclipse.papyrus.uml.tools.model.UmlModel;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.Profile;
-
-/**
- * This class is a Property tester used to check is current model (meaning the model currently opened in Papyrus) is a UML Model or a UML Profile.
- * This class is used in order to create test for deciding whether a diagram creation command should be visible or not.
- * This property tester assumes that currently active editor is Papyrus, it should be used with care (simultaneously with a test to ensure Papyrus is
- * currently opened and active).
- */
-public class UMLSelectionTester extends PropertyTester {
-
- /** Tester ID for UML Model nature */
- public final static String IS_UML_MODEL = "isUMLModel";
-
- /** Tester ID for UML Profile nature */
- public final static String IS_UML_PROFILE = "isUMLProfile";
-
- /** Default constructor */
- public UMLSelectionTester() {
- }
-
- /** Test the receiver against the selected property */
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
-
- // Ensure Papyrus is the active editor
- IMultiDiagramEditor editor = EditorUtils.getMultiDiagramEditor();
- if(editor == null) {
- return false;
- }
-
- Object currentValue = null;
- if(IS_UML_MODEL.equals(property)) {
- currentValue = testUMLModelNature(receiver);
- return (currentValue == expectedValue);
- } else if(IS_UML_PROFILE.equals(property)) {
- currentValue = testUMLProfileNature(receiver);
- return (currentValue == expectedValue);
- }
-
- return false;
- }
-
- /** True if root object is a UML Model */
- protected boolean testUMLModelNature(Object receiver) {
- EObject root = getRoot();
- /*
- * For controlled resources, it is very important to consider root of UML model can be a Package. Of course, we
- * can still exclude Profile, which should be dedicated to profile diagrams.
- */
- return root instanceof Package && !(root instanceof Profile);
- }
-
- /** True if root object is a UML Profile */
- protected boolean testUMLProfileNature(Object receiver) {
- return (getRoot() instanceof Profile);
- }
-
- /** Returns the root EObject of currently opened model */
- private EObject getRoot() {
- EObject root = null;
-
- try {
- ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance();
- UmlModel openedModel = (UmlModel)serviceUtils.getModelSet().getModel(UmlModel.MODEL_ID);
- if(openedModel != null) {
- root = openedModel.lookupRoot();
- }
- } catch (ServiceException e) {
- Activator.log.error(e);
- } catch (NotFoundException e) {
- Activator.log.error(e);
- }
-
- return root;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * CEA LIST - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.resource.NotFoundException;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.core.utils.EditorUtils;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtilsForActionHandlers;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.tools.model.UmlModel;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Profile;
+
+/**
+ * This class is a Property tester used to check is current model (meaning the model currently opened in Papyrus) is a UML Model or a UML Profile.
+ * This class is used in order to create test for deciding whether a diagram creation command should be visible or not.
+ * This property tester assumes that currently active editor is Papyrus, it should be used with care (simultaneously with a test to ensure Papyrus is
+ * currently opened and active).
+ */
+public class UMLSelectionTester extends PropertyTester {
+
+ /** Tester ID for UML Model nature */
+ public final static String IS_UML_MODEL = "isUMLModel";
+
+ /** Tester ID for UML Profile nature */
+ public final static String IS_UML_PROFILE = "isUMLProfile";
+
+ /** Default constructor */
+ public UMLSelectionTester() {
+ }
+
+ /** Test the receiver against the selected property */
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+
+ // Ensure Papyrus is the active editor
+ IMultiDiagramEditor editor = EditorUtils.getMultiDiagramEditor();
+ if(editor == null) {
+ return false;
+ }
+
+ Object currentValue = null;
+ if(IS_UML_MODEL.equals(property)) {
+ currentValue = testUMLModelNature(receiver);
+ return (currentValue == expectedValue);
+ } else if(IS_UML_PROFILE.equals(property)) {
+ currentValue = testUMLProfileNature(receiver);
+ return (currentValue == expectedValue);
+ }
+
+ return false;
+ }
+
+ /** True if root object is a UML Model */
+ protected boolean testUMLModelNature(Object receiver) {
+ EObject root = getRoot();
+ /*
+ * For controlled resources, it is very important to consider root of UML model can be a Package. Of course, we
+ * can still exclude Profile, which should be dedicated to profile diagrams.
+ */
+ return root instanceof Package && !(root instanceof Profile);
+ }
+
+ /** True if root object is a UML Profile */
+ protected boolean testUMLProfileNature(Object receiver) {
+ return (getRoot() instanceof Profile);
+ }
+
+ /** Returns the root EObject of currently opened model */
+ private EObject getRoot() {
+ EObject root = null;
+
+ try {
+ ServiceUtilsForActionHandlers serviceUtils = ServiceUtilsForActionHandlers.getInstance();
+ UmlModel openedModel = (UmlModel)serviceUtils.getModelSet().getModel(UmlModel.MODEL_ID);
+ if(openedModel != null) {
+ root = openedModel.lookupRoot();
+ }
+ } catch (ServiceException e) {
+ Activator.log.error(e);
+ } catch (NotFoundException e) {
+ Activator.log.error(e);
+ }
+
+ return root;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Util.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Util.java
index 03c42541984..c1845cea468 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Util.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Util.java
@@ -1,505 +1,505 @@
-/*****************************************************************************
- * Copyright (c) 2008 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Chokri Mraidha (CEA LIST) Chokri.Mraidha@cea.fr - Initial API and implementation
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Modification
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
-import org.eclipse.uml2.uml.Classifier;
-import org.eclipse.uml2.uml.DataType;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.ElementImport;
-import org.eclipse.uml2.uml.Enumeration;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Package;
-import org.eclipse.uml2.uml.PackageImport;
-import org.eclipse.uml2.uml.PrimitiveType;
-import org.eclipse.uml2.uml.Profile;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.Stereotype;
-import org.eclipse.uml2.uml.Type;
-
-/**
- * Some utils extracted from org.eclipse.papyrus.profile.utils
- */
-public class Util {
-
- /**
- * Check if a type is a metaclass.
- *
- * @param type
- * to check
- *
- * @return true if type is metaclass, else false
- */
- public static boolean isMetaclass(Type type) {
- boolean isMetaclass = false;
-
- if((type instanceof org.eclipse.uml2.uml.Class) && (type.getAppliedStereotypes() != null) && (type.getAppliedStereotypes().size() > 0)) {
-
- Stereotype firstStereotype = type.getAppliedStereotypes().get(0);
-
- if(firstStereotype.getName().equals("Metaclass")) {
- isMetaclass = true;
- }
- }
- return isMetaclass;
- }
-
- /**
- * @deprecated must be replaced by org.eclipse.papyrus.uml.tools.utils.ElementUtil#getInstancesFilteredByType
- *
- * Retrieve an arraylist of all instances in the model that are instances of
- * the java.lang.Class metaType or with a stereotype applied
- *
- * @param metaType
- * selected classes
- * @param model
- * to check
- * @param appliedStereotype
- * may be null, metatype is ignored if not null
- * @return an arraylist containing the selected instances
- */
- public static ArrayList getInstancesFilteredByType(Package topPackage, Class metaType, Stereotype appliedStereotype) {
- // List<EObject> elements = ElementUtil.getInstancesFilteredByType(topPackage, metaType, appliedStereotype);
- // return new ArrayList<EObject>(elements);
- // retrieve parent element
- // Package topPackage = Util.topPackage(element);
- // Assert.isNotNull(topPackage,
- // "Top package should not be null for element " + element);
- Iterator iter = topPackage.eAllContents();
- ArrayList filteredElements = new ArrayList();
-
- while(iter.hasNext()) {
- Object currentElt = iter.next();
-
- // If currentElt is an ElementImport, it is replaced by the imported
- // Element.
- if(currentElt instanceof ElementImport) {
- ElementImport elementImport = (ElementImport)currentElt;
- currentElt = elementImport.getImportedElement();
- }
-
- /* package imports treatment */
- else if(currentElt instanceof PackageImport) {
- Iterator piIter = ((PackageImport)currentElt).getImportedPackage().eAllContents();
- while(piIter.hasNext()) {
- Object piCurrentElt = piIter.next();
- if(piCurrentElt instanceof Element) {
- if(appliedStereotype != null) {
-
- Iterator appStIter = ((Element)piCurrentElt).getAppliedStereotypes().iterator();
- while(appStIter.hasNext()) {
- Stereotype currentSt = (Stereotype)appStIter.next();
-
- if(currentSt.conformsTo(appliedStereotype)) {
- filteredElements.add(piCurrentElt);
- }
- }
-
- } else { // if (appliedStereotype == null)
- if(metaType.isInstance(piCurrentElt)) {
- filteredElements.add(piCurrentElt);
- }
-
- /** add imported meta elements */
- else if(piCurrentElt instanceof ElementImport) {
- Iterator eIter = ((ElementImport)piCurrentElt).getImportedElement().eAllContents();
- while(eIter.hasNext()) {
- Object currentEIelt = eIter.next();
- if(metaType.isInstance(currentEIelt))
- filteredElements.add(currentEIelt);
- }
- }
- }
- }
-
- }
- }
-
- // Filtering elements
- if(currentElt instanceof Element) {
-
- if(appliedStereotype != null) {
-
- Iterator appStIter = ((Element)currentElt).getAppliedStereotypes().iterator();
- while(appStIter.hasNext()) {
- Stereotype currentSt = (Stereotype)appStIter.next();
-
- if(currentSt.conformsTo(appliedStereotype)) {
- filteredElements.add(currentElt);
- }
- }
-
- } else { // if (appliedStereotype == null)
- if(metaType.isInstance(currentElt)) {
- filteredElements.add(currentElt);
- }
-
- /** add imported meta elements */
- else if(currentElt instanceof ElementImport) {
- Iterator eIter = ((ElementImport)currentElt).getImportedElement().eAllContents();
- while(eIter.hasNext()) {
- Object currentEIelt = eIter.next();
- if(metaType.isInstance(currentEIelt))
- filteredElements.add(currentEIelt);
- }
- }
- }
- }
- }
-
- return filteredElements;
- }
-
- /**
- * This method is used to look for the top package that contains this
- * element.
- *
- * @param element
- * the element for which top package must be returned
- * @return the top package
- */
- public static Package topPackage(Element element) {
- if(element.getOwner() == null) {
- return (Package)element;
- } else {
- return topPackage(element.getOwner());
- }
- }
-
- /**
- * This method is used to look for the nearest common parent of two
- * elements.
- *
- * @param element1
- * the first element to find a parent
- * @param element2
- * the other element to find a parent
- * @param parentClass
- * the class the common parent must be (otherwise, search in its
- * parents)
- * @return the common parent (not element1 or element2 themselves) or null
- */
- @SuppressWarnings("unchecked")
- public static <T extends Element> T getCommonParent(Element element1, Element element2, Class<T> parentClass) {
- // compute depth of each element
- int depth1 = 0;
- Element ancestor1 = element1.getOwner();
- while(ancestor1 != null) {
- depth1++;
- ancestor1 = ancestor1.getOwner();
- }
- int depth2 = 0;
- Element ancestor2 = element2.getOwner();
- while(ancestor2 != null) {
- depth2++;
- ancestor2 = ancestor2.getOwner();
- }
- // reset to direct parents
- ancestor1 = element1.getOwner();
- ancestor2 = element2.getOwner();
- // explore owners from bottom to top to find common parent
- Element commonParent = null;
- while(depth1 > 0 && depth2 > 0 && commonParent == null) {
- if(depth1 > depth2) {
- ancestor1 = ancestor1.getOwner();
- depth1--;
- } else if(depth2 > depth1) {
- ancestor2 = ancestor2.getOwner();
- depth2--;
- } else {
- // depth1 == depth2
- if(ancestor1 == ancestor2) {
- commonParent = ancestor1;
- } else {
- ancestor1 = ancestor1.getOwner();
- depth1--;
- ancestor2 = ancestor2.getOwner();
- depth2--;
- }
- }
- }
- // find common parent with correct class
- while(commonParent != null && !parentClass.isInstance(commonParent)) {
- commonParent = commonParent.getOwner();
- }
- return (T)commonParent;
- }
-
- /**
- * This function refind the value from a string for the following types :
- * <ul>
- * <li>Boolean</li>
- * <li>Integer</li>
- * <li>String</li>
- * <li>UnlimitedNatural</li>
- * <li>DataType</li>
- * </ul>
- *
- * @param property
- * : the property to edit
- * @param propertyValue
- * : the value to find
- * @return the set of value to apply to the property
- *
- */
- public static Object getValueFromString(Property property, ArrayList<String> stringValues) {
- ArrayList returnedValue = new ArrayList();
-
- Type type = property.getType();
- if(type instanceof PrimitiveType) {
- if(type.getQualifiedName().equals("UMLPrimitiveTypes::Integer")) {
- for(int i = 0; i < stringValues.size(); i++) {
- returnedValue.add(Integer.valueOf(stringValues.get(i)));
- }
- } else if(type.getQualifiedName().equals("UMLPrimitiveTypes::UnlimitedNatural")) {
- for(int i = 0; i < stringValues.size(); i++) {
- returnedValue.add(Integer.valueOf(stringValues.get(i)));
- }
- } else if(type.getQualifiedName().equals("UMLPrimitiveTypes::String")) {
- for(int i = 0; i < stringValues.size(); i++) {
- returnedValue.add(stringValues.get(i));
- }
- } else if(type.getQualifiedName().equals("UMLPrimitiveTypes::Boolean")) {
- for(int i = 0; i < stringValues.size(); i++) {
- returnedValue.add(Boolean.valueOf(stringValues.get(i)));
- }
- } else { // user defined primitive type
- for(int i = 0; i < stringValues.size(); i++) {
- returnedValue.add(stringValues.get(i));
- }
- }
- } else if(type instanceof DataType) {
- for(int i = 0; i < stringValues.size(); i++) {
- returnedValue.add(stringValues.get(i));
- }
- }
-
- if(property.getUpper() == 1) {
- return returnedValue.get(0);
- }
- return returnedValue;
- }
-
- /**
- *
- * @param property
- * : the property to edit
- * @param propertyValue
- * : the value to find
- * @param objectToEdit
- * @return the set of the element representing the value to apply to the
- * property or <code>null</code>
- *
- */
- public static Object retrievesMetaclassElementFromString(Property property, ArrayList<String> stringValues, org.eclipse.uml2.uml.Element packageContainer) {
-
- // the applied profiles
- EList<Profile> profiles = ((org.eclipse.uml2.uml.Package)packageContainer).getAllAppliedProfiles();
- ArrayList<Object> returnedValues = new ArrayList<Object>();
- ArrayList<Object> metaclassElement = new ArrayList<Object>();
- String metaclassName = ((org.eclipse.uml2.uml.Class)property.getType()).getName();
-
- /*
- * we research all the representation of the metaclass in the Profiles
- */
- // Try to retrieve type of the metaclass
- java.lang.Class metaType = null;
- try {
- metaType = java.lang.Class.forName("org.eclipse.uml2.uml." + metaclassName); //$NON-NLS-1$
- } catch (Exception e) {
- e.printStackTrace();
- }
- for(Profile profile : profiles) {
- metaclassElement.addAll(Util.getInstancesFilteredByType(profile, metaType, null));
- }
-
- /*
- * we retrieve the element with its QualifiedName
- */
-
- for(String valuesQualifiedName : stringValues) {
- for(Object metaclassRepresentation : metaclassElement) {
- if(metaclassRepresentation instanceof NamedElement) {
- if(((NamedElement)metaclassRepresentation).getQualifiedName().equals(valuesQualifiedName)) {
- ((ArrayList)returnedValues).add(metaclassRepresentation);
- }
- }
- }
-
- }
-
- if(property.getUpper() != 1) {
- return returnedValues;
- } else if(returnedValues.size() > 0) {
- return returnedValues.get(0);
- }
- return null;
- }
-
- /**
- *
- * @param property
- * : the property to edit
- * @param propertyValue
- * : the value to find
- * @return the set of the stereotyped element to apply to the property or <code>null</code>
- *
- */
- public static Object retrievesStereotypedElementFromString(Property property, ArrayList<String> stringValues, org.eclipse.uml2.uml.Element packageContainer) {
-
- ArrayList<Object> returnedValues = new ArrayList<Object>();
- ArrayList<Object> stereotypedElement = new ArrayList<Object>();
-
- EList<Profile> profiles = ((org.eclipse.uml2.uml.Package)packageContainer).getAllAppliedProfiles();
- /*
- * we research all the representation of the stereotype in the Profiles
- */
- for(Profile profile : profiles) {
- stereotypedElement.addAll(Util.getInstancesFilteredByType(profile, null, (Stereotype)property.getType()));
- }
-
- /*
- * we retrieve the element with its QualifiedName
- */
- for(String valuesQualifiedName : stringValues) {
- for(Object element : stereotypedElement) {
- if(element instanceof NamedElement) {
- if(((NamedElement)element).getQualifiedName().equals(valuesQualifiedName)) {
-
- // Like in AppliedStereotypePropertyEditor
- EObject newValue = ((NamedElement)element).getStereotypeApplication((Stereotype)property.getType());
- if(newValue == null) {
- List<?> subStereotypes = ((NamedElement)element).getAppliedSubstereotypes((Stereotype)property.getType());
- if(!subStereotypes.isEmpty()) {
- newValue = ((NamedElement)element).getStereotypeApplication((Stereotype)subStereotypes.get(0));
- }
- }
- // Like in StereotypeValueTreeObject
- if(newValue != null) {
-
- returnedValues.add(newValue);
-
- }
- returnedValues.add(element);
- break;
- }
- } else {
- // TODO for the element which aren't NamedElement
- }
- }
- }
-
- if(property.getUpper() != 1) {
- return returnedValues;
- } else if(returnedValues.size() > 0) {
- return returnedValues.get(0);
- }
- return null;
-
- }
-
- /**
- *
- * @param property
- * : the property to edit
- * @param propertyValue
- * : the value to find
- * @return the set of EnumerationLiteral to apply to the property
- *
- */
- public static Object retrievesEnumerationLiteralFromString(Property property, ArrayList<String> stringValues, org.eclipse.uml2.uml.Element packageContainer) {
- Enumeration enume = null;
-
- Type type = property.getType();
- Assert.isTrue(type instanceof Enumeration);
- enume = (Enumeration)type;
-
- ArrayList<Object> returnedValues = new ArrayList<Object>();
-
- // we research the enumerationLiteral
- for(int i = 0; i < stringValues.size(); i++) {
- Object obj = enume.getOwnedLiteral(stringValues.get(i));
- returnedValues.add(obj);
- }
-
- if(property.getUpper() != 1) {
- return returnedValues;
- } else if(returnedValues.size() > 0) {
- return returnedValues.get(0);
- }
- return null;
- }
-
- /**
- * Test if an EditPart is an Affixed Child Node or not
- *
- * @param ep
- * an editpart
- * @return <ul>
- * <li> <code>true</code> if the editpart is an Affixed Child Node</li>
- * <li> <code>false</code>if not</li>
- * </ul>
- */
- public static boolean isAffixedChildNode(EditPart ep) {
- if(ep instanceof BorderedBorderItemEditPart) {
- if(ep.getParent() instanceof CompartmentEditPart) {
- return false;
- } else if(ep.getParent() instanceof DiagramEditPart) {
- return false;
- }
- return true;
- }
- return false;
- }
-
- /**
- *
- * Returns a {@link Set} owning all the level of super classes for the
- * Classifier With this method we don't have loop problems with {@link Generalization}
- *
- * @param visitedClassifier
- * the list of the visited Classifier (can be <code>null</code>)
- * @param clazz
- * the classifier to visit
- * @return a {@link Set} owning all the level of super classes for the
- * Classifier
- */
- public static Set<Classifier> getAllSuperClasses(Set<Classifier> visitedClassifier, Classifier clazz) {
- Assert.isNotNull(clazz);
- if(visitedClassifier == null) {
- visitedClassifier = new HashSet<Classifier>();
- }
- for(Classifier classifier : clazz.getGenerals()) {
- if(!visitedClassifier.contains(classifier)) {
- visitedClassifier.add(classifier);
- visitedClassifier.addAll(getAllSuperClasses(visitedClassifier, classifier));
- }
- }
- return visitedClassifier;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2008 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Chokri Mraidha (CEA LIST) Chokri.Mraidha@cea.fr - Initial API and implementation
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Modification
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.CompartmentEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.papyrus.uml.tools.utils.ElementUtil;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.PackageImport;
+import org.eclipse.uml2.uml.PrimitiveType;
+import org.eclipse.uml2.uml.Profile;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Stereotype;
+import org.eclipse.uml2.uml.Type;
+
+/**
+ * Some utils extracted from org.eclipse.papyrus.profile.utils
+ */
+public class Util {
+
+ /**
+ * Check if a type is a metaclass.
+ *
+ * @param type
+ * to check
+ *
+ * @return true if type is metaclass, else false
+ */
+ public static boolean isMetaclass(Type type) {
+ boolean isMetaclass = false;
+
+ if((type instanceof org.eclipse.uml2.uml.Class) && (type.getAppliedStereotypes() != null) && (type.getAppliedStereotypes().size() > 0)) {
+
+ Stereotype firstStereotype = type.getAppliedStereotypes().get(0);
+
+ if(firstStereotype.getName().equals("Metaclass")) {
+ isMetaclass = true;
+ }
+ }
+ return isMetaclass;
+ }
+
+ /**
+ * @deprecated must be replaced by org.eclipse.papyrus.uml.tools.utils.ElementUtil#getInstancesFilteredByType
+ *
+ * Retrieve an arraylist of all instances in the model that are instances of
+ * the java.lang.Class metaType or with a stereotype applied
+ *
+ * @param metaType
+ * selected classes
+ * @param model
+ * to check
+ * @param appliedStereotype
+ * may be null, metatype is ignored if not null
+ * @return an arraylist containing the selected instances
+ */
+ public static ArrayList getInstancesFilteredByType(Package topPackage, Class metaType, Stereotype appliedStereotype) {
+ // List<EObject> elements = ElementUtil.getInstancesFilteredByType(topPackage, metaType, appliedStereotype);
+ // return new ArrayList<EObject>(elements);
+ // retrieve parent element
+ // Package topPackage = Util.topPackage(element);
+ // Assert.isNotNull(topPackage,
+ // "Top package should not be null for element " + element);
+ Iterator iter = topPackage.eAllContents();
+ ArrayList filteredElements = new ArrayList();
+
+ while(iter.hasNext()) {
+ Object currentElt = iter.next();
+
+ // If currentElt is an ElementImport, it is replaced by the imported
+ // Element.
+ if(currentElt instanceof ElementImport) {
+ ElementImport elementImport = (ElementImport)currentElt;
+ currentElt = elementImport.getImportedElement();
+ }
+
+ /* package imports treatment */
+ else if(currentElt instanceof PackageImport) {
+ Iterator piIter = ((PackageImport)currentElt).getImportedPackage().eAllContents();
+ while(piIter.hasNext()) {
+ Object piCurrentElt = piIter.next();
+ if(piCurrentElt instanceof Element) {
+ if(appliedStereotype != null) {
+
+ Iterator appStIter = ((Element)piCurrentElt).getAppliedStereotypes().iterator();
+ while(appStIter.hasNext()) {
+ Stereotype currentSt = (Stereotype)appStIter.next();
+
+ if(currentSt.conformsTo(appliedStereotype)) {
+ filteredElements.add(piCurrentElt);
+ }
+ }
+
+ } else { // if (appliedStereotype == null)
+ if(metaType.isInstance(piCurrentElt)) {
+ filteredElements.add(piCurrentElt);
+ }
+
+ /** add imported meta elements */
+ else if(piCurrentElt instanceof ElementImport) {
+ Iterator eIter = ((ElementImport)piCurrentElt).getImportedElement().eAllContents();
+ while(eIter.hasNext()) {
+ Object currentEIelt = eIter.next();
+ if(metaType.isInstance(currentEIelt))
+ filteredElements.add(currentEIelt);
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ // Filtering elements
+ if(currentElt instanceof Element) {
+
+ if(appliedStereotype != null) {
+
+ Iterator appStIter = ((Element)currentElt).getAppliedStereotypes().iterator();
+ while(appStIter.hasNext()) {
+ Stereotype currentSt = (Stereotype)appStIter.next();
+
+ if(currentSt.conformsTo(appliedStereotype)) {
+ filteredElements.add(currentElt);
+ }
+ }
+
+ } else { // if (appliedStereotype == null)
+ if(metaType.isInstance(currentElt)) {
+ filteredElements.add(currentElt);
+ }
+
+ /** add imported meta elements */
+ else if(currentElt instanceof ElementImport) {
+ Iterator eIter = ((ElementImport)currentElt).getImportedElement().eAllContents();
+ while(eIter.hasNext()) {
+ Object currentEIelt = eIter.next();
+ if(metaType.isInstance(currentEIelt))
+ filteredElements.add(currentEIelt);
+ }
+ }
+ }
+ }
+ }
+
+ return filteredElements;
+ }
+
+ /**
+ * This method is used to look for the top package that contains this
+ * element.
+ *
+ * @param element
+ * the element for which top package must be returned
+ * @return the top package
+ */
+ public static Package topPackage(Element element) {
+ if(element.getOwner() == null) {
+ return (Package)element;
+ } else {
+ return topPackage(element.getOwner());
+ }
+ }
+
+ /**
+ * This method is used to look for the nearest common parent of two
+ * elements.
+ *
+ * @param element1
+ * the first element to find a parent
+ * @param element2
+ * the other element to find a parent
+ * @param parentClass
+ * the class the common parent must be (otherwise, search in its
+ * parents)
+ * @return the common parent (not element1 or element2 themselves) or null
+ */
+ @SuppressWarnings("unchecked")
+ public static <T extends Element> T getCommonParent(Element element1, Element element2, Class<T> parentClass) {
+ // compute depth of each element
+ int depth1 = 0;
+ Element ancestor1 = element1.getOwner();
+ while(ancestor1 != null) {
+ depth1++;
+ ancestor1 = ancestor1.getOwner();
+ }
+ int depth2 = 0;
+ Element ancestor2 = element2.getOwner();
+ while(ancestor2 != null) {
+ depth2++;
+ ancestor2 = ancestor2.getOwner();
+ }
+ // reset to direct parents
+ ancestor1 = element1.getOwner();
+ ancestor2 = element2.getOwner();
+ // explore owners from bottom to top to find common parent
+ Element commonParent = null;
+ while(depth1 > 0 && depth2 > 0 && commonParent == null) {
+ if(depth1 > depth2) {
+ ancestor1 = ancestor1.getOwner();
+ depth1--;
+ } else if(depth2 > depth1) {
+ ancestor2 = ancestor2.getOwner();
+ depth2--;
+ } else {
+ // depth1 == depth2
+ if(ancestor1 == ancestor2) {
+ commonParent = ancestor1;
+ } else {
+ ancestor1 = ancestor1.getOwner();
+ depth1--;
+ ancestor2 = ancestor2.getOwner();
+ depth2--;
+ }
+ }
+ }
+ // find common parent with correct class
+ while(commonParent != null && !parentClass.isInstance(commonParent)) {
+ commonParent = commonParent.getOwner();
+ }
+ return (T)commonParent;
+ }
+
+ /**
+ * This function refind the value from a string for the following types :
+ * <ul>
+ * <li>Boolean</li>
+ * <li>Integer</li>
+ * <li>String</li>
+ * <li>UnlimitedNatural</li>
+ * <li>DataType</li>
+ * </ul>
+ *
+ * @param property
+ * : the property to edit
+ * @param propertyValue
+ * : the value to find
+ * @return the set of value to apply to the property
+ *
+ */
+ public static Object getValueFromString(Property property, ArrayList<String> stringValues) {
+ ArrayList returnedValue = new ArrayList();
+
+ Type type = property.getType();
+ if(type instanceof PrimitiveType) {
+ if(type.getQualifiedName().equals("UMLPrimitiveTypes::Integer")) {
+ for(int i = 0; i < stringValues.size(); i++) {
+ returnedValue.add(Integer.valueOf(stringValues.get(i)));
+ }
+ } else if(type.getQualifiedName().equals("UMLPrimitiveTypes::UnlimitedNatural")) {
+ for(int i = 0; i < stringValues.size(); i++) {
+ returnedValue.add(Integer.valueOf(stringValues.get(i)));
+ }
+ } else if(type.getQualifiedName().equals("UMLPrimitiveTypes::String")) {
+ for(int i = 0; i < stringValues.size(); i++) {
+ returnedValue.add(stringValues.get(i));
+ }
+ } else if(type.getQualifiedName().equals("UMLPrimitiveTypes::Boolean")) {
+ for(int i = 0; i < stringValues.size(); i++) {
+ returnedValue.add(Boolean.valueOf(stringValues.get(i)));
+ }
+ } else { // user defined primitive type
+ for(int i = 0; i < stringValues.size(); i++) {
+ returnedValue.add(stringValues.get(i));
+ }
+ }
+ } else if(type instanceof DataType) {
+ for(int i = 0; i < stringValues.size(); i++) {
+ returnedValue.add(stringValues.get(i));
+ }
+ }
+
+ if(property.getUpper() == 1) {
+ return returnedValue.get(0);
+ }
+ return returnedValue;
+ }
+
+ /**
+ *
+ * @param property
+ * : the property to edit
+ * @param propertyValue
+ * : the value to find
+ * @param objectToEdit
+ * @return the set of the element representing the value to apply to the
+ * property or <code>null</code>
+ *
+ */
+ public static Object retrievesMetaclassElementFromString(Property property, ArrayList<String> stringValues, org.eclipse.uml2.uml.Element packageContainer) {
+
+ // the applied profiles
+ EList<Profile> profiles = ((org.eclipse.uml2.uml.Package)packageContainer).getAllAppliedProfiles();
+ ArrayList<Object> returnedValues = new ArrayList<Object>();
+ ArrayList<Object> metaclassElement = new ArrayList<Object>();
+ String metaclassName = ((org.eclipse.uml2.uml.Class)property.getType()).getName();
+
+ /*
+ * we research all the representation of the metaclass in the Profiles
+ */
+ // Try to retrieve type of the metaclass
+ java.lang.Class metaType = null;
+ try {
+ metaType = java.lang.Class.forName("org.eclipse.uml2.uml." + metaclassName); //$NON-NLS-1$
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ for(Profile profile : profiles) {
+ metaclassElement.addAll(Util.getInstancesFilteredByType(profile, metaType, null));
+ }
+
+ /*
+ * we retrieve the element with its QualifiedName
+ */
+
+ for(String valuesQualifiedName : stringValues) {
+ for(Object metaclassRepresentation : metaclassElement) {
+ if(metaclassRepresentation instanceof NamedElement) {
+ if(((NamedElement)metaclassRepresentation).getQualifiedName().equals(valuesQualifiedName)) {
+ ((ArrayList)returnedValues).add(metaclassRepresentation);
+ }
+ }
+ }
+
+ }
+
+ if(property.getUpper() != 1) {
+ return returnedValues;
+ } else if(returnedValues.size() > 0) {
+ return returnedValues.get(0);
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @param property
+ * : the property to edit
+ * @param propertyValue
+ * : the value to find
+ * @return the set of the stereotyped element to apply to the property or <code>null</code>
+ *
+ */
+ public static Object retrievesStereotypedElementFromString(Property property, ArrayList<String> stringValues, org.eclipse.uml2.uml.Element packageContainer) {
+
+ ArrayList<Object> returnedValues = new ArrayList<Object>();
+ ArrayList<Object> stereotypedElement = new ArrayList<Object>();
+
+ EList<Profile> profiles = ((org.eclipse.uml2.uml.Package)packageContainer).getAllAppliedProfiles();
+ /*
+ * we research all the representation of the stereotype in the Profiles
+ */
+ for(Profile profile : profiles) {
+ stereotypedElement.addAll(Util.getInstancesFilteredByType(profile, null, (Stereotype)property.getType()));
+ }
+
+ /*
+ * we retrieve the element with its QualifiedName
+ */
+ for(String valuesQualifiedName : stringValues) {
+ for(Object element : stereotypedElement) {
+ if(element instanceof NamedElement) {
+ if(((NamedElement)element).getQualifiedName().equals(valuesQualifiedName)) {
+
+ // Like in AppliedStereotypePropertyEditor
+ EObject newValue = ((NamedElement)element).getStereotypeApplication((Stereotype)property.getType());
+ if(newValue == null) {
+ List<?> subStereotypes = ((NamedElement)element).getAppliedSubstereotypes((Stereotype)property.getType());
+ if(!subStereotypes.isEmpty()) {
+ newValue = ((NamedElement)element).getStereotypeApplication((Stereotype)subStereotypes.get(0));
+ }
+ }
+ // Like in StereotypeValueTreeObject
+ if(newValue != null) {
+
+ returnedValues.add(newValue);
+
+ }
+ returnedValues.add(element);
+ break;
+ }
+ } else {
+ // TODO for the element which aren't NamedElement
+ }
+ }
+ }
+
+ if(property.getUpper() != 1) {
+ return returnedValues;
+ } else if(returnedValues.size() > 0) {
+ return returnedValues.get(0);
+ }
+ return null;
+
+ }
+
+ /**
+ *
+ * @param property
+ * : the property to edit
+ * @param propertyValue
+ * : the value to find
+ * @return the set of EnumerationLiteral to apply to the property
+ *
+ */
+ public static Object retrievesEnumerationLiteralFromString(Property property, ArrayList<String> stringValues, org.eclipse.uml2.uml.Element packageContainer) {
+ Enumeration enume = null;
+
+ Type type = property.getType();
+ Assert.isTrue(type instanceof Enumeration);
+ enume = (Enumeration)type;
+
+ ArrayList<Object> returnedValues = new ArrayList<Object>();
+
+ // we research the enumerationLiteral
+ for(int i = 0; i < stringValues.size(); i++) {
+ Object obj = enume.getOwnedLiteral(stringValues.get(i));
+ returnedValues.add(obj);
+ }
+
+ if(property.getUpper() != 1) {
+ return returnedValues;
+ } else if(returnedValues.size() > 0) {
+ return returnedValues.get(0);
+ }
+ return null;
+ }
+
+ /**
+ * Test if an EditPart is an Affixed Child Node or not
+ *
+ * @param ep
+ * an editpart
+ * @return <ul>
+ * <li> <code>true</code> if the editpart is an Affixed Child Node</li>
+ * <li> <code>false</code>if not</li>
+ * </ul>
+ */
+ public static boolean isAffixedChildNode(EditPart ep) {
+ if(ep instanceof BorderedBorderItemEditPart) {
+ if(ep.getParent() instanceof CompartmentEditPart) {
+ return false;
+ } else if(ep.getParent() instanceof DiagramEditPart) {
+ return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ *
+ * Returns a {@link Set} owning all the level of super classes for the
+ * Classifier With this method we don't have loop problems with {@link Generalization}
+ *
+ * @param visitedClassifier
+ * the list of the visited Classifier (can be <code>null</code>)
+ * @param clazz
+ * the classifier to visit
+ * @return a {@link Set} owning all the level of super classes for the
+ * Classifier
+ */
+ public static Set<Classifier> getAllSuperClasses(Set<Classifier> visitedClassifier, Classifier clazz) {
+ Assert.isNotNull(clazz);
+ if(visitedClassifier == null) {
+ visitedClassifier = new HashSet<Classifier>();
+ }
+ for(Classifier classifier : clazz.getGenerals()) {
+ if(!visitedClassifier.contains(classifier)) {
+ visitedClassifier.add(classifier);
+ visitedClassifier.addAll(getAllSuperClasses(visitedClassifier, classifier));
+ }
+ }
+ return visitedClassifier;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewServiceUtil.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewServiceUtil.java
index a58c7ab5ff0..a98433358b9 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewServiceUtil.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/ViewServiceUtil.java
@@ -1,61 +1,61 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-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.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * This class provides method to force the load of the view service see bug
- * 302555
- */
-public class ViewServiceUtil {
-
- /**
- * To load a service, we build a dummy command and we test if it can be
- * executed
- *
- */
- public static void forceLoad() {
- IEditorPart activeEditor = MDTUtil.getActiveEditor();
- if(activeEditor != null) {
- if(activeEditor instanceof IMultiDiagramEditor) {
- Diagram diagram = (Diagram)((IMultiDiagramEditor)activeEditor).getAdapter(Diagram.class);
- if(diagram != null) {
- String diagramSemanticHint = diagram.getType();
- DiagramEditPart host = (DiagramEditPart)((IMultiDiagramEditor)activeEditor).getAdapter(DiagramEditPart.class);
-
- // When we don't have the semanticHint, the command can't be
- // executed, if the ViewService is not started
- // The goal of this class is to launch the view service
- ViewDescriptor descriptor = new ViewDescriptor(new EObjectAdapter(diagram), Diagram.class, diagramSemanticHint, ViewUtil.APPEND, false, ((IGraphicalEditPart)host).getDiagramPreferencesHint());
- CreateCommand dummyCommand = new CreateCommand(((IGraphicalEditPart)host).getEditingDomain(), descriptor, ((View)host.getModel()));
-
- // this action force the load of the ViewService
- dummyCommand.canExecute();
- }
- }
- }
-
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+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.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.ui.IEditorPart;
+
+/**
+ * This class provides method to force the load of the view service see bug
+ * 302555
+ */
+public class ViewServiceUtil {
+
+ /**
+ * To load a service, we build a dummy command and we test if it can be
+ * executed
+ *
+ */
+ public static void forceLoad() {
+ IEditorPart activeEditor = MDTUtil.getActiveEditor();
+ if(activeEditor != null) {
+ if(activeEditor instanceof IMultiDiagramEditor) {
+ Diagram diagram = (Diagram)((IMultiDiagramEditor)activeEditor).getAdapter(Diagram.class);
+ if(diagram != null) {
+ String diagramSemanticHint = diagram.getType();
+ DiagramEditPart host = (DiagramEditPart)((IMultiDiagramEditor)activeEditor).getAdapter(DiagramEditPart.class);
+
+ // When we don't have the semanticHint, the command can't be
+ // executed, if the ViewService is not started
+ // The goal of this class is to launch the view service
+ ViewDescriptor descriptor = new ViewDescriptor(new EObjectAdapter(diagram), Diagram.class, diagramSemanticHint, ViewUtil.APPEND, false, ((IGraphicalEditPart)host).getDiagramPreferencesHint());
+ CreateCommand dummyCommand = new CreateCommand(((IGraphicalEditPart)host).getEditingDomain(), descriptor, ((View)host.getModel()));
+
+ // this action force the load of the ViewService
+ dummyCommand.canExecute();
+ }
+ }
+ }
+
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Visitor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Visitor.java
index 97dbaff7e6e..e77f0651a1b 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Visitor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/Visitor.java
@@ -1,113 +1,113 @@
-/*****************************************************************************
- * Copyright (c) 2010 CEA LIST.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.emf.transaction.util.TransactionUtil;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.ElementImport;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.Namespace;
-import org.eclipse.uml2.uml.PackageImport;
-
-/**
- *
- * This class provides methods to get
- * <ul>
- * <li>all element of a given type</li>
- * <li>all imported namespaces</li>
- * </ul>
- *
- *
- *
- */
-public class Visitor {
-
- /**
- *
- * shall be overridden to restrict the possible {@link Type}
- *
- *
- * Returns the owned and imported {@link Type} imported namespace
- *
- * @param visited
- * the visited namespace
- * @return the owned and imported {@link Type} imported namespace
- */
- public static List<Element> getOwnedAndImportedElement(Namespace visited, Class<?> wantedClass) {
- List<Element> visibleElements = new ArrayList<Element>();
- // first retrieves imported properties
- for(ElementImport eImport : visited.getElementImports()) {
- if(wantedClass.isInstance(eImport)) {
- visibleElements.add(eImport.getImportedElement());
- }
- }
- // then retrieves owned properties
- for(NamedElement n : visited.getOwnedMembers()) {
- if(wantedClass.isInstance(n)) {
- visibleElements.add(n);
- }
- if(n instanceof Namespace) {
- visibleElements.addAll(getOwnedAndImportedElement((Namespace)n, wantedClass));
- }
- }
-
- TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(wantedClass);
- return visibleElements;
- }
-
- /**
- * Returns the imported {@link Namespace}
- *
- * @param visited
- * the visited namespace
- * @return the imported {@link Namespace}
- */
- public static List<Namespace> getImportedNamespaces(Namespace visited) {
- List<Namespace> namespaces = new ArrayList<Namespace>();
-
- // retrieves imported namespaces
- for(PackageImport pImport : visited.getPackageImports()) {
- namespaces.add(pImport.getImportedPackage());
- }
- for(ElementImport eImport : visited.getElementImports()) {
- if(eImport.getImportedElement() instanceof Namespace)
- namespaces.add((Namespace)eImport.getImportedElement());
- }
-
- return namespaces;
- }
-
- /**
- * Returns the owned and imported {@link Namespace}
- *
- * @param visited
- * the visited namespace
- * @return the owned and imported {@link Namespace}
- */
- public static List<Namespace> getOwnedAndImportedNamespaces(Namespace visited) {
- List<Namespace> namespaces = new ArrayList<Namespace>();
- // first retrieves imported namespaces
- namespaces.addAll(getImportedNamespaces(visited));
- // then retrieves owned namespaces
- for(NamedElement n : visited.getOwnedMembers()) {
- if(n instanceof Namespace)
- namespaces.add((Namespace)n);
- }
- return namespaces;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2010 CEA LIST.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.transaction.util.TransactionUtil;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Namespace;
+import org.eclipse.uml2.uml.PackageImport;
+
+/**
+ *
+ * This class provides methods to get
+ * <ul>
+ * <li>all element of a given type</li>
+ * <li>all imported namespaces</li>
+ * </ul>
+ *
+ *
+ *
+ */
+public class Visitor {
+
+ /**
+ *
+ * shall be overridden to restrict the possible {@link Type}
+ *
+ *
+ * Returns the owned and imported {@link Type} imported namespace
+ *
+ * @param visited
+ * the visited namespace
+ * @return the owned and imported {@link Type} imported namespace
+ */
+ public static List<Element> getOwnedAndImportedElement(Namespace visited, Class<?> wantedClass) {
+ List<Element> visibleElements = new ArrayList<Element>();
+ // first retrieves imported properties
+ for(ElementImport eImport : visited.getElementImports()) {
+ if(wantedClass.isInstance(eImport)) {
+ visibleElements.add(eImport.getImportedElement());
+ }
+ }
+ // then retrieves owned properties
+ for(NamedElement n : visited.getOwnedMembers()) {
+ if(wantedClass.isInstance(n)) {
+ visibleElements.add(n);
+ }
+ if(n instanceof Namespace) {
+ visibleElements.addAll(getOwnedAndImportedElement((Namespace)n, wantedClass));
+ }
+ }
+
+ TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(wantedClass);
+ return visibleElements;
+ }
+
+ /**
+ * Returns the imported {@link Namespace}
+ *
+ * @param visited
+ * the visited namespace
+ * @return the imported {@link Namespace}
+ */
+ public static List<Namespace> getImportedNamespaces(Namespace visited) {
+ List<Namespace> namespaces = new ArrayList<Namespace>();
+
+ // retrieves imported namespaces
+ for(PackageImport pImport : visited.getPackageImports()) {
+ namespaces.add(pImport.getImportedPackage());
+ }
+ for(ElementImport eImport : visited.getElementImports()) {
+ if(eImport.getImportedElement() instanceof Namespace)
+ namespaces.add((Namespace)eImport.getImportedElement());
+ }
+
+ return namespaces;
+ }
+
+ /**
+ * Returns the owned and imported {@link Namespace}
+ *
+ * @param visited
+ * the visited namespace
+ * @return the owned and imported {@link Namespace}
+ */
+ public static List<Namespace> getOwnedAndImportedNamespaces(Namespace visited) {
+ List<Namespace> namespaces = new ArrayList<Namespace>();
+ // first retrieves imported namespaces
+ namespaces.addAll(getImportedNamespaces(visited));
+ // then retrieves owned namespaces
+ for(NamedElement n : visited.getOwnedMembers()) {
+ if(n instanceof Namespace)
+ namespaces.add((Namespace)n);
+ }
+ return namespaces;
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/EObjectToViewFunction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/EObjectToViewFunction.java
index e3ffd63c47c..db6efc07d3e 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/EObjectToViewFunction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/EObjectToViewFunction.java
@@ -1,44 +1,44 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- * Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util.functions;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.View;
-
-import com.google.common.base.Function;
-/**
- * Transform an EObject to a View
- * If the EObject passed into apply is not a view then return null
- * @author adaussy
- *
- */
-public class EObjectToViewFunction implements Function<EObject, View> {
-
- private static class SingletonHolder {
- private static EObjectToViewFunction INSTANCE = new EObjectToViewFunction();
- }
-
- public static EObjectToViewFunction getInstance(){
- return SingletonHolder.INSTANCE;
- }
-
- public View apply(EObject from) {
- if ( from instanceof View){
- return (View)from;
- }
- return null;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ * Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util.functions;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+
+import com.google.common.base.Function;
+/**
+ * Transform an EObject to a View
+ * If the EObject passed into apply is not a view then return null
+ * @author adaussy
+ *
+ */
+public class EObjectToViewFunction implements Function<EObject, View> {
+
+ private static class SingletonHolder {
+ private static EObjectToViewFunction INSTANCE = new EObjectToViewFunction();
+ }
+
+ public static EObjectToViewFunction getInstance(){
+ return SingletonHolder.INSTANCE;
+ }
+
+ public View apply(EObject from) {
+ if ( from instanceof View){
+ return (View)from;
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/SettingToEObjectFunction.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/SettingToEObjectFunction.java
index be2270f2e7a..760b081966d 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/SettingToEObjectFunction.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/functions/SettingToEObjectFunction.java
@@ -1,33 +1,33 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- * Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util.functions;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature.Setting;
-
-import com.google.common.base.Function;
-
-/**
- * Function to transform a {@link Setting} to an {@link EObject}
- * @author adaussy
- *
- */
-public class SettingToEObjectFunction implements Function<Setting, EObject> {
-
- public EObject apply(Setting from) {
- return from.getEObject();
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ * Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util.functions;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature.Setting;
+
+import com.google.common.base.Function;
+
+/**
+ * Function to transform a {@link Setting} to an {@link EObject}
+ * @author adaussy
+ *
+ */
+public class SettingToEObjectFunction implements Function<Setting, EObject> {
+
+ public EObject apply(Setting from) {
+ return from.getEObject();
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ReferencingViewPredicate.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ReferencingViewPredicate.java
index b8f97104a8a..c27e7885179 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ReferencingViewPredicate.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ReferencingViewPredicate.java
@@ -1,52 +1,52 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- * Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util.predicates;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.notation.View;
-
-import com.google.common.base.Predicate;
-
-/**
- * This predicate return true if the EObject(notation) passed into apply method is a view which:
- * -> refer to the element (semantic) element passed in argument to the constructor
- * @author arthur daussy
- *
- */
-public class ReferencingViewPredicate implements Predicate<EObject> {
-
- private EObject element;
- /**
- *
- * @param element {@link EObject} representing the semantic elemetn
- */
- public ReferencingViewPredicate(EObject element) {
- super();
- Assert.isNotNull(element);
- this.element = element;
- }
-
- public boolean apply(EObject input) {
- /*
- * Select all the view corresponding to this element and which have the same visual representations
- */
- if(input instanceof View) {
- return element.equals(((View)input).getElement());
- }
- return false;
- }
-
-}
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ * Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util.predicates;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+
+import com.google.common.base.Predicate;
+
+/**
+ * This predicate return true if the EObject(notation) passed into apply method is a view which:
+ * -> refer to the element (semantic) element passed in argument to the constructor
+ * @author arthur daussy
+ *
+ */
+public class ReferencingViewPredicate implements Predicate<EObject> {
+
+ private EObject element;
+ /**
+ *
+ * @param element {@link EObject} representing the semantic elemetn
+ */
+ public ReferencingViewPredicate(EObject element) {
+ super();
+ Assert.isNotNull(element);
+ this.element = element;
+ }
+
+ public boolean apply(EObject input) {
+ /*
+ * Select all the view corresponding to this element and which have the same visual representations
+ */
+ if(input instanceof View) {
+ return element.equals(((View)input).getElement());
+ }
+ return false;
+ }
+
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ViewTypePredicate.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ViewTypePredicate.java
index 5a2828c7ba2..ac9b9415106 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ViewTypePredicate.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/src/org/eclipse/papyrus/uml/diagram/common/util/predicates/ViewTypePredicate.java
@@ -1,47 +1,47 @@
-/*****************************************************************************
- * Copyright (c) 2011 Atos.
- *
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Atos - Initial API and implementation
- * Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.common.util.predicates;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.gmf.runtime.notation.View;
-
-import com.google.common.base.Predicate;
-
-/**
- * Predicate used to filter views by ID
- * @author arthur daussy
- */
-public class ViewTypePredicate implements Predicate<View>{
- /**
- * Visual Id
- */
- private String id;
-
- /**
- * Visual Id your are looking for
- * @param id
- */
- public ViewTypePredicate(String id) {
- super();
- Assert.isNotNull(id);
- this.id = id;
- }
-
- public boolean apply(View input) {
- return id.equals(input.getType());
- }
-
-
+/*****************************************************************************
+ * Copyright (c) 2011 Atos.
+ *
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Atos - Initial API and implementation
+ * Bug 366159 - [ActivityDiagram] Activity Diagram should be able to handle correctly Interruptible Edge
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.common.util.predicates;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.gmf.runtime.notation.View;
+
+import com.google.common.base.Predicate;
+
+/**
+ * Predicate used to filter views by ID
+ * @author arthur daussy
+ */
+public class ViewTypePredicate implements Predicate<View>{
+ /**
+ * Visual Id
+ */
+ private String id;
+
+ /**
+ * Visual Id your are looking for
+ * @param id
+ */
+ public ViewTypePredicate(String id) {
+ super();
+ Assert.isNotNull(id);
+ this.id = id;
+ }
+
+ public boolean apply(View input) {
+ return id.equals(input.getType());
+ }
+
+
} \ No newline at end of file

Back to the top